uk.co.westhawk.tablelayout
Class TableLoc

java.lang.Object
  extended by uk.co.westhawk.tablelayout.TableLoc

public class TableLoc
extends java.lang.Object

The TableLayout Manager keeps its layout description as a TableLoc, which contains a vector of TableLocRec and of the components. Each TableLocRec defines the component's location information (the row, col, spans, and layout options like justification and sizing controls). The layout describes where components may be placed if and when they become layout-ed. The layout is created from a string by the TableLocRec constructor.

See Also:
TableLayout, TableLocRec

Constructor Summary
TableLoc()
           
 
Method Summary
 void addElement(TableLoc loc)
          Adds a TableLoc vector
 void addElement(TableLocRec rec, java.awt.Component comp)
          Adds a component with its layout
 java.lang.Object clone()
          Creates a clone of the object.
 java.awt.Component compElementAt(int index)
          Returns the component on a given position
 TableLocRec element(java.awt.Component w)
          Returns the TableLocRec layout information of a given component
 int numCols()
          Returns the number of columns of the layout
 int numRows()
          Returns the number of rows of the layout
 void qsort(int left, int right, boolean do_col)
          Sorts the colums of row to their position
 TableLocRec recElementAt(int index)
          Returns the TableLocRec layout information on a given position
 void removeElement(java.awt.Component comp)
          Removes the information about a component
 int size()
          Returns the number of components in the layout
 void swap(int one, int two)
          Swap two cells
 java.lang.String toString()
          Returns the String representation
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TableLoc

public TableLoc()
Method Detail

addElement

public void addElement(TableLocRec rec,
                       java.awt.Component comp)
Adds a component with its layout

Parameters:
rec - the layout information of the component
comp - the component

addElement

public void addElement(TableLoc loc)
Adds a TableLoc vector

Parameters:
loc - the TableLoc vector to add

removeElement

public void removeElement(java.awt.Component comp)
Removes the information about a component

Parameters:
comp - the component

size

public int size()
Returns the number of components in the layout


recElementAt

public TableLocRec recElementAt(int index)
Returns the TableLocRec layout information on a given position

Parameters:
index - the index of the information

compElementAt

public java.awt.Component compElementAt(int index)
Returns the component on a given position

Parameters:
index - the index of the information

element

public TableLocRec element(java.awt.Component w)
Returns the TableLocRec layout information of a given component

Parameters:
w - the component

numCols

public int numCols()
Returns the number of columns of the layout


numRows

public int numRows()
Returns the number of rows of the layout


qsort

public void qsort(int left,
                  int right,
                  boolean do_col)
Sorts the colums of row to their position

Parameters:
left - left element
right - right element
do_col - are these columns?

swap

public void swap(int one,
                 int two)
Swap two cells

Parameters:
one - cell no. 1
two - cell no. 2

clone

public java.lang.Object clone()
Creates a clone of the object. A new instance is allocated and all the variables of the class are cloned

Overrides:
clone in class java.lang.Object

toString

public java.lang.String toString()
Returns the String representation

Overrides:
toString in class java.lang.Object