uk.co.ist.mwt
Class PanedWindowLayout

java.lang.Object
  |
  +--uk.co.ist.mwt.MarginLayoutManager
        |
        +--uk.co.ist.mwt.PanedWindowLayout

public class PanedWindowLayout
extends MarginLayoutManager

A PanedWindowLayout splits itself vertically, with each of its children taking up the whole width of the parent container, and a portion of its height. The children are separated by separators. The height of each child can be dynamically changed by the user. Each child's position and other details can be specified in a PanedWindowConstraints object using layout.constrain(); if this is not called, ot a null constrains is used, a default set of constraints are used.

See Also:
Serialized Form

Fields inherited from class uk.co.ist.mwt.MarginLayoutManager
marginHeight, marginWidth
 
Constructor Summary
PanedWindowLayout()
           
 
Method Summary
 void addLayoutComponent(java.lang.String name, java.awt.Component comp)
          Add a component to the layout manager's records.
 void constrain(java.awt.Component comp, PanedWindowConstraints constr)
          Add a set of constraints to one of the children in the layout; if the child has not yet been added, throw the constraints away (as the child must have been added to the container before we can safely add it here.
protected  void doFirstTimeLayout(java.awt.Container parent, java.awt.Dimension totalSize)
          Lays out the container when we first come to it.
 void doLayout(java.awt.Container parent)
          Wrapper for the doLayout with more parameters; calculates the missing parameters from the parent.
protected  void doLayout(java.awt.Container parent, java.awt.Dimension totalSize, Sorter children)
          Places the children into their caculated positions
protected  void doNormalLayout(java.awt.Container parent, java.awt.Dimension totalSize)
          Lays out the container at any time after the first layout;
 boolean getSeparatorsOn()
          Finds out whether or not this layout puts separators between the components it is laying out.
 void layoutContainer(java.awt.Container parent)
          Lays out the container.
 java.awt.Dimension minimumLayoutSize(java.awt.Container parent)
          Finds out the minimum size this layout needs in the given parent
 java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
          Finds out the preferred size this layout wants in the given parent
 void removeLayoutComponent(java.awt.Component comp)
          Remove a component from the layout manager's records.
 void setSeparatorsOn(boolean whether)
          Sets whether or not this layout puts separators between the components it is laying out.
 Sorter sortedChildren(java.awt.Container parent)
          Sorts the children into the order of their position indices
 
Methods inherited from class uk.co.ist.mwt.MarginLayoutManager
getMarginHeight, getMarginWidth, setMarginHeight, setMarginWidth, sizeOfComponent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PanedWindowLayout

public PanedWindowLayout()
Method Detail

constrain

public void constrain(java.awt.Component comp,
                      PanedWindowConstraints constr)
Add a set of constraints to one of the children in the layout; if the child has not yet been added, throw the constraints away (as the child must have been added to the container before we can safely add it here.

sortedChildren

public Sorter sortedChildren(java.awt.Container parent)
Sorts the children into the order of their position indices
Parameters:
parent - the container of these children

doLayout

public void doLayout(java.awt.Container parent)
Wrapper for the doLayout with more parameters; calculates the missing parameters from the parent.

doLayout

protected void doLayout(java.awt.Container parent,
                        java.awt.Dimension totalSize,
                        Sorter children)
Places the children into their caculated positions
Parameters:
parent - the container we're attached to
totalSize - the amount of its space we may use
children - a sorted list of the children

doNormalLayout

protected void doNormalLayout(java.awt.Container parent,
                              java.awt.Dimension totalSize)
Lays out the container at any time after the first layout;

doFirstTimeLayout

protected void doFirstTimeLayout(java.awt.Container parent,
                                 java.awt.Dimension totalSize)
Lays out the container when we first come to it. This routine tries to give every child the same amount of space, allowing for their constraints.

layoutContainer

public void layoutContainer(java.awt.Container parent)
Lays out the container.
Overrides:
layoutContainer in class MarginLayoutManager
Tags copied from class: MarginLayoutManager
Parameters:
parent - the component which needs to be laid out

minimumLayoutSize

public java.awt.Dimension minimumLayoutSize(java.awt.Container parent)
Finds out the minimum size this layout needs in the given parent
Overrides:
minimumLayoutSize in class MarginLayoutManager
Tags copied from class: MarginLayoutManager
Parameters:
parent - the component to be laid out
See Also:
MarginLayoutManager.preferredLayoutSize(java.awt.Container)

preferredLayoutSize

public java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
Finds out the preferred size this layout wants in the given parent
Overrides:
preferredLayoutSize in class MarginLayoutManager
Tags copied from class: MarginLayoutManager
Parameters:
parent - the component to be laid out
See Also:
MarginLayoutManager.minimumLayoutSize(java.awt.Container)

removeLayoutComponent

public void removeLayoutComponent(java.awt.Component comp)
Remove a component from the layout manager's records. Because we do not associate any extra contraints-type information with a component, its name included, we do not keep an internal list of the components we are meant to be laying out; instead, like the Flow- and GridLayout classes, we construct a new list of Components to lay out each time we are asked to do so. So, removeLayoutComponent is not used.
Overrides:
removeLayoutComponent in class MarginLayoutManager
Parameters:
comp - would be the component to remove.
See Also:
addLayoutComponent(java.lang.String, java.awt.Component)

addLayoutComponent

public void addLayoutComponent(java.lang.String name,
                               java.awt.Component comp)
Add a component to the layout manager's records. Because we do not associate any extra contraints-type information with a component, its name included, we do not keep an internal list of the components we are meant to be laying out; instead, like the Flow- and GridLayout classes, we construct a new list of Components to lay out each time we are asked to do so. So, addLayoutComponent is not used.
Overrides:
addLayoutComponent in class MarginLayoutManager
Parameters:
comp - would be the component to add.
name - would be the name with which to add the component.
See Also:
removeLayoutComponent(java.awt.Component)

setSeparatorsOn

public void setSeparatorsOn(boolean whether)
Sets whether or not this layout puts separators between the components it is laying out.

getSeparatorsOn

public boolean getSeparatorsOn()
Finds out whether or not this layout puts separators between the components it is laying out.