com.evanmclean.evlib.tablelayout
Class TableLayoutFactory

java.lang.Object
  extended by com.evanmclean.evlib.tablelayout.TableLayoutFactory
All Implemented Interfaces:
TL

public final class TableLayoutFactory
extends Object
implements TL

Utility to make it easy to create TableLayout objects with the specified rows and columns. See summary for an example of typical usage.

Author:
Evan McLean McLean Computer Services (see the overview for copyright and licensing.)

Field Summary
 double[] cols
           
 int hgap
           
 double[] rows
           
 int vgap
           
 
Fields inherited from interface com.evanmclean.evlib.tablelayout.TL
F, FILL, M, MINIMUM, P, PREFERRED
 
Method Summary
static TableLayoutFactory build()
          Create a factory builder, with horizontal and vertical gaps of zero.
static TableLayoutFactory build(int gap)
          Create a factory builder, with a specified horizontal and vertical gap.
static TableLayoutFactory build(int hgap, int vgap)
          Create a factory builder, with a specified horizontal and vertical gaps.
 TableLayoutFactory cols(double... colargs)
          Set the columns to be used in the layout.
 TableLayoutFactory fillcols(boolean... colargs)
          Set the columns to be used to either FILL or PREFERRED depending on if the boolean arg is true or false respectively.
 TableLayoutFactory fillrows(boolean... rowargs)
          Set the rows to be used to either FILL or PREFERRED depending on if the boolean arg is true or false respectively.
 TableLayoutFactory gap(int gap)
          Set the horizontal and vertical gaps to the same value.
 TableLayoutFactory gap(int hgap, int vgap)
          Set the vertical gap.
 TableLayoutFactory hgap(int hgap)
          Set the horizontal gap.
 info.clearthought.layout.TableLayout make()
          Create the table layout with the specified rows and columns.
 TableLayoutFactory rows(double... rowargs)
          Set the rows to be used in the layout.
 TableLayoutFactory vgap(int vgap)
          Set the vertical gap.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cols

public double[] cols

rows

public double[] rows

vgap

public int vgap

hgap

public int hgap
Method Detail

build

public static TableLayoutFactory build()
Create a factory builder, with horizontal and vertical gaps of zero.

Returns:
The new builder.

build

public static TableLayoutFactory build(int gap)
Create a factory builder, with a specified horizontal and vertical gap.

Parameters:
gap - The value for both the horizontal and vertical gaps.
Returns:
The new builder.

build

public static TableLayoutFactory build(int hgap,
                                       int vgap)
Create a factory builder, with a specified horizontal and vertical gaps.

Parameters:
hgap - The horizontal gap.
vgap - The vertical gap.
Returns:
The new builder.

cols

public TableLayoutFactory cols(double... colargs)
Set the columns to be used in the layout.

Parameters:
colargs -
Returns:
Factory to allow stringing method calls together.

fillcols

public TableLayoutFactory fillcols(boolean... colargs)
Set the columns to be used to either FILL or PREFERRED depending on if the boolean arg is true or false respectively.

Parameters:
colargs -
Returns:
Factory to allow stringing method calls together.

fillrows

public TableLayoutFactory fillrows(boolean... rowargs)
Set the rows to be used to either FILL or PREFERRED depending on if the boolean arg is true or false respectively.

Parameters:
rowargs -
Returns:
Factory to allow stringing method calls together.

gap

public TableLayoutFactory gap(int gap)
Set the horizontal and vertical gaps to the same value.

Parameters:
gap -
Returns:
Factory to allow stringing method calls together.

gap

public TableLayoutFactory gap(int hgap,
                              int vgap)
Set the vertical gap.

Parameters:
hgap -
vgap -
Returns:
Factory to allow stringing method calls together.

hgap

public TableLayoutFactory hgap(int hgap)
Set the horizontal gap.

Parameters:
hgap -
Returns:
Factory to allow stringing method calls together.

make

public info.clearthought.layout.TableLayout make()
Create the table layout with the specified rows and columns. Will throw TLFException if the columns or rows were not specified, or either of the arrays is zero length.

Returns:
The new table layout.
Throws:
TLFException - If the columns or rows were not specified, or either of the arrays is zero length.

rows

public TableLayoutFactory rows(double... rowargs)
Set the rows to be used in the layout.

Parameters:
rowargs -
Returns:
Factory to allow stringing method calls together.

vgap

public TableLayoutFactory vgap(int vgap)
Set the vertical gap.

Parameters:
vgap -
Returns:
Factory to allow stringing method calls together.