org.tbee.swing.tablelayout
Class TableLayoutSpaced

java.lang.Object
  extended by info.clearthought.layout.TableLayout
      extended by org.tbee.swing.tablelayout.TableLayoutSpaced
All Implemented Interfaces:
info.clearthought.layout.TableLayoutConstants, java.awt.LayoutManager, java.awt.LayoutManager2, java.io.Serializable
Direct Known Subclasses:
TableLayoutSpacer

public class TableLayoutSpaced
extends info.clearthought.layout.TableLayout

This class extends the basic TableLayout with automatic spacing: Margins are added automatically around the components and inter column/row spacing between the components. The usage is quite simple: instead of instantiating TableLayout, instatiate this class.

Version:
$Revision: 1.21 $
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class info.clearthought.layout.TableLayout
info.clearthought.layout.TableLayout.Entry
 
Field Summary
static java.lang.String SOURCECODE_VERSION
          Standard variable for determining version of a class file.
 
Fields inherited from class info.clearthought.layout.TableLayout
C, checkForComponentOrientationSupport, crOffset, crSize, crSpec, defaultSize, dirty, hGap, list, methodGetComponentOrientation, oldHeight, oldWidth, R, vGap
 
Fields inherited from interface info.clearthought.layout.TableLayoutConstants
BOTTOM, CENTER, FILL, FULL, LEADING, LEFT, MINIMUM, PREFERRED, RIGHT, TOP, TRAILING
 
Constructor Summary
TableLayoutSpaced()
          Setup TableLayout
TableLayoutSpaced(double[][] columnsAndRows)
           
TableLayoutSpaced(double[] columns, double[] rows)
          Setup TableLayout
TableLayoutSpaced(java.lang.String columns, java.lang.String rows)
          Setup TableLayout
TableLayoutSpaced(java.lang.String columns, java.lang.String rows, int topMargin, int bottomMargin, int leftMargin, int rightMargin, int interColumnSpacing, int interRowSpacing)
          Setup TableLayout
 
Method Summary
 void addLayoutComponent(java.awt.Component c, java.lang.Object s)
          Replace arguments with spacing aware values
protected  double getActualColumn(int idx)
           
 int getActualColumnWidth(int idx)
          the size of a column in pixels
 int getActualNumColumn()
          get the number of columns
 int getActualNumRow()
           
 double getActualRow(int idx)
           
 int getActualRowHeight(int idx)
          the size of a row in pixels
 double[] getColumn()
           
 double getColumn(int idx)
           
 int getColumnId(java.lang.String name)
           
 int getColumnWidth(int idx)
          the size of a column in pixels
 int getNumColumn()
          get the number of columns
 int getNumRow()
           
 double[] getRow()
           
 double getRow(int idx)
           
 int getRowHeight(int idx)
          the size of a row in pixels
 int getRowId(java.lang.String name)
           
static void main(java.lang.String[] args)
          test code
protected  void setActualColumn(int idx, double value)
           
 void setActualRow(int idx, double value)
           
 void setBottomMargin(double value)
           
 void setColumn(double[] oldArray)
           
 void setColumn(int idx, double value)
          set the column (using the TableLayout constaint values)
 void setColumnId(int idx, java.lang.String name)
           
 void setInterColumnSpacing(double value)
           
 void setInterColumnSpacing(int idx, double value)
           
 void setInterRowSpacing(double value)
           
 void setInterRowSpacing(int idx, double value)
           
 void setLeftMargin(double value)
           
 void setMargin(double value)
           
 void setRightMargin(double value)
           
 void setRow(double[] oldArray)
           
 void setRow(int idx, double value)
           
 void setRowId(int idx, java.lang.String name)
           
 void setTopMargin(double value)
           
 
Methods inherited from class info.clearthought.layout.TableLayout
addLayoutComponent, assignAbsoluteSize, assignFillSize, assignPrefMinSize, assignRelativeSize, calculateLayoutSize, calculateLayoutSize, calculateOffset, calculateSize, calculateSizeAndOffset, deleteColumn, deleteCr, deleteRow, getComponentOrientation, getConstraints, getHGap, getInvalidEntry, getLayoutAlignmentX, getLayoutAlignmentY, getOverlappingEntry, getVGap, init, insertColumn, insertCr, insertRow, invalidateLayout, layoutContainer, maximumLayoutSize, minimumLayoutSize, preferredLayoutSize, removeLayoutComponent, setConstraints, setCr, setCr, setHGap, setVGap, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SOURCECODE_VERSION

public static final java.lang.String SOURCECODE_VERSION
Standard variable for determining version of a class file.

See Also:
Constant Field Values
Constructor Detail

TableLayoutSpaced

public TableLayoutSpaced()
Setup TableLayout


TableLayoutSpaced

public TableLayoutSpaced(java.lang.String columns,
                         java.lang.String rows,
                         int topMargin,
                         int bottomMargin,
                         int leftMargin,
                         int rightMargin,
                         int interColumnSpacing,
                         int interRowSpacing)
Setup TableLayout

Parameters:
columns -
rows -

TableLayoutSpaced

public TableLayoutSpaced(java.lang.String columns,
                         java.lang.String rows)
Setup TableLayout

Parameters:
columns -
rows -

TableLayoutSpaced

public TableLayoutSpaced(double[] columns,
                         double[] rows)
Setup TableLayout

Parameters:
columns -
rows -

TableLayoutSpaced

public TableLayoutSpaced(double[][] columnsAndRows)
Parameters:
columnsAndRows -
Method Detail

addLayoutComponent

public void addLayoutComponent(java.awt.Component c,
                               java.lang.Object s)
Replace arguments with spacing aware values

Specified by:
addLayoutComponent in interface java.awt.LayoutManager2
Overrides:
addLayoutComponent in class info.clearthought.layout.TableLayout

getNumColumn

public int getNumColumn()
get the number of columns

Overrides:
getNumColumn in class info.clearthought.layout.TableLayout

getActualNumColumn

public int getActualNumColumn()
get the number of columns


setColumn

public void setColumn(int idx,
                      double value)
set the column (using the TableLayout constaint values)

Overrides:
setColumn in class info.clearthought.layout.TableLayout

getColumn

public double getColumn(int idx)
Overrides:
getColumn in class info.clearthought.layout.TableLayout

setColumn

public void setColumn(double[] oldArray)
Overrides:
setColumn in class info.clearthought.layout.TableLayout

setActualColumn

protected void setActualColumn(int idx,
                               double value)

getActualColumn

protected double getActualColumn(int idx)

getColumn

public double[] getColumn()
Overrides:
getColumn in class info.clearthought.layout.TableLayout

getNumRow

public int getNumRow()
Overrides:
getNumRow in class info.clearthought.layout.TableLayout

getActualNumRow

public int getActualNumRow()

setRow

public void setRow(int idx,
                   double value)
Overrides:
setRow in class info.clearthought.layout.TableLayout

getRow

public double getRow(int idx)
Overrides:
getRow in class info.clearthought.layout.TableLayout

setActualRow

public void setActualRow(int idx,
                         double value)

getActualRow

public double getActualRow(int idx)

setRow

public void setRow(double[] oldArray)
Overrides:
setRow in class info.clearthought.layout.TableLayout

getRow

public double[] getRow()
Overrides:
getRow in class info.clearthought.layout.TableLayout

setMargin

public void setMargin(double value)

setLeftMargin

public void setLeftMargin(double value)

setRightMargin

public void setRightMargin(double value)
Parameters:
value -

setTopMargin

public void setTopMargin(double value)
Parameters:
value -

setBottomMargin

public void setBottomMargin(double value)
Parameters:
value -

setInterColumnSpacing

public void setInterColumnSpacing(int idx,
                                  double value)
Parameters:
idx -
value -

setInterColumnSpacing

public void setInterColumnSpacing(double value)
Parameters:
value -

setInterRowSpacing

public void setInterRowSpacing(int idx,
                               double value)
Parameters:
idx -
value -

setInterRowSpacing

public void setInterRowSpacing(double value)
Parameters:
value -

getColumnWidth

public int getColumnWidth(int idx)
the size of a column in pixels


getActualColumnWidth

public int getActualColumnWidth(int idx)
the size of a column in pixels


getRowHeight

public int getRowHeight(int idx)
the size of a row in pixels


getActualRowHeight

public int getActualRowHeight(int idx)
the size of a row in pixels


setColumnId

public void setColumnId(int idx,
                        java.lang.String name)

getColumnId

public int getColumnId(java.lang.String name)

setRowId

public void setRowId(int idx,
                     java.lang.String name)

getRowId

public int getRowId(java.lang.String name)

main

public static void main(java.lang.String[] args)
test code

Parameters:
args -


Copyright © 2010. All Rights Reserved.