net.mtu.eggplant.util.gui
Class BetterBoxLayout

java.lang.Object
  extended by net.mtu.eggplant.util.gui.BetterBoxLayout
All Implemented Interfaces:
LayoutManager, LayoutManager2

public class BetterBoxLayout
extends Object
implements LayoutManager2

Lets box be it's preferred size and lays out components inside accordingly.

Version:
$Revision$

Field Summary
static net.mtu.eggplant.util.gui.BetterBoxLayout.BetterBoxLayoutOrientation HORIZONTAL
          Layout components along the X axis.
static net.mtu.eggplant.util.gui.BetterBoxLayout.BetterBoxLayoutOrientation VERTICAL
          Layout components along the Y axis.
 
Constructor Summary
BetterBoxLayout()
          Create a BetterBoxLayout with a HORIZONTAL orientation, ie. components laid out along the X axis.
BetterBoxLayout(net.mtu.eggplant.util.gui.BetterBoxLayout.BetterBoxLayoutOrientation orientation)
          Create a BetterBoxLayout with given orientation.
 
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)
           
 Dimension maximumLayoutSize(Container target)
           
 Dimension minimumLayoutSize(Container target)
           
 Dimension preferredLayoutSize(Container target)
           
 void removeLayoutComponent(Component comp)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERTICAL

public static final net.mtu.eggplant.util.gui.BetterBoxLayout.BetterBoxLayoutOrientation VERTICAL
Layout components along the Y axis.


HORIZONTAL

public static final net.mtu.eggplant.util.gui.BetterBoxLayout.BetterBoxLayoutOrientation HORIZONTAL
Layout components along the X axis.

Constructor Detail

BetterBoxLayout

public BetterBoxLayout()
Create a BetterBoxLayout with a HORIZONTAL orientation, ie. components laid out along the X axis.


BetterBoxLayout

public BetterBoxLayout(net.mtu.eggplant.util.gui.BetterBoxLayout.BetterBoxLayoutOrientation orientation)
Create a BetterBoxLayout with given orientation.

Method Detail

addLayoutComponent

public void addLayoutComponent(String name,
                               Component comp)
Specified by:
addLayoutComponent in interface LayoutManager

addLayoutComponent

public void addLayoutComponent(Component comp,
                               Object constraints)
Specified by:
addLayoutComponent in interface LayoutManager2

layoutContainer

public void layoutContainer(Container target)
Specified by:
layoutContainer in interface LayoutManager

minimumLayoutSize

public Dimension minimumLayoutSize(Container target)
Specified by:
minimumLayoutSize in interface LayoutManager

preferredLayoutSize

public Dimension preferredLayoutSize(Container target)
Specified by:
preferredLayoutSize in interface LayoutManager

maximumLayoutSize

public Dimension maximumLayoutSize(Container target)
Specified by:
maximumLayoutSize in interface LayoutManager2

removeLayoutComponent

public void removeLayoutComponent(Component comp)
Specified by:
removeLayoutComponent in interface LayoutManager

getLayoutAlignmentX

public float getLayoutAlignmentX(Container target)
Specified by:
getLayoutAlignmentX in interface LayoutManager2

getLayoutAlignmentY

public float getLayoutAlignmentY(Container target)
Specified by:
getLayoutAlignmentY in interface LayoutManager2

invalidateLayout

public void invalidateLayout(Container target)
Specified by:
invalidateLayout in interface LayoutManager2