kirk.gui
Class VariableLineLayout

java.lang.Object
  |
  +--kirk.gui.LineLayout
        |
        +--kirk.gui.VariableLineLayout
All Implemented Interfaces:
java.awt.LayoutManager

public class VariableLineLayout
extends LineLayout

VariableLineLayout extends LineLayout, and it makes each component as high as its preferred size. Use this class if you don't want to waste space or if you want easy adding of components under each other (like in a Dialog or something).

Version:
1
Author:
Berend "Kirk" Wouda
See Also:
LineLayout, FixedLineLayout, GridLineLayout, LargestLineLayout

Field Summary
 
Fields inherited from class kirk.gui.LineLayout
 
Constructor Summary
VariableLineLayout()
          Constructs a new VariableLineLayout.
VariableLineLayout(int verticalgap)
          Constructs a new VariableLineLayout with the given value for the vertical gap, and the default value for the horizontal gap.
VariableLineLayout(int horizontalgap, int verticalgap)
          Constructs a new VariableLineLayout with the given values for the gaps.
 
Method Summary
 void layoutContainer(java.awt.Container parent)
          Lays out the given container.
 java.awt.Dimension minimumLayoutSize(java.awt.Container parent)
          Returns the minimum size of the container if it get's layed out by this LayoutManager.
 java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
          Returns the preferred size of the container if it get's layed out by this LayoutManager.
 
Methods inherited from class kirk.gui.LineLayout
addLayoutComponent, getHorizontalGap, getMinimumWidth, getPreferredWidth, getVerticalGap, getWidth, removeLayoutComponent, setHorizontalGap, setVerticalGap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VariableLineLayout

public VariableLineLayout(int horizontalgap,
                          int verticalgap)
Constructs a new VariableLineLayout with the given values for the gaps.


VariableLineLayout

public VariableLineLayout(int verticalgap)
Constructs a new VariableLineLayout with the given value for the vertical gap, and the default value for the horizontal gap.


VariableLineLayout

public VariableLineLayout()
Constructs a new VariableLineLayout. Use the default values for the gaps.

Method Detail

preferredLayoutSize

public java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
Returns the preferred size of the container if it get's layed out by this LayoutManager.

Specified by:
preferredLayoutSize in interface java.awt.LayoutManager
Specified by:
preferredLayoutSize in class LineLayout
Parameters:
parent - The Container that the preferred size is wanted of.
See Also:
LineLayout.preferredLayoutSize(java.awt.Container), LayoutManager.preferredLayoutSize(java.awt.Container)

minimumLayoutSize

public java.awt.Dimension minimumLayoutSize(java.awt.Container parent)
Returns the minimum size of the container if it get's layed out by this LayoutManager.

Specified by:
minimumLayoutSize in interface java.awt.LayoutManager
Specified by:
minimumLayoutSize in class LineLayout
Parameters:
parent - The Container that the minimum size is wanted of.
See Also:
LineLayout.minimumLayoutSize(java.awt.Container), LayoutManager.minimumLayoutSize(java.awt.Container)

layoutContainer

public void layoutContainer(java.awt.Container parent)
Lays out the given container.

Specified by:
layoutContainer in interface java.awt.LayoutManager
Specified by:
layoutContainer in class LineLayout
Parameters:
parent - The Container to be layed out.
See Also:
LineLayout.layoutContainer(java.awt.Container), LayoutManager.layoutContainer(java.awt.Container)