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: Finally, Window encapsulates some additional state:


Variable Index

 o DELIVER_ALL
Delivery mode for grab: deliver all events to the grab window.
 o DISCARD_NOISY
Delivery mode for grab: discard events not directed to the grabbing window.
 o DISCARD_SILENT
Delivery mode for grab: discard events not directed to the grabbing window, giving no feedback.

Method Index

 o acquireInputFocus()
Assign the keyboard input focus to this window.
 o dispose()
Dispose of any resources associated with the window, and mark it invalid.
 o getBackgroundColor()
Get the background color for the window (i.e.
 o getBounds(boolean)
Get the location and size of the window.
 o getGraphics()
Get a graphics object for this window.
 o getUserData()
Return the window's "user data" field.
 o grabInput(int)
Make this window grab all input.
 o hasGrab()
Determine whether this window (actually its top-level ancestor) owns the input grab.
 o hasInputFocus()
Determine whether this window has the keyboard input focus.
 o isMapped()
Query the map state of the window
 o map()
Make this window visible.
 o releaseGrab()
Make this window (or its top-level ancestor) release the grab.
 o setBackgroundColor(Color)
Set the background color for the window (i.e.
 o setBounds(int, int, int, int)
Set the location and/or size of the window.
 o setCursorImage(CursorImage)
Set the cursor image to match the one supplied.
 o setStackingOrder(int)
Move this window so that it is Nth in its list of siblings.
 o setUserData(Object)
Set the window's "user data" field to the given object.
 o unmap()
Make this window invisible.

Variables

 o DELIVER_ALL
 public static final int DELIVER_ALL
Delivery mode for grab: deliver all events to the grab window.

 o 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.

 o DISCARD_SILENT
 public static final int DISCARD_SILENT
Delivery mode for grab: discard events not directed to the grabbing window, giving no feedback.

Methods

 o 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.

 o 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.
 o 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.
 o 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.

 o 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.)

 o 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.
 o isMapped
 public abstract boolean isMapped() throws IllegalStateException
Query the map state of the window

Returns:
true if the window is mapped (visible) false otherwise.
 o map
 public abstract void map() throws IllegalStateException
Make this window visible.

 o unmap
 public abstract void unmap() throws IllegalStateException
Make this window invisible. If the window has the grab or the input focus, implicitly releases them.

 o 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.

 o 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.
 o acquireInputFocus
 public abstract void acquireInputFocus() throws IllegalStateException
Assign the keyboard input focus to this window.

 o 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.
 o 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.
 o 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.

 o 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
 o 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.

 o 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