|
|||||||||
| Home >> All >> java >> [ awt overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.awt
Class Window

java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Window
- All Implemented Interfaces:
- javax.accessibility.Accessible, java.awt.image.ImageObserver, MenuContainer, java.io.Serializable
- public class Window
- extends Container
- implements javax.accessibility.Accessible
- extends Container
This class represents a top-level window with no decorations.
| Nested Class Summary | |
protected class |
Window.AccessibleAWTWindow
|
private class |
Window.WindowBltBufferStrategy
A BltBufferStrategy for windows. |
private class |
Window.WindowFlipBufferStrategy
A FlipBufferStrategy for windows. |
| Nested classes inherited from class java.awt.Container |
Container.AccessibleAWTContainer, Container.GfxPaintAllVisitor, Container.GfxPaintVisitor, Container.GfxPrintAllVisitor, Container.GfxPrintVisitor, Container.GfxVisitor |
| Nested classes inherited from class java.awt.Component |
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy, Component.HeavyweightInLightweightListener |
| Field Summary | |
private boolean |
focusableWindowState
|
private GraphicsConfiguration |
graphicsConfiguration
|
private static long |
next_window_number
|
private java.util.Vector |
ownedWindows
|
private static long |
serialVersionUID
|
private boolean |
shown
|
private int |
state
|
private java.lang.String |
warningString
|
private java.awt.event.WindowFocusListener |
windowFocusListener
|
(package private) Component |
windowFocusOwner
|
private java.awt.event.WindowListener |
windowListener
|
private int |
windowSerializedDataVersion
|
private java.awt.event.WindowStateListener |
windowStateListener
|
| Fields inherited from class java.awt.Container |
component, containerListener, containerSerializedDataVersion, focusCycleRoot, focusTraversalKeys, layoutMgr, maxSize, ncomponents |
| Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
(package private) |
Window()
This (package access) constructor is used by subclasses that want to build windows that do not have parents. |
|
Window(Frame owner)
Initializes a new instance of Window with the specified
parent. |
(package private) |
Window(GraphicsConfiguration gc)
|
|
Window(Window owner)
Initializes a new instance of Window with the specified
parent. |
|
Window(Window owner,
GraphicsConfiguration gc)
Initializes a new instance of Window with the specified
parent. |
| Method Summary | |
void |
addNotify()
Creates the native peer for this window. |
void |
addWindowFocusListener(java.awt.event.WindowFocusListener wfl)
Adds the specified listener to this window. |
void |
addWindowListener(java.awt.event.WindowListener listener)
Adds the specified listener to the list of WindowListeners
that will receive events for this window. |
void |
addWindowStateListener(java.awt.event.WindowStateListener wsl)
Adds the specified listener to this window. |
void |
applyResourceBundle(java.util.ResourceBundle rb)
Deprecated. |
void |
applyResourceBundle(java.lang.String rbName)
Deprecated. |
void |
createBufferStrategy(int numBuffers)
Creates a buffering strategy that manages how this window is repainted. |
void |
createBufferStrategy(int numBuffers,
BufferCapabilities caps)
Creates a buffering strategy that manages how this window is repainted. |
(package private) void |
dispatchEventImpl(AWTEvent e)
Implementation of dispatchEvent. |
void |
dispose()
Destroys any resources associated with this window. |
(package private) java.lang.String |
generateName()
Generate a unique name for this window. |
javax.accessibility.AccessibleContext |
getAccessibleContext()
Gets the AccessibleContext associated with this Window. |
java.awt.image.BufferStrategy |
getBufferStrategy()
Returns the buffer strategy used by the window. |
boolean |
getFocusableWindowState()
Returns the value of the focusableWindowState property. |
Container |
getFocusCycleRootAncestor()
Returns the root container that owns the focus cycle where this component resides. |
Component |
getFocusOwner()
Returns the child window that has focus if this window is active. |
GraphicsConfiguration |
getGraphicsConfiguration()
Get graphics configuration. |
(package private) GraphicsConfiguration |
getGraphicsConfigurationImpl()
Implementation method that allows classes such as Canvas and Window to override the graphics configuration without violating the published API. |
java.util.EventListener[] |
getListeners(java.lang.Class listenerType)
Returns an array of all the objects currently registered as FooListeners upon this Window. |
java.util.Locale |
getLocale()
Returns the locale that this window is configured for. |
Component |
getMostRecentFocusOwner()
Returns the child component of this window that would receive focus if this window were to become focused. |
Window[] |
getOwnedWindows()
|
Window |
getOwner()
|
Toolkit |
getToolkit()
Returns the toolkit used to create this window. |
private static long |
getUniqueLong()
|
java.lang.String |
getWarningString()
Returns the warning string that will be displayed if this window is popped up by an unsecure applet or application. |
java.awt.event.WindowFocusListener[] |
getWindowFocusListeners()
Returns an array of all the window focus listeners registered on this window. |
java.awt.event.WindowListener[] |
getWindowListeners()
Returns an array of all the window listeners registered on this window. |
java.awt.event.WindowStateListener[] |
getWindowStateListeners()
Returns an array of all the window state listeners registered on this window. |
void |
hide()
Hides this component so that it is no longer shown on the screen. |
boolean |
isActive()
Identifies if this window is active. |
boolean |
isFocusableWindow()
Returns whether this Window can get the focus or not. |
boolean |
isFocusCycleRoot()
Check whether this Container is a focus cycle root. |
boolean |
isFocused()
Identifies if this window is focused. |
boolean |
isShowing()
Tests whether or not this window is visible on the screen. |
void |
pack()
Relays out this window's child components at their preferred size. |
boolean |
postEvent(Event e)
Deprecated. |
protected void |
processEvent(AWTEvent evt)
Processes the specified event for this window. |
protected void |
processWindowEvent(java.awt.event.WindowEvent evt)
Dispatches this event to any listeners that are listening for WindowEvents on this window. |
protected void |
processWindowFocusEvent(java.awt.event.WindowEvent event)
|
protected void |
processWindowStateEvent(java.awt.event.WindowEvent event)
|
void |
removeWindowFocusListener(java.awt.event.WindowFocusListener wfl)
Removes the specified listener from this window. |
void |
removeWindowListener(java.awt.event.WindowListener listener)
Removes the specified listener from the list of WindowListeners that will receive events for this window. |
void |
removeWindowStateListener(java.awt.event.WindowStateListener wsl)
Removes the specified listener from this window. |
void |
setCursor(Cursor cursor)
Sets the cursor for this window to the specifiec cursor. |
void |
setFocusableWindowState(boolean focusableWindowState)
Sets the value of the focusableWindowState property. |
void |
setFocusCycleRoot(boolean focusCycleRoot)
Set whether or not this Container is the root of a focus traversal cycle. |
(package private) void |
setFocusOwner(Component windowFocusOwner)
Set the focus owner for this window. |
void |
setLocationRelativeTo(Component c)
|
void |
show()
Shows on-screen this window and any of its owned windows for whom isVisible returns true. |
void |
toBack()
Sends this window to the back so that all other windows display in front of it. |
void |
toFront()
Brings this window to the front so that it displays in front of any other windows. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
warningString
private java.lang.String warningString
windowSerializedDataVersion
private int windowSerializedDataVersion
state
private int state
- Since:
- 1.2
focusableWindowState
private boolean focusableWindowState
- Since:
- 1.4
ownedWindows
private transient java.util.Vector ownedWindows
windowListener
private transient java.awt.event.WindowListener windowListener
windowFocusListener
private transient java.awt.event.WindowFocusListener windowFocusListener
windowStateListener
private transient java.awt.event.WindowStateListener windowStateListener
graphicsConfiguration
private transient GraphicsConfiguration graphicsConfiguration
shown
private transient boolean shown
windowFocusOwner
transient Component windowFocusOwner
next_window_number
private static transient long next_window_number
| Constructor Detail |
Window
Window()
- This (package access) constructor is used by subclasses that want
to build windows that do not have parents. Eg. toplevel
application frames. Subclasses cannot call super(null), since
null is an illegal argument.
Window
Window(GraphicsConfiguration gc)
Window
public Window(Frame owner)
- Initializes a new instance of
Windowwith the specified parent. The window will initially be invisible.
Window
public Window(Window owner)
- Initializes a new instance of
Windowwith the specified parent. The window will initially be invisible. - Since:
- 1.2
Window
public Window(Window owner, GraphicsConfiguration gc)
- Initializes a new instance of
Windowwith the specified parent. The window will initially be invisible. - Since:
- 1.3
| Method Detail |
getGraphicsConfigurationImpl
GraphicsConfiguration getGraphicsConfigurationImpl()
- Description copied from class:
Component - Implementation method that allows classes such as Canvas and Window to
override the graphics configuration without violating the published API.
- Overrides:
getGraphicsConfigurationImplin classComponent
addNotify
public void addNotify()
pack
public void pack()
- Relays out this window's child components at their preferred size.
show
public void show()
- Shows on-screen this window and any of its owned windows for whom
isVisible returns true.
hide
public void hide()
- Description copied from class:
Component - Hides this component so that it is no longer shown on the screen.
dispose
public void dispose()
- Destroys any resources associated with this window. This includes
all components in the window and all owned top-level windows.
toBack
public void toBack()
- Sends this window to the back so that all other windows display in
front of it.
toFront
public void toFront()
- Brings this window to the front so that it displays in front of
any other windows.
getToolkit
public Toolkit getToolkit()
- Returns the toolkit used to create this window.
- Overrides:
getToolkitin classComponent
getWarningString
public final java.lang.String getWarningString()
- Returns the warning string that will be displayed if this window is
popped up by an unsecure applet or application.
getLocale
public java.util.Locale getLocale()
setCursor
public void setCursor(Cursor cursor)
getOwner
public Window getOwner()
getOwnedWindows
public Window[] getOwnedWindows()
- Since:
- 1.2
addWindowListener
public void addWindowListener(java.awt.event.WindowListener listener)
- Adds the specified listener to the list of
WindowListenersthat will receive events for this window.
removeWindowListener
public void removeWindowListener(java.awt.event.WindowListener listener)
- Removes the specified listener from the list of
WindowListenersthat will receive events for this window.
getWindowListeners
public java.awt.event.WindowListener[] getWindowListeners()
- Returns an array of all the window listeners registered on this window.
- Since:
- 1.4
getWindowFocusListeners
public java.awt.event.WindowFocusListener[] getWindowFocusListeners()
- Returns an array of all the window focus listeners registered on this
window.
- Since:
- 1.4
getWindowStateListeners
public java.awt.event.WindowStateListener[] getWindowStateListeners()
- Returns an array of all the window state listeners registered on this
window.
- Since:
- 1.4
addWindowFocusListener
public void addWindowFocusListener(java.awt.event.WindowFocusListener wfl)
- Adds the specified listener to this window.
addWindowStateListener
public void addWindowStateListener(java.awt.event.WindowStateListener wsl)
- Adds the specified listener to this window.
- Since:
- 1.4
removeWindowFocusListener
public void removeWindowFocusListener(java.awt.event.WindowFocusListener wfl)
- Removes the specified listener from this window.
removeWindowStateListener
public void removeWindowStateListener(java.awt.event.WindowStateListener wsl)
- Removes the specified listener from this window.
- Since:
- 1.4
getListeners
public java.util.EventListener[] getListeners(java.lang.Class listenerType)
- Returns an array of all the objects currently registered as FooListeners
upon this Window. FooListeners are registered using the addFooListener
method.
- Overrides:
getListenersin classContainer
- Since:
- 1.3
dispatchEventImpl
void dispatchEventImpl(AWTEvent e)
- Description copied from class:
Component - Implementation of dispatchEvent. Allows trusted package classes
to dispatch additional events first. This implementation first
translates
eto an AWT 1.0 event and sends the result toComponent.postEvent(java.awt.Event)55 . If the AWT 1.0 event is not handled, and events of typeeare enabled for this component, e is passed on toComponent.processEvent(java.awt.AWTEvent)55 .- Overrides:
dispatchEventImplin classContainer
processEvent
protected void processEvent(AWTEvent evt)
- Processes the specified event for this window. If the event is an
instance of
WindowEvent, thenprocessWindowEvent()is called to process the event, otherwise the superclass version of this method is invoked.- Overrides:
processEventin classContainer
processWindowEvent
protected void processWindowEvent(java.awt.event.WindowEvent evt)
- Dispatches this event to any listeners that are listening for
WindowEventson this window. This method only gets invoked if it is enabled viaenableEvents()or if a listener has been added.
isActive
public boolean isActive()
- Identifies if this window is active. The active window is a Frame or
Dialog that has focus or owns the active window.
- Since:
- 1.4
isFocused
public boolean isFocused()
- Identifies if this window is focused. A window is focused if it is the
focus owner or it contains the focus owner.
- Since:
- 1.4
getFocusOwner
public Component getFocusOwner()
- Returns the child window that has focus if this window is active.
This method returns
nullif this window is not active or no children have focus.
getMostRecentFocusOwner
public Component getMostRecentFocusOwner()
- Returns the child component of this window that would receive
focus if this window were to become focused. If the window
already has the top-level focus, then this method returns the
same component as getFocusOwner. If no child component has
requested focus within the window, then the initial focus owner
is returned. If this is a non-focusable window, this method
returns null.
- Since:
- 1.4
setFocusOwner
void setFocusOwner(Component windowFocusOwner)
- Set the focus owner for this window. This method is used to
remember which component was focused when this window lost
top-level focus, so that when it regains top-level focus the same
child component can be refocused.
postEvent
public boolean postEvent(Event e)
- Deprecated.
- Post a Java 1.0 event to the event queue.
- Specified by:
postEventin interfaceMenuContainer- Overrides:
postEventin classComponent
- Post a Java 1.0 event to the event queue.
isShowing
public boolean isShowing()
- Tests whether or not this window is visible on the screen.
In contrast to the normal behaviour of Container, which is that
a container is showing if its parent is visible and showing, a Window
is even showing, if its parent (i.e. an invisible Frame) is not showing.
setLocationRelativeTo
public void setLocationRelativeTo(Component c)
createBufferStrategy
public void createBufferStrategy(int numBuffers)
- Creates a buffering strategy that manages how this window is
repainted. This method attempts to create the optimum strategy
based on the desired number of buffers. Hardware or software
acceleration may be used.
createBufferStrategy attempts different levels of optimization,
but guarantees that some strategy with the requested number of
buffers will be created even if it is not optimal. First it
attempts to create a page flipping strategy, then an accelerated
blitting strategy, then an unaccelerated blitting strategy.
Calling this method causes any existing buffer strategy to be
destroyed.
- Since:
- 1.4
createBufferStrategy
public void createBufferStrategy(int numBuffers,
BufferCapabilities caps)
throws AWTException
- Creates a buffering strategy that manages how this window is
repainted. This method attempts to create a strategy based on
the specified capabilities and throws an exception if the
requested strategy is not supported.
Calling this method causes any existing buffer strategy to be
destroyed.
- Since:
- 1.4
getBufferStrategy
public java.awt.image.BufferStrategy getBufferStrategy()
- Returns the buffer strategy used by the window.
- Since:
- 1.4
applyResourceBundle
public void applyResourceBundle(java.util.ResourceBundle rb) throws gnu.classpath.NotImplementedException
- Deprecated.
- Since:
- 1.2
applyResourceBundle
public void applyResourceBundle(java.lang.String rbName)
- Deprecated.
- Since:
- 1.2
getAccessibleContext
public javax.accessibility.AccessibleContext getAccessibleContext()
- Gets the AccessibleContext associated with this
Window. The context is created, if necessary.- Specified by:
getAccessibleContextin interfacejavax.accessibility.Accessible- Overrides:
getAccessibleContextin classComponent
getGraphicsConfiguration
public GraphicsConfiguration getGraphicsConfiguration()
- Get graphics configuration. The implementation for Window will
not ask any parent containers, since Window is a toplevel
window and not actually embedded in the parent component.
- Overrides:
getGraphicsConfigurationin classComponent
processWindowFocusEvent
protected void processWindowFocusEvent(java.awt.event.WindowEvent event)
processWindowStateEvent
protected void processWindowStateEvent(java.awt.event.WindowEvent event)
- Since:
- 1.4
isFocusableWindow
public final boolean isFocusableWindow()
- Returns whether this
Windowcan get the focus or not.- Since:
- 1.4
getFocusableWindowState
public boolean getFocusableWindowState()
- Returns the value of the focusableWindowState property.
- Since:
- 1.4
setFocusableWindowState
public void setFocusableWindowState(boolean focusableWindowState)
- Sets the value of the focusableWindowState property.
- Since:
- 1.4
isFocusCycleRoot
public final boolean isFocusCycleRoot()
- Check whether this Container is a focus cycle root.
Returns always
trueas Windows are the root of the focus cycle.- Overrides:
isFocusCycleRootin classContainer
- Since:
- 1.4
setFocusCycleRoot
public final void setFocusCycleRoot(boolean focusCycleRoot)
- Set whether or not this Container is the root of a focus
traversal cycle. Windows are the root of the focus cycle
and therefore this method does nothing.
- Overrides:
setFocusCycleRootin classContainer
- Since:
- 1.4
getFocusCycleRootAncestor
public final Container getFocusCycleRootAncestor()
- Returns the root container that owns the focus cycle where this
component resides. Windows have no ancestors and this method
returns always
null.- Overrides:
getFocusCycleRootAncestorin classComponent
- Since:
- 1.4
generateName
java.lang.String generateName()
- Generate a unique name for this window.
- Overrides:
generateNamein classComponent
getUniqueLong
private static long getUniqueLong()
|
|||||||||
| Home >> All >> java >> [ awt overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC