Packages
 In this topic

*Constructors

*Methods

 

Packages   PreviousThis PackageNext
Package com.ms.ui   Previous This
Package
Next

 


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

Constructors

UIWindow

public UIWindow(UIFrame frame);

Creates a window using the specified parent UIFrame.

ParameterDescription
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

UIWindow

public UIWindow(Frame frame);

Creates a window using the specified parent java.awt.Frame.

ParameterDescription
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

UIWindow

public UIWindow(UIFrame frame, int edge);

Creates a window using the specified parent UIFrame and the the specified edge style.

ParameterDescription
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

UIWindow

public UIWindow(Frame frame, int edge);

Creates a window using the specified parent java.awt.Frame and the the specified edge style.

ParameterDescription
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

Methods

addWindowListener

public synchronized void addWindowListener(IUIWindowListener l);

Adds the specified window listener to receive window events from this window.

Return Value:

No return value.

ParameterDescription
l The window listener.

dispose

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.

hide

public void hide();

Note As of JDK version 1.1, replaced by setVisible(boolean).

navigate

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.

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

pack

public void pack();

Packs the components of the Window.

Return Value:

No return value.

processEvent

protected void processEvent(UIEvent e);

Processes the specified event.

Return Value:

No return value.

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

Event type Method called
action event processActionEvent
component event processComponentEvent (inherited through UIStateContainer)
container event processContainerEvent (inherited through UIStateContainer)
focus event processFocusEvent (inherited through UIStateContainer)
key event processKeyEvent (inherited through UIStateContainer)
mouse event processMouseEvent (inherited through UIStateContainer)
mouse motion event processMouseMotionEvent (inherited through UIStateContainer)

When overriding processEvent, call the super method processEvent to ensure the default event processing continues normally.

processWindowEvent

protected void processWindowEvent(UIWindowEvent e);

Processes action events.

Return Value:

No return value.

ParameterDescription
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

removeWindowListener

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.

ParameterDescription
l The window listener.

reshape

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

resize

public void resize(int w,int h);

Note As of JDK version 1.1, replaced by setSize(int, int).

setBounds

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.

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

setBounds

public void setBounds(Rectangle r);

Sets the bounding rectangle of the window, according to the specified Rectangle object.

Return Value:

No return value.

ParameterDescription
r The rectangle identifying the coordinates for the window's upper-left corner and the window's new width and height.

setCursor

public synchronized void setCursor(Cursor cursor);

Sets a specific cursor to the window.

Return Value:

No return value.

ParameterDescription
cursor The Cursor object to associate with the window.

setCursor

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.

ParameterDescription
cursorType The type of cursor to set. Valid types are defined in the java.awt Cursor class.

setFont

public void setFont(Font font);

Sets the font for the UIWindow.

Return Value:

No return value.

ParameterDescription
font The font for the window.

setLocation

public void setLocation(int x, int y);

Sets the location of the window, relative to its parent frame.

Return Value:

No return value.

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

setLocation

public void setLocation(Point point);

Sets the location of the UIWindow, relative to its parent frame.

Return Value:

No return value.

ParameterDescription
point The upper-left corner of the window, relative to the parent frame.

setSize

public void setSize(int w, int h);

Sets the size of the window, according to the specified dimensions.

Return Value:

No return value.

ParameterDescription
w The new width for the window.
h The new height for the window.

setSize

public void setSize(Dimension size);

Sets the size of the window, according to the specified Dimension object.

Return Value:

No return value.

ParameterDescription
size The new width and height for the window.

setVisible

public void setVisible(boolean show);

Sets or clears the visible state of the UIWindow.

Return Value:

No return value.

ParameterDescription
show If true, the visible state is set; otherwise, it is cleared.

show

public void show(boolean show);

Note As of JDK version 1.1, replaced by setVisible(boolean).

show

public void show();

Note As of JDK version 1.1, replaced by setVisible(boolean).

upnrm.gif © 1998 Microsoft Corporation. All rights reserved. Terms of use.