Eclipse Rich Ajax Platform
Release 1.2

org.eclipse.swt.graphics
Class Device

java.lang.Object
  extended byorg.eclipse.swt.graphics.Device
Direct Known Subclasses:
Display

public abstract class Device
extends Object

This class is the abstract superclass of all device objects, such as Display.

This class is not intended to be directly used by clients.


Constructor Summary
Device()
           
 
Method Summary
protected  void checkDevice()
           
 Color getSystemColor(int id)
          Returns the matching standard color for the given constant, which should be one of the color constants specified in class SWT.
 Font getSystemFont()
          Returns a reasonable font for applications to use.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Device

public Device()
Method Detail

getSystemColor

public Color getSystemColor(int id)
Returns the matching standard color for the given constant, which should be one of the color constants specified in class SWT. Any value other than one of the SWT color constants which is passed in will result in the color black. This color should not be free'd because it was allocated by the system, not the application.

Parameters:
id - the color constant
Returns:
the matching color
Throws:
SWTException -
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
  • ERROR_DEVICE_DISPOSED - if the receiver has been disposed
See Also:
SWT

getSystemFont

public Font getSystemFont()
Returns a reasonable font for applications to use. On some platforms, this will match the "default font" or "system font" if such can be found. This font should not be free'd because it was allocated by the system, not the application.

Typically, applications which want the default look should simply not set the font on the widgets they create. Widgets are always created with the correct default font for the class of user-interface component they represent.

Returns:
a font
Throws:
SWTException -
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
  • ERROR_DEVICE_DISPOSED - if the receiver has been disposed

checkDevice

protected void checkDevice()

Eclipse Rich Ajax Platform
Release 1.2

Copyright (c) Innoopract Informationssysteme GmbH and others 2002, 2008. All rights reserved.