All Packages Class Hierarchy This Package Previous Next Index
Interface sun.porting.windowsystem.Window
- public interface Window
This is the public interface for a window object. In this context it
is a relatively low-level object (not to be confused with java.awt.Window)
which underlies the implementation of a set of toolkit peers.
Window
has only a small number of capabilities:
- It is an opaque, clipped drawing surface (i.e. has a background color)
- Its size can be dynamically changed
- It is capable of being the target for input events
- It can contain other Windows in a strict hierarchical fashion
- It can exist without being visible (i.e. "mapped")
Finally, Window
encapsulates some additional state:
- X, Y position relative to its parent
- Z order with respect to its siblings
- keyboard and input focus
- an associated cursor image
-
DELIVER_ALL
- Delivery mode for grab: deliver all events to the grab window.
-
DISCARD_NOISY
- Delivery mode for grab: discard events not directed to the grabbing
window.
-
DISCARD_SILENT
- Delivery mode for grab: discard events not directed to the grabbing
window, giving no feedback.
-
acquireInputFocus()
- Assign the keyboard input focus to this window.
-
dispose()
- Dispose of any resources associated with the window, and mark it invalid.
-
getBackgroundColor()
- Get the background color for the window (i.e.
-
getBounds(boolean)
-
Get the location and size of the window.
-
getGraphics()
- Get a graphics object for this window.
-
getUserData()
- Return the window's "user data" field.
-
grabInput(int)
- Make this window grab all input.
-
hasGrab()
- Determine whether this window (actually its top-level ancestor)
owns the input grab.
-
hasInputFocus()
- Determine whether this window has the keyboard input focus.
-
isMapped()
- Query the map state of the window
-
map()
- Make this window visible.
-
releaseGrab()
- Make this window (or its top-level ancestor) release the grab.
-
setBackgroundColor(Color)
- Set the background color for the window (i.e.
-
setBounds(int, int, int, int)
- Set the location and/or size of the window.
-
setCursorImage(CursorImage)
- Set the cursor image to match the one supplied.
-
setStackingOrder(int)
- Move this window so that it is Nth in its list of siblings.
-
setUserData(Object)
- Set the window's "user data" field to the given object.
-
unmap()
- Make this window invisible.
DELIVER_ALL
public static final int DELIVER_ALL
- Delivery mode for grab: deliver all events to the grab window.
DISCARD_NOISY
public static final int DISCARD_NOISY
- Delivery mode for grab: discard events not directed to the grabbing
window. Some auditory and/or visual feedback should accompany each
discarded event.
DISCARD_SILENT
public static final int DISCARD_SILENT
- Delivery mode for grab: discard events not directed to the grabbing
window, giving no feedback.
getGraphics
public abstract Graphics getGraphics()
- Get a graphics object for this window. The
Graphics
object
which is returned will be created with a GeometryProvider
which
corresponds to this window; as a result, all drawing operations
using this Graphics
object will be located within, and clipped
to this window.
getBounds
public abstract Rectangle getBounds(boolean global) throws IllegalStateException
- Get the location and size of the window. If global is true,
the position will be returned in root coordinates; otherwise
they will be relative to this window's parent.
- Parameters:
- global - A flag indicating whether to return x and y in
global or parent-relative coordinates.
- Returns:
- The position and size in pixels, as a
Rectangle
object.
setBounds
public abstract void setBounds(int x,
int y,
int w,
int h) throws IllegalStateException
- Set the location and/or size of the window. x and y are relative
to this window's parent.
- Parameters:
- x - x coordinate of the upper left corner, relative to parent.
- y - y coordinate of the upper left corner, relative to parent.
- w - width in pixels.
- h - height in pixels.
setStackingOrder
public abstract void setStackingOrder(int n) throws IllegalStateException
- Move this window so that it is Nth in its list of siblings.
N = 0 moves the window to the front; N = -1 moves it to the back.
N = -2 moves it so it is above only the last window, etc.
setBackgroundColor
public abstract void setBackgroundColor(Color c)
- Set the background color for the window (i.e. the color which
will be used to erase it when damage occurs, etc.)
getBackgroundColor
public abstract Color getBackgroundColor()
- Get the background color for the window (i.e. the color which
will be used to erase it when damage occurs, etc.)
- Returns:
- The background color, as a
Color
object.
isMapped
public abstract boolean isMapped() throws IllegalStateException
- Query the map state of the window
- Returns:
- true if the window is mapped (visible) false otherwise.
map
public abstract void map() throws IllegalStateException
- Make this window visible.
unmap
public abstract void unmap() throws IllegalStateException
- Make this window invisible.
If the window has the grab or the input focus, implicitly releases them.
dispose
public abstract void dispose()
- Dispose of any resources associated with the window, and mark it invalid.
If the window has the grab or the input focus, implicitly releases them.
hasInputFocus
public abstract boolean hasInputFocus() throws IllegalStateException
- Determine whether this window has the keyboard input focus.
- Returns:
- true if this window has keyboard input focus, false otherwise.
acquireInputFocus
public abstract void acquireInputFocus() throws IllegalStateException
- Assign the keyboard input focus to this window.
hasGrab
public abstract boolean hasGrab() throws IllegalStateException
- Determine whether this window (actually its top-level ancestor)
owns the input grab.
- Returns:
- true if this window has the grab, false otherwise.
grabInput
public abstract void grabInput(int mode) throws IllegalStateException
- Make this window grab all input. Does not change keyboard focus.
If this window is not a top-level window, the grab will be given to
its top-level ancestor instead. The mode argument indicates what
should be done with events that are not directed at the grab window.
- Parameters:
- mode - how to handle events directed at other windows.
releaseGrab
public abstract void releaseGrab() throws IllegalStateException
- Make this window (or its top-level ancestor) release the grab.
Does not change keyboard focus. Only explicitly-acquired
grabs can be released by this method.
setCursorImage
public abstract void setCursorImage(CursorImage image)
- Set the cursor image to match the one supplied.
- Parameters:
- image - The contents of the cursor image
- hotX - The x coordinate of the hotspot
- hotY - The y coordinate of the hotspot
- See Also:
- CursorImage
setUserData
public abstract void setUserData(Object o)
- Set the window's "user data" field to the given object.
This is a convenience for
Toolkit
implementors which allows
them to efficiently associate private data with each window.
getUserData
public abstract Object getUserData()
- Return the window's "user data" field.
This is a convenience for
Toolkit
implementors which allows
them to efficiently associate private data with each window.
All Packages Class Hierarchy This Package Previous Next Index