org.pf.swing
Class TakeAllLayoutManager

java.lang.Object
  extended by org.pf.swing.TakeAllLayoutManager
All Implemented Interfaces:
java.awt.LayoutManager

public class TakeAllLayoutManager
extends java.lang.Object
implements java.awt.LayoutManager

This layout manager expects only one component in the parent container. Its simple task is to resize the inner component to the container's full available size.

Version:
1.0
Author:
Manfred Duchrow

Constructor Summary
TakeAllLayoutManager()
          Initialize the new instance with default values.
TakeAllLayoutManager(int margin)
          Initialize the new instance with a margin for all sides.
TakeAllLayoutManager(int left, int right, int top, int bottom)
          Initialize the new instance with the specified margin values.
 
Method Summary
 void addLayoutComponent(java.lang.String name, java.awt.Component comp)
           
 int getBottomMargin()
          Returns the current bottom margin
 int getLeftMargin()
          Returns the current left margin
 int getRightMargin()
          Returns the current right margin
 int getTopMargin()
          Returns the current top margin
 void layoutContainer(java.awt.Container parent)
           
 java.awt.Dimension minimumLayoutSize(java.awt.Container parent)
           
 java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
           
 void removeLayoutComponent(java.awt.Component comp)
           
 void setBottomMargin(int newValue)
          Sets the bottom margin
 void setLeftMargin(int newValue)
          Sets the left margin
 void setRightMargin(int newValue)
          Sets the right margin
 void setTopMargin(int newValue)
          Sets the top margin
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TakeAllLayoutManager

public TakeAllLayoutManager()
Initialize the new instance with default values.


TakeAllLayoutManager

public TakeAllLayoutManager(int margin)
Initialize the new instance with a margin for all sides.


TakeAllLayoutManager

public TakeAllLayoutManager(int left,
                            int right,
                            int top,
                            int bottom)
Initialize the new instance with the specified margin values.

Method Detail

layoutContainer

public void layoutContainer(java.awt.Container parent)
Specified by:
layoutContainer in interface java.awt.LayoutManager

addLayoutComponent

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

minimumLayoutSize

public java.awt.Dimension minimumLayoutSize(java.awt.Container parent)
Specified by:
minimumLayoutSize in interface java.awt.LayoutManager

preferredLayoutSize

public java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
Specified by:
preferredLayoutSize in interface java.awt.LayoutManager

removeLayoutComponent

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

getTopMargin

public int getTopMargin()
Returns the current top margin


setTopMargin

public void setTopMargin(int newValue)
Sets the top margin

Parameters:
newValue - The margin in pixel (must be >=0)

getBottomMargin

public int getBottomMargin()
Returns the current bottom margin


setBottomMargin

public void setBottomMargin(int newValue)
Sets the bottom margin

Parameters:
newValue - The margin in pixel (must be >=0)

getLeftMargin

public int getLeftMargin()
Returns the current left margin


setLeftMargin

public void setLeftMargin(int newValue)
Sets the left margin

Parameters:
newValue - The margin in pixel (must be >=0)

getRightMargin

public int getRightMargin()
Returns the current right margin


setRightMargin

public void setRightMargin(int newValue)
Sets the right margin

Parameters:
newValue - The margin in pixel (must be >=0)