Class UIBarLayout
public class UIBarLayout extends UILayoutManager
{
// Constructors
public UIBarLayout();
public UIBarLayout(int hgap, int vgap);
// Methods
public Dimension getMinimumSize(IUIContainer target);
public Dimension getPreferredSize(IUIContainer target);
public boolean isOverlapping();
public void layout(IUIContainer target, Rectangle bounds);
public IUIComponent navigate(IUIContainer cont,
IUIComponent comp, int dir, boolean keyable);
public void removeLayoutComponent(IUIContainer target,
IUIComponent comp);
}
This class implements a layout manager for a bar object. UIBarLayout is the default layout manager for UIBandBox.
UILayoutManager
|
+--UIBarLayout
public UIBarLayout();
Creates a bar layout manager.
Remarks:
By default, the horizontal and vertical gaps (used for spacing between components) are 5 pixels each.
public UIBarLayout(int hgap, int vgap);
Creates a bar layout manager with the specified horizontal and vertical gaps.
Parameter | Description |
hgap
| The number of pixels used for horizontal spacing between components.
|
vgap
| The number of pixels used for vertical spacing between components.
|
public Dimension getMinimumSize(IUIContainer target);
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 |
target
| The container of the components.
|
Remarks:
This method is called by the container's getMinimumSize method. Typically, the container is a UIBandBox control, which manages a collection of bands or rows of objects. The width of the returned Dimension object is the largest of the widths of each band. The width of each band is the sum of the minimum widths of each item in the band, plus the horizontal gaps between items.
The returned Dimension object's height is the sum of the heights of each band and the vertical gaps between bands. The height of each band is the largest of the minimum heights of each item in the band.
Overrides:
getMinimumSize(IUIContainer) in UILayoutManager.
See Also: getPreferredSize
public Dimension getPreferredSize(IUIContainer target);
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 |
target
| The container of the components.
|
Remarks:
This method is called by the container's getPreferredSize method. Typically, the container is a UIBandBox control, which manages a collection of bands or rows of objects. The width of the returned Dimension object is the largest of the widths of each band. The width of each band is the sum of the preferred widths of each item in the band, plus the horizontal gaps between items.
The returned Dimension object's height is the sum of the heights of each band, plus the vertical gaps between bands. The and bottom insets and the vertical gaps between bands. The height of each band is the largest of the preferred heights of each item in the band.
Overrides:
getPreferredSize(IUIContainer) in UILayoutManager.
See Also: getMinimumSize
public boolean isOverlapping();
Determines if this layout manager lays out its children so that they overlap either completely or partially.
Return Value:
Returns false. The UIBarLayout layout manager lays out components so they do not overlap. Returning false also means that only the sibling floater window, if one exists, needs to be clipped by the manager.
Overrides:
isOverlapping() in UILayoutManager.
public void layout(IUIContainer target, Rectangle bounds);
Lays out the components in the specified container.
Return Value:
No return value.
Parameter | Description |
target
| 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. If a component has the BREAK style, it is laid at the beginning of a new row.
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. When a component in the container has focus and a key is pressed, navigate is called to move focus to another item in the container. The following table shows the keys that have corresponding IUIAccessible directions.
Overrides:
navigate(IUIContainer,IUIComponent,int,boolean) in UILayoutManager.
public void removeLayoutComponent(IUIContainer target, IUIComponent comp);
Removes the specified component from the container.
Return Value:
No return value.
Parameter | Description |
target
| The container of the component.
|
comp
| The component to be removed.
|
Overrides:
removeLayoutComponent(IUIContainer,IUIComponent) in UILayoutManager.