com.vlsolutions.swing.toolbars

Class VLToolBarLayout

Implemented Interfaces:
LayoutManager2

public class VLToolBarLayout
extends java.lang.Object
implements LayoutManager2

The layout for VLToolBar (supports horizontal and vertical orientation).

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 Summary

VLToolBarLayout()
VLToolBarLayout(boolean isHorizontal)
Constructs a new Layout.
VLToolBarLayout(boolean isHorizontal, int gap)
Constructs a new Layout.

Method Summary

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)

Constructor Details

VLToolBarLayout

public VLToolBarLayout()

VLToolBarLayout

public VLToolBarLayout(boolean isHorizontal)
Constructs a new Layout.
Parameters:
isHorizontal - indicates if the layout will be horizontal or vertical.

VLToolBarLayout

public VLToolBarLayout(boolean isHorizontal,
                       int gap)
Constructs a new Layout.
Parameters:
isHorizontal - indicates if the layout will be horizontal or vertical.
gap - gap in pixels between components

Method Details

addLayoutComponent

public void addLayoutComponent(Component comp,
                               Object constraints)

addLayoutComponent

public void addLayoutComponent(String name,
                               Component comp)

getLayoutAlignmentX

public float getLayoutAlignmentX(Container target)

getLayoutAlignmentY

public float getLayoutAlignmentY(Container target)

invalidateLayout

public void invalidateLayout(Container target)

layoutContainer

public void layoutContainer(Container target)
overridden to adjust position (x(top) = width(left), y(left) = height(top)

maximumLayoutSize

public Dimension maximumLayoutSize(Container target)

minimumLayoutSize

public Dimension minimumLayoutSize(Container parent)

preferredLayoutSize

public Dimension preferredLayoutSize(Container parent)

removeLayoutComponent

public void removeLayoutComponent(Component comp)

© Copyright 2004-2006 VLSolutions. All Rights Reserved.
www.vlsolutions.com : Java Components - Smart Client Applications