Class UITabListLayout
public class UITabListLayout extends UILayoutManager
{
// Constructors
public UITabListLayout();
// Methods
public Dimension getMinimumSize(IUIContainer parent);
public Dimension getPreferredSize(IUIContainer parent);
public boolean isWidthRelative();
public void layout(IUIContainer parent, Rectangle bounds);
public IUIComponent navigate(IUIContainer cont,
IUIComponent comp, int dir, boolean keyable);
}
This class implements a layout manager for a collection of tab controls. UITabListLayout lays out the container's tabs consecutively and in a single row, and handles navigation across the tab collection. UITabList uses UITabListLayout for its layout manager.
UILayoutManager
|
+--UITabListLayout
public UITabListLayout();
Creates a tab list layout manager.
public Dimension getMinimumSize(IUIContainer parent);
Determines the minimum dimensions (in pixels) needed to lay out the child components in the specified container.
Return Value:
Returns a Dimension object containing the minimum layout size.
Parameter | Description |
parent
| The container of the components.
|
Remarks:
This method is called by the container's getMinimumSize method. Typically, the container is a UITabList control, which manages a collection of tab components. The width of the returned Dimension object is the sum of the minimum widths of each tab. The Dimension object's height is the largest of the minimum heights of each tab.
Overrides:
getMinimumSize(IUIContainer) in UILayoutManager.
See Also: getPreferredSize
public Dimension getPreferredSize(IUIContainer parent);
Determines the preferred dimensions (in pixels) for laying out the child components in the specified container.
Return Value:
Returns a Dimension object containing the preferred layout size.
Parameter | Description |
parent
| The container of the components.
|
Remarks:
This method is called by the container's getPreferredSize method. Typically, the container is a UITabList control, which manages a collection of tab components. The width of the returned Dimension object is the sum of the preferred widths of each tab. The Dimension object's height is the largest of the preferred heights of each tab.
Overrides:
getPreferredSize(IUIContainer) in UILayoutManager.
See Also: getMinimumSize
public boolean isWidthRelative();
This method simply returns false, indicating that the layout manager does not use the width of the container to lay out its children.
Return Value:
Returns false. The UITabListLayout layout manager does not lay out components based on the width of the container.
Overrides:
isWidthRelative() in UILayoutManager.
See Also: isHeightRelative
public void layout(IUIContainer parent, Rectangle bounds);
Lays out the components in the specified container.
Return Value:
No return value.
Parameter | Description |
parent
| The container being laid out.
|
bounds
| The bounding rectangle in which to lay out the components.
|
Remarks:
This method is called by the container's layout method. Typically, the container is a UITabList control, which manages a collection of tab components. layout lays out the tabs consecutively, and in a single row. The width of each tab is its respective preferred width; each tab's height is the height of the bounding rectangle. If the tab is currently selected, its height and width both increase by 2 edges.
Overrides:
layout(IUIContainer,Rectangle) in UILayoutManager.
public IUIComponent navigate(IUIContainer cont, 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.
Parameter | Description |
cont
| The container where the navigation is occurring.
|
comp
| The tab component to navigate from.
|
dir
| The navigation direction. Specify one of the following values defined in IUIAccessible:
|
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 handles keyboard navigation in the container. Typically, the container is a UITabList control, which manages a collection of tab components. When a tab in the UITabList container has focus and a key is pressed, navigate is called to move focus to another tab in the container. The following table shows the keys that have corresponding IUIAccessible directions.
Overrides:
navigate(IUIContainer,IUIComponent,int,boolean) in UILayoutManager.