tablelayout
Class TableLocRec

java.lang.Object
  extended by tablelayout.TableLocRec

public class TableLocRec
extends Object

This class parses the string which specifies the layout for a component. The layout string specifies the column, row, column span, row span, and options for each component. The options field is optional. The options are parsed by the TableOpts class. Components which are not named in the layout specification are positioned in column 0, row 0, with colum and row spans of 1, all the options will be false. If the layout is changed after the TableLocRec is created, then a complete re-layout is performed. Each layout specification is of the form:

 name col row [opts]
 

Version:
$Revision: 11553 $ $Date: 2007-06-05 15:06:23 -0700 (Tue, 05 Jun 2007) $
Author:
Birgit Arkesteijn
See Also:
TableLayout, TableOpts

Field Summary
 int col
          Position of column in table (>=0)
 int col_span
          Horizontal widget span (>=1)
 TableOpts options
          Justify, grow and shrink constraint options
 int orig_height
          Original heigth of the cell
 int orig_width
          Original width of the cell
 int row
          Position of row in table (>=0)
 int row_span
          Vertical widget span (>=1)
 int same_height
          The height of the cell, changed because of sameHeight constraint
 int same_width
          The width of the cell, changed because of sameWidth constraint
 
Constructor Summary
TableLocRec()
           
TableLocRec(String layout)
           
 
Method Summary
 Object clone()
          Creates a clone of the object.
static int compareColSpan(TableLocRec loc1, TableLocRec loc2)
          Compaires the span width of two columns, returns the difference in span width
static int compareRowSpan(TableLocRec loc1, TableLocRec loc2)
          Compaires the span height of two rows, returns the difference in span height
 int preferredHeight()
          Returns the preferred heigth of the layout component
 int preferredWidth()
          Returns the preferred width of the layout component
 String toString()
          Returns the String representation
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

col

public int col
Position of column in table (>=0)


row

public int row
Position of row in table (>=0)


col_span

public int col_span
Horizontal widget span (>=1)


row_span

public int row_span
Vertical widget span (>=1)


orig_width

public int orig_width
Original width of the cell


orig_height

public int orig_height
Original heigth of the cell


same_width

public int same_width
The width of the cell, changed because of sameWidth constraint


same_height

public int same_height
The height of the cell, changed because of sameHeight constraint


options

public TableOpts options
Justify, grow and shrink constraint options

See Also:
TableOpts
Constructor Detail

TableLocRec

public TableLocRec()

TableLocRec

public TableLocRec(String layout)
Parameters:
layout - the string that specifies the layout
Method Detail

clone

public 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 Object

toString

public String toString()
Returns the String representation

Overrides:
toString in class Object

compareColSpan

public static int compareColSpan(TableLocRec loc1,
                                 TableLocRec loc2)
Compaires the span width of two columns, returns the difference in span width

Parameters:
loc1 - the first column
loc2 - the second column

compareRowSpan

public static int compareRowSpan(TableLocRec loc1,
                                 TableLocRec loc2)
Compaires the span height of two rows, returns the difference in span height

Parameters:
loc1 - the first row
loc2 - the second row

preferredWidth

public int preferredWidth()
Returns the preferred width of the layout component


preferredHeight

public int preferredHeight()
Returns the preferred heigth of the layout component



Copyright © 2000-2009 FreeHEP. All Rights Reserved.