|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.swt.graphics.Font
Instances of this class manage operating system resources that
define how text looks when it is displayed. Fonts may be constructed
by providing a device and either name, size and style information
or a FontData
object which encapsulates this data.
Application code must explicitly invoke the Font.dispose()
method to release the operating system resources managed by each instance
when those instances are no longer required.
FontData
Constructor Summary | |
Font(Device device,
FontData fd)
Constructs a new font given a device and font data which describes the desired font's appearance. |
|
Font(Device device,
FontData[] fds)
Constructs a new font given a device and an array of font data which describes the desired font's appearance. |
|
Font(Device device,
java.lang.String name,
int height,
int style)
Constructs a new font given a device, a font name, the height of the desired font in points, and a font style. |
Method Summary | |
void |
dispose()
Disposes of the operating system resources associated with the font. |
boolean |
equals(java.lang.Object object)
Compares the argument to the receiver, and returns true if they represent the same object using a class specific comparison. |
FontData[] |
getFontData()
Returns an array of FontData s representing the receiver. |
int |
hashCode()
Returns an integer hash code for the receiver. |
boolean |
isDisposed()
Returns true if the font has been disposed,
and false otherwise. |
java.lang.String |
toString()
Returns a string containing a concise, human-readable description of the receiver. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Font(Device device, FontData fd)
You must dispose the font when it is no longer required.
device
- the device to create the font onfd
- the FontData that describes the desired font (must not be null)
java.lang.IllegalArgumentException
- SWTError
- public Font(Device device, FontData[] fds)
You must dispose the font when it is no longer required.
device
- the device to create the font onfds
- the array of FontData that describes the desired font (must not be null)
java.lang.IllegalArgumentException
- SWTError
- public Font(Device device, java.lang.String name, int height, int style)
You must dispose the font when it is no longer required.
device
- the device to create the font onname
- the name of the font (must not be null)height
- the font height in pointsstyle
- a bit or combination of NORMAL, BOLD, ITALIC
java.lang.IllegalArgumentException
- SWTError
- Method Detail |
public void dispose()
public boolean equals(java.lang.Object object)
object
- the object to compare with this object
true
if the object is the same as this object and false
otherwisehashCode()
public FontData[] getFontData()
FontData
s representing the receiver.
On Windows, only one FontData will be returned per font. On X however,
a Font
object may be composed of multiple X
fonts. To support this case, we return an array of font data objects.
SWTException
- public int hashCode()
true
when passed to
equals
must return the same value for this
method.
equals(java.lang.Object)
public boolean isDisposed()
true
if the font has been disposed,
and false
otherwise.
This method gets the dispose state for the font. When a font has been disposed, it is an error to invoke any other method using the font.
true
when the font is disposed and false
otherwisepublic java.lang.String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |