public class VLToolBarLayout extends Object implements LayoutManager2
When used in horizontal orientation, this layout respects the preferred width of the contained components, and forces the height to the maximum of all the preferred heights. (so components are vertically streched to have the same height).
When used in vertical orientation, this layout respects the preferred height of the contained components, and forces the width to the maximum of all the preferred widths. (so components are horizontally streched to have the same width).
Constructor and Description |
---|
VLToolBarLayout() |
VLToolBarLayout(boolean isHorizontal)
Constructs a new Layout.
|
VLToolBarLayout(boolean isHorizontal,
int gap)
Constructs a new Layout.
|
Modifier and Type | Method and Description |
---|---|
void |
addLayoutComponent(Component comp,
Object constraints) |
void |
addLayoutComponent(String name,
Component comp) |
float |
getLayoutAlignmentX(Container target) |
float |
getLayoutAlignmentY(Container target) |
void |
invalidateLayout(Container target) |
void |
layoutContainer(Container target)
overridden to adjust position (x(top) = width(left), y(left) = height(top)
|
Dimension |
maximumLayoutSize(Container target) |
Dimension |
minimumLayoutSize(Container parent) |
Dimension |
preferredLayoutSize(Container parent) |
void |
removeLayoutComponent(Component comp) |
public VLToolBarLayout()
public VLToolBarLayout(boolean isHorizontal)
isHorizontal
- indicates if the layout will be horizontal or vertical.public VLToolBarLayout(boolean isHorizontal, int gap)
isHorizontal
- indicates if the layout will be horizontal or vertical.gap
- gap in pixels between componentspublic float getLayoutAlignmentX(Container target)
getLayoutAlignmentX
in interface LayoutManager2
public float getLayoutAlignmentY(Container target)
getLayoutAlignmentY
in interface LayoutManager2
public void invalidateLayout(Container target)
invalidateLayout
in interface LayoutManager2
public Dimension maximumLayoutSize(Container target)
maximumLayoutSize
in interface LayoutManager2
public void addLayoutComponent(Component comp, Object constraints)
addLayoutComponent
in interface LayoutManager2
public void removeLayoutComponent(Component comp)
removeLayoutComponent
in interface LayoutManager
public void addLayoutComponent(String name, Component comp)
addLayoutComponent
in interface LayoutManager
public Dimension minimumLayoutSize(Container parent)
minimumLayoutSize
in interface LayoutManager
public Dimension preferredLayoutSize(Container parent)
preferredLayoutSize
in interface LayoutManager
public void layoutContainer(Container target)
layoutContainer
in interface LayoutManager
© Copyright 2004-2007 VLSolutions. All Rights Reserved.
www.vlsolutions.com : Java Components - Smart Client Applications