org.tigris.swidgets
Class NewspaperLayout

java.lang.Object
  extended byorg.tigris.swidgets.GridLayout2
      extended byorg.tigris.swidgets.NewspaperLayout
All Implemented Interfaces:
java.awt.LayoutManager, java.io.Serializable

public class NewspaperLayout
extends GridLayout2

Similar to GridLayout2 but once the components fill the height of the container they flow into another grid on the right until the full width of the container is filled. Once the containers width is full it flows to the right no more, the grid depths increase instead so that the user scrolls up/down instead of left/right.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.tigris.swidgets.GridLayout2
BOTH, CENTER, EAST, FITPARENT, HORIZONTAL, MAXPREFERRED, NONE, NORTH, NORTHEAST, NORTHWEST, ROWCOLPREFERRED, SOUTH, SOUTHEAST, SOUTHWEST, VERTICAL, WEST
 
Constructor Summary
NewspaperLayout()
          The constructor.
NewspaperLayout(int rows, int cols)
          The constructor.
NewspaperLayout(int rows, int cols, int hgap, int vgap, int gg)
          The constructor.
 
Method Summary
 void addLayoutComponent(java.lang.String name, java.awt.Component comp)
          Adds the specified component with the specified name to the layout.
 void layoutContainer(java.awt.Container parent)
           
 java.awt.Dimension maximumLayoutSize(java.awt.Container parent)
          TODO: This is never used, and not part of the interface LayoutContainer.
 java.awt.Dimension minimumLayoutSize(java.awt.Container parent)
          Required by LayoutManager.
 java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
          Determines the preferred size of the container argument using this grid layout.
 void removeLayoutComponent(java.awt.Component comp)
          Removes the specified component with the specified name from the layout.
 
Methods inherited from class org.tigris.swidgets.GridLayout2
calculateSizes, getColumns, getColWidth, getComponentCellHeight, getComponentCellWidth, getHgap, getLargestHeight, getLargestWidth, getRowHeight, getRows, getVgap, positionComponentInCell, setCols, setColWidth, setHgap, setLargestHeight, setLargestWidth, setRowHeight, setRows, setVgap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NewspaperLayout

public NewspaperLayout()
The constructor.


NewspaperLayout

public NewspaperLayout(int rows,
                       int cols)
The constructor.

Parameters:
rows - the number of rows
cols - the number of columns

NewspaperLayout

public NewspaperLayout(int rows,
                       int cols,
                       int hgap,
                       int vgap,
                       int gg)
The constructor.

Parameters:
rows - the number of rows
cols - the number of columns
hgap - the horizontal gap
vgap - the vertical gap
gg - the grid gap
Method Detail

addLayoutComponent

public void addLayoutComponent(java.lang.String name,
                               java.awt.Component comp)
Description copied from class: GridLayout2
Adds the specified component with the specified name to the layout. This is included to satisfy the LayoutManager interface but is not actually used in this layout implementation.

Specified by:
addLayoutComponent in interface java.awt.LayoutManager
Overrides:
addLayoutComponent in class GridLayout2
Parameters:
name - the name of the component
comp - the component to be added
See Also:
LayoutManager.addLayoutComponent(java.lang.String, java.awt.Component)

removeLayoutComponent

public void removeLayoutComponent(java.awt.Component comp)
Description copied from class: GridLayout2
Removes the specified component with the specified name from the layout. This is included to satisfy the LayoutManager interface but is not actually used in this layout implementation.

Specified by:
removeLayoutComponent in interface java.awt.LayoutManager
Overrides:
removeLayoutComponent in class GridLayout2
Parameters:
comp - the name of the component
See Also:
LayoutManager.removeLayoutComponent(java.awt.Component)

preferredLayoutSize

public java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
Description copied from class: GridLayout2
Determines the preferred size of the container argument using this grid layout. The preferred size of a grid layout is dependant on the cellSizing scheme.

MAXPREFERRED and FITPARENT use the same formula to calculate prefered size.

The prefered width using MAXPREFERRED or FITPARENT is the largest preferred width of any of the widths in the container times the number of columns, plus the horizontal padding times the number of columns plus one, plus the left and right insets of the target container.

The preferred height using MAXPREFERRED or FITPARENT is the largest preferred height of any of the heights in the container times the number of rows, plus the vertical padding times the number of rows plus one, plus the top and bottom insets of the target container.

The prefered width using ROWCOLPREFERRED is the largest preferred is the sum of the widths of of all columns, plus the horizontal padding times the number of columns plus one, plus the left and right insets of the target container.

The prefered height using ROWCOLPREFERRED is the largest preferred is the sum of the heights of of all columns, plus the horizontal padding times the number of columns plus one, plus the left and right insets of the target container.

Specified by:
preferredLayoutSize in interface java.awt.LayoutManager
Overrides:
preferredLayoutSize in class GridLayout2
Parameters:
parent - the container to be laid out
Returns:
the preferred dimensions to lay out the subcomponents of the specified container
See Also:
LayoutManager.preferredLayoutSize(java.awt.Container)

minimumLayoutSize

public java.awt.Dimension minimumLayoutSize(java.awt.Container parent)
Description copied from class: GridLayout2
Required by LayoutManager.

Specified by:
minimumLayoutSize in interface java.awt.LayoutManager
Overrides:
minimumLayoutSize in class GridLayout2
See Also:
LayoutManager.minimumLayoutSize(java.awt.Container)

maximumLayoutSize

public java.awt.Dimension maximumLayoutSize(java.awt.Container parent)
TODO: This is never used, and not part of the interface LayoutContainer.

Parameters:
parent - the container
Returns:
the dimension

layoutContainer

public void layoutContainer(java.awt.Container parent)
Specified by:
layoutContainer in interface java.awt.LayoutManager
Overrides:
layoutContainer in class GridLayout2
See Also:
LayoutManager.layoutContainer(java.awt.Container)