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

Class UIVerticalFlowLayout

Constructors , Methods , Fields

public class UIVerticalFlowLayout extends UILayoutManager
{
  // Fields
  public static final int MULTICOLUMN;
  public static final int FILL;

  // Constructors
  public UIVerticalFlowLayout();
  public UIVerticalFlowLayout(int style);
  public UIVerticalFlowLayout(int style, int gap);

  // Methods
  public void layoutContainer(Container parent);
  public Dimension minimumLayoutSize(Container parent);
  public Dimension preferredLayoutSize(Container parent);
  
  public Component navigate(Container cont, Component comp, int dir, 
                            boolean keyable);
  public void setStyle(int style);

}

A class that implements a vertical flow layout manager. UIVerticalFlowLayout defines the MULTICOLUMN style, which means components will be laid out in multiple columns (the default layout is one single column). UIList uses UIVerticalFlowLayout for its layout manager.


Constructors


UIVerticalFlowLayout

public UIVerticalFlowLayout();

Creates a vertical flow layout manager.

Remarks:

The horizontal gap of the layout manager is defined to be 15 pixels. By default, components will be laid in one vertical column.


UIVerticalFlowLayout

public UIVerticalFlowLayout(int style);

Creates a vertical flow layout manager with the specified style.

ParameterDescription
style The style for the layout manager. You can specify any bitwise combination of MULTICOLUMN and FILL. Pass 0 for the default style of single column, no fill.

Remarks:

By default, the horizontal gap is defined to be 15 pixels. Components will be laid out and accessed according to the specified style. If any undefined style bits are specified, an IllegalArgumentException is thrown.


UIVerticalFlowLayout

public UIVerticalFlowLayout(int style, int gap);

Creates a vertical flow layout manager with the specified style and gap.

ParameterDescription
style The style for the layout manager. You can specify any bitwise combination of MULTICOLUMN and FILL. Pass 0 for the default style of single column, no fill.
gap The horizontal gap between components.

Remarks:

If any undefined style bits are specified, an IllegalArgumentException is thrown.


Methods


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:

This method reshapes the components in order to satisfy the style settings of the layout manager.


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.


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.


setStyle

public void setStyle(int style);

Sets the style of the layout manager.

Return Value:

No return value.

ParameterDescription
style The style for the layout manager. You can specify any bitwise combination of MULTICOLUMN and FILL. Pass 0 for the default style of single column, no fill.

Remarks:

If any undefined style bits are specified, an IllegalArgumentException is thrown.


Fields

MULTICOLUMN
Specifies that the vertical layout will flow to multiple columns.
FILL
Specifies that the width of each component will be equal to the width of the parent container minus its insets.


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