APIdia Launch Partner
Top Inners Fields Constructors Methods
sun.awt.X11

public Class XBaseWindow

extends Object
Class Inheritance
Known Direct Subclasses
sun.awt.X11.XRootWindow, sun.awt.X11.XFocusProxyWindow, sun.awt.X11.XIconWindow, sun.awt.X11.XWindow
Imports
java.awt.Dimension, .Point, .Rectangle, java.util.HashSet, .Set, sun.awt.SunToolkit, sun.util.logging.PlatformLogger

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static enum
pack-priv static class

Field Summary

Modifier and TypeField and Description
public static final String
public static final String
public static final String
public static final String
public static final String
pack-priv Set<Long>
public static final String
pack-priv static final int
public static final String
private XCreateWindowParams
public static final String
private boolean
public static final String
pack-priv boolean
public static final String
private static final PlatformLogger
private static final PlatformLogger
private static final PlatformLogger
pack-priv int
private XSizeHints
private XBaseWindow.InitialiseState
private static final PlatformLogger
private static final PlatformLogger
pack-priv boolean
pack-priv Rectangle
pack-priv static final int
public static final String
public static final String
public static final String
pack-priv volatile XBaseWindow
public static final String
private long
protected XBaseWindow.StateLock
public static final String
public static final String
pack-priv boolean
public static final String
public static final String
pack-priv int
pack-priv long
private static XAtom
private XWMHints
pack-priv int
x

pack-priv int
y

Constructor Summary

AccessConstructor and Description
pack-priv
pack-priv
XBaseWindow(long parentWindow, Rectangle bounds)

Creates normal child window

pack-priv
XBaseWindow(Rectangle bounds)

Creates top-level window

public
pack-priv
XBaseWindow(long parentWindow)

Method Summary

Modifier and TypeMethod and Description
pack-priv void
pack-priv void
pack-priv void
pack-priv void
public boolean
protected void
checkParams(XCreateWindowParams params)

Verifies that all required parameters are set.

public boolean
contains(int x, int y)

Returns whether the given point is inside of the window.

public boolean
containsGlobal(int x, int y)

Returns whether the given point is inside of the window.

private void
create(XCreateWindowParams params)

Creates window with parameters specified by params

pack-priv void
public void
pack-priv static void
dispatchToWindow(XEvent ev)

Dispatches event to the grab Window or event source window depending on whether the grab is active and on the event type

pack-priv void
public int
public int
public Rectangle
public Set<Long>
public long
public XBaseWindow
public XCreateWindowParams
pack-priv int
public XSizeHints
public XBaseWindow
protected int
getScale()

Returns scale factor of the window.

pack-priv long
pack-priv long
pack-priv static long
getScreenOfWindow(long window)

public Dimension
pack-priv Object
getStateLock()

This lock object can be used to protect instance data from concurrent access by two threads.

public XWindowPeer
pack-priv int
public long
public XWMHints
protected String
pack-priv int
getX()

pack-priv static XRootWindow
pack-priv int
getY()

public boolean
grabInput()

We should always grab both keyboard and pointer to control event flow on popups.

public void
handleButtonPressRelease(XEvent xev)

Activate automatic grab on first ButtonPress, deactivate on full mouse release

public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
protected final void
init(long parentWindow, Rectangle bounds)

protected final void
init(XCreateWindowParams params)

Creates window using parameters params If params contain flag DELAYED doesn't do anything.

protected void
pack-priv void
instantPreInit(XCreateWindowParams params)

Called for delayed inits during construction

pack-priv boolean
protected boolean
pack-priv static boolean
isFullRelease(int buttonState, int button)

Checks ButtonRelease released all Mouse buttons

pack-priv static boolean
pack-priv boolean
public boolean
pack-priv boolean
protected final void
pack-priv void
postInit(XCreateWindowParams params)

Called after window creation, descendants should override to initialize Window with class-specific values and perform post-initialization actions.

protected final void
pack-priv void
preInit(XCreateWindowParams params)

Called before window creation, descendants should override to initialize the data, initialize params.

protected int
scaleDown(int x)

protected int
scaleUp(int x)

pack-priv void
setDisposed(boolean d)

public void
setSizeHints(long flags, int x, int y, int width, int height)

pack-priv void
public final void
setWMHints(XWMHints hints)

Helper function to set W

public void
pack-priv Rectangle
pack-priv Point
pack-priv Point
toGlobal(int x, int y)

pack-priv Point
pack-priv Point
toLocal(int x, int y)

pack-priv static Point

Returns:

coordinates relative to dst, or null if error happened
toOtherWindow
(long src, long dst, int x, int y)

Translate coordinates from one window into another.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

public static void
pack-priv void
pack-priv void
public static long
public void
xRequestFocus(long time)

public void
public void
public void
xSetBounds(int x, int y, int width, int height)

public void
xSetVisible(boolean visible)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

BACKGROUND_PIXMAPback to summary
public static final String BACKGROUND_PIXMAP
BACKING_STOREback to summary
public static final String BACKING_STORE
BIT_GRAVITYback to summary
public static final String BIT_GRAVITY
BORDER_PIXELback to summary
public static final String BORDER_PIXEL
BOUNDSback to summary
public static final String BOUNDS
childrenback to summary
pack-priv Set<Long> children
COLORMAPback to summary
public static final String COLORMAP
DEF_LOCATIONback to summary
pack-priv static final int DEF_LOCATION
DELAYEDback to summary
public static final String DELAYED
delayedParamsback to summary
private XCreateWindowParams delayedParams
DEPTHback to summary
public static final String DEPTH
disposedback to summary
private boolean disposed
EMBEDDEDback to summary
public static final String EMBEDDED
embeddedback to summary
pack-priv boolean embedded
EVENT_MASKback to summary
public static final String EVENT_MASK
eventLogback to summary
private static final PlatformLogger eventLog
focusLogback to summary
private static final PlatformLogger focusLog
grabLogback to summary
private static final PlatformLogger grabLog
heightback to summary
pack-priv int height
hintsback to summary
private XSizeHints hints
initialisingback to summary
private XBaseWindow.InitialiseState initialising
insLogback to summary
private static final PlatformLogger insLog
logback to summary
private static final PlatformLogger log
mappedback to summary
pack-priv boolean mapped
maxBoundsback to summary
pack-priv Rectangle maxBounds
MIN_SIZEback to summary
pack-priv static final int MIN_SIZE
OVERRIDE_REDIRECTback to summary
public static final String OVERRIDE_REDIRECT
PARENTback to summary
public static final String PARENT
PARENT_WINDOWback to summary
public static final String PARENT_WINDOW
parentWindowback to summary
pack-priv volatile XBaseWindow parentWindow
SAVE_UNDERback to summary
public static final String SAVE_UNDER
screenback to summary
private long screen
state_lockback to summary
protected XBaseWindow.StateLock state_lock
VALUE_MASKback to summary
public static final String VALUE_MASK
VISIBLEback to summary
public static final String VISIBLE
visibleback to summary
pack-priv boolean visible
VISUALback to summary
public static final String VISUAL
VISUAL_CLASSback to summary
public static final String VISUAL_CLASS
widthback to summary
pack-priv int width
windowback to summary
pack-priv long window
wm_client_leaderback to summary
private static XAtom wm_client_leader
wmHintsback to summary
private XWMHints wmHints
xback to summary
pack-priv int x
yback to summary
pack-priv int y

Constructor Detail

XBaseWindowback to summary
pack-priv XBaseWindow()
XBaseWindowback to summary
pack-priv XBaseWindow(long parentWindow, Rectangle bounds)

Creates normal child window

XBaseWindowback to summary
pack-priv XBaseWindow(Rectangle bounds)

Creates top-level window

XBaseWindowback to summary
public XBaseWindow(XCreateWindowParams params)
XBaseWindowback to summary
pack-priv XBaseWindow(long parentWindow)

Method Detail

awtLockback to summary
pack-priv void awtLock()
awtLockNotifyAllback to summary
pack-priv void awtLockNotifyAll()
awtLockWaitback to summary
pack-priv void awtLockWait() throws InterruptedException
awtUnlockback to summary
pack-priv void awtUnlock()
checkInitialisedback to summary
public boolean checkInitialised()
checkParamsback to summary
protected void checkParams(XCreateWindowParams params)

Verifies that all required parameters are set. If not, sets them to default values. Verifies values of critical parameters, adjust their values when needed.

Exceptions
IllegalArgumentException:
if params is null
containsback to summary
public boolean contains(int x, int y)

Returns whether the given point is inside of the window. Coordinates are local.

containsGlobalback to summary
public boolean containsGlobal(int x, int y)

Returns whether the given point is inside of the window. Coordinates are global.

createback to summary
private void create(XCreateWindowParams params)

Creates window with parameters specified by params

See Also
init
destroyback to summary
pack-priv void destroy()
dispatchEventback to summary
public void dispatchEvent(XEvent xev)
dispatchToWindowback to summary
pack-priv static void dispatchToWindow(XEvent ev)

Dispatches event to the grab Window or event source window depending on whether the grab is active and on the event type

flushback to summary
pack-priv void flush()
getAbsoluteXback to summary
public int getAbsoluteX()
getAbsoluteYback to summary
public int getAbsoluteY()
getBoundsback to summary
public Rectangle getBounds()
getChildrenback to summary
public Set<Long> getChildren()
getContentWindowback to summary
public long getContentWindow()
getContentXWindowback to summary
public XBaseWindow getContentXWindow()
getDelayedParamsback to summary
public XCreateWindowParams getDelayedParams()
getHeightback to summary
pack-priv int getHeight()
getHintsback to summary
public XSizeHints getHints()
getParentWindowback to summary
public XBaseWindow getParentWindow()
getScaleback to summary
protected int getScale()

Returns scale factor of the window. It is used to convert native coordinates to local and vice verse.

getScreenback to summary
pack-priv long getScreen()
getScreenNumberback to summary
pack-priv long getScreenNumber()
getScreenOfWindowback to summary
pack-priv static long getScreenOfWindow(long window)
getSizeback to summary
public Dimension getSize()
getStateLockback to summary
pack-priv Object getStateLock()

This lock object can be used to protect instance data from concurrent access by two threads. If both state lock and AWT lock are taken, AWT Lock should be taken first.

getToplevelXWindowback to summary
public XWindowPeer getToplevelXWindow()
getWidthback to summary
pack-priv int getWidth()
getWindowback to summary
public long getWindow()
getWMHintsback to summary
public XWMHints getWMHints()
getWMNameback to summary
protected String getWMName()
getXback to summary
pack-priv int getX()
getXAWTRootWindowback to summary
pack-priv static XRootWindow getXAWTRootWindow()
getYback to summary
pack-priv int getY()
grabInputback to summary
public boolean grabInput()

We should always grab both keyboard and pointer to control event flow on popups. This also simplifies synthetic grab implementation. The active grab overrides activated automatic grab.

handleButtonPressReleaseback to summary
public void handleButtonPressRelease(XEvent xev)

Activate automatic grab on first ButtonPress, deactivate on full mouse release

handleClientMessageback to summary
public void handleClientMessage(XEvent xev)
handleConfigureNotifyEventback to summary
public void handleConfigureNotifyEvent(XEvent xev)
handleCreateNotifyback to summary
public void handleCreateNotify(XEvent xev)
handleDestroyNotifyback to summary
public void handleDestroyNotify(XEvent xev)
handleExposeEventback to summary
public void handleExposeEvent(XEvent xev)
handleKeyPressback to summary
public void handleKeyPress(XEvent xev)
handleKeyReleaseback to summary
public void handleKeyRelease(XEvent xev)
handleMapNotifyEventback to summary
public void handleMapNotifyEvent(XEvent xev)
handleMotionNotifyback to summary
public void handleMotionNotify(XEvent xev)
handlePropertyNotifyback to summary
public void handlePropertyNotify(XEvent xev)
handleReparentNotifyEventback to summary
public void handleReparentNotifyEvent(XEvent xev)
handleUnmapNotifyEventback to summary
public void handleUnmapNotifyEvent(XEvent xev)
handleVisibilityEventback to summary
public void handleVisibilityEvent(XEvent xev)
handleXCrossingEventback to summary
public void handleXCrossingEvent(XEvent xev)
initback to summary
protected final void init(long parentWindow, Rectangle bounds)
initback to summary
protected final void init(XCreateWindowParams params)

Creates window using parameters params If params contain flag DELAYED doesn't do anything.

Note

Descendants can call this method to create the window at the time different to instance construction.

initClientLeaderback to summary
protected void initClientLeader()
instantPreInitback to summary
pack-priv void instantPreInit(XCreateWindowParams params)

Called for delayed inits during construction

isDisposedback to summary
pack-priv boolean isDisposed()
isEventDisabledback to summary
protected boolean isEventDisabled(XEvent e)
isFullReleaseback to summary
pack-priv static boolean isFullRelease(int buttonState, int button)

Checks ButtonRelease released all Mouse buttons

isGrabbedEventback to summary
pack-priv static boolean isGrabbedEvent(XEvent ev, XBaseWindow target)
isMappedback to summary
pack-priv boolean isMapped()
isMinSizeSetback to summary
public boolean isMinSizeSet()
isVisibleback to summary
pack-priv boolean isVisible()
postInitback to summary
protected final void postInit()
postInitback to summary
pack-priv void postInit(XCreateWindowParams params)

Called after window creation, descendants should override to initialize Window with class-specific values and perform post-initialization actions.

preInitback to summary
protected final void preInit()
preInitback to summary
pack-priv void preInit(XCreateWindowParams params)

Called before window creation, descendants should override to initialize the data, initialize params.

scaleDownback to summary
protected int scaleDown(int x)
scaleUpback to summary
protected int scaleUp(int x)
setDisposedback to summary
pack-priv void setDisposed(boolean d)
setSizeHintsback to summary
public void setSizeHints(long flags, int x, int y, int width, int height)
setWMClassback to summary
pack-priv void setWMClass(String[] cl)
setWMHintsback to summary
public final void setWMHints(XWMHints hints)

Helper function to set W

toFrontback to summary
public void toFront()
toGlobalback to summary
pack-priv Rectangle toGlobal(Rectangle rec)
toGlobalback to summary
pack-priv Point toGlobal(Point pt)
toGlobalback to summary
pack-priv Point toGlobal(int x, int y)
toLocalback to summary
pack-priv Point toLocal(Point pt)
toLocalback to summary
pack-priv Point toLocal(int x, int y)
toOtherWindowback to summary
pack-priv static Point toOtherWindow(long src, long dst, int x, int y)

Translate coordinates from one window into another. Optimized for XAWT - uses cached data when possible. Preferable over pure XTranslateCoordinates.

Returns:Point

coordinates relative to dst, or null if error happened

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Annotations
@Override
ungrabInputback to summary
public static void ungrabInput()
ungrabInputImplback to summary
pack-priv void ungrabInputImpl()
updateWMNameback to summary
pack-priv void updateWMName()
xGetInputFocusback to summary
public static long xGetInputFocus()
xRequestFocusback to summary
public void xRequestFocus(long time)
xRequestFocusback to summary
public void xRequestFocus()
xSetBoundsback to summary
public void xSetBounds(Rectangle bounds)
xSetBoundsback to summary
public void xSetBounds(int x, int y, int width, int height)
xSetVisibleback to summary
public void xSetVisible(boolean visible)
sun.awt.X11 back to summary

pack-priv final Enum XBaseWindow.InitialiseState

extends Enum<XBaseWindow.InitialiseState>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final XBaseWindow.InitialiseState
public static final XBaseWindow.InitialiseState
public static final XBaseWindow.InitialiseState

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static XBaseWindow.InitialiseState
public static XBaseWindow.InitialiseState[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

FAILED_INITIALISATIONback to summary
public static final XBaseWindow.InitialiseState FAILED_INITIALISATION
INITIALISEDback to summary
public static final XBaseWindow.InitialiseState INITIALISED
INITIALISINGback to summary
public static final XBaseWindow.InitialiseState INITIALISING

Constructor Detail

InitialiseStateback to summary
private InitialiseState()

Method Detail

valueOfback to summary
public static XBaseWindow.InitialiseState valueOf(String name)
valuesback to summary
public static XBaseWindow.InitialiseState[] values()
sun.awt.X11 back to summary

pack-priv final Class XBaseWindow.StateLock

extends Object
Class Inheritance

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

StateLockback to summary
pack-priv StateLock()