FreeHEP API
Version current

org.freehep.swing.layout
Class TableLayout

java.lang.Object
  extended byjava.awt.GridBagLayout
      extended byorg.freehep.swing.layout.TableLayout
All Implemented Interfaces:
LayoutManager, LayoutManager2, Serializable

public class TableLayout
extends GridBagLayout

This layoutmanager uses all of the GridBagLayout's managers functionality and power but allows you to set the options easily. It will construct the GridBagConstraints object for you. To use it, set the layout manager for your Container to TableLayout and add each component with a name string for which the format is specified below: "gridx gridy gridwidth gridheight ( ipadx ipady ) [ top left bottom right ] { weightx weighty} options" you may use spaces or commas as separators. gridx and gridy are mandatory, can be * for RELATIVE gridwidth and gridheight are optional, can be * for REMAINDER ipadx and ipady are optional insets (top...right) are optional weights are optional and override any settings made to them by the options options are optional Options may contain a set of characters which will set the corresponding flag to true. If not set, the flag is false. "r" right align "l" left align "t" top align "b" bottom align if none of these are set the component is placed in the center. "w" resize both cell and component in width "W" resize only cell in width "h" resize both cell and component in height "H" resize only cell in height if none of these are set neither the component nor the cell is not resized. and the extra space is put on the outside of the table. The weight is calculated as follows, if not set explicitly by the {weight} section: 1 if character set, fill is set if lowercase. You may construct a TableLayout with some default name string.

Version:
$Id: TableLayout.java,v 1.2 2003/05/14 04:10:20 duns Exp $
Author:
Mark Donszelmann
See Also:
Serialized Form
Source Code:
TableLayout.java

Nested Class Summary
static class TableLayout.TableConstraints
           
 
Field Summary
static String COLUMN
           
static String COLUMN_FILL
           
static String FULL
           
static String LEFT
           
static String NO_RESIZE
           
static String RESIZE_BOTH
           
static String RESIZE_HEIGHT
           
static String RESIZE_WIDTH
           
static String RIGHT
           
static String VERY_LEFT
           
static String VERY_RIGHT
           
 
Fields inherited from class java.awt.GridBagLayout
columnWeights, columnWidths, comptable, defaultConstraints, layoutInfo, MAXGRIDSIZE, MINSIZE, PREFERREDSIZE, rowHeights, rowWeights
 
Constructor Summary
TableLayout()
           
TableLayout(String defaultOptions)
           
 
Method Summary
 void addLayoutComponent(Component component, Object constraints)
           
 void addLayoutComponent(String name, Component component)
           
protected  GridBagConstraints getGridBagConstraints(String name)
           
static GridBagConstraints getGridBagConstraints(String name, GridBagConstraints def)
           
static void main(String[] args)
           
 String toString()
           
static String toString(GridBagConstraints c)
           
 void usage()
           
 
Methods inherited from class java.awt.GridBagLayout
adjustForGravity, AdjustForGravity, arrangeGrid, ArrangeGrid, getConstraints, getLayoutAlignmentX, getLayoutAlignmentY, getLayoutDimensions, getLayoutInfo, GetLayoutInfo, getLayoutOrigin, getLayoutWeights, getMinSize, GetMinSize, invalidateLayout, layoutContainer, location, lookupConstraints, maximumLayoutSize, minimumLayoutSize, preferredLayoutSize, removeLayoutComponent, setConstraints
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NO_RESIZE

public static final String NO_RESIZE
See Also:
Constant Field Values

RESIZE_WIDTH

public static final String RESIZE_WIDTH
See Also:
Constant Field Values

RESIZE_HEIGHT

public static final String RESIZE_HEIGHT
See Also:
Constant Field Values

RESIZE_BOTH

public static final String RESIZE_BOTH
See Also:
Constant Field Values

LEFT

public static final String LEFT
See Also:
Constant Field Values

RIGHT

public static final String RIGHT
See Also:
Constant Field Values

VERY_LEFT

public static final String VERY_LEFT
See Also:
Constant Field Values

VERY_RIGHT

public static final String VERY_RIGHT
See Also:
Constant Field Values

FULL

public static final String FULL
See Also:
Constant Field Values

COLUMN

public static final String COLUMN
See Also:
Constant Field Values

COLUMN_FILL

public static final String COLUMN_FILL
See Also:
Constant Field Values
Constructor Detail

TableLayout

public TableLayout()

TableLayout

public TableLayout(String defaultOptions)
Method Detail

usage

public void usage()

addLayoutComponent

public void addLayoutComponent(String name,
                               Component component)

addLayoutComponent

public void addLayoutComponent(Component component,
                               Object constraints)

toString

public String toString()

getGridBagConstraints

protected GridBagConstraints getGridBagConstraints(String name)

getGridBagConstraints

public static GridBagConstraints getGridBagConstraints(String name,
                                                       GridBagConstraints def)

toString

public static String toString(GridBagConstraints c)

main

public static void main(String[] args)

FreeHEP API
Version current

Copyright © 2000-2004 FreeHEP, All Rights Reserved.