Top Description Inners Fields Constructors Methods
org.eclipse.swt.widgets

public Class Display

extends Device
implements Executor
Class Inheritance
All Implemented Interfaces
java.util.concurrent.Executor
Imports
java.io.*, java.lang.reflect.*, java.net.*, java.util.*, java.util.Map.*, java.util.concurrent.*, java.util.concurrent.atomic.*, java.util.function.*, java.util.regex.*, .Pattern, org.eclipse.swt.*, org.eclipse.swt.graphics.*, org.eclipse.swt.internal.*, org.eclipse.swt.internal.GDBus.*, org.eclipse.swt.internal.cairo.*, org.eclipse.swt.internal.gtk.*, org.eclipse.swt.internal.gtk3.*, org.eclipse.swt.internal.gtk4.*

Instances of this class are responsible for managing the connection between SWT and the underlying operating system. Their most important function is to implement the SWT event loop in terms of the platform event model. They also provide various methods for accessing information about the operating system, and have overall control over the operating system resources which SWT allocates.

Applications which are built with SWT will almost always require only a single display. In particular, some platforms which SWT supports will not allow more than one active display. In other words, some platforms do not support creating a new display if one already exists that has not been sent the dispose() message.

In SWT, the thread which creates a Display instance is distinguished as the user-interface thread for that display.

The user-interface thread for a particular display has the following special attributes:

Enforcing these attributes allows SWT to be implemented directly on the underlying operating system's event model. This has numerous benefits including smaller footprint, better use of resources, safer memory management, clearer program logic, better performance, and fewer overall operating system threads required. The down side however, is that care must be taken (only) when constructing multi-threaded applications to use the inter-thread communication mechanisms which this class provides when required.

All SWT API methods which may only be called from the user-interface thread are distinguished in their documentation by indicating that they throw the "ERROR_THREAD_INVALID_ACCESS" SWT exception.

Styles:
(none)
Events:
Close, Dispose, OpenDocument, Settings, Skin

Important Note

This class is not intended to be subclassed.

See Also
syncExec, asyncExec, wake, readAndDispatch, sleep, Device#dispose, Display snippets, Sample code and further information

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class

Field Summary

Modifier and TypeField and Description
pack-priv Callback
pack-priv long
pack-priv boolean
pack-priv Shell
pack-priv static final String
pack-priv static final String
pack-priv long
pack-priv Callback
pack-priv long
pack-priv int
pack-priv static String
pack-priv static String
pack-priv int
pack-priv Callback
pack-priv int
pack-priv long
pack-priv Callback
pack-priv long
pack-priv Callback
pack-priv long
pack-priv Callback
pack-priv long
pack-priv int
pack-priv long[]
pack-priv int[]
pack-priv long[]
pack-priv GdkRGBA
pack-priv GdkRGBA
pack-priv GdkRGBA
pack-priv GdkRGBA
pack-priv GdkRGBA
pack-priv GdkRGBA
pack-priv GdkRGBA
pack-priv GdkRGBA
pack-priv GdkRGBA
pack-priv GdkRGBA
pack-priv GdkRGBA
pack-priv GdkRGBA
pack-priv GdkRGBA
pack-priv GdkRGBA
pack-priv GdkRGBA
pack-priv GdkRGBA
pack-priv GdkRGBA
pack-priv GdkRGBA
pack-priv GdkRGBA
pack-priv GdkRGBA
pack-priv GdkRGBA
pack-priv GdkRGBA
pack-priv GdkRGBA
pack-priv GdkRGBA
pack-priv ArrayList<String>
private static final Pattern
pack-priv Callback
pack-priv long
pack-priv Caret
pack-priv Control
pack-priv TrayItem
pack-priv Cursor[]
pack-priv Object
pack-priv static Display
pack-priv static final String
pack-priv int[]
pack-priv static Display[]
pack-priv Runnable[]
pack-priv long
pack-priv Callback
pack-priv Callback
pack-priv long
pack-priv boolean
pack-priv Consumer<Error>
pack-priv Image
pack-priv Callback
pack-priv long
pack-priv Event[]
pack-priv EventTable
pack-priv XExposeEvent
pack-priv static final String
pack-priv boolean
pack-priv long
pack-priv EventTable
pack-priv static long
pack-priv boolean
pack-priv long[]
pack-priv GdkRectangle
pack-priv long
pack-priv Callback
pack-priv Control
pack-priv int
pack-priv long
pack-priv int
pack-priv int
pack-priv long[]
pack-priv Widget[]
pack-priv Callback
pack-priv long
pack-priv static final String
pack-priv static final String
pack-priv static final String
pack-priv Map<Integer, Integer>
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv Callback
pack-priv int
pack-priv Object
pack-priv boolean
pack-priv long
pack-priv boolean
pack-priv boolean
pack-priv boolean
pack-priv long
pack-priv Control
pack-priv int[]
pack-priv Image
pack-priv static final int
pack-priv Callback
pack-priv long
pack-priv String[]
pack-priv Callback
pack-priv long
pack-priv static final int[][]
private static final int
pack-priv int
pack-priv long
pack-priv int
pack-priv Widget
private int
pack-priv Composite[]
pack-priv int
pack-priv Callback
pack-priv long
pack-priv int[]
pack-priv Control
pack-priv Dialog
pack-priv Shell[]
pack-priv Callback
pack-priv long
pack-priv int
pack-priv long
pack-priv Callback
pack-priv long
pack-priv static final String
pack-priv long
pack-priv long
pack-priv long
pack-priv static long
pack-priv static long
pack-priv Menu[]
pack-priv long
pack-priv long
pack-priv long
pack-priv Image
pack-priv static final String
pack-priv static Callback
pack-priv static long
pack-priv static Callback
pack-priv static long
pack-priv static Callback
pack-priv static long
pack-priv static Callback
pack-priv static long
pack-priv int
pack-priv int
pack-priv int
pack-priv int
pack-priv Callback
pack-priv double
pack-priv double
pack-priv int
pack-priv long
pack-priv static final int
pack-priv Resource[]
pack-priv boolean
pack-priv Consumer<RuntimeException>
pack-priv Callback
pack-priv long
pack-priv SessionManagerDBus
pack-priv Display.SessionManagerListener
pack-priv static final String
pack-priv Callback
pack-priv long
pack-priv boolean
pack-priv long
pack-priv Callback
pack-priv long
pack-priv long
pack-priv Callback
pack-priv int[]
pack-priv long
pack-priv Callback
pack-priv long
pack-priv Callback
pack-priv long
pack-priv int
pack-priv Widget[]
private static final int
pack-priv Callback
pack-priv long
pack-priv static boolean
pack-priv static final int
pack-priv final int
pack-priv final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv Synchronizer
pack-priv static long
pack-priv static long
pack-priv static boolean
themeDark

True if the current theme is dark.

pack-priv static String
themeName

The name of the current theme, including the theme named by GTK_THEME.

pack-priv Thread
pack-priv int[]
pack-priv Callback
pack-priv int[]
pack-priv Runnable[]
pack-priv long
pack-priv static long
pack-priv static long
pack-priv Tracker
pack-priv Tray
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv int[]
pack-priv int[]
pack-priv Object[]
pack-priv boolean
pack-priv Image
pack-priv Widget[]
pack-priv Callback
pack-priv long
pack-priv Callback
pack-priv Callback
pack-priv Callback
pack-priv Callback
pack-priv Callback
pack-priv String
pack-priv long
pack-priv long
pack-priv long
pack-priv long
pack-priv long
pack-priv boolean
pack-priv Callback
pack-priv long
Inherited from org.eclipse.swt.graphics.Device:
CHANGE_SCALEFACTORCurrentDeviceDEBUGDeviceFinderxDisplay

Constructor Summary

AccessConstructor and Description
public
Display()

Constructs a new instance of this class.

public
Display(DeviceData
the device data
data
)

Constructs a new instance of this class using the parameter.

Method Summary

Modifier and TypeMethod and Description
pack-priv static int
_getDeviceZoom(long monitor_num)

pack-priv void
activateProc(long action, long parameter, long user_data)

public void
addFilter(int
the type of event to listen for
eventType
,
Listener
the listener which should be notified when the event occurs
listener
)

Adds the listener to the collection of listeners who will be notified when an event of the given type occurs anywhere in a widget.

pack-priv void
addGdkEvent(long event)

pack-priv void
pack-priv void
public void
addListener(int
the type of event to listen for
eventType
,
Listener
the listener which should be notified when the event occurs
listener
)

Adds the listener to the collection of listeners who will be notified when an event of the given type occurs.

pack-priv void
addMouseHoverTimeout(long handle)

pack-priv void
addPopup(Menu menu)

pack-priv void
pack-priv void
addWidget(long handle, Widget widget)

pack-priv long
allChildrenProc(long widget, long recurse)

public void
asyncExec(Runnable
code to run on the user-interface thread or null
runnable
)

Causes the run() method of the runnable to be invoked by the user-interface thread at the next reasonable opportunity.

public void
beep()

Causes the system hardware to emit a short sound (if it supports this capability).

pack-priv long
caretProc(long clientData)

pack-priv long
cellDataProc(long tree_column, long cell, long tree_model, long iter, long data)

pack-priv boolean
changeValue(long handle, int scroll, double value, long user_data)

pack-priv boolean

Returns:

true if the current theme is dark
checkAndSetThemeDetails
(String
the full name of the current theme SWT is running with
themeName
)

Sets the org.eclipse.swt.internal.gtk.theme value with the current GTK theme name.

protected void
checkDevice()

Overrides org.eclipse.swt.graphics.Device.checkDevice.

Throws an SWTException if the receiver can not be accessed by the caller.
pack-priv static void
checkDisplay(Thread thread, boolean multiple)

pack-priv long
checkIfEventProc(long display, long xEvent, long userData)

pack-priv void
checkIMModule()

Check if the XIM module is present and generates a warning for potential graphical issues if GTK_IM_MODULE=xim is detected.

protected void
checkSubclass()

Checks that this class can be subclassed.

pack-priv void
public void
close()

Requests that the connection between SWT and the underlying operating system be closed.

pack-priv void
computeSizeProc(long toplevel, long size, long user_data)

pack-priv GdkRGBA
copyRGBA(GdkRGBA source)

protected void
create(DeviceData
the DeviceData which describes the receiver
data
)

Overrides org.eclipse.swt.graphics.Device.create.

Creates the device in the operating system.
pack-priv void
pack-priv Image
pack-priv String
debugInfoForIndex(long index)

pack-priv static void
protected void
destroy()

Overrides org.eclipse.swt.graphics.Device.destroy.

Destroys the device in the operating system and releases the device's handle.
pack-priv void
public void
disposeExec(Runnable
code to run at dispose time.
runnable
)

Causes the run() method of the runnable to be invoked by the user-interface thread just before the receiver is disposed.

pack-priv void
dpiChanged(int newScaleFactor)

pack-priv String
pack-priv long
emissionProc(long ihint, long n_param_values, long param_values, long data)

pack-priv void
enterMotionProc(long controller, double x, double y, long user_data)

pack-priv void
error(int
the descriptive error code
code
)

Does whatever display specific cleanup is required, and then uses the code in SWTError.error to handle the error.

pack-priv long
eventProc(long event, long data)

public void
execute(Runnable
the runnable to execute in the user-interface thread, never null
runnable
)

Implements java.util.concurrent.Executor.execute.

Executes the given runnable in the user-interface thread of this Display.
public static String

Returns:

a String representing the error message that was set
extractFreeGError
(long
pointer to the GError
errorPtr
)

Helper method to extract GError messages.

pack-priv boolean
pack-priv boolean
filters(int eventType)

public static Display

Returns:

the display for the given thread
findDisplay
(Thread
the user-interface thread
thread
)

Returns the display which the given thread is the user-interface thread for, or null if the given thread is not a user-interface thread for any display.

pack-priv long
private int

Returns:

the most Latin keyboard layout group (i.e. group holding the max number of Latin alphabet keys)
findLatinKeyGroup
()

Determine key group of Latin layout, and update the layout group to key count map.

public Widget

Returns:

the SWT widget that the handle represents
findWidget
(long
the handle for the widget
handle
)

Given the operating system handle for a widget, returns the instance of the Widget subclass which represents it in the currently running application, if such exists, or null if no matching widget can be found.

public Widget

Returns:

the SWT widget that the handle/id pair represents
findWidget
(long
the handle for the widget
handle
,
long
the id for the subwidget (usually an item)
id
)

Given the operating system handle for a widget, and widget-specific id, returns the instance of the Widget subclass which represents the handle/id pair in the currently running application, if such exists, or null if no matching widget can be found.

public Widget

Returns:

the SWT subwidget (usually an item) that the widget/id pair represents
findWidget
(Widget
the widget
widget
,
long
the id for the subwidget (usually an item)
id
)

Given a widget and a widget-specific id, returns the instance of the Widget subclass which represents the widget/id pair in the currently running application, if such exists, or null if no matching widget can be found.

pack-priv void
flushExposes(long window, boolean all)

pack-priv void
focusProc(long controller, long user_data)

private void
gdbus_init_methods()

Handle gdbus on 'org.eclipse.swt' DBus session.

pack-priv long
gdk_device_get_surface_at_position(double[] win_x, double[] win_y)

pack-priv long
gdk_device_get_window_at_position(int[] win_x, int[] win_y)

pack-priv void
gesturePressReleaseProc(long gesture, int n_press, double x, double y, long user_data)

public Shell

Returns:

the active shell or null
getActiveShell
()

Returns the currently active Shell, or null if no shell belonging to the currently running application is active.

public static String

Returns:

the application name
getAppName
()

Returns the application name.

public static String

Returns:

the application version
getAppVersion
()

Returns the application version.

public Rectangle

Returns:

the bounding rectangle
getBounds
()

Overrides org.eclipse.swt.graphics.Device.getBounds.

Returns a rectangle describing the receiver's size and location.
pack-priv Rectangle
pack-priv int
public Rectangle

Returns:

the client area
getClientArea
()

Overrides org.eclipse.swt.graphics.Device.getClientArea.

Returns a rectangle which describes the area of the receiver which is capable of displaying data.
pack-priv long
getClosure(int id)

public static Display

Returns:

the current display
getCurrent
()

Returns the display which the currently running thread is the user-interface thread for, or null if the currently running thread is not a user-interface thread for any display.

public Control

Returns:

the control under the cursor or null
getCursorControl
()

Returns the control which the on-screen pointer is currently over top of, or null if it is not currently over one of the controls built by the currently running application.

public Point

Returns:

the cursor location
getCursorLocation
()

Returns the location of the on-screen pointer relative to the top left corner of the screen.

pack-priv Point
public Point[]

Returns:

the array of cursor sizes
getCursorSizes
()

Returns an array containing the recommended cursor sizes.

public Object

Returns:

the value of the property or null if it has not been set
getData
(String
the name of the property
key
)

Returns the application defined property of the receiver with the specified name, or null if it has not been set.

public Object

Returns:

the display specific data
getData
()

Returns the application defined, display specific data associated with the receiver, or null if it has not been set.

public static Display

Returns:

the default display
getDefault
()

Returns the default display.

public int
getDepth()

Overrides org.eclipse.swt.graphics.Device.getDepth.

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.
public int

Returns:

the button dismissal order
getDismissalAlignment
()

Returns the button dismissal alignment, one of LEFT or RIGHT.

public int

Returns:

the double click time
getDoubleClickTime
()

Returns the longest duration, in milliseconds, between two mouse button clicks that will be considered a double click by the underlying operating system.

public final Consumer<Error>

Returns:

the current error handler. Never null.
getErrorHandler
()

Returns the current exception handler.

public Control

Returns:

the focus control or null
getFocusControl
()

Returns the control which currently has keyboard focus, or null if keyboard events are not currently going to any of the controls built by the currently running application.

pack-priv Map<Integer, Integer>
getGroupKeysCount()

Return a mapping from layout group to the number of Latin alphabet (a-z) in each group

public boolean

Returns:

the high contrast mode
getHighContrast
()

Returns true when the high contrast mode is enabled.

public int

Returns:

the maximum icon depth
getIconDepth
()

Returns the maximum allowed depth of icons on this display, in bits per pixel.

public Point[]

Returns:

the array of icon sizes
getIconSizes
()

Returns an array containing the recommended icon sizes.

pack-priv int
pack-priv int
getLatinKeyGroup()

Return the most Latin keyboard layout group.

public Menu

Returns:

the application menu bar, or null
getMenuBar
()

Returns the single instance of the application menu bar, or null if there is no application menu bar for the platform.

pack-priv Dialog
public Monitor[]

Returns:

the array of monitors
getMonitors
()

Returns an array of monitors attached to the device.

pack-priv void
getPointerPosition(double[] x, double[] y)

Gets the current cursor position relative to the upper left corner of the surface.

public Monitor

Returns:

the primary monitor
getPrimaryMonitor
()

Returns the primary monitor for that device.

public final Consumer<RuntimeException>

Returns:

the current exception handler. Never null.
getRuntimeExceptionHandler
()

Returns the current exception handler.

public Shell[]

Returns:

the receiver's shells
getShells
()

Returns a (possibly empty) array containing all shells which have not been disposed and have the receiver as their display.

public Synchronizer

Returns:

the receiver's synchronizer
getSynchronizer
()

Gets the synchronizer used by the display.

public Thread

Returns:

the receiver's sync-interface thread
getSyncThread
()

Returns the thread that has invoked syncExec or null if no such runnable is currently being invoked by the user-interface thread.

public Color

Returns:

the matching color
getSystemColor
(int
the color constant
id
)

Overrides org.eclipse.swt.graphics.Device.getSystemColor.

Returns the matching standard color for the given constant, which should be one of the color constants specified in class SWT.
public Cursor

Returns:

the corresponding cursor or null
getSystemCursor
(int
the SWT cursor constant
id
)

Returns the matching standard platform cursor for the given constant, which should be one of the cursor constants specified in class SWT.

public Image

Returns:

the corresponding image or null
getSystemImage
(int
the SWT icon constant
id
)

Returns the matching standard platform image for the given constant, which should be one of the icon constants specified in class SWT.

public Menu

Returns:

the system menu, or null
getSystemMenu
()

Returns the single instance of the system-provided menu for the application, or null on platforms where no menu is provided for the application.

public TaskBar

Returns:

the system taskBar or null
getSystemTaskBar
()

Returns the single instance of the system taskBar or null when there is no system taskBar available for the platform.

public Tray

Returns:

the system tray or null
getSystemTray
()

Returns the single instance of the system tray or null when there is no system tray available for the platform.

public Thread

Returns:

the receiver's user-interface thread
getThread
()

Returns the user-interface thread for the receiver.

public boolean

Returns:

true if a touch-aware input device is detected, or false otherwise
getTouchEnabled
()

Returns a boolean indicating whether a touch-aware input device is attached to the system and is ready for use.

pack-priv Widget
getWidget(long handle)

pack-priv long

Returns:

the cursor position to x & y. Return value of the function is the window pointer underneath the cursor, can be NULL.
getWindowPointerPosition
(long window, int[] x, int[] y, int[] mask)

Gets the current cursor position relative to the upper left corner of the window.

pack-priv Rectangle
getWorkArea()

Returns the work area, an EWMH property to store the size and position of the screen not covered by dock and panel windows.

pack-priv long
pack-priv long
pack-priv long
pack-priv String
gtk_css_create_css_color_string(String background, String foreground, int property)

pack-priv GdkRGBA

Returns:

a GdkRGBA object representing the background color, or COLOR_WIDGET_BACKGROUND if the background color could not be parsed or isn't set
gtk_css_parse_background
(String
a CSS being parsed
css
,
String
a String representation of a selector to search for, or NULL if the entire GtkCssProvider is to be parsed
precise
)

This method allows for parsing of background colors from a GTK CSS string.

pack-priv GdkRGBA

Returns:

a GdkRGBA object representing the foreground color or COLOR_WIDGET_FOREGROUND if the foreground color could not be parsed or isn't set
gtk_css_parse_foreground
(String
a CSS representation of the gtk theme
css
,
String
a String representation of a selector to search for, or NULL if the entire GtkCssProvider is to be parsed
precise
)

This method allows for parsing of foreground colors from a GTK CSS string.

pack-priv GdkRGBA

Returns:

a GdkRGBA object representing the color, or transparent (empty GdkRGBA) if the color could not be parsed
gtk_css_property_to_rgba
(String
a String representation of the color
property
)

This method parses a string representation of a color and returns a GdkRGBA object of that color.

pack-priv String
pack-priv long
pack-priv String

Returns:

a String representation of the color or COLOR_WIDGET_BACKGROUND if NULL is specified as a parameter
gtk_rgba_to_css_string
(GdkRGBA
a GdkRGBA object containing the color to be parsed or NULL
rgba
)

In GdkRGBA, values are a double between 0-1.

pack-priv String

Returns:

a String representation of the widget's CSS name
gtk_widget_class_get_css_name
(long
a pointer to the GtkWidget resource
handle
)

Gets the CSS name of the widget provided.

pack-priv String

Returns:

a String representation of the widget's name
gtk_widget_get_name
(long
a pointer to the GtkWidget resource
handle
)

Gets the name of the widget in String format.

pack-priv long
idleProc(long data)

protected void
init()

Overrides org.eclipse.swt.graphics.Device.init.

Initializes any internal resources needed by the device.
pack-priv void
pack-priv void
pack-priv void
pack-priv void
pack-priv void
pack-priv void
pack-priv void
initializeSystemColorsList(long shellContext)

pack-priv void
initializeSystemColorsTitle(long shellContext)

pack-priv void
pack-priv void
pack-priv void
initializeSystemColorsWidget(long shellContext)

pack-priv void
pack-priv void
public void
internal_dispose_GC(long
the platform specific GC handle
hDC
,
GCData
the platform specific GC data
data
)

Implements abstract org.eclipse.swt.graphics.Device.internal_dispose_GC.

Implements org.eclipse.swt.graphics.Drawable.internal_dispose_GC.

Invokes platform specific functionality to dispose a GC handle.
public long

Returns:

the platform specific GC handle
internal_new_GC
(GCData
the platform specific GC data
data
)

Implements abstract org.eclipse.swt.graphics.Device.internal_new_GC.

Implements org.eclipse.swt.graphics.Drawable.internal_new_GC.

Invokes platform specific functionality to allocate a new GC handle.
pack-priv static int
inversePremultipliedColor(int color, int alpha)

Calculates original color from RGBA with premultiplied alpha.

pack-priv static boolean
public static boolean

Returns:

true if the current OS theme has a dark appearance, else returns false.
isSystemDarkTheme
()

Returns true if the current OS theme has a dark appearance, else returns false.

pack-priv static boolean
isValidClass(Class<?> clazz)

pack-priv boolean
pack-priv boolean
keyPressReleaseProc(long controller, int keyval, int keycode, int state, long user_data)

pack-priv long
keysChangedProc(long keymap, long user_data)

'keys-changed' event handler.

pack-priv void
leaveProc(long controller, long user_data)

public Point

Returns:

point with mapped coordinates
map
(Control
the source Control or null
from
,
Control
the destination Control or null
to
,
Point
to be mapped
point
)

Maps a point from one coordinate system to another.

public Point

Returns:

point with mapped coordinates
map
(Control
the source Control or null
from
,
Control
the destination Control or null
to
,
int
coordinates to be mapped
x
,
int
coordinates to be mapped
y
)

Maps a point from one coordinate system to another.

public Rectangle

Returns:

rectangle with mapped coordinates
map
(Control
the source Control or null
from
,
Control
the destination Control or null
to
,
Rectangle
to be mapped
rectangle
)

Maps a point from one coordinate system to another.

public Rectangle

Returns:

rectangle with mapped coordinates
map
(Control
the source Control or null
from
,
Control
the destination Control or null
to
,
int
coordinates to be mapped
x
,
int
coordinates to be mapped
y
,
int
coordinates to be mapped
width
,
int
coordinates to be mapped
height
)

Maps a point from one coordinate system to another.

pack-priv Point
mapInPixels(Control from, Control to, int x, int y)

pack-priv Rectangle
mapInPixels(Control from, Control to, Rectangle rectangle)

pack-priv Rectangle
mapInPixels(Control from, Control to, int x, int y, int width, int height)

pack-priv long
mouseHoverProc(long handle)

pack-priv long
notifyProc(long object, long param_spec, long user_data)

public boolean

Returns:

true if the event was generated or false otherwise
post
(Event
the event to be generated
event
)

Generate a low level system event.

pack-priv void
pack-priv void
public boolean

Returns:

false if the caller can sleep upon return from this method
readAndDispatch
()

Reads an event from the operating system's event queue, dispatches it appropriately, and returns 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.

pack-priv static void
register(Display display)

protected void
release()

Overrides org.eclipse.swt.graphics.Device.release.

Releases any internal resources back to the operating system and clears all fields except the device handle.
pack-priv void
pack-priv void
public void
removeFilter(int
the type of event to listen for
eventType
,
Listener
the listener which should no longer be notified when the event occurs
listener
)

Removes the listener from the collection of listeners who will be notified when an event of the given type occurs anywhere in a widget.

pack-priv long
pack-priv void
public void
removeListener(int
the type of event to listen for
eventType
,
Listener
the listener which should no longer be notified
listener
)

Removes the listener from the collection of listeners who will be notified when an event of the given type occurs.

pack-priv void
pack-priv void
pack-priv Widget
removeWidget(long handle)

private static void
renderAllBackgrounds(long styleContext, long cairo)

What user sees is a combination of multiple layers.

pack-priv static long
rendererClassInitProc(long g_class, long class_data)

pack-priv static long
rendererGetPreferredWidthProc(long cell, long handle, long minimun_size, long natural_size)

pack-priv static long
rendererRenderProc(long cell, long cr, long handle, long background_area, long cell_area, long flags)

pack-priv static long
rendererSnapshotProc(long cell, long snapshot, long handle, long background_area, long cell_area, long flags)

pack-priv void
pack-priv void
resizeProc(long handle, int width, int height)

pack-priv boolean
runAsyncMessages(boolean all)

pack-priv boolean
pack-priv boolean
pack-priv boolean
pack-priv boolean
pack-priv boolean
pack-priv void
pack-priv boolean
scrollProc(long controller, double dx, double dy, long user_data)

pack-priv void
sendEvent(int eventType, Event event)

pack-priv void
sendEvent(EventTable eventTable, Event event)

private void
sendJDKInternalEvent(int eventType)

private void
sendJDKInternalEvent(int eventType, int detail)

does sent event with JDK time

pack-priv void
sendPostEvent(int eventType)

public void
sendPostExternalEventDispatchEvent()

Sends a SWT.PostExternalEventDispatch event.

pack-priv void
sendPreEvent(int eventType)

public void
sendPreExternalEventDispatchEvent()

Sends a SWT.PreExternalEventDispatch event.

public static void
setAppName(String
the new app name or null
name
)

Sets the application name to the argument.

public static void
setAppVersion(String
the new app version
version
)

Sets the application version to the argument.

pack-priv void
public void
setCursorLocation(int
the new x coordinate for the cursor
x
,
int
the new y coordinate for the cursor
y
)

Sets the location of the on-screen pointer relative to the top left corner of the screen.

public void
setCursorLocation(Point
new position
point
)

Sets the location of the on-screen pointer relative to the top left corner of the screen.

pack-priv void
public void
setData(String
the name of the property
key
,
Object
the new value for the property
value
)

Sets the application defined property of the receiver with the specified name to the given argument.

public void
setData(Object
the new display specific data
data
)

Sets the application defined, display specific data associated with the receiver, to the argument.

pack-priv static void
setDevice(Device device)

pack-priv long
setDirectionProc(long widget, long direction)

public final void
setErrorHandler(Consumer<Error>
new error handler to be registered.
errorHandler
)

Sets a callback that will be invoked whenever an error is thrown by a listener or external callback function.

pack-priv void
setModalDialog(Dialog modalDailog)

pack-priv void
public final void
setRuntimeExceptionHandler(Consumer<RuntimeException>
new exception handler to be registered.
runtimeExceptionHandler
)

Sets a callback that will be invoked whenever an exception is thrown by a listener or external callback function.

public void
setSynchronizer(Synchronizer
the new synchronizer for the display (must not be null)
synchronizer
)

Sets the synchronizer used by the display to be the argument, which can not be null.

pack-priv long
shellMapProc(long handle, long arg0, long user_data)

pack-priv void
pack-priv long
signalProc(long gobject, long arg1, long user_data)

pack-priv long
sizeAllocateProc(long handle, long arg0, long user_data)

pack-priv long
sizeRequestProc(long handle, long arg0, long user_data)

public boolean

Returns:

true if an event requiring dispatching was placed on the queue.
sleep
()

Causes the user-interface thread to sleep (that is, to be put in a state where it does not consume CPU cycles) until an event is received or it is otherwise awakened.

pack-priv void
snapshotDrawProc(long handle, long snapshot)

pack-priv GdkRGBA
styleContextEstimateBackgroundColor(long context, int state)

Background in GTK theme can be more complex then just solid color: 1) Due to 'background-image', 'background-position', 'background-repeat', etc. Example: 'tooltip' in 'Ambiance' theme uses 'background-image'.

pack-priv GdkRGBA
styleContextGetColor(long context, int flag)

public <T, E extends Exception> T
syncCall(SwtCallable<T, E>
the code to call on the user-interface thread
callable
)

Calls the callable on the user-interface thread at the next reasonable opportunity, and returns the its result from this method.

public void
syncExec(Runnable
code to run on the user-interface thread or null
runnable
)

Causes the run() method of the runnable to be invoked by the user-interface thread at the next reasonable opportunity.

public void
timerExec(int
the delay before running the runnable
milliseconds
,
Runnable
code to run on the user-interface thread
runnable
)

Causes the run() method of the runnable to be invoked by the user-interface thread after the specified number of milliseconds have elapsed.

pack-priv long
timerProc(long i)

pack-priv GdkRGBA

Returns:

GdkRGBA object with calculated RGB values
toGdkRGBA
(GdkRGBA
the source GdkRGBA from which RGB values are copied from
rgba
,
double
a value between 0 and Double.MAX_VALUE which modifies the brightness of saturation and luminosity
brightness
)

This method converts from RGB to HSV, from HSV to HSL (including brightness), from HSL back to HSV and from HSV back to RGB.

pack-priv static int
translateKey(int key)

pack-priv static int
untranslateKey(int key)

public void
update()

Forces all outstanding paint requests for the display to be processed before this method returns.

public void
wake()

If the receiver's user-interface thread was sleeping, causes it to be awakened and start running again.

pack-priv void
pack-priv void
windowActiveProc(long handle, long user_data)

pack-priv long
windowProc(long handle, long user_data)

pack-priv long
windowProc(long handle, long arg0, long user_data)

pack-priv long
windowProc(long handle, long arg0, long arg1, long user_data)

pack-priv long
windowProc(long handle, long arg0, long arg1, long arg2, long user_data)

pack-priv long
windowProc(long handle, long arg0, long arg1, long arg2, long arg3, long user_data)

pack-priv long
windowTimerProc(long handle)

Inherited from org.eclipse.swt.graphics.Device:
disposegetDeviceDatagetDeviceZoomgetDPIgetFontListgetSystemFontgetWarningsisDisposedisTrackingloadFontsetTrackingsetWarnings