Package com.ms.ui Previous
Previous
Contents
Contents
Index
Index
Next
Next

Class UILayoutManager

Methods

public abstract class UILayoutManager implements IUILayoutManager
{
  // Methods
  public void addLayoutComponent(String name, Component comp);
  public void removeLayoutComponent(Component comp);

  public Component getComponent(Container cont, int index);
  public Component getLayoutComponent(String name);

  public Dimension minimumLayoutSize(Container parent);
  public Dimension preferredLayoutSize(Container parent);

  public int continueInvalidate();
  public boolean continueInvalidate(Component comp);

  public void layoutContainer(Container parent);
  public void paintContainer(Container parent, Graphics g);
  public Component navigate(Container cont, Component comp, int dir,
                            boolean keyable);
}

An abstract class that manages an extended layout manager. The following diagram shows the classes that extend UILayoutManager.

UILayoutManager
|
+--UIBarLayout
|
+--UIFixedFlowLayout
|
+--UIRowLayout
|
+--UISplitLayout
|
+--UITabLayout
|
+--UITabListLayout
|
+--UITreeLayout
|
+--UIVerticalFlowLayout


Methods


addLayoutComponent

public void addLayoutComponent(String name, Component comp);

Adds or replaces the specified layout component with the given component.

Return Value:

No return value.

ParameterDescription
name The layout name identifying the component to be added or replaced.
comp The component to be added.

Remarks:

The default implementation does nothing.


continueInvalidate

public int continueInvalidate();

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

Return Value:

Returns 1, indicating the container should be invalidated.

Remarks:

This method implements continueInvalidate in the IUILayoutManager interface.


continueInvalidate

public boolean continueInvalidate(Component comp);

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

Return Value:

Always returns true, indicating the container should be invalidated.

ParameterDescription
comp The component being invalidated.

Remarks:

This method implements continueInvalidate in the IUILayoutManager interface.


getComponent

public Component getComponent(Container cont, int index);

Retrieves the component at the specified index.

Return Value:

Returns the specified component, or null if no component is found.

ParameterDescription
cont The container to retrieve the component from.
index The index of component to retrieve.

Remarks:

This method implements getComponent in the IUILayoutManager interface.


getLayoutComponent

public Component getLayoutComponent(String name);

Retrieves the component identified by the specified name.

Return Value:

Returns the specified component.

ParameterDescription
name The layout name identifying the component to retrieve.

Remarks:

This method implements getLayoutComponent in the IUILayoutManager interface, and by default, simply returns null.


layoutContainer

public void layoutContainer(Container parent);

Lays out the components in the specified container.

Return Value:

No return value.

ParameterDescription
parent The container of the components being laid out.

Remarks:

The default implementation does nothing.


minimumLayoutSize

public Dimension minimumLayoutSize(Container parent);

Determines the minimum dimensions (in pixels) needed to lay out the components in the specified container.

Return Value:

Returns a Dimension object containing the minimum dimensions.

ParameterDescription
parent The container of the components to be laid out.

Remarks:

By default, this method returns a height and width of 0.


navigate

public Component navigate(Container cont, Component comp, 
                          int dir, boolean keyable);

Navigates to another component from the specified component in the given direction.

Return Value:

Returns the component navigated to, or null if no component in the specified direction exists.

ParameterDescription
cont The container where the navigation is occurring.
comp The component from which to navigate.
dir The direction to navigate. Specify one of the field values in IUIAccessible.
keyable If true, non-keyable components will be ignored during the navigation; otherwise, all components can be navigated to.

Remarks:

This method implements navigate in the IUILayoutManager interface. If an undefined direction is specified, an IllegalArgumentException is thrown.


paintContainer

public void paintContainer(Container parent, Graphics g);

Paints into the container as needed.

Return Value:

No return value.

ParameterDescription
parent The container.
g The graphics context of the container to be used for painting.

Remarks:

This method implements paintContainer in the IUILayoutManager interface, and by default, does nothing.


preferredLayoutSize

public Dimension preferredLayoutSize(Container parent);

Determines the preferred dimensions (in pixels) for laying out the components in the specified container.

Return Value:

Returns a Dimension object containing the preferred dimensions.

ParameterDescription
parent The container of the components to be laid out.

Remarks:

By default, this method returns a height and width of 0.


removeLayoutComponent

public void removeLayoutComponent(Component comp);

Removes the specified component from the layout.

Return Value:

No return value.

ParameterDescription
comp The component to be removed.

Remarks:

The default implementation does nothing.



Top© 1997 Microsoft Corporation. All rights reserved. Legal Notices.