java.lang.Object | +--org.eclipse.swt.graphics.Device | +--org.eclipse.swt.widgets.Display
Unsafe:
org.eclipse.swt.internal.win32.MSG
msg
Display()
Display(DeviceData data)
(package private) void
addFilter(int eventType,
Listener listener)
void
addListener(int eventType,
Listener listener)
void
asyncExec(Runnable runnable)
run() method of the runnable to
be invoked by the user-interface thread at the next
reasonable opportunity.
void
beep()
protected void
checkDevice()
SWTException if the receiver can not
be accessed by the caller.
void
close()
protected void
destroy()
void
disposeExec(Runnable runnable)
run() method of the runnable to
be invoked by the user-interface thread just before the
receiver is disposed.
(package private) void
error(int code)
SWTError.error to handle the error.
static Display
findDisplay(Thread thread)
Widget
findWidget(int handle)
Widget subclass which
represents it in the currently running application, if
such exists, or null if no matching widget can be found.
Shell
getActiveShell()
Shell, or null
if no shell belonging to the currently running application
is active.
Rectangle
getClientArea()
static Display
getCurrent()
Control
getCursorControl()
Point
getCursorLocation()
Object
getData()
Object
getData(String key)
int
getDismissalAlignment()
LEFT or RIGHT.
int
getDoubleClickTime()
Control
getFocusControl()
Shell[]
getShells()
Thread
getSyncThread()
syncExec
or null if no such runnable is currently being invoked by
the user-interface thread.
Color
getSystemColor(int id)
SWT.
void
internal_dispose_GC(int hDC,
GCData data)
int
internal_new_GC(GCData data)
boolean
readAndDispatch()
true
if there is potentially more work to do, or false
if the caller can sleep until another event is placed on
the event queue.
protected void
release()
(package private) void
removeFilter(int eventType,
Listener listener)
void
removeListener(int eventType,
Listener listener)
static void
setAppName(String name)
void
setCursorLocation(int x,
int y)
void
setCursorLocation(Point point)
void
setData(Object data)
void
setData(String key,
Object value)
void
setSynchronizer(Synchronizer synchronizer)
boolean
sleep()
void
syncExec(Runnable runnable)
run() method of the runnable to
be invoked by the user-interface thread at the next
reasonable opportunity.
void
timerExec(int milliseconds,
Runnable runnable)
run() method of the runnable to
be invoked by the user-interface thread after the specified
number of milliseconds have elapsed.
(package private) boolean
translateAccelerator(org.eclipse.swt.internal.win32.MSG msg,
Control control)
(package private) boolean
translateMnemonic(org.eclipse.swt.internal.win32.MSG msg,
Control control)
(package private) boolean
translateTraversal(org.eclipse.swt.internal.win32.MSG msg,
Control control)
void
update()
void
wake()
sleep'ing,
causes it to be awakened and start running again.
public org.eclipse.swt.internal.win32.MSG msg
Event[] eventQueue
org.eclipse.swt.internal.Callback windowCallback
int windowProc
int threadId
int processId
org.eclipse.swt.internal.win32.TCHAR windowClass
static int WindowClassCount
static final String WindowName
EventTable eventTable
EventTable filterTable
org.eclipse.swt.internal.Callback msgFilterCallback
int msgFilterProc
int hHook
org.eclipse.swt.internal.win32.MSG hookMsg
Synchronizer synchronizer
Thread thread
Runnable[] disposeList
int timerCount
int[] timerIds
Runnable[] timerList
boolean lockActiveWindow
boolean lastVirtual
boolean lastNull
int lastKey
int lastAscii
int lastMouse
byte[] keyboard
boolean accelKeyHit
boolean mnemonicKeyHit
int hwndMessage
int messageProc
org.eclipse.swt.internal.Callback messageCallback
int[] systemFonts
ImageList[] imageList
ImageList[] toolImageList
ImageList[] toolHotImageList
ImageList[] toolDisabledImageList
int lpCustColors
Object data
String[] keys
Object[] values
Menu[] bars
Menu[] popups
static final int[][] KeyTable
static Display Default
static Display[] Displays
Shell[] modalWidgets
static boolean TrimEnabled
static final String PACKAGE_PREFIX
public Display()
Note: The resulting display is marked as the current display. If this is the first display which has been constructed since the application started, it is also marked as the default display.
getCurrent(),
getDefault(),
Widget.checkSubclass(),
Shellpublic Display(DeviceData data)
static void setDevice(Device device)
int asciiKey(int key)
void addFilter(int eventType, Listener listener)
handleEvent() message.
eventType - the type of event to listen forlistener - the listener which should be notified when the event occursListener,
removeFilter(int, org.eclipse.swt.widgets.Listener),
removeListener(int, org.eclipse.swt.widgets.Listener)public void addListener(int eventType, Listener listener)
handleEvent() message.
eventType - the type of event to listen forlistener - the listener which should be notified when the event occursListener,
removeListener(int, org.eclipse.swt.widgets.Listener)void addBar(Menu menu)
void addPopup(Menu menu)
public void asyncExec(Runnable runnable)
run() method of the runnable to
be invoked by the user-interface thread at the next
reasonable opportunity. The caller of this method continues
to run in parallel, and is not notified when the
runnable has completed.
runnable - code to run on the user-interface thread.syncExec(java.lang.Runnable)public void beep()
protected void checkSubclass()
IMPORTANT: See the comment in Widget.checkSubclass().
Widget.checkSubclass()protected void checkDevice()
DeviceSWTException 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.
checkDevice in class Devicestatic void checkDisplay(Thread thread)
void clearModal(Shell shell)
int controlKey(int key)
public void close()
Device.dispose()protected void create(DeviceData data)
This method is called before init.
data - the DeviceData which describes the receiverinit()void createDisplay(DeviceData data)
static void deregister(Display display)
protected void destroy()
This method is called after release.
Device.dispose(),
release()void destroyDisplay()
public void disposeExec(Runnable runnable)
run() method of the runnable to
be invoked by the user-interface thread just before the
receiver is disposed.
runnable - code to run at dispose time.void drawMenuBars()
void error(int code)
SWTError.error to handle the error.
code - the descriptive error codeSWTError#errorboolean filterEvent(Event event)
boolean filters(int eventType)
boolean filterMessage(org.eclipse.swt.internal.win32.MSG msg)
public Widget findWidget(int handle)
Widget subclass which
represents it in the currently running application, if
such exists, or null if no matching widget can be found.
handle - the handle for the widget
Control findControl(int handle)
public static Display findDisplay(Thread thread)
thread - the user-interface thread
public Shell getActiveShell()
Shell, or null
if no shell belonging to the currently running application
is active.
public Rectangle getBounds()
public static Display getCurrent()
public Rectangle getClientArea()
getClientArea in class DevicegetBounds()public Control getCursorControl()
public Point getCursorLocation()
public static Display getDefault()
static boolean isValidClass(Class clazz)
public Object getData(String key)
Applications may have associated arbitrary objects with the
receiver in this fashion. If the objects stored in the
properties need to be notified when the display is disposed
of, it is the application's responsibility provide a
disposeExec() handler which does so.
key - the name of the property
setData(java.lang.String, java.lang.Object),
disposeExec(java.lang.Runnable)public Object getData()
Applications may put arbitrary objects in this field. If
the object stored in the display specific data needs to
be notified when the display is disposed of, it is the
application's responsibility provide a
disposeExec() handler which does so.
setData(java.lang.String, java.lang.Object),
disposeExec(java.lang.Runnable)public int getDismissalAlignment()
LEFT or RIGHT.
The button dismissal alignment is the ordering that should be used when positioning the
default dismissal button for a dialog. For example, in a dialog that contains an OK and
CANCEL button, on platforms where the button dismissal alignment is LEFT, the
button ordering should be OK/CANCEL. When button dismissal alignment is RIGHT,
the button ordering should be CANCEL/OK.
public int getDoubleClickTime()
public Control getFocusControl()
public int getIconDepth()
ImageList getImageList(Point size)
ImageList getToolImageList(Point size)
ImageList getToolHotImageList(Point size)
ImageList getToolDisabledImageList(Point size)
Shell getModalShell()
int getLastEventTime()
public Shell[] getShells()
public Thread getSyncThread()
syncExec
or null if no such runnable is currently being invoked by
the user-interface thread.
Note: If a runnable invoked by asyncExec is currently running, this method will return null.
public Color getSystemColor(int id)
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.
getSystemColor in class Deviceid - the color constant
SWTpublic Font getSystemFont()
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.
getSystemFont in class Devicepublic Thread getThread()
public int internal_new_GC(GCData data)
IMPORTANT: This method is not part of the public
API for Display. 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.
internal_new_GC in interface Drawableinternal_new_GC in class Devicedata - the platform specific GC data
protected void init()
This method is called after create.
public void internal_dispose_GC(int hDC, GCData data)
IMPORTANT: This method is not part of the public
API for Display. 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.
internal_dispose_GC in interface Drawableinternal_dispose_GC in class Devicedata - the platform specific GC databoolean isWakeMessage(org.eclipse.swt.internal.win32.MSG msg)
boolean isValidThread()
boolean isVirtualKey(int key)
int messageProc(int hwnd, int msg, int wParam, int lParam)
int msgFilterProc(int code, int wParam, int lParam)
int numpadKey(int key)
void postEvent(Event event)
public boolean readAndDispatch()
true
if there is potentially more work to do, or false
if the caller can sleep until another event is placed on
the event queue.
In addition to checking the system event queue, this method also
checks if any inter-thread messages (created by syncExec()
or asyncExec()) are waiting to be processed, and if
so handles them before returning.
static void register(Display display)
protected void release()
Disposes all shells which are currently open on the display.
After this method has been invoked, all related related shells
will answer true when sent the message
isDisposed().
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.
destroy.
Device.dispose(),
destroy()void releaseDisplay()
void releaseImageList(ImageList list)
void releaseToolImageList(ImageList list)
void releaseToolHotImageList(ImageList list)
void releaseToolDisabledImageList(ImageList list)
void removeFilter(int eventType, Listener listener)
eventType - the type of event to listen forlistener - the listener which should no longer be notified when the event occursListener,
addFilter(int, org.eclipse.swt.widgets.Listener),
addListener(int, org.eclipse.swt.widgets.Listener)public void removeListener(int eventType, Listener listener)
eventType - the type of event to listen forlistener - the listener which should no longer be notified when the event occursListener,
addListener(int, org.eclipse.swt.widgets.Listener)void removeBar(Menu menu)
void removePopup(Menu menu)
boolean runAsyncMessages()
boolean runDeferredEvents()
boolean runPopups()
boolean runTimer(int id)
void sendEvent(int eventType, Event event)
public void setCursorLocation(int x, int y)
x - the new x coordinate for the cursory - the new y coordinate for the cursorpublic void setCursorLocation(Point point)
point - new positionpublic void setData(String key, Object value)
Applications may have associated arbitrary objects with the
receiver in this fashion. If the objects stored in the
properties need to be notified when the display is disposed
of, it is the application's responsibility provide a
disposeExec() handler which does so.
key - the name of the propertyvalue - the new value for the propertysetData(java.lang.String, java.lang.Object),
disposeExec(java.lang.Runnable)public void setData(Object data)
Applications may put arbitrary objects in this field. If
the object stored in the display specific data needs to
be notified when the display is disposed of, it is the
application's responsibility provide a
disposeExec() handler which does so.
data - the new display specific datagetData(java.lang.String),
disposeExec(java.lang.Runnable)public static void setAppName(String name)
name - the new app namevoid setModalShell(Shell shell)
public void setSynchronizer(Synchronizer synchronizer)
synchronizer - the new synchronizer for the display (must not be null)int shiftedKey(int key)
public boolean sleep()
true if an event requiring dispatching was placed on the queue.wake()public void syncExec(Runnable runnable)
run() method of the runnable to
be invoked by the user-interface thread at the next
reasonable opportunity. The thread which calls this method
is suspended until the runnable completes.
runnable - code to run on the user-interface thread.asyncExec(java.lang.Runnable)int systemFont()
public void timerExec(int milliseconds, Runnable runnable)
run() method of the runnable to
be invoked by the user-interface thread after the specified
number of milliseconds have elapsed. If milliseconds is less
than zero, the runnable is not executed.
milliseconds - the delay before running the runnablerunnable - code to run on the user-interface threadasyncExec(java.lang.Runnable)boolean translateAccelerator(org.eclipse.swt.internal.win32.MSG msg, Control control)
static int translateKey(int key)
boolean translateMnemonic(org.eclipse.swt.internal.win32.MSG msg, Control control)
boolean translateTraversal(org.eclipse.swt.internal.win32.MSG msg, Control control)
static int untranslateKey(int key)
public void update()
Control.update()void updateFont()
public void wake()
sleep'ing,
causes it to be awakened and start running again. Note that this
method may be called from any thread.
sleep()int windowProc(int hwnd, int msg, int wParam, int lParam)
static String withCrLf(String string)