| sun.porting.windowsystem.Window
Window | public interface Window (Code) | | 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
version: 1.18, 08/19/02 |
Field Summary | |
final static int | DELIVER_ALL Delivery mode for grab: deliver all events to the grab window. | final static int | DISCARD_NOISY Delivery mode for grab: discard events not directed to the grabbing
window. | final static int | DISCARD_SILENT Delivery mode for grab: discard events not directed to the grabbing
window, giving no feedback. |
DELIVER_ALL | final static int DELIVER_ALL(Code) | | Delivery mode for grab: deliver all events to the grab window.
|
DISCARD_NOISY | final static int DISCARD_NOISY(Code) | | 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 | final static int DISCARD_SILENT(Code) | | Delivery mode for grab: discard events not directed to the grabbing
window, giving no feedback.
|
dispose | void dispose()(Code) | | 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.
|
getBackgroundColor | Color getBackgroundColor()(Code) | | Get the background color for the window (i.e. the color which
will be used to erase it when damage occurs, etc.)
The background color, as a Color object. |
getBounds | Rectangle getBounds(boolean global) throws IllegalStateException(Code) | | 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 inglobal or parent-relative coordinates. The position and size in pixels, as a Rectangle object. throws: IllegalStateException - if the window has been disposed. |
getGraphics | public Graphics getGraphics()(Code) | | 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.
|
getUserData | java.lang.Object getUserData()(Code) | | 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.
|
grabInput | void grabInput(int mode) throws IllegalStateException(Code) | | 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. throws: IllegalStateException - if the window is disposed or not mapped,or if the grab is owned by someone else.Important note: the actual window that owns the explicit grab must always be a top-level window. It is the window system's responsibility to find the top-level ancestor when grabbing, and to ensure that the event target is owned by (not necessarily equal to) the grab owner. |
hasGrab | boolean hasGrab() throws IllegalStateException(Code) | | Determine whether this window (actually its top-level ancestor)
owns the input grab.
true if this window has the grab, false otherwise. throws: IllegalStateException - if the window has been disposed. |
hasInputFocus | boolean hasInputFocus() throws IllegalStateException(Code) | | Determine whether this window has the keyboard input focus.
true if this window has keyboard input focus, false otherwise. throws: IllegalStateException - if the window has been disposed. |
releaseGrab | void releaseGrab() throws IllegalStateException(Code) | | 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.
throws: IllegalStateException - if the window does not have the grabor has been disposed. |
setBackgroundColor | void setBackgroundColor(Color c)(Code) | | Set the background color for the window (i.e. the color which
will be used to erase it when damage occurs, etc.)
|
setBounds | void setBounds(int x, int y, int w, int h) throws IllegalStateException(Code) | | 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. Parameters: y - y coordinate of the upper left corner, relative to parent. Parameters: w - width in pixels. Parameters: h - height in pixels. throws: IllegalStateException - if the window has been disposed. |
setStackingOrder | void setStackingOrder(int n) throws IllegalStateException(Code) | | 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.
throws: IllegalStateException - if the window has been disposed. |
setUserData | void setUserData(java.lang.Object o)(Code) | | 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.
|
|
|