|
Eclipse Platform Release 3.6 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.jface.layout.PixelConverter
public class PixelConverter
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.
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 |
---|
public PixelConverter(Control control)
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.public PixelConverter(Font font)
font
- the font that should be used for pixel conversions.Method Detail |
---|
public int convertHeightInCharsToPixels(int chars)
chars
- the number of characters
public int convertHorizontalDLUsToPixels(int dlus)
dlus
- the number of horizontal dialog units
public int convertVerticalDLUsToPixels(int dlus)
dlus
- the number of vertical dialog units
public int convertWidthInCharsToPixels(int chars)
chars
- the number of characters
|
Eclipse Platform Release 3.6 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) Eclipse contributors and others 2000, 2010. All rights reserved.