Packages
 In this topic

*Constructors

*Methods

 

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

 


Class UIContainer

abstract public class UIContainer extends UIComponent
             implements IUIContainer
{
  // Constructors
  public UIContainer();
  public UIContainer(int edge);

  // Methods
  public IUIComponent add(IUIComponent comp);
  public IUIComponent add(IUIComponent comp, int index);
  public IUIComponent add(IUIComponent comp, Object constraints);
  public IUIComponent add(IUIComponent comp, Object constraints,
        int index);
  public IUIComponent add(String name, IUIComponent comp);
  public void addContainerListener(IUIContainerListener l);
  public void addFocusListener(IUIFocusListener l);
  public void addKeyListener(IUIKeyListener l);
  public void addMouseListener(IUIMouseListener l);
  public void addMouseMotionListener(IUIMouseMotionListener l);
  public void addNotify();
  public void adjustLayoutSize(IUIComponent comp,
        Dimension oldSize, Dimension newSize);
  public boolean continueInvalidate(IUIComponent comp);
  public boolean ensureVisible(int index);
  public IUIComponent getChild(int index);
  public Rectangle getChildBounds(IUIComponent child);
  public Rectangle getChildBounds(int index);
  public int getChildCount();
  public int getChildIndex(IUIComponent comp);
  public Point getChildLocation(IUIComponent child);
  public Point getChildLocation(int index);
  public Dimension getChildSize(IUIComponent child);
  public Dimension getChildSize(int index);
  public Rectangle getClientRect();
  public IUIComponent getComponent(int x, int y);
  public IUIComponent getComponent(Point point);
  public IUIComponent getComponent(int index);
  public IUIComponent getComponent(IUIComponent comp);
  public int getComponentCount();
  public IUIComponent getComponentFromID(int id);
  public int getComponentIndex(IUIComponent comp);
  public IUIComponent[] getComponents();
  public int getEdge();
  public IUIComponent getFloater();
  public IUIComponent getFocusComponent();
  public IUIComponent getHeader();
  public int getID();
  public Insets getInsets();
  public IUILayoutManager getLayout();
  public Dimension getMinimumSize();
  public String getName();
  public Dimension getPreferredSize(Dimension size);
  public Dimension getPreferredSize();
  public boolean gotFocus(Event e, Object o);
  public boolean invalidateAll();
  public boolean isHeightRelative();
  public boolean isOverlapping();
  public boolean isWidthRelative();
  public boolean keyDown(Event e, int key);
  public void layout();
  public boolean lostFocus(Event e, Object o);
  public boolean mouseEnter(Event e, int x, int y);
  public boolean mouseExit(Event e, int x, int y);
  public boolean move(IUIComponent comp, IUIComponent before);
  public boolean move(int from, int to);
  public IUIComponent navigate(IUIComponent comp, int direction,
        boolean keyable);
  public void notifyEvent(UINotifyEvent e);
  public void paint(FxGraphics g);
  public void paintAll(FxGraphics g);
  public void paintComponents(FxGraphics g);
  public IUIComponent passFocus(int dir);
  public void printAll(FxGraphics g);
  public void remove(int index);
  public void remove(IUIComponent comp);
  public void removeAll();
  public void removeAllChildren();
  public void removeContainerListener(IUIContainerListener l);
  public void removeFocusListener(IUIFocusListener l);
  public void removeKeyListener(IUIKeyListener l);
  public void removeMouseListener(IUIMouseListener l);
  public void removeMouseMotionListener(IUIMouseMotionListener l);
  public void removeNotify();
  public IUIComponent replace(IUIComponent comp, IUIComponent old);
  public IUIComponent replace(IUIComponent comp, int index);
  public IUIComponent replace(IUIComponent comp,
        Object constraints, IUIComponent old);
  public IUIComponent replace(IUIComponent comp,
        Object constraints, int index);
  public IUIComponent replace(IUIComponent comp,
        Object constraints);
  public void setChildBounds(IUIComponent child, int x, int y,
        int width, int height);
  public void setChildBounds(IUIComponent child, Rectangle rect);
  public void setChildBounds(int index, int x, int y, int width,
        int height);
  public void setChildBounds(int index, Rectangle rect);
  public void setChildLocation(IUIComponent child, int x, int y);
  public void setChildLocation(IUIComponent child, Point point);
  public void setChildLocation(int index, int x, int y);
  public void setChildLocation(int index, Point point);
  public void setChildSize(IUIComponent child, int width,
        int height);
  public void setChildSize(IUIComponent child, Dimension size);
  public void setChildSize(int index, int width, int height);
  public void setChildSize(int index, Dimension size);
  public void setComponent(int index, IUIComponent comp);
  public void setEdge(int edge);
  public void setHeader(IUIComponent header);
  public void setID(int id);
  public void setLayout(IUILayoutManager lm);
  public void setLocation(int x, int y);
  public void setName(String name);
  public void setSize(int width, int height);
  public void update(FxGraphics g);
}

This class implements a stateless container. UIContainer is the base class for all containers in AFC, and allows you to create lightweight controls without the overhead of managing an object's states. Although most containers in AFC are not stateless, UIContainer provides the option of creating a container that has no states.

Note AFC extends UIStateContainer from UIContainer to implement a container having states.

A container in AFC is a UIComponent object that holds a collection of other UIComponent objects. Some containers hold multiple child components and an optional header component. Others contain only a header component. Header components are used to represent the container itself; for example, the text displayed on a button is used as its header component.

UIContainer provides methods that operate either on the entire collection of components, or on the collection of child components that excludes the header. For example, getComponentCount returns the total number of child and header components in the container, while getChildCount strictly returns the number of child components, excluding the header component.

UIContainer implements the IUIContainer interface.

UIComponent
  |
  +--UIContainer

Constructors

UIContainer

public UIContainer();

Creates a stateless container with no edge.

UIContainer

public UIContainer(int edge);

Creates a stateless container with the specified edge.

ParameterDescription
edge The style of the container's edge. Edge styles can be one of the following values:

Remarks:

By default, the edge parameter is ignored.

Methods

add

public IUIComponent add(IUIComponent comp);

Adds the specified component to the end of the container.

Return Value:

Returns the component that was added if successful; otherwise, returns null. (The default return value is null.)

ParameterDescription
comp The component to be added.

Remarks:

This method implements add in the IUIContainer interface. Containers that override this method should return the component that was added, if successful, or null otherwise.

See Also: remove

add

public IUIComponent add(IUIComponent comp, int index);

Adds the specified component to the container at the specified index.

Return Value:

Returns the component that was added if successful; otherwise, returns null. (The default return value is null.)

ParameterDescription
comp The component to be added.
index The zero-based index at which to insert the component. If the container has a header component, the header is at index 0, and the first child begins at index 1; otherwise, the first child begins at index 0. To add the component at the end of the container, pass -1 as the index. (For more information about header components, see the UIContainer overview.)

Remarks:

This method implements add in the IUIContainer interface. Containers that override this method should return the component that was added, if successful, or null otherwise.

See Also: remove

add

public IUIComponent add(IUIComponent comp, Object constraints);

Adds the specified component to the container, according to the specified constraints.

Return Value:

Returns the component that was added if successful; otherwise, returns null. (The default return value is null.)

ParameterDescription
comp The component to be added.
constraints The layout constraints, which depend on the current layout manager. For more information about layout constraints, see the layout manager's addLayoutComponent method.

Remarks:

This method implements add in the IUIContainer interface. Containers that override this method should return the component that was added, if successful, or null otherwise.

See Also: remove

add

public IUIComponent add(IUIComponent comp, Object constraints, int index);

Adds the specified component to the container, according to the specified constraints and index.

Return Value:

Returns the component that was added if successful; otherwise, returns null. (The default return value is null.)

ParameterDescription
comp The component to be added.
constraints The layout constraints, which depend on the current layout manager. For more information about layout constraints, see the layout manager's addLayoutComponent method.
index The zero-based index at which to insert the component. If the container has a header component, the header is at index 0, and the first child begins at index 1; otherwise, the first child begins at index 0. To add the component at the end of the container, pass -1 as the index. (For more information about header components, see the UIContainer overview.)

Remarks:

This method implements add in the IUIContainer interface. Containers that override this method should return the component that was added, if successful, or null otherwise.

See Also: remove

add

public IUIComponent add(String name, IUIComponent comp);

Note This method is replaced by add(IUIComponent comp, Object constraints).

addContainerListener

public void addContainerListener(IUIContainerListener l);

Adds the specified container listener. The listener receives all container events generated for the container.

Return Value:

No return value.

ParameterDescription
l The container listener to be added.

Remarks:

This method implements addContainerListener in the IUIContainer interface.

See Also: removeContainerListener

addFocusListener

public void addFocusListener(IUIFocusListener l);

Adds the specified focus listener. The listener receives all focus events generated for the container.

Return Value:

No return value.

ParameterDescription
l The focus listener to be added.

Remarks:

This method implements addFocusListener in the IUIContainer interface.

See Also: removeFocusListener

addKeyListener

public void addKeyListener(IUIKeyListener l);

Adds the specified key listener. The listener receives all key events generated for the container.

Return Value:

No return value.

ParameterDescription
l The key listener to be added.

Remarks:

This method implements addKeyListener in the IUIContainer interface.

See Also: removeKeyListener

addMouseListener

public void addMouseListener(IUIMouseListener l);

Adds the specified mouse listener. The listener receives all mouse events generated for the container.

Return Value:

No return value.

ParameterDescription
l The mouse listener to be added.

Remarks:

This method implements addMouseListener in the IUIContainer interface.

See Also: removeMouseListener

addMouseMotionListener

public void addMouseMotionListener(IUIMouseMotionListener l);

Adds the specified mouse motion listener. The listener receives all mouse motion events generated for the container.

Return Value:

No return value.

ParameterDescription
l The mouse motion listener to be added.

Remarks:

This method implements addMouseMotionListener in the IUIContainer interface.

See Also: removeMouseMotionListener

addNotify

public void addNotify();

Called to perform initialization when the graphics context is first available.

Return Value:

No return value.

Remarks:

This method invokes addNotify for each component in the container.

Overrides:

addNotify() in UIComponent.

See Also: removeNotify

adjustLayoutSize

public void adjustLayoutSize(IUIComponent comp, Dimension oldSize,
        Dimension newSize);

Adjusts the layout size of the specified component.

Return Value:

No return value.

ParameterDescription
comp The component being sized.
oldSize The previous layout size of the component (in pixels).
newSize The new layout size of the component (in pixels).

Remarks:

This method implements adjustLayoutSize in the IUIContainer interface. adjustLayoutSize is automatically invoked when the specified component's size has changed.

continueInvalidate

public boolean continueInvalidate(IUIComponent comp);

Determines whether the container should be invalidated when the specified child component is invalidated.

Return Value:

Returns true if the container should be invalidated; otherwise, returns false.

ParameterDescription
comp The component being invalidated.

Remarks:

This method implements continueInvalidate in the IUIContainer interface.

ensureVisible

public boolean ensureVisible(int index);

Brings the component at the specified index into view.

Return Value:

Returns true if any window was moved or resized to make the specified component visible; otherwise, returns false.

ParameterDescription
index The zero-based index of the component to be made visible in the container. If the container has a header component, the header is at index 0, and the first child begins at index 1; otherwise, the first child begins at index 0.

Remarks:

This method implements ensureVisible in the IUIContainer interface.

getChild

public IUIComponent getChild(int index);

Retrieves the child component at the specified index. This method cannot retrieve the header component.

Return Value:

Returns null, indicating the specified component cannot be found.

ParameterDescription
index The zero-based index of the component to be retrieved. Regardless of whether the container has a header component, pass 0 to indicate the first child component.

Remarks:

This method implements getChild in the IUIContainer interface, and by default, simply returns null. Containers should override this method.

See Also: getComponent, getChildCount

getChildBounds

public Rectangle getChildBounds(IUIComponent child);

Retrieves the bounding rectangle of the specified component.

Return Value:

Returns the result of calling getChildBounds with the index parameter.

ParameterDescription
child The component. Specify either the container's header component or any child component.

Remarks:

This method implements getChildBounds in the IUIContainer interface.

See Also: setChildBounds

getChildBounds

public Rectangle getChildBounds(int index);

Retrieves the bounding rectangle of the component at the specified index.

Return Value:

Returns null, indicating the bounding rectangle cannot be retrieved.

ParameterDescription
index The zero-based index of the component. If the container has a header component, then the header is at index 0 and the first child component begins at index 1; otherwise, the first child begins at index 0.

Remarks:

This method implements getChildBounds in the IUIContainer interface, and by default, simply returns null. Containers should override this method.

See Also: setChildBounds

getChildCount

public int getChildCount();

Retrieves the number of child components in the container, excluding the header component.

Return Value:

Returns the number of components or 0, indicating that the container has no child components.

Remarks:

This method implements getChildCount in the IUIContainer interface. Containers should override this method.

See Also: getComponentCount, getChild

getChildIndex

public int getChildIndex(IUIComponent comp);

Retrieves the index of the specified child component.

Return Value:

Returns the zero-based index of the component (if the component belongs to the container); otherwise, returns null.

ParameterDescription
comp The component to retrieve the index for. This component must be a child component and not the header component.

Remarks:

This method implements getChildIndex in the IUIContainer interface. Regardless of whether the container has a header component, index 0 indicates the first child component.

See Also: getComponentIndex

getChildLocation

public Point getChildLocation(IUIComponent child);

Retrieves the location of the specified component.

Return Value:

Returns the result of calling getChildLocation with the index parameter.

ParameterDescription
child The component. Specify either the container's header component or any child component.

Remarks:

This method implements getChildLocation in the IUIContainer interface.

See Also: setChildLocation

getChildLocation

public Point getChildLocation(int index);

Retrieves the location of the component at the specified index.

Return Value:

Returns null, indicating the location cannot be retrieved.

ParameterDescription
index The zero-based index of the component. If the container has a header component, the header is at index 0 and the first child component begins at index 1; otherwise, the first child begins at index 0.

Remarks:

This method implements getChildLocation in the IUIContainer interface, and by default, simply returns null. Containers should override this method.

See Also: setChildLocation

getChildSize

public Dimension getChildSize(IUIComponent child);

Retrieves the size of the specified component.

Return Value:

Returns the result of calling getChildSize with the index parameter.

ParameterDescription
child The component. Specify either the container's header component or any child component.

Remarks:

This method implements getChildSize in the IUIContainer interface.

See Also: setChildSize

getChildSize

public Dimension getChildSize(int index);

Retrieves the size of the component at the specified index.

Return Value:

Returns null, indicating the size cannot be retrieved.

ParameterDescription
index The zero-based index of the component. If the container has a header component, the header is at index 0 and the first child component begins at index 1; otherwise, the first child begins at index 0.

Remarks:

This method implements getChildSize in the IUIContainer interface, and by default, simply returns null. Containers should override this method.

See Also: setChildSize

getClientRect

public Rectangle getClientRect();

Retrieves the client rectangle of the container. The client rectangle is the area that remains after the container's bounding rectangle is reduced by the size of its insets.

Return Value:

Returns the bounding rectangle of the container's client area, in the container's coordinate space.

Remarks:

This method implements getClientRect in the IUIContainer interface. The height of the client rectangle is the height of the container minus its top and bottom insets. Similarly, the width of the client rectangle is the width of the container minus its left and right insets. (The width and height are given in pixels.)

getComponent

public IUIComponent getComponent(int x, int y);

Retrieves the component that contains the point identified by the specified coordinates. The header component or any child component can be retrieved.

Return Value:

Returns the component containing the point (if the point lies within the container); otherwise, returns null.

ParameterDescription
x The x coordinate of the point, in the container's coordinate space.
y The y coordinate of the point, in the container's coordinate space.

Remarks:

If the point lies within the container's boundaries, this method enumerates the container's child components to find the first component containing the point. If no child contains the point, the container itself is returned.

Overrides:

getComponent(int,int) in UIComponent.

getComponent

public IUIComponent getComponent(Point point);

Retrieves the component that contains the specified point. The header component or any child component can be retrieved.

Return Value:

Returns the component containing the point (if the point lies within the container); otherwise, returns null.

ParameterDescription
point The point, whose coordinates are given in the container's coordinate space.

Remarks:

If the point lies within the container's boundaries, this method enumerates the container's child components to find the first component containing the point. If no child contains the point, the container itself is returned.

Overrides:

getComponent(Point) in UIComponent.

getComponent

public IUIComponent getComponent(int index);

Retrieves the component that lies at the specified index. The header component or any child component can be retrieved.

Return Value:

Returns null, indicating no component was found at the specified index.

ParameterDescription
index The zero-based index of the component to be retrieved. If the container has a header component, the header is at index 0, and the first child begins at index 1; otherwise, the first child begins at index 0.

Remarks:

This method implements getComponent in the IUIContainer interface, and by default, simply returns null. Containers should override this method.

getComponent

public IUIComponent getComponent(IUIComponent comp);

Retrieves the component in the container that is the ancestor of the specified component. The header component or any child component can be retrieved.

Return Value:

Returns the container's immediate child or header component that is the ancestor of the specified component. If the specified component is itself an immediate child (or header) of the container, this component is returned. If the container is not an ancestor of the specified component, null is returned.

ParameterDescription
comp The component to find the ancestor for.

Remarks:

This method implements getComponent in the IUIContainer interface.

getComponentCount

public int getComponentCount();

Retrieves the number of components in the container, including the header component.

Return Value:

Returns the number of components or 0, indicating that the container has no components.

Remarks:

This method implements getComponentCount in the IUIContainer interface. Containers should override this method.

See Also: getChildCount, getComponent

getComponentFromID

public IUIComponent getComponentFromID(int id);

Retrieves the component with the specified identifier.

Return Value:

Returns the component; returns null if no component with the specified identifier was found.

ParameterDescription
id The ID of the component to be retrieved.

See Also: setID

getComponentIndex

public int getComponentIndex(IUIComponent comp);

Retrieves the index of the specified component.

Return Value:

Returns the zero-based index of the component (if the component belongs to the container); otherwise, returns null.

ParameterDescription
comp The component to retrieve the index for. This component can be the header component or any child component.

Remarks:

This method implements getComponentIndex in the IUIContainer interface. If the container has a header component, the header is at index 0, and the first child begins at index 1; otherwise, the first child begins at index 0.

See Also: getChildIndex

getComponents

public IUIComponent[] getComponents();

Retrieves all components in the container.

Return Value:

Returns an array of the container's components. If the container has a header, the first item in the array is the header component; otherwise, the first item is the first child component.

Remarks:

This method implements getComponents in the IUIContainer interface.

getEdge

public int getEdge();

Retrieves the style of the container's edge.

Return Value:

Returns 0, indicating the container has no edge style.

Remarks:

This method implements getEdge in the IUIContainer interface. Containers should override this method.

See Also: setEdge

getFloater

public IUIComponent getFloater();

Retrieves the floating component in this container, if there is one. The floating component is the component that is superceding the standard z-order of the container's children by being first in the z-order. This is most commonly used when a component is being dragged across the screen, such as a column header or a scroll thumb.

Return Value:

Returns the current floating component; returns null if there is none.

getFocusComponent

public IUIComponent getFocusComponent();

Retrieves the component of the container that currently has input focus.

Return Value:

Returns the component that either itself has focus or is the ancestor of the component that has focus. If no descendant of the container currently has focus, null is returned.

Remarks:

This method implements getFocusComponent in the IUIContainer interface. The returned component is either a direct child of the container or the header component. For example, the container has a child component that is itself a container and a component within this child container has focus. Then, getFocusComponent returns the child container.

getHeader

public IUIComponent getHeader();

Retrieves the container's header component.

Return Value:

Returns null, indicating the container has no header.

Remarks:

This method implements getHeader in the IUIContainer interface, and by default, simply returns null. Containers should override this method. For more information about header components, see the UIContainer overview.

See Also: setHeader

getID

public int getID();

Retrieves the container's identifier.

Return Value:

Returns the integer associated with the container; returns null if the container has no identifier.

Overrides:

getID() in UIComponent.

See Also: setID, getName

getInsets

public Insets getInsets();

Retrieves the container's insets (in pixels), which identify the nonclient area of the container.

Return Value:

Returns an Insets object containing the container's insets.

Remarks:

This method implements getInsets in the IUIContainer interface. The container's insets are based on the style of its edges.

See Also: getEdge

getLayout

public IUILayoutManager getLayout();

Retrieves the layout manager of the container.

Return Value:

Returns null, indicating the container has no layout manager.

Remarks:

This method implements getLayout in the IUIContainer interface, and by default, simply returns null. Containers should override this method.

See Also: setLayout

getMinimumSize

public Dimension getMinimumSize();

Retrieves the minimum size of the container. The minimum size specifies the smallest dimensions (in pixels) that will allow the container and its components to be displayed.

Return Value:

Returns a Dimension object containing the minimum size.

Remarks:

If the container has a layout manager, the layout manager's getMinimumSize method is called to determine the container's minimum size.

Overrides:

getMinimumSize() in UIComponent.

See Also: getPreferredSize

getName

public String getName();

Retrieves the container's name.

Return Value:

Returns the String that displays the container's associated name; returns null if the container has no name.

Overrides:

getName() in UIComponent.

See Also: setName, getID

getPreferredSize

public Dimension getPreferredSize(Dimension size);

Retrieves the preferred layout size of the container (in pixels). The Dimension parameter that's passed is used to force the returned preferred size to be larger on a particular axis.

Return Value:

Returns a Dimension object with a width and height of 0 pixels.

ParameterDescription
size The Dimension to coerce the preferred size to.

Remarks:

This method implements getPreferredSize in the IUIComponent interface. Components should override this method if their size is dependent upon a possible size constraint.

Overrides:

getPreferredSize(Dimension) in UIComponent.

See Also: getMinimumSize, getMaximumSize, getSize

getPreferredSize

public Dimension getPreferredSize();

Retrieves the preferred dimensions (in pixels) for displaying the container and its components.

Return Value:

Returns a Dimension object containing the preferred size.

Remarks:

If the container has a layout manager, the layout manager's getPreferredSize method is called to determine the container's preferred size.

Overrides:

getPreferredSize() in UIComponent.

See Also: getMinimumSize

gotFocus

public boolean gotFocus(Event e, Object o);

Responds to the control receiving input focus.

Return Value:

Returns true if the event was handled; otherwise, returns false.

ParameterDescription
e The event posted to the control.
o The object that posted the event (typically null).

Remarks:

This method calls UIComponent.gotFocus.

Overrides:

gotFocus(Event,Object) in UIComponent.

invalidateAll

public boolean invalidateAll();

Invalidates the container and all its components.

Return Value:

Returns true if the container and its children were invalidated; otherwise, returns false.

Overrides:

invalidateAll() in UIComponent.

isHeightRelative

public boolean isHeightRelative();

Determines if this layout manager uses the height of the container to lay out its children.

Return Value:

Returns true if this layout manager uses the container's height to lay out the children; otherwise, returns false. (The default is true.) Returning false also means that the container's layout method doesn't need to be called on a horizontal resizing.

Overrides:

isHeightRelative() in UIComponent.

See Also: isWidthRelative

isOverlapping

public boolean isOverlapping();

Determines if this layout manager lays out its children so they overlap either completely or partially.

Return Value:

Returns true if the children overlap; otherwise, returns false. (The default is true.) Returning false also means that only the sibling floater window, if one exists, needs to be clipped by the manager.

isWidthRelative

public boolean isWidthRelative();

Determines if this layout manager uses the width of the container to lay out its children.

Return Value:

Returns true if this layout manager uses the container's width to lay out the children; otherwise, returns false. (The default is true.) Returning false also means that the container's layout method doesn't need to be called on a vertical resizing.

Overrides:

isWidthRelative() in UIComponent.

See Also: isHeightRelative

keyDown

public boolean keyDown(Event e, int key);

Handles keyboard navigation in the container.

Return Value:

Returns true if the event was handled; otherwise, returns false.

ParameterDescription
e The event posted to the container.
key The key that was pressed.

Remarks:

This method is called when the container (or a component in the container) has focus and a key is pressed. keyDown navigates to another component in the container based on the following key values:

Key Component navigated to
HOME The first component in the container
END The last component in the container
UP ARROW The component above
DOWN ARROW The component below
LEFT ARROW The component to the left
RIGHT ARROW The component to the right

The component navigated to receives the focus.

Overrides:

keyDown(Event,int) in UIComponent.

See Also: navigate

layout

public void layout();

Lays out the container and its components.

Return Value:

No return value.

Remarks:

If the container has a layout manager, the layout manager's layout method is called to lay out the container.

Overrides:

layout() in UIComponent.

lostFocus

public boolean lostFocus(Event e, Object o);

Responds to the control losing input focus.

Return Value:

Returns true if the event was handled; otherwise, returns false.

ParameterDescription
e The event posted to the control.
o The object that posted the event (typically null).

Remarks:

This method calls UIComponent.lostFocus.

Overrides:

lostFocus(Event,Object) in UIComponent.

mouseEnter

public boolean mouseEnter(Event e, int x, int y);

Responds to the mouse entering the control.

Return Value:

Returns true if the event was handled; otherwise, returns false.

ParameterDescription
e The event posted to the control.
x The x coordinate of the event.
y The y coordinate of the event.

Remarks:

This method calls UIComponent.mouseEnter.

Overrides:

mouseEnter(Event,int,int) in UIComponent.

See Also: mouseExit

mouseExit

public boolean mouseExit(Event e, int x, int y);

Responds to the mouse leaving the control.

Return Value:

Returns true if the event was handled; otherwise, returns false.

ParameterDescription
e The event posted to the control.
x The x coordinate of the event.
y The y coordinate of the event.

Remarks:

This method calls UIComponent.mouseExit.

Overrides:

mouseExit(Event,int,int) in UIComponent.

See Also: mouseEnter, mouseMove

move

public boolean move(IUIComponent comp, IUIComponent before);

Moves a component in the container before the specified component.

Return Value:

Returns false, indicating the component was not moved.

ParameterDescription
comp The component to move.
before The component to move comp before. If null, comp is placed at the end of the container.

Remarks:

This method implements move in the IUIContainer interface, and by default, simply returns false. Containers should override this method.

move

public boolean move(int from, int to);

Moves a component in the container, according to the specified indices.

Return Value:

Returns false, indicating the component was not moved.

ParameterDescription
from The zero-based index of the component to move.
to The zero-based index of the position to move the component in front of. If -1, the component is placed at the end of the container.

Remarks:

This method implements move in the IUIContainer interface, and by default, simply returns false. Containers should override this method.

If the container has a header component, the header is at index 0 and the first child begins at index 1; otherwise, the first child begins at index 0.

navigate

public IUIComponent navigate(IUIComponent comp, int direction,
        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.
direction 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.

Remarks:

This method implements navigate in the IUIContainer interface. If the container has a layout manager, then the layout manager's navigate method is called. Otherwise this method returns null.

Overrides:

navigate(IUIComponent,int,boolean) in UIComponent.

notifyEvent

public void notifyEvent(UINotifyEvent e);

Passes event notification to any children who have requested notification.

Return Value:

No return value.

ParameterDescription
e The event.

Overrides:

notifyEvent(UINotifyEvent) in UIComponent.

paint

public void paint(FxGraphics g);

Draws the container.

Return Value:

No return value.

ParameterDescription
g The graphics context.

Remarks:

If the container has a layout manager, the layout manager's paintContainer method is also invoked.

Overrides:

paint(FxGraphics) in UIComponent.

See Also: paintAll

paintAll

public void paintAll(FxGraphics g);

Draws the container and its components.

Return Value:

No return value.

ParameterDescription
g The graphics context.

Remarks:

If the container has the redrawing state set, this method draws the container and its components by calling update and paintComponents. For more information about states, see the UIStateContainer overview.

Overrides:

paintAll(FxGraphics) in UIComponent.

See Also: paint

paintComponents

public void paintComponents(FxGraphics g);

Draws all the components in the container.

ParameterDescription
g The graphics context.

Remarks:

This method implements paintComponents in the IUIContainer interface, and is invoked by paintAll.

passFocus

public IUIComponent passFocus(int dir);

Retrieves the component that should receive input focus when navigating to the container in the specified direction.

Return Value:

Returns the component, or the container itself, that should receive input focus.

ParameterDescription
dir The navigation direction. Specify one of the NAVDIR values defined in the IUIAccessible interface.

Remarks:

This method implements passFocus in the IUIContainer interface.

See Also: navigate

printAll

public void printAll(FxGraphics g);

Prints the control and all of its child components, using the specified graphics context.

Return Value:

No return value.

ParameterDescription
g The graphics context.

Remarks:

This method calls update and printComponents.

Overrides:

printAll(FxGraphics) in UIComponent.

See Also: print

remove

public void remove(int index);

Removes the component at the specified index from the container.

Return Value:

No return value.

ParameterDescription
index The zero-based index of the component to be removed. If the container has a header component, the header is at index 0 and the first child begins at index 1; otherwise, the first child begins at index 0.

Remarks:

This method implements remove in the IUIContainer interface.

See Also: removeAll, removeAllChildren, add

remove

public void remove(IUIComponent comp);

Removes the specified component from the container.

Return Value:

No return value.

ParameterDescription
comp The header or child component to be removed.

Remarks:

This method implements remove in the IUIContainer interface.

Exceptions:

IllegalArgumentException if the specified component does not belong to the container.

See Also: removeAll, removeAllChildren, add

removeAll

public void removeAll();

Removes all components from the container, including the header component.

Return Value:

No return value.

Remarks:

This method implements removeAll in the IUIContainer interface.

See Also: remove, removeAllChildren, add

removeAllChildren

public void removeAllChildren();

Removes all child components from the container. The header component is not removed.

Return Value:

No return value.

Remarks:

This method implements removeAllChildren in the IUIContainer interface.

See Also: remove, removeAll, add

removeContainerListener

public void removeContainerListener(IUIContainerListener l);

Removes the specified container listener. The listener no longer receives the container's container events.

Return Value:

No return value.

ParameterDescription
l The container listener to be removed.

Remarks:

This method implements removeContainerListener in the IUIContainer interface.

See Also: addContainerListener

removeFocusListener

public void removeFocusListener(IUIFocusListener l);

Removes the specified focus listener. The listener no longer receives the container's focus events.

Return Value:

No return value.

ParameterDescription
l The focus listener to be removed.

Remarks:

This method implements removeFocusListener in the IUIContainer interface.

See Also: addFocusListener

removeKeyListener

public void removeKeyListener(IUIKeyListener l);

Removes the specified key listener. The listener no longer receives the container's key events.

Return Value:

No return value.

ParameterDescription
l The key listener to be removed.

Remarks:

This method implements removeKeyListener in the IUIContainer interface.

See Also: addKeyListener

removeMouseListener

public void removeMouseListener(IUIMouseListener l);

Removes the specified mouse listener. The listener no longer receives the container's mouse events.

Return Value:

No return value.

ParameterDescription
l The mouse listener to be removed.

Remarks:

This method implements removeMouseListener in the IUIContainer interface.

See Also: addMouseListener

removeMouseMotionListener

public void removeMouseMotionListener(IUIMouseMotionListener l);

Removes the specified mouse motion listener. The listener no longer receives the container's mouse motion events.

Return Value:

No return value.

ParameterDescription
l The mouse motion listener to be removed.

Remarks:

This method implements removeMouseMotionListener in the IUIContainer interface.

See Also: addMouseMotionListener

removeNotify

public void removeNotify();

Called when the graphics context first becomes unavailable.

Return Value:

No return value.

Remarks:

This method invokes removeNotify for each component in the container.

Overrides:

removeNotify() in UIComponent.

See Also: addNotify

replace

public IUIComponent replace(IUIComponent comp, IUIComponent old);

Adds the specified component to the container, replacing the specified component.

Return Value:

Returns the component that was added.

ParameterDescription
comp The component to be added.
old The component to be replaced.

See Also: add, remove

replace

public IUIComponent replace(IUIComponent comp, int index);

Adds the specified component to the container, replacing the specified component.

Return Value:

Returns the component that was added.

ParameterDescription
comp The component to be added.
index The index of the component to be replaced.

See Also: add, remove

replace

public IUIComponent replace(IUIComponent comp, Object constraints,
        IUIComponent old);

Adds the specified component to the container with the specified constraints, replacing the specified component.

Return Value:

Returns the component added.

ParameterDescription
comp The component to be added.
constraints The layout constraints, which depend on the current layout manager. For more information about layout constraints, see the layout manager's addLayoutComponent method.
old The component to be replaced.

See Also: add, remove

replace

public IUIComponent replace(IUIComponent comp, Object constraints,
        int index);

Adds the specified component to the container with the specified constraints, replacing the specified component.

Return Value:

Returns the component that was added.

ParameterDescription
comp The component to be added.
constraints The layout constraints, which depend on the current layout manager. For more information about layout constraints, see the layout manager's addLayoutComponent method.
index The index of the component to be replaced.

See Also: add, remove

replace

public IUIComponent replace(IUIComponent comp, Object constraints);

Adds the specified component to the container, replacing the component with the specified constraints.

Return Value:

Returns the component that was added.

ParameterDescription
comp The component to be added.
constraints The layout constraints of the component to be replaced (as well as the component to be added), which depend on the current layout manager. For more information about layout constraints, see the layout manager's addLayoutComponent method.

See Also: add, remove

setChildBounds

public void setChildBounds(IUIComponent child, int x, int y, int width, int
        height);

Sets the bounds of the specified component, according to the specified coordinates and dimensions.

Return Value:

No return value.

ParameterDescription
child The component. Specify either the container's header component or any child component.
x The x coordinate for the upper-left corner of the component.
y The y coordinate for the upper-left corner of the component.
width The width for the component (in pixels).
height The height for the component (in pixels).

Remarks:

This method implements setChildBounds in the IUIContainer interface, and by default, simply returns false. Containers should override this method.

See Also: getChildBounds

setChildBounds

public void setChildBounds(IUIComponent child, Rectangle rect);

Sets the bounds of the specified component, according to the specified Rectangle object.

Return Value:

No return value.

ParameterDescription
child The component. Specify either the container's header component or any child component.
rect The bounding rectangle for the component.

Remarks:

This method implements setChildBounds in the IUIContainer interface, and by default, simply returns false. Containers should override this method.

See Also: getChildBounds

setChildBounds

public void setChildBounds(int index, int x, int y, int width, int height);

Sets the bounds of the component at the specified index, according to the specified coordinates and dimensions.

Return Value:

No return value.

ParameterDescription
index The zero-based index of the component. If the container has a header component, then the header is at index 0 and the first child component begins at index 1; otherwise, the first child begins at index 0.
x The x coordinate for the upper-left corner of the component.
y The y coordinate for the upper-left corner of the component.
width The width for the component.
height The height for the component.

Remarks:

This method implements setChildBounds in the IUIContainer interface, and by default, simply returns false. Containers should override this method.

See Also: getChildBounds

setChildBounds

public void setChildBounds(int index, Rectangle rect);

Sets the bounds of the component at the specified index, according to the specified Rectangle object.

Return Value:

No return value.

ParameterDescription
index The zero-based index of the component. If the container has a header component, then the header is at index 0 and the first child component begins at index 1; otherwise, the first child begins at index 0.
rect The bounding rectangle for the component.

Remarks:

This method implements setChildBounds in the IUIContainer interface, and by default, simply returns false. Containers should override this method.

See Also: getChildBounds

setChildLocation

public void setChildLocation(IUIComponent child, int x, int y);

Sets the location of the specified component, according to the specified coordinates.

Return Value:

No return value.

ParameterDescription
child The component. Specify either the container's header component or any child component.
x The x coordinate for the upper-left corner of the component.
y The y coordinate for the upper-left corner of the component.

Remarks:

This method implements setChildLocation in the IUIContainer interface.

See Also: getChildLocation

setChildLocation

public void setChildLocation(IUIComponent child, Point point);

Sets the location of the specified component, according to the specified Point object.

Return Value:

No return value.

ParameterDescription
child The component. Specify either the container's header component or any child component.
point The upper-left corner of the component.

Remarks:

This method implements setChildLocation in the IUIContainer interface.

See Also: getChildLocation

setChildLocation

public void setChildLocation(int index, int x, int y);

Sets the location of the component at the specified index, according to the specified coordinates.

Return Value:

No return value.

ParameterDescription
index The zero-based index of the component. If the container has a header component, the header is at index 0 and the first child component begins at index 1; otherwise, the first child begins at index 0.
x The x coordinate for the upper-left corner of the component.
y The y coordinate for the upper-left corner of the component.

Remarks:

This method implements setChildLocation in the IUIContainer interface, and by default, simply returns false. Containers should override this method.

See Also: getChildLocation

setChildLocation

public void setChildLocation(int index, Point point);

Sets the location of the component at the specified index, according to the specified Point object.

Return Value:

No return value.

ParameterDescription
index The zero-based index of the component. If the container has a header component, the header is at index 0 and the first child component begins at index 1; otherwise, the first child begins at index 0.
point The upper-left corner of the component.

Remarks:

This method implements setChildLocation in the IUIContainer interface, and by default, simply returns false. Containers should override this method.

See Also: getChildLocation

setChildSize

public void setChildSize(IUIComponent child, int width, int height);

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

Return Value:

No return value.

ParameterDescription
child The component. Specify either the container's header component or any child component.
width The width for the component (in pixels).
height The height for the component (in pixels).

Remarks:

This method implements setChildSize in the IUIContainer interface.

See Also: getChildSize

setChildSize

public void setChildSize(IUIComponent child, Dimension size);

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

Return Value:

No return value.

ParameterDescription
child The component. Specify either the container's header component or any child component.
size The dimensions for the component (in pixels).

Remarks:

This method implements setChildSize in the IUIContainer interface.

See Also: getChildSize

setChildSize

public void setChildSize(int index, int width, int height);

Sets the size of the component at the specified index, according to the specified dimensions.

Return Value:

No return value.

ParameterDescription
index The zero-based index of the component. If the container has a header component, then the header is at index 0 and the first child component begins at index 1; otherwise, the first child begins at index 0.
width The width for the component (in pixels).
height The height for the component (in pixels).

Remarks:

This method implements setChildSize in the IUIContainer interface, and by default, simply returns false. Containers should override this method.

See Also: getChildSize

setChildSize

public void setChildSize(int index, Dimension size);

Sets the location of the component at the specified index, according to the specified Dimension object.

Return Value:

No return value.

ParameterDescription
index The zero-based index of the component. If the container has a header component, then the header is at index 0 and the first child component begins at index 1; otherwise, the first child begins at index 0.
size The dimensions for the component.

Remarks:

This method implements setChildSize in the IUIContainer interface, and by default, simply returns false. Containers should override this method.

See Also: getChildSize

setComponent

public void setComponent(int index, IUIComponent comp);

Adds the component to the container.

Return Value:

No return value.

ParameterDescription
index The index in the container where the component will be inserted.
comp The component to be inserted.

setEdge

public void setEdge(int edge);

Sets the style of the container's edge.

Return Value:

No return value.

ParameterDescription
edge The style of the container's edge. Edge styles can be one of the following values:

Remarks:

This method implements setEdge in the IUIContainer interface, and by default, simply returns false. Containers should override this method.

See Also: getEdge

setHeader

public void setHeader(IUIComponent header);

Sets the header component for the container.

Return Value:

No return value.

ParameterDescription
header The component to be used as the container's header component. For more information about headers, see the UIContainer overview.

Remarks:

This method implements setHeader in the IUIContainer interface, and by default, simply returns null. Containers should override this method.

See Also: getHeader

setID

public void setID(int id);

Sets the container's identifier.

Return Value:

No return value.

ParameterDescription
id The value to be associated with the container.

Remarks:

To set the identifier, the container must have a header component.

Overrides:

setID(int) in UIComponent.

See Also: getID, setName, getHeader, setHeader

setLayout

public void setLayout(IUILayoutManager lm);

Sets the layout manager of the container.

Return Value:

No return value.

ParameterDescription
lm The new layout manager to be used.

Remarks:

This method implements setLayout in the IUIContainer interface, and by default, simply returns false. Containers should override this method.

See Also: getLayout

setLocation

public void setLocation(int x, int y);

Sets the location of the control, relative to its parent.

Return Value:

No return value.

ParameterDescription
x The x coordinate for the upper-left corner of the control, relative to the parent.
y The y coordinate for the upper-left corner of the control, relative to the parent.

Remarks:

This method implements setLocation in the IUIComponent interface.

Overrides:

setLocation(int,int) in UIComponent.

See Also: getLocation

setName

public void setName(String name);

Sets the container's name.

Return Value:

No return value.

ParameterDescription
name The name to be associated with the container.

Remarks:

To set the name, the container must have a header component.

Overrides:

setName(String) in UIComponent.

See Also: getName, setID, getHeader, setHeader

setSize

public void setSize(int width, int height);

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

Return Value:

No return value.

ParameterDescription
width The new width for the control (in pixels).
height The new height for the control (in pixels).

Remarks:

This method implements setSize in the IUIComponent interface.

Overrides:

setSize(int,int) in UIComponent.

See Also: getSize

update

public void update(FxGraphics g);

Updates the container by filling it with the background color and redrawing the container.

Return Value:

No return value.

ParameterDescription
g The graphics context.

Overrides:

update(FxGraphics) in UIComponent.

See Also: paintAll

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