Top Inners Fields Constructors Methods
sun.awt.X11

public final Class XToolkit

extends UNIXToolkit
implements Runnable
Class Inheritance
All Implemented Interfaces
java.lang.Runnable
Imports
java.awt.AWTError, .AWTException, .Button, .Canvas, .Checkbox, .CheckboxMenuItem, .Choice, .Color, .Component, .Cursor, .Desktop, .Dialog, .Dimension, .EventQueue, .FileDialog, .Frame, .GraphicsConfiguration, .GraphicsDevice, .GraphicsEnvironment, .HeadlessException, .Image, .Insets, .JobAttributes, .Label, .Menu, .MenuBar, .MenuItem, .PageAttributes, .Panel, .Point, .PopupMenu, .PrintJob, .Rectangle, .ScrollPane, .Scrollbar, .SystemColor, .SystemTray, .Taskbar, .TextArea, .TextField, .Toolkit, .TrayIcon, .Window, java.awt.datatransfer.Clipboard, java.awt.dnd.DragGestureEvent, .DragGestureListener, .DragGestureRecognizer, .DragSource, .InvalidDnDOperationException, .MouseDragGestureRecognizer, java.awt.dnd.peer.DragSourceContextPeer, java.awt.event.InputEvent, .KeyEvent, .MouseEvent, java.awt.font.TextAttribute, java.awt.im.InputMethodHighlight, java.awt.im.spi.InputMethodDescriptor, java.awt.peer.ButtonPeer, .CanvasPeer, .CheckboxMenuItemPeer, .CheckboxPeer, .ChoicePeer, .DesktopPeer, .DialogPeer, .FileDialogPeer, .FontPeer, .FramePeer, .KeyboardFocusManagerPeer, .LabelPeer, .ListPeer, .MenuBarPeer, .MenuItemPeer, .MenuPeer, .MouseInfoPeer, .PanelPeer, .PopupMenuPeer, .RobotPeer, .ScrollPanePeer, .ScrollbarPeer, .SystemTrayPeer, .TaskbarPeer, .TextAreaPeer, .TextFieldPeer, .TrayIconPeer, .WindowPeer, java.beans.PropertyChangeListener, java.security.AccessController, .PrivilegedAction, java.util.ArrayList, .Collection, .HashMap, .Hashtable, .Iterator, .LinkedList, .Map, .NoSuchElementException, .Properties, .SortedMap, .TreeMap, .Vector, java.util.concurrent.TimeUnit, javax.swing.LookAndFeel, .UIDefaults, sun.awt.AWTAccessor, .AWTPermissions, .AppContext, .DisplayChangedListener, .LightweightFrame, .SunToolkit, .UNIXToolkit, .X11GraphicsConfig, .X11GraphicsDevice, .X11GraphicsEnvironment, .XSettings, sun.awt.datatransfer.DataTransferer, sun.awt.util.PerformanceLogger, .ThreadGroupUtils, sun.font.FontConfigManager, sun.java2d.SunGraphicsEnvironment, sun.print.PrintJob2D, sun.security.action.GetBooleanAction, .GetPropertyAction, sun.util.logging.PlatformLogger

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface

Field Summary

Modifier and TypeField and Description
private static XAtom
pack-priv static int
private static boolean
pack-priv static int
pack-priv static int
private static final int
pack-priv static int
pack-priv static boolean
pack-priv static boolean
pack-priv static int
pack-priv static long
pack-priv static int
private static String
private static final PlatformLogger
private static int
backingStoreType

One of XConstants: NotUseful, WhenMapped or Always.

pack-priv XClipboard
private static final X11GraphicsDevice
private static final long
private static final DisplayChangedListener
displayChangedHandler

Listener installed to detect display changes.

private static final String
protected static boolean
private static final PlatformLogger
private static long
private FontConfigManager
private static boolean
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static int
private static final PlatformLogger
private Point
private Collection<XToolkit.XEventListener>
private boolean
loadedXSettings

True when the x settings have been loaded.

pack-priv static final X11GraphicsEnvironment
private static final PlatformLogger
private static volatile int
private static volatile int
maxWindowWidthInPixels

Dimensions of default virtual screen in pixels.

pack-priv static int
pack-priv static int
pack-priv static int
pack-priv static int
private static int
private static boolean
private static XEventDispatcher
private static final String
private static final String
pack-priv static final boolean
pack-priv static final boolean
pack-priv static boolean
pack-priv XClipboard
pack-priv static HashMap<Object, Object>
private static Boolean
pack-priv static int
private static final XEventDispatcher
private static final PlatformLogger
private static SortedMap<Long, List<Runnable>>
private static long
private static boolean
pack-priv static Thread
pack-priv static UIDefaults
pack-priv static TreeMap<Long, XBaseWindow>
pack-priv static HashMap<Long, Collection<XEventDispatcher>>
pack-priv static final int
private static XMouseInfoPeer
private XSettings
xs

XSETTINGS for the default screen.

pack-priv static final int
Inherited from sun.awt.UNIXToolkit:
FONTCONFIGAAHINTGTK_LOCK

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
pack-priv static void
addEventDispatcher(long window, XEventDispatcher dispatcher)

public synchronized void
addPropertyChangeListener(String
The name of the property to listen for
name
,
PropertyChangeListener
The property change listener
pcl
)

Overrides java.awt.Toolkit.addPropertyChangeListener.

Adds the specified property change listener for the named desktop property.
pack-priv static void
addToWinMap(long window, XBaseWindow xwin)

public void
public boolean
areExtraMouseButtonsEnabled()

Overrides java.awt.Toolkit.areExtraMouseButtonsEnabled.

Reports whether events from extra mouse buttons are allowed to be processed and posted into EventQueue.
pack-priv static native void
pack-priv static native void
pack-priv static void
public void
beep()

Implements abstract java.awt.Toolkit.beep.

Emits an audio beep depending on native system settings and hardware capabilities.
private static void
callTimeoutTasks()

Executes mature timeout tasks registered with schedule().

pack-priv static boolean
public ButtonPeer
createButton(Button
the button to be implemented
target
)

Overrides default sun.awt.ComponentFactory.createButton.

Creates this toolkit's implementation of Button using the specified peer interface.
public CanvasPeer
createCanvas(Canvas
the canvas to be implemented
target
)

Overrides default sun.awt.ComponentFactory.createCanvas.

Creates this toolkit's implementation of Canvas using the specified peer interface.
public CheckboxPeer
createCheckbox(Checkbox
the check box to be implemented
target
)

Overrides default sun.awt.ComponentFactory.createCheckbox.

Creates this toolkit's implementation of Checkbox using the specified peer interface.
public CheckboxMenuItemPeer
createCheckboxMenuItem(CheckboxMenuItem
the checkbox menu item to be implemented
target
)

Overrides default sun.awt.ComponentFactory.createCheckboxMenuItem.

Creates this toolkit's implementation of CheckboxMenuItem using the specified peer interface.
public ChoicePeer
createChoice(Choice
the choice to be implemented
target
)

Overrides default sun.awt.ComponentFactory.createChoice.

Creates this toolkit's implementation of Choice using the specified peer interface.
public Cursor
createCustomCursor(Image
the image to display when the cursor is activated
cursor
,
Point
the X and Y of the large cursor's hot spot; the hotSpot values must be less than the Dimension returned by getBestCursorSize
hotSpot
,
String
a localized description of the cursor, for Java Accessibility use
name
)

Overrides java.awt.Toolkit.createCustomCursor.

Returns a new custom cursor.
public DesktopPeer
createDesktopPeer(Desktop
the desktop to be implemented
target
)

Overrides default sun.awt.ComponentFactory.createDesktopPeer.

Creates this toolkit's implementation of the Desktop using the specified peer interface.
public DialogPeer
createDialog(Dialog
the dialog to be implemented
target
)

Overrides default sun.awt.ComponentFactory.createDialog.

Creates this toolkit's implementation of Dialog using the specified peer interface.
public <T extends DragGestureRecognizer> T
createDragGestureRecognizer(Class<T>
The abstract class of the required recognizer
recognizerClass
,
DragSource
The DragSource
ds
,
Component
The Component target for the DragGestureRecognizer
c
,
int
The actions permitted for the gesture
srcActions
,
DragGestureListener
The DragGestureListener
dgl
)

Overrides java.awt.Toolkit.createDragGestureRecognizer.

Creates a concrete, platform dependent, subclass of the abstract DragGestureRecognizer class requested, and associates it with the DragSource, Component and DragGestureListener specified.
public DragSourceContextPeer
createDragSourceContextPeer(DragGestureEvent
the DragGestureEvent
dge
)

Overrides default sun.awt.ComponentFactory.createDragSourceContextPeer.

Creates the peer for a DragSourceContext.
public XEmbeddedFramePeer
pack-priv XEmbedChildProxyPeer
public FileDialogPeer
createFileDialog(FileDialog
the file dialog to be implemented
target
)

Overrides default sun.awt.ComponentFactory.createFileDialog.

Creates this toolkit's implementation of FileDialog using the specified peer interface.
public FramePeer
createFrame(Frame
the frame to be implemented
target
)

Overrides default sun.awt.ComponentFactory.createFrame.

Creates this toolkit's implementation of Frame using the specified peer interface.
public LabelPeer
createLabel(Label
the label to be implemented
target
)

Overrides default sun.awt.ComponentFactory.createLabel.

Creates this toolkit's implementation of Label using the specified peer interface.
public FramePeer
public ListPeer
createList(List
the list to be implemented
target
)

Overrides default sun.awt.ComponentFactory.createList.

Creates this toolkit's implementation of List using the specified peer interface.
public MenuPeer
createMenu(Menu
the menu to be implemented
target
)

Overrides default sun.awt.ComponentFactory.createMenu.

Creates this toolkit's implementation of Menu using the specified peer interface.
public MenuBarPeer
createMenuBar(MenuBar
the menu bar to be implemented
target
)

Overrides default sun.awt.ComponentFactory.createMenuBar.

Creates this toolkit's implementation of MenuBar using the specified peer interface.
public MenuItemPeer
createMenuItem(MenuItem
the menu item to be implemented
target
)

Overrides default sun.awt.ComponentFactory.createMenuItem.

Creates this toolkit's implementation of MenuItem using the specified peer interface.
public PanelPeer
createPanel(Panel
the panel to be implemented
target
)

Overrides default sun.awt.ComponentFactory.createPanel.

Creates this toolkit's implementation of Panel using the specified peer interface.
public PopupMenuPeer
createPopupMenu(PopupMenu
the popup menu to be implemented
target
)

Overrides default sun.awt.ComponentFactory.createPopupMenu.

Creates this toolkit's implementation of PopupMenu using the specified peer interface.
public RobotPeer
createRobot(GraphicsDevice
the GraphicsDevice indicating the coordinate system the Robot will operate in
screen
)

Overrides default sun.awt.ComponentFactory.createRobot.

Creates the peer for a Robot.
public ScrollbarPeer
createScrollbar(Scrollbar
the scroll bar to be implemented
target
)

Overrides default sun.awt.ComponentFactory.createScrollbar.

Creates this toolkit's implementation of Scrollbar using the specified peer interface.
public ScrollPanePeer
createScrollPane(ScrollPane
the scroll pane to be implemented
target
)

Overrides default sun.awt.ComponentFactory.createScrollPane.

Creates this toolkit's implementation of ScrollPane using the specified peer interface.
public SystemTrayPeer
public TaskbarPeer
createTaskbarPeer(Taskbar
the taskbar to be implemented
target
)

Overrides default sun.awt.ComponentFactory.createTaskbarPeer.

Creates this toolkit's implementation of the Taskbar using the specified peer interface.
public TextAreaPeer
createTextArea(TextArea
the text area to be implemented
target
)

Overrides default sun.awt.ComponentFactory.createTextArea.

Creates this toolkit's implementation of TextArea using the specified peer interface.
public TextFieldPeer
createTextField(TextField
the text field to be implemented
target
)

Overrides default sun.awt.ComponentFactory.createTextField.

Creates this toolkit's implementation of TextField using the specified peer interface.
public TrayIconPeer
public WindowPeer
createWindow(Window
the window to be implemented
target
)

Overrides default sun.awt.ComponentFactory.createWindow.

Creates this toolkit's implementation of Window using the specified peer interface.
private void
pack-priv static void
public boolean
enableInputMethodsForTextComponent()

Overrides sun.awt.SunToolkit.enableInputMethodsForTextComponent.

Implements sun.awt.InputMethodSupport.enableInputMethodsForTextComponent.

Returns whether enableInputMethods should be set to true for peered TextComponent instances on this platform.
pack-priv void
pack-priv static String
pack-priv static int
getBackingStoreType()

Returns one of XConstants: NotUseful, WhenMapped or Always.

public Dimension
getBestCursorSize(int
the preferred cursor width the component would like to use.
preferredWidth
,
int
the preferred cursor height the component would like to use.
preferredHeight
)

Overrides java.awt.Toolkit.getBestCursorSize.

Returns the supported cursor size
pack-priv static String
pack-priv static long
public DataTransferer
public static long
pack-priv static native long
public static long

Returns:

X11 Display
getDisplay
()

Returns the X11 Display of the default screen device.

pack-priv static native String
public static long
pack-priv static EventQueue
public FontPeer
getFontPeer(String
the font to be implemented
name
,
int
the style of the font, such as PLAIN, BOLD, ITALIC, or a combination
style
)

Overrides default sun.awt.ComponentFactory.getFontPeer.

Creates this toolkit's implementation of Font using the specified peer interface.
public InputMethodDescriptor
getInputMethodAdapterDescriptor()

Implements sun.awt.InputMethodSupport.getInputMethodAdapterDescriptor.

Returns a new input method adapter descriptor for native input methods.
public KeyboardFocusManagerPeer
pack-priv boolean

Returns:

true, if there is remembered last cursor position, false otherwise
getLastCursorPos
(Point p)

Returns whether there is last remembered cursor position.

public boolean
getLockingKeyState(int
the key code
key
)

Overrides java.awt.Toolkit.getLockingKeyState.

Returns whether the given locking key on the keyboard is currently in its "on" state.
public int
getMaximumCursorColors()

Overrides java.awt.Toolkit.getMaximumCursorColors.

Returns the maximum number of colors the Toolkit supports in a custom cursor palette.
pack-priv static int
pack-priv static int
pack-priv static boolean
public synchronized MouseInfoPeer
getMouseInfoPeer()

Overrides default sun.awt.ComponentFactory.getMouseInfoPeer.

Obtains this toolkit's implementation of helper class for MouseInfo operations.
pack-priv static int
private long
public int
getNumberOfButtons()

Overrides sun.awt.SunToolkit.getNumberOfButtons.

Descendants of the SunToolkit should override and put their own logic here.
pack-priv static int
private native int
getNumberOfButtonsImpl()

This method runs through the XPointer and XExtendedPointer array.

public PrintJob
getPrintJob(final Frame
the parent of the print dialog. May not be null.
frame
,
final String
the title of the PrintJob. A null title is equivalent to "".
doctitle
,
final Properties
a Properties object containing zero or more properties. Properties are not standardized and are not consistent across implementations. Because of this, PrintJobs which require job and page control should use the version of this function which takes JobAttributes and PageAttributes objects. This object may be updated to reflect the user's job choices on exit. May be null.
props
)

Implements abstract java.awt.Toolkit.getPrintJob.

Gets a PrintJob object which is the result of initiating a print operation on the toolkit's platform.
public PrintJob
getPrintJob(final Frame
the parent of the print dialog. May not be null.
frame
,
final String
the title of the PrintJob. A null title is equivalent to "".
doctitle
,
final JobAttributes
a set of job attributes which will control the PrintJob. The attributes will be updated to reflect the user's choices as outlined in the JobAttributes documentation. May be null.
jobAttributes
,
final PageAttributes
a set of page attributes which will control the PrintJob. The attributes will be applied to every page in the job. The attributes will be updated to reflect the user's choices as outlined in the PageAttributes documentation. May be null.
pageAttributes
)

Overrides java.awt.Toolkit.getPrintJob.

Gets a PrintJob object which is the result of initiating a print operation on the toolkit's platform.
public Insets
getScreenInsets(final GraphicsConfiguration
a GraphicsConfiguration
gc
)

Overrides java.awt.Toolkit.getScreenInsets.

Gets the insets of the screen.
private Insets
public int
getScreenResolution()

Implements abstract java.awt.Toolkit.getScreenResolution.

Returns the screen resolution in dots-per-inch.
public static boolean
getSunAwtDisableGrab()

Returns the value of "sun.awt.disablegrab" property.

public static synchronized boolean
getSunAwtDisableGtkFileDialogs()

Returns the value of "sun.awt.disableGtkFileDialogs" property.

public Clipboard
getSystemClipboard()

Implements abstract java.awt.Toolkit.getSystemClipboard.

Gets the singleton instance of the system Clipboard which interfaces with clipboard facilities provided by the native platform.
public Clipboard
getSystemSelection()

Overrides java.awt.Toolkit.getSystemSelection.

Gets the singleton instance of the system selection as a Clipboard object.
pack-priv static native long
pack-priv static UIDefaults
private static Rectangle
getWorkArea(long root, int scale)

pack-priv static int
pack-priv static int
pack-priv static long
public void
grab(Window w)

Implements abstract sun.awt.SunToolkit.grab.

Grabs the mouse input for the given window.
pack-priv void
init()

protected void
pack-priv static void
private static native void
initIDs()

Hides java.awt.Toolkit.initIDs.

Initialize JNI field and method ids
private static void
pack-priv static void
pack-priv static void
private boolean

Returns:

true if the method has initialized XAWTXSettings.
initXSettingsIfNeeded
(final String propName)

Initializes XAWTXSettings if a property for a given property name is provided by XSettings and they are not initialized yet.

public boolean
isAlwaysOnTopSupported()

Overrides java.awt.Toolkit.isAlwaysOnTopSupported.

Returns whether the always-on-top mode is supported by this toolkit.
public boolean
isDesktopSupported()

Implements abstract sun.awt.SunToolkit.isDesktopSupported.

Returns if the java.awt.Desktop class is supported on the current desktop.
public boolean
isDynamicLayoutActive()

Overrides java.awt.Toolkit.isDynamicLayoutActive.

Returns whether dynamic layout of Containers on resize is currently enabled on the underlying operating system and/or window manager.
protected boolean
isDynamicLayoutSet()

Overrides java.awt.Toolkit.isDynamicLayoutSet.

Returns whether the layout of Containers is validated dynamically during resizing, or statically, after resizing is complete.
protected boolean
public boolean
isFrameStateSupported(int
one of named frame state constants.
state
)

Overrides java.awt.Toolkit.isFrameStateSupported.

Returns whether Toolkit supports this state for Frames.
pack-priv static boolean
pack-priv static boolean
public boolean
isModalExclusionTypeSupported(Dialog.ModalExclusionType
modal exclusion type to be checked for support by this toolkit
exclusionType
)

Overrides sun.awt.SunToolkit.isModalExclusionTypeSupported.

Overridden in XToolkit and WToolkit
public boolean
isModalityTypeSupported(Dialog.ModalityType
modality type to be checked for support by this toolkit
modalityType
)

Overrides sun.awt.SunToolkit.isModalityTypeSupported.

Overridden in XToolkit and WToolkit
pack-priv static boolean
pack-priv static boolean
pack-priv static boolean
public boolean
pack-priv static boolean
public boolean
public boolean
public boolean
public boolean
public boolean
pack-priv static boolean
pack-priv static boolean
isXsunKPBehavior()

Check for Xsun convention regarding numpad keys.

pack-priv static int
protected Object
lazilyLoadDesktopProperty(String
the name
name
)

Overrides sun.awt.UNIXToolkit.lazilyLoadDesktopProperty.

Overridden to handle GTK icon loading
public void
loadSystemColors(int[]
an integer array.
systemColors
)

Overrides java.awt.Toolkit.loadSystemColors.

Fills in the integer array that is supplied as an argument with the current system color values.
private void
public Map<TextAttribute, ?>
mapInputMethodHighlight(InputMethodHighlight
input method highlight
highlight
)

Implements abstract java.awt.Toolkit.mapInputMethodHighlight.

Returns a map of visual attributes for the abstract level description of the given input method highlight, or null if no mapping is found.
private native void
nativeLoadSystemColors(int[] systemColors)

protected boolean
needsXEmbedImpl()

Overrides sun.awt.SunToolkit.needsXEmbedImpl.

Returns whether this toolkit needs the support of the xembed from embedding host(if any).
private void
pack-priv void
parseXSettings(int screen_XXX_ignored, Map<String, Object> updatedSettings)

Callback from the native side indicating some, or all, of the desktop properties have changed and need to be reloaded.

pack-priv static void
private void
private void
pack-priv static void
remove(Runnable task)

Removed the task from the list of waiting-to-be called tasks.

pack-priv static void
removeEventDispatcher(long window, XEventDispatcher dispatcher)

pack-priv static void
removeFromWinMap(long window, XBaseWindow xwin)

pack-priv static void
removeSourceEvents(EventQueue queue, Object source, boolean removeAllEvents)

pack-priv static void
private void
public void
run()

Implements java.lang.Runnable.run.

Runs this operation.
public void
run(boolean loop)

pack-priv static void
schedule(Runnable
a Runnable which run method will be called on the toolkit thread when interval milliseconds elapse
task
,
long
an interval in milliseconds
interval
)

Registers a Runnable which run() method will be called once on the toolkit thread when a specified interval of time elapses.

private static void
public void
setDynamicLayout(boolean
If true, Containers should re-layout their components as the Container is being resized. If false, the layout will be validated after resizing is completed.
b
)

Overrides java.awt.Toolkit.setDynamicLayout.

Controls whether the layout of Containers is validated dynamically during resizing, or statically, after resizing is complete.
pack-priv static void
protected boolean
syncNativeQueue(long timeout)

Implements abstract sun.awt.SunToolkit.syncNativeQueue.

Platform toolkits need to implement this method to perform the sync of the native queue.
protected static void
protected static Object
pack-priv static boolean
tryXKB()

Query XKEYBOARD extension.

public void
ungrab(Window w)

Implements abstract sun.awt.SunToolkit.ungrab.

Forces ungrab.
public boolean
pack-priv static native void
waitForEvents(long nextTaskTime)

pack-priv static native void
pack-priv static XBaseWindow
windowToXWindow(long window)

pack-priv static void
Inherited from sun.awt.UNIXToolkit:
checkGtkVersiondismissPopupOnFocusLostIfNeededdismissPopupOnFocusLostIfNeededCleanUpgetDatatransferTimeoutgetDesktopgetDesktopAAHintsgetEnabledGtkVersiongetGTKIcongetGtkVersiongetStockIconisGtkVerboseisNativeGTKAvailableisOnWaylandisRunningOnWaylandlazilyLoadGTKIconloadGTKloadIconCallbackshouldDisableSystemTraysync