kirk.gui.layout
Class FixedLineLayout

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

public class FixedLineLayout
extends LineLayout

FixedLineLayout extends LineLayout, and it makes each line is as high as specified when constructing an object of this class. Use this class if you want to line up multiple LineLayouts. Note that Components will have their preferred height, but with a maximum of the preset height. They will also be vertically centered in their line.

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

Field Summary
protected  int height
          The height of each Component.
 
Fields inherited from class kirk.gui.layout.LineLayout
 
Constructor Summary
FixedLineLayout(int height)
          Construct a new FixedLineLayout with the specified height, and the default gap values.
FixedLineLayout(int height, int verticalgap)
          Construct a new FixedLineLayout with the specified height, and the specified vertical gap, and the default horizontal gap value.
FixedLineLayout(int height, int horizontalgap, int verticalgap)
          Construct a new FixedLineLayout with the specified height, and the specified gap values.
 
Method Summary
 int getHeight()
          Returns the height value this LayoutManager uses.
 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.
 void setHeight(int height)
          Sets the height value this LayoutManager uses.
 
Methods inherited from class kirk.gui.layout.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
 

Field Detail

height

protected int height
The height of each Component.

Constructor Detail

FixedLineLayout

public FixedLineLayout(int height,
                       int horizontalgap,
                       int verticalgap)
Construct a new FixedLineLayout with the specified height, and the specified gap values.


FixedLineLayout

public FixedLineLayout(int height,
                       int verticalgap)
Construct a new FixedLineLayout with the specified height, and the specified vertical gap, and the default horizontal gap value.


FixedLineLayout

public FixedLineLayout(int height)
Construct a new FixedLineLayout with the specified height, and the default gap values.

Method Detail

getHeight

public int getHeight()
Returns the height value this LayoutManager uses.

Returns:
The height value.

setHeight

public void setHeight(int height)
Sets the height value this LayoutManager uses.

Parameters:
height - The height of each Component.

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)