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

Class UIRowLayout

Constructor , Methods

public class UIRowLayout extends UILayoutManager 
{
  // Constructor
  public UIRowLayout(int columns);

  // Methods
  public int getOrderIndex(int index)
  public int getWidth(int index);
  public void setWidth(int index, int width);

  public Component getComponent(Container cont, int index);
  public void moveColumn(int from, int to);

  public void layoutContainer(Container target);
  public Dimension minimumLayoutSize(Container parent);
  public Dimension preferredLayoutSize(Container parent);

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

A class that implements a row layout manager.


Constructor


UIRowLayout

public UIRowLayout(int columns);

Creates a row layout manager with the specified number of columns.

ParameterDescription
columns The number of columns to create. You must specify a value greater than zero.


Methods


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:

If an invalid index is specified, an IllegalArgumentException is thrown.


getOrderIndex

public int getOrderIndex(int index);

Retrieves the order of the column at the specified index.

Return Value:

Returns the order of the column's location.

ParameterDescription
index The zero-based index of the column.

Remarks:

If an invalid index is specified, an IllegalArgumentException is thrown.


getWidth

public int getWidth(int index);

Retrieves the width of the column at the specified index.

Return Value:

Returns the width (in pixels) of the specified column.

ParameterDescription
index The zero-based index of the column.

Remarks:

If an invalid index is specified, an IllegalArgumentException is thrown.


layoutContainer

public void layoutContainer(Container target);

Lays out the container and its components.

Return Value:

No return value.

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


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:

The minimum layout size is determined from the minimum size of each component in the container.


moveColumn

public void moveColumn(int from, int to);

Moves a column from one location to another.

Return Value:

No return value.

ParameterDescription
from The zero-based index identifying the column to move.
to The zero-based index identifying the new location for the column.


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:

If an undefined direction is specified, an IllegalArgumentException is thrown.


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:

The preferred layout size is determined from the preferred size of each component in the container.


setWidth

public void setWidth(int index, int width);

Sets the width of the column at the specified index.

Return Value:

No return value.

ParameterDescription
index The zero-based index of the column.
width The new width (in pixels) for the column.

Remarks:

If an invalid index is specified, an IllegalArgumentException is thrown.



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