org.onemind.swingweb.templaterender.layout
Class DefaultComponentGridLayout

java.lang.Object
  extended byorg.onemind.swingweb.templaterender.layout.DefaultComponentGridLayout
All Implemented Interfaces:
ComponentGridLayout

public class DefaultComponentGridLayout
extends java.lang.Object
implements ComponentGridLayout

ComponentGridLayout calculates the components the ordering of some components according their x, y position and the cells that they will fill in a 2 dimensional grid

Author:
TiongHiang Lee (thlee@onemindsoft.org)

Constructor Summary
DefaultComponentGridLayout(java.awt.Component[] coms)
           
DefaultComponentGridLayout(java.awt.Container con)
          Constructor.
 
Method Summary
 void doLayout()
          Do the layout calculation
 java.util.List getCells()
          Returnn the cells
 int getCols()
          Returnn number of columns
 java.awt.Container getContainer()
          Get the container
 int getRows()
          Return number of rows
static void main(java.lang.String[] args)
          The main program
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultComponentGridLayout

public DefaultComponentGridLayout(java.awt.Container con)
Constructor. IMPORTANT: the helper must be constructed after layout is done since it uses the bounds information of the children components.

Parameters:
con - the container

DefaultComponentGridLayout

public DefaultComponentGridLayout(java.awt.Component[] coms)
Method Detail

doLayout

public void doLayout()
Do the layout calculation


main

public static void main(java.lang.String[] args)
The main program

Parameters:
args - the arguments

getCells

public final java.util.List getCells()
Returnn the cells

Specified by:
getCells in interface ComponentGridLayout
Returns:
the cells

getContainer

public java.awt.Container getContainer()
Get the container

Returns:
the container

getCols

public int getCols()
Description copied from interface: ComponentGridLayout
Returnn number of columns

Specified by:
getCols in interface ComponentGridLayout
Returns:
# of cols

getRows

public int getRows()
Description copied from interface: ComponentGridLayout
Return number of rows

Specified by:
getRows in interface ComponentGridLayout
Returns:
#of rows


Copyright © 2004-2007 . All Rights Reserved.