Class UIWindow
public class UIWindow extends UIRoot
{
// Constructors
public UIWindow(UIFrame frame);
public UIWindow(Frame frame);
public UIWindow(UIFrame frame, int edge);
public UIWindow(Frame frame, int edge);
// Methods
public synchronized void addWindowListener(IUIWindowListener l);
public void dispose();
public void hide();
public IUIComponent navigate(IUIComponent comp, int dir,
boolean keyable);
public void pack();
protected void processEvent(UIEvent e);
protected void processWindowEvent(UIWindowEvent e);
public synchronized void removeWindowListener(
IUIWindowListener l);
public void reshape(int x, int y, int w, int h);
public void resize(int w,int h);
public void setBounds(int x, int y, int width, int height);
public void setBounds(Rectangle r);
public synchronized void setCursor(Cursor cursor);
public synchronized void setCursor(int cursorType);
public void setFont(Font font);
public void setLocation(int x, int y);
public void setLocation(Point point);
public void setSize(int w, int h);
public void setSize(Dimension size);
public void setVisible(boolean show);
public void show(boolean show);
public void show();
}
This class implements a top-level window. UIWindow extends the UIRoot class. Initially, the root container is empty; to add components, call add.
A window is initially hidden when it is first created. You must call the window's setVisible to make the window visible.
UIComponent
|
+--UIContainer
|
+--UIStateContainer
|
+--UIPanel
|
+--UIRoot
|
+--UIWindow
public UIWindow(UIFrame frame);
Creates a window using the specified parent UIFrame.
Parameter | Description |
frame
| The parent frame of the window.
|
Remarks:
By default, the window uses BorderLayout for its layout manager. The host is then added to the center of the window, and the root container is displayed. Initially, the root container is empty; to add components, call add. By default, the root container uses UIBorderLayout for its layout manager.
The window is initially hidden. You must call the window's show method to make the window visible.
Applications extending UIWindow must call the super method handleEvent() inside the local handleEvent to use ToolTips. Applications extending UIWindow and implementing the TimerListener interface, must call the super method TimerTriggered(event).
UIWindowEvent events are supported by this window.
See Also: setLayout, com.ms.ui.event.IUIWindowListener, com.ms.ui.event.IUIMouseListener, com.ms.util.TimerListener
public UIWindow(Frame frame);
Creates a window using the specified parent java.awt.Frame.
Parameter | Description |
frame
| The parent frame of the window.
|
Remarks:
By default, the window uses BorderLayout for its layout manager. The host is then added to the center of the window, and the root container is displayed. Initially, the root container is empty; to add components, call add. By default, the root container uses UIBorderLayout for its layout manager.
The window is initially hidden. You must call the window's show method to make the window visible.
See Also: setLayout
public UIWindow(UIFrame frame, int edge);
Creates a window using the specified parent UIFrame and the the specified edge style.
Parameter | Description |
frame
| The parent frame of the window.
|
edge
| The edge style of the window's root container. For a list of possible styles, see UIContainer.setEdge.
|
Remarks:
By default, the window uses BorderLayout for its layout manager. The host is then added to the center of the window, and the root container is displayed. Initially, the root container is empty; to add components, call add. By default, the root container uses UIBorderLayout for its layout manager.
The window is initially hidden. You must call the window's show method to make the window visible.
See Also: setLayout
public UIWindow(Frame frame, int edge);
Creates a window using the specified parent java.awt.Frame and the the specified edge style.
Parameter | Description |
frame
| The parent frame of the window.
|
edge
| The edge style of the window's root container. For a list of possible styles, see UIContainer.setEdge.
|
Remarks:
By default, the window uses BorderLayout for its layout manager. The host is then added to the center of the window, and the root container is displayed. Initially, the root container is empty; to add components, call add. By default, the root container uses UIBorderLayout for its layout manager.
The window is initially hidden. You must call the window's show method to make the window visible.
See Also: setLayout
public synchronized void addWindowListener(IUIWindowListener l);
Adds the specified window listener to receive window events from this window.
Return Value:
No return value.
Parameter | Description |
l
| The window listener.
|
public void dispose();
Disposes the window. This method must be called to release the resources that are used for the window.
Return Value:
No return value.
public void hide();
Note As of JDK version 1.1, replaced by setVisible(boolean).
public IUIComponent navigate(IUIComponent comp, int dir, boolean keyable);
Navigates from the specified component to another component in the specified direction.
Return Value:
Returns the component navigated to (if a component in the specified direction exists); otherwise, returns null.
Parameter | Description |
comp
| The component to navigate from.
|
dir
| The navigation direction. Specify one of the NAVDIR values defined in the IUIAccessible interface.
|
keyable
| If true, only components that are able to receive keyboard input can be navigated to; otherwise, all components can be navigated to.
|
public void pack();
Packs the components of the Window.
Return Value:
No return value.
protected void processEvent(UIEvent e);
Processes the specified event.
Return Value:
No return value.
Parameter | Description |
e
| The event.
|
Remarks:
This method is automatically invoked if a listener has has been registered through a call to addXXXListener. Depending on the type of event, processEvent calls one of the following methods.
When overriding processEvent, call the super method processEvent to ensure the default event processing continues normally.
protected void processWindowEvent(UIWindowEvent e);
Processes action events.
Return Value:
No return value.
Parameter | Description |
e
| The action event.
|
Remarks:
This method is called by processEvent and dispatches the event to a registered action listener. When overriding this method, call the super method processActionEvent to ensure that the default event processing continues normally.
See Also: addActionListener
public synchronized void removeWindowListener(IUIWindowListener l);
Removes the specified window listener so that it no longer receives window events from this window.
Return Value:
No return value.
Parameter | Description |
l
| The window listener.
|
public void reshape(int x, int y, int w, int h);
Note As of JDK version 1.1, replaced by setBounds(int, int, int, int).
public void resize(int w,int h);
Note As of JDK version 1.1, replaced by setSize(int, int).
public void setBounds(int x, int y, int width, int height);
Sets the bounding rectangle of the window, according to the specified coordinates and dimensions.
Return Value:
No return value.
Parameter | Description |
x
| The x coordinate for the upper-left corner of the window, relative to the parent.
|
y
| The y coordinate for the upper-left corner of the window, relative to the parent.
|
width
| The new width of the window.
|
height
| The new height of the window.
|
public void setBounds(Rectangle r);
Sets the bounding rectangle of the window, according to the specified Rectangle object.
Return Value:
No return value.
Parameter | Description |
r
| The rectangle identifying the coordinates for the window's upper-left corner and the window's new width and height.
|
public synchronized void setCursor(Cursor cursor);
Sets a specific cursor to the window.
Return Value:
No return value.
Parameter | Description |
cursor
| The Cursor object to associate with the window.
|
public synchronized void setCursor(int cursorType);
Sets a specific cursor to the window. This method has been deprecated and replaced by the setCursor(Cursor) method.
Return Value:
No return value.
Parameter | Description |
cursorType
| The type of cursor to set. Valid types are defined in the java.awt Cursor class.
|
public void setFont(Font font);
Sets the font for the UIWindow.
Return Value:
No return value.
Parameter | Description |
font
| The font for the window.
|
public void setLocation(int x, int y);
Sets the location of the window, relative to its parent frame.
Return Value:
No return value.
Parameter | Description |
x
| The x coordinate for the upper-left corner of the window, relative to the parent frame.
|
y
| The y coordinate for the upper-left corner of the window, relative to the parent frame.
|
public void setLocation(Point point);
Sets the location of the UIWindow, relative to its parent frame.
Return Value:
No return value.
Parameter | Description |
point
| The upper-left corner of the window, relative to the parent frame.
|
public void setSize(int w, int h);
Sets the size of the window, according to the specified dimensions.
Return Value:
No return value.
Parameter | Description |
w
| The new width for the window.
|
h
| The new height for the window.
|
public void setSize(Dimension size);
Sets the size of the window, according to the specified Dimension object.
Return Value:
No return value.
Parameter | Description |
size
| The new width and height for the window.
|
public void setVisible(boolean show);
Sets or clears the visible state of the UIWindow.
Return Value:
No return value.
Parameter | Description |
show
| If true, the visible state is set; otherwise, it is cleared.
|
public void show(boolean show);
Note As of JDK version 1.1, replaced by setVisible(boolean).
public void show();
Note As of JDK version 1.1, replaced by setVisible(boolean).