Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 


Eclipse Platform
Release 3.5

org.eclipse.jface.layout
Class PixelConverter


java.lang.Object
  extended by 
org.eclipse.jface.layout.PixelConverter

public class PixelConverter
extends Object

PixelConverter performs various conversions from device-independent units (such as DLUs or characters) to pixels. It can be associated with a control or a font. In the case of a control, the font used by the control at the time the PixelConverter is created is used for the pixel calculations. In the case of a specific font, the supplied font is used for the calculations. The control and/or font must not be disposed at the time the PixelConverter is created.

Since:
3.5

Constructor Summary
PixelConverter ( Control control)
          Create a PixelConverter which will convert device-independent units to pixels using the font of the specified control.
PixelConverter ( Font font)
          Create a PixelConverter which will convert device-independent units to pixels using the specified font.
 
Method Summary
 int convertHeightInCharsToPixels (int chars)
          Returns the number of pixels corresponding to the height of the given number of characters.
 int convertHorizontalDLUsToPixels (int dlus)
          Returns the number of pixels corresponding to the given number of horizontal dialog units.
 int convertVerticalDLUsToPixels (int dlus)
          Returns the number of pixels corresponding to the given number of vertical dialog units.
 int convertWidthInCharsToPixels (int chars)
          Returns the number of pixels corresponding to the width of the given number of characters.
 
Methods inherited from class java.lang. Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PixelConverter

public PixelConverter(
Control control)
Create a PixelConverter which will convert device-independent units to pixels using the font of the specified control.

Parameters:
control - the control whose font should be used for pixel conversions. Note that the font used by the control at the time this constructor is called is the font that will be used for all calculations. If the font of the specified control is changed after this PixelConverter is created, then the conversions from this instance will not produce the desired effect.

PixelConverter

public PixelConverter(
Font font)
Create a PixelConverter which will convert device-independent units to pixels using the specified font.

Parameters:
font - the font that should be used for pixel conversions.
Method Detail

convertHeightInCharsToPixels

public int convertHeightInCharsToPixels(int chars)
Returns the number of pixels corresponding to the height of the given number of characters.

Parameters:
chars - the number of characters
Returns:
the number of pixels

convertHorizontalDLUsToPixels

public int convertHorizontalDLUsToPixels(int dlus)
Returns the number of pixels corresponding to the given number of horizontal dialog units.

Parameters:
dlus - the number of horizontal dialog units
Returns:
the number of pixels

convertVerticalDLUsToPixels

public int convertVerticalDLUsToPixels(int dlus)
Returns the number of pixels corresponding to the given number of vertical dialog units.

Parameters:
dlus - the number of vertical dialog units
Returns:
the number of pixels

convertWidthInCharsToPixels

public int convertWidthInCharsToPixels(int chars)
Returns the number of pixels corresponding to the width of the given number of characters.

Parameters:
chars - the number of characters
Returns:
the number of pixels

Eclipse Platform
Release 3.5

Guidelines for using Eclipse APIs.

Copyright (c) Eclipse contributors and others 2000, 2008. All rights reserved.


 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire