Java Doc for Device.java in  » IDE-Eclipse » swt » org » eclipse » swt » graphics » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » IDE Eclipse » swt » org.eclipse.swt.graphics 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.eclipse.swt.graphics.Device

All known Subclasses:   org.eclipse.swt.printing.Printer,  org.eclipse.swt.widgets.Display,
Device
abstract public class Device implements Drawable(Code)
This class is the abstract superclass of all device objects, such as the Display device and the Printer device. Devices can have a graphics context (GC) created for them, and they can be drawn on by sending messages to the associated GC.


Field Summary
 ColorCOLOR_BLACKCOLOR_DARK_REDCOLOR_DARK_GREENCOLOR_DARK_YELLOWCOLOR_DARK_BLUE
    
 ColorCOLOR_DARK_MAGENTACOLOR_DARK_CYANCOLOR_GRAYCOLOR_DARK_GRAYCOLOR_RED
    
 ColorCOLOR_GREENCOLOR_YELLOWCOLOR_BLUECOLOR_MAGENTACOLOR_CYANCOLOR_WHITE
    
protected static  DeviceCurrentDevice
    
public static  booleanDEBUG
    
protected static  RunnableDeviceFinder
    
 intcolorspace
    
 booleandebug
    
 booleandisposedwarnings
    
 CallbackdrawPatternCallbackaxialShadingCallbackreleaseCallback
    
 intdrawPatternProcaxialShadingProcreleaseProc
    
 Error[]errors
    
 Object[]objects
    
 FontsystemFont
    
 booleantracking
    
 ObjecttrackingLock
    

Constructor Summary
public  Device()
     Constructs a new instance of this class.

You must dispose the device when it is no longer required.

public  Device(DeviceData data)
     Constructs a new instance of this class.

You must dispose the device when it is no longer required.


Method Summary
 intaxialShadingProc(int ref, int in, int out)
    
protected  voidcheckDevice()
     Throws an SWTException if the receiver can not be accessed by the caller.
protected  voidcreate(DeviceData data)
     Creates the device in the operating system.
 voidcreatePatternCallbacks()
    
protected  voiddestroy()
     Destroys the device in the operating system and releases the device's handle.
public  voiddispose()
     Disposes of the operating system resources associated with the receiver.
 voiddispose_Object(Object object)
    
 intdrawPatternProc(int ref, int context)
    
public  RectanglegetBounds()
     Returns a rectangle describing the receiver's size and location.
public  RectanglegetClientArea()
     Returns a rectangle which describes the area of the receiver which is capable of displaying data.
public  PointgetDPI()
     Returns a point whose x coordinate is the horizontal dots per inch of the display, and whose y coordinate is the vertical dots per inch of the display.
public  intgetDepth()
     Returns the bit depth of the screen, which is the number of bits it takes to represent the number of unique colors that the screen is currently capable of displaying.
static synchronized  DevicegetDevice()
    
public  DeviceDatagetDeviceData()
     Returns a DeviceData based on the receiver.
public  FontData[]getFontList(String faceName, boolean scalable)
     Returns FontData objects which describe the fonts that match the given arguments.
public  ColorgetSystemColor(int id)
     Returns the matching standard color for the given constant, which should be one of the color constants specified in class SWT.
public  FontgetSystemFont()
     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.
public  booleangetWarnings()
     Returns true if the underlying window system prints out warning messages on the console, and setWarnings had previously been called with true.
protected  voidinit()
     Initializes any internal resources needed by the device.
abstract public  voidinternal_dispose_GC(int handle, GCData data)
     Invokes platform specific functionality to dispose a GC handle.

IMPORTANT: This method is not part of the public API for Device.

abstract public  intinternal_new_GC(GCData data)
     Invokes platform specific functionality to allocate a new GC handle.

IMPORTANT: This method is not part of the public API for Device.

public  booleanisDisposed()
     Returns true if the device has been disposed, and false otherwise.
public  booleanloadFont(String path)
     Loads the font specified by a file.
 voidnew_Object(Object object)
    
protected  voidrelease()
     Releases any internal resources back to the operating system and clears all fields except the device handle.

When a device is destroyed, resources that were acquired on behalf of the programmer need to be returned to the operating system.

 intreleaseProc(int info, int data, int size)
    
public  voidsetWarnings(boolean warnings)
     If the underlying window system supports printing warning messages to the console, setting warnings to false prevents these messages from being printed.

Field Detail
COLOR_BLACKCOLOR_DARK_REDCOLOR_DARK_GREENCOLOR_DARK_YELLOWCOLOR_DARK_BLUE
Color COLOR_BLACKCOLOR_DARK_REDCOLOR_DARK_GREENCOLOR_DARK_YELLOWCOLOR_DARK_BLUE(Code)



COLOR_DARK_MAGENTACOLOR_DARK_CYANCOLOR_GRAYCOLOR_DARK_GRAYCOLOR_RED
Color COLOR_DARK_MAGENTACOLOR_DARK_CYANCOLOR_GRAYCOLOR_DARK_GRAYCOLOR_RED(Code)



COLOR_GREENCOLOR_YELLOWCOLOR_BLUECOLOR_MAGENTACOLOR_CYANCOLOR_WHITE
Color COLOR_GREENCOLOR_YELLOWCOLOR_BLUECOLOR_MAGENTACOLOR_CYANCOLOR_WHITE(Code)



CurrentDevice
protected static Device CurrentDevice(Code)



DEBUG
public static boolean DEBUG(Code)



DeviceFinder
protected static Runnable DeviceFinder(Code)



colorspace
int colorspace(Code)



debug
boolean debug(Code)



disposedwarnings
boolean disposedwarnings(Code)



drawPatternCallbackaxialShadingCallbackreleaseCallback
Callback drawPatternCallbackaxialShadingCallbackreleaseCallback(Code)



drawPatternProcaxialShadingProcreleaseProc
int drawPatternProcaxialShadingProcreleaseProc(Code)



errors
Error[] errors(Code)



objects
Object[] objects(Code)



systemFont
Font systemFont(Code)



tracking
boolean tracking(Code)



trackingLock
Object trackingLock(Code)




Constructor Detail
Device
public Device()(Code)
Constructs a new instance of this class.

You must dispose the device when it is no longer required.


See Also:   Device.create
See Also:   Device.init
since:
   3.1



Device
public Device(DeviceData data)(Code)
Constructs a new instance of this class.

You must dispose the device when it is no longer required.


Parameters:
  data - the DeviceData which describes the receiver
See Also:   Device.create
See Also:   Device.init
See Also:   DeviceData




Method Detail
axialShadingProc
int axialShadingProc(int ref, int in, int out)(Code)



checkDevice
protected void checkDevice()(Code)
Throws an SWTException if the receiver can not be accessed by the caller. This may include both checks on the state of the receiver and more generally on the entire execution context. This method should be called by device implementors to enforce the standard SWT invariants.

Currently, it is an error to invoke any method (other than isDisposed() and dispose()) on a device that has had its dispose() method called.

In future releases of SWT, there may be more or fewer error checks and exceptions may be thrown for different reasons.


exception:
  SWTException -

  • ERROR_WIDGET_DISPOSED - if the receiver has been disposed



create
protected void create(DeviceData data)(Code)
Creates the device in the operating system. If the device does not have a handle, this method may do nothing depending on the device.

This method is called before init.

Subclasses are supposed to reimplement this method and not call the super implementation.


Parameters:
  data - the DeviceData which describes the receiver
See Also:   Device.init



createPatternCallbacks
void createPatternCallbacks()(Code)



destroy
protected void destroy()(Code)
Destroys the device in the operating system and releases the device's handle. If the device does not have a handle, this method may do nothing depending on the device.

This method is called after release.

Subclasses are supposed to reimplement this method and not call the super implementation.


See Also:   Device.dispose
See Also:   Device.release



dispose
public void dispose()(Code)
Disposes of the operating system resources associated with the receiver. After this method has been invoked, the receiver will answer true when sent the message isDisposed().
See Also:   Device.release
See Also:   Device.destroy
See Also:   Device.checkDevice



dispose_Object
void dispose_Object(Object object)(Code)



drawPatternProc
int drawPatternProc(int ref, int context)(Code)



getBounds
public Rectangle getBounds()(Code)
Returns a rectangle describing the receiver's size and location. the bounding rectangle
exception:
  SWTException -
  • ERROR_DEVICE_DISPOSED - if the receiver has been disposed



getClientArea
public Rectangle getClientArea()(Code)
Returns a rectangle which describes the area of the receiver which is capable of displaying data. the client area
exception:
  SWTException -
  • ERROR_DEVICE_DISPOSED - if the receiver has been disposed

See Also:   Device.getBounds



getDPI
public Point getDPI()(Code)
Returns a point whose x coordinate is the horizontal dots per inch of the display, and whose y coordinate is the vertical dots per inch of the display. the horizontal and vertical DPI
exception:
  SWTException -
  • ERROR_DEVICE_DISPOSED - if the receiver has been disposed



getDepth
public int getDepth()(Code)
Returns the bit depth of the screen, which is the number of bits it takes to represent the number of unique colors that the screen is currently capable of displaying. This number will typically be one of 1, 8, 15, 16, 24 or 32. the depth of the screen
exception:
  SWTException -
  • ERROR_DEVICE_DISPOSED - if the receiver has been disposed



getDevice
static synchronized Device getDevice()(Code)



getDeviceData
public DeviceData getDeviceData()(Code)
Returns a DeviceData based on the receiver. Modifications made to this DeviceData will not affect the receiver. a DeviceData containing the device's data and attributes
exception:
  SWTException -
  • ERROR_DEVICE_DISPOSED - if the receiver has been disposed

See Also:   DeviceData



getFontList
public FontData[] getFontList(String faceName, boolean scalable)(Code)
Returns FontData objects which describe the fonts that match the given arguments. If the faceName is null, all fonts will be returned.
Parameters:
  faceName - the name of the font to look for, or null
Parameters:
  scalable - if true only scalable fonts are returned, otherwise only non-scalable fonts are returned. the matching font data
exception:
  SWTException -
  • ERROR_DEVICE_DISPOSED - if the receiver has been disposed



getSystemColor
public Color getSystemColor(int id)(Code)
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 freed because it was allocated by the system, not the application.
Parameters:
  id - the color constant the matching color
exception:
  SWTException -
  • ERROR_DEVICE_DISPOSED - if the receiver has been disposed

See Also:   SWT



getSystemFont
public Font getSystemFont()(Code)
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 freed 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.

a font
exception:
  SWTException -
  • ERROR_DEVICE_DISPOSED - if the receiver has been disposed



getWarnings
public boolean getWarnings()(Code)
Returns true if the underlying window system prints out warning messages on the console, and setWarnings had previously been called with true. trueif warnings are being handled, and false otherwise
exception:
  SWTException -
  • ERROR_DEVICE_DISPOSED - if the receiver has been disposed



init
protected void init()(Code)
Initializes any internal resources needed by the device.

This method is called after create.

If subclasses reimplement this method, they must call the super implementation.


See Also:   Device.create



internal_dispose_GC
abstract public void internal_dispose_GC(int handle, GCData data)(Code)
Invokes platform specific functionality to dispose a GC handle.

IMPORTANT: This method is not part of the public API for Device. It is marked public only so that it can be shared within the packages provided by SWT. It is not available on all platforms, and should never be called from application code.


Parameters:
  hDC - the platform specific GC handle
Parameters:
  data - the platform specific GC data



internal_new_GC
abstract public int internal_new_GC(GCData data)(Code)
Invokes platform specific functionality to allocate a new GC handle.

IMPORTANT: This method is not part of the public API for Device. It is marked public only so that it can be shared within the packages provided by SWT. It is not available on all platforms, and should never be called from application code.


Parameters:
  data - the platform specific GC data the platform specific GC handle



isDisposed
public boolean isDisposed()(Code)
Returns true if the device has been disposed, and false otherwise.

This method gets the dispose state for the device. When a device has been disposed, it is an error to invoke any other method using the device. true when the device is disposed and false otherwise




loadFont
public boolean loadFont(String path)(Code)
Loads the font specified by a file. The font will be present in the list of fonts available to the application.
Parameters:
  path - the font file path whether the font was successfully loaded
exception:
  SWTException -
  • ERROR_NULL_ARGUMENT - if path is null
  • ERROR_DEVICE_DISPOSED - if the receiver has been disposed

See Also:   Font
since:
   3.3



new_Object
void new_Object(Object object)(Code)



release
protected void release()(Code)
Releases any internal resources back to the operating system and clears all fields except the device handle.

When a device is destroyed, resources that were acquired on behalf of the programmer need to be returned to the operating system. For example, if the device allocated a font to be used as the system font, this font would be freed in release. Also,to assist the garbage collector and minimize the amount of memory that is not reclaimed when the programmer keeps a reference to a disposed device, all fields except the handle are zero'd. The handle is needed by destroy.

This method is called before destroy.

If subclasses reimplement this method, they must call the super implementation.


See Also:   Device.dispose
See Also:   Device.destroy



releaseProc
int releaseProc(int info, int data, int size)(Code)



setWarnings
public void setWarnings(boolean warnings)(Code)
If the underlying window system supports printing warning messages to the console, setting warnings to false prevents these messages from being printed. If the argument is true then message printing is not blocked.
Parameters:
  warnings - trueif warnings should be printed, and false otherwise
exception:
  SWTException -
  • ERROR_DEVICE_DISPOSED - if the receiver has been disposed



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.