tablelayout
Class TableLayout

java.lang.Object
  extended by tablelayout.TableLayout
All Implemented Interfaces:
LayoutManager

public class TableLayout
extends Object
implements LayoutManager

TableLayout is a layout manager which allows components to be arranged in a tabular form. The TableLayout component has a layout resource which is used to specify the column and row position of each component. Components can span rows and/or columns. Layout options are available to control the initial sizes, justification, and dynamic resizing

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

Constructor Summary
TableLayout()
           
 
Method Summary
 void addLayoutComponent(String name, Component comp)
          Adds the specified component with the layout string to the layout
 Object clone()
          Creates a clone of the object.
 void columnSpacing(int sp)
          Specifies the number of pixels between columns
 void forceShrink(boolean force)
          Specifies if components should be made smaller than their "preferred" sizes.
 void layoutContainer(Container target)
          Lays out the container in the specified panel
 void marginHeight(int i)
          The minimum spacing between the top and bottom edges of the components in the Container
 void marginWidth(int i)
          The minimum spacing between the left and right edges of the components in the Container
 Dimension minimumLayoutSize(Container target)
          Calculates the minimum size dimensions for the specified panel, given the components in the specified target container
 Dimension preferredLayoutSize(Container target)
          Calculates the preferred size dimensions for the specified panel, given the components in the specified target container
 void removeLayoutComponent(Component comp)
          Removes the specified component from the layout
 void rowSpacing(int sp)
          Specifies the number of pixels between rows
 void sameHeight(Vector v)
          This resource is used to specify the names of components which will be constrained to remain the same heigth as the table shrinks and grows
 void sameWidth(Vector v)
          This resource is used to specify the names of components which will be constrained to remain the same width as the table shrinks and grows
 String toString()
          Returns the String representation
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TableLayout

public TableLayout()
Method Detail

addLayoutComponent

public void addLayoutComponent(String name,
                               Component comp)
Adds the specified component with the layout string to the layout

Specified by:
addLayoutComponent in interface LayoutManager
Parameters:
layout - represents the wanted layout of the component
comp - the component to be added
See Also:
TableLocRec

removeLayoutComponent

public void removeLayoutComponent(Component comp)
Removes the specified component from the layout

Specified by:
removeLayoutComponent in interface LayoutManager
Parameters:
comp - the component to be removed

preferredLayoutSize

public Dimension preferredLayoutSize(Container target)
Calculates the preferred size dimensions for the specified panel, given the components in the specified target container

Specified by:
preferredLayoutSize in interface LayoutManager
Parameters:
target - the component to be laid out

minimumLayoutSize

public Dimension minimumLayoutSize(Container target)
Calculates the minimum size dimensions for the specified panel, given the components in the specified target container

Specified by:
minimumLayoutSize in interface LayoutManager
Parameters:
target - the component to be laid out

layoutContainer

public void layoutContainer(Container target)
Lays out the container in the specified panel

Specified by:
layoutContainer in interface LayoutManager
Parameters:
target - the component to be laid out

sameWidth

public void sameWidth(Vector v)
This resource is used to specify the names of components which will be constrained to remain the same width as the table shrinks and grows

Parameters:
v - the vector of component with the same width

sameHeight

public void sameHeight(Vector v)
This resource is used to specify the names of components which will be constrained to remain the same heigth as the table shrinks and grows

Parameters:
v - the vector of component with the same heigth

marginWidth

public void marginWidth(int i)
The minimum spacing between the left and right edges of the components in the Container

Parameters:
i - the spacing

marginHeight

public void marginHeight(int i)
The minimum spacing between the top and bottom edges of the components in the Container

Parameters:
i - the spacing

forceShrink

public void forceShrink(boolean force)
Specifies if components should be made smaller than their "preferred" sizes. The TableLayout component tries to respect the preferred geometries of its components. Components which are locked using options including any of "whWH" will continue to be excluded from stretching, but others will be stretched and then can be shrunk back to their initial preferred sizes from the time they were last managed. When the table is shrunk further, all components are shrunk an equal number of pixels until they are of size 1 (the smallest legal size of a Components). By default, this resource is true.

Parameters:
force - boolean to indicate shrink should be forced
See Also:
TableOpts

columnSpacing

public void columnSpacing(int sp)
Specifies the number of pixels between columns

Parameters:
sp - the spacing between columns

rowSpacing

public void rowSpacing(int sp)
Specifies the number of pixels between rows

Parameters:
sp - the spacing between rows

toString

public String toString()
Returns the String representation

Overrides:
toString in class Object

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


Copyright © 2000-2009 FreeHEP. All Rights Reserved.