uk.co.ist.mwt
Class ColumnPackedRCLayout

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

public class ColumnPackedRCLayout
extends RowColLayout

This layout manager (when attached to a Container) mimics the behaviour of a Motif XmRowColumn with XmNpacking set to XmPACK_COLUMN.

Irritatingly enough, a Motif XmRowColumn does with packing set to XmPACK_COLUMN does not quite map to a GridLayout. For example, if the container is too large for all of the children, the RowColumn just leaves empty space, or if it's adjusting the last column, it expands just that. The GridLayout, however, will just resize all of the children so that they all have an equal width and height and so that the container is filled.

See Also:
Serialized Form

Fields inherited from class uk.co.ist.mwt.RowColLayout
adjustLast, vertical
 
Fields inherited from class uk.co.ist.mwt.MarginLayoutManager
marginHeight, marginWidth
 
Constructor Summary
ColumnPackedRCLayout()
           
 
Method Summary
protected  java.awt.Dimension getChildSize(java.awt.Component[] children, boolean minimum)
          Method to find out what size every child in this layout should be (with the exception of the last row/column if adjustLast is set)
 int getNumColumns()
          Get accessor for the number of columns in this layout (the number of rows if it's being laid out horizontally
 void layoutContainer(java.awt.Container parent)
          Lays out the container.
protected  java.awt.Dimension layoutSize(java.awt.Container parent, boolean minimum)
          Method to find out the size of a parent container with this layout
 void setNumColumns(int num)
          Set accessor for the number of columns in this layout (the number of rows if it's being laid out horizontally
 
Methods inherited from class uk.co.ist.mwt.RowColLayout
addLayoutComponent, getAdjustLast, getVertical, minimumLayoutSize, preferredLayoutSize, removeLayoutComponent, setAdjustLast, setVertical
 
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

ColumnPackedRCLayout

public ColumnPackedRCLayout()
Method Detail

setNumColumns

public void setNumColumns(int num)
Set accessor for the number of columns in this layout (the number of rows if it's being laid out horizontally
Parameters:
num - the new number of columns.
See Also:
getNumColumns(), RowColLayout.setVertical(boolean), RowColLayout.getVertical()

getNumColumns

public int getNumColumns()
Get accessor for the number of columns in this layout (the number of rows if it's being laid out horizontally
Returns:
the number of columns
See Also:
setNumColumns(int), RowColLayout.setVertical(boolean), RowColLayout.getVertical()

getChildSize

protected java.awt.Dimension getChildSize(java.awt.Component[] children,
                                          boolean minimum)
Method to find out what size every child in this layout should be (with the exception of the last row/column if adjustLast is set)
Parameters:
children - the array of all of the children in the layout
minimum - true if we want the minimum size, false otherwise
Returns:
the size the children should be

layoutContainer

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

layoutSize

protected java.awt.Dimension layoutSize(java.awt.Container parent,
                                        boolean minimum)
Method to find out the size of a parent container with this layout
Overrides:
layoutSize in class RowColLayout
Parameters:
parent - the parent container
minimum - true if we want the minimum size, false if we want the preferred size
Returns:
the size needed
See Also:
RowColLayout.minimumLayoutSize(java.awt.Container), RowColLayout.preferredLayoutSize(java.awt.Container)