org.tigris.swidgets

Class NewspaperLayout

Implemented Interfaces:
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.
Author:
Bob Tarling
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(String name, Component comp)
void
layoutContainer(Container parent)
Dimension
maximumLayoutSize(Container parent)
TODO: This is never used, and not part of the interface LayoutContainer.
Dimension
minimumLayoutSize(Container parent)
Dimension
preferredLayoutSize(Container parent)
void
removeLayoutComponent(Component comp)

Methods inherited from class org.tigris.swidgets.GridLayout2

addLayoutComponent, calculateSizes, getColWidth, getColumns, getComponentCellHeight, getComponentCellWidth, getHgap, getLargestHeight, getLargestWidth, getRowHeight, getRows, getVgap, layoutContainer, minimumLayoutSize, positionComponentInCell, preferredLayoutSize, removeLayoutComponent, setColWidth, setCols, setHgap, setLargestHeight, setLargestWidth, setRowHeight, setRows, setVgap

Constructor Details

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 Details

addLayoutComponent

public void addLayoutComponent(String name,
                               Component comp)
Overrides:
addLayoutComponent in interface GridLayout2
See Also:
java.awt.LayoutManager.addLayoutComponent(java.lang.String, java.awt.Component)

layoutContainer

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

maximumLayoutSize

public Dimension maximumLayoutSize(Container parent)
TODO: This is never used, and not part of the interface LayoutContainer.
Parameters:
parent - the container
Returns:
the dimension

minimumLayoutSize

public Dimension minimumLayoutSize(Container parent)
Overrides:
minimumLayoutSize in interface GridLayout2
See Also:
java.awt.LayoutManager.minimumLayoutSize(java.awt.Container)

preferredLayoutSize

public Dimension preferredLayoutSize(Container parent)
Overrides:
preferredLayoutSize in interface GridLayout2
See Also:
java.awt.LayoutManager.preferredLayoutSize(java.awt.Container)

removeLayoutComponent

public void removeLayoutComponent(Component comp)
Overrides:
removeLayoutComponent in interface GridLayout2
See Also:
java.awt.LayoutManager.removeLayoutComponent(java.awt.Component)