pagelayout
Class Cell

java.lang.Object
  extended by pagelayout.Cell
Direct Known Subclasses:
CardCell, CellContainer, CellGrid, ComponentCell, Gap, PanelCell, TabbedPaneCell

public abstract class Cell
extends java.lang.Object

Cells and the associated objects of the class BoundSpring, which encapsulates the geometrical characteristics of a cell, are the two fundamental type of objects that form the basis for the method used by PageLayout to layout components within a container.

The methods of this class and its subclasses allow the relative location of the components to be modeled as a set of nested cells that form a tree with a top level cell as its root. The leaves of this tree are only of two types: gaps, which are just empty boxes which may or may not be rigid, and component cells, which are cells containing components (objects of the type java.awt.Component ). We call these the primitive cells, as opposed to composite cells that contain other cells. Using the methods of the BoundSpring class, each composite cell computes its BoundSpring from the BoundSprings of its children. Note that the BoundSpring for each cell can be computed once and for all immediately after the tree of the cells has been constructed( or modified), and, for this computation, there is no need for any information on the size of the container on which the components have to be ultimately laid out.

Whereas the computation of the BoundSpring of a composite cell is based on the BoundSprings of its children, during the layout process, the size of the rectangle within which a cell is laid out is determined by its parent. Once the size of the rectangle of the container is known, the top level cell computes the part of the rectangle that it will use for drawing itself based upon its BoundSpring, and then computes the sizes and locations of the rectangles that will be assigned to its children. This process is recursively applied to descending levels of the tree and terminates when each of the cells in the tree has been assigned a rectangle within the container in which to draw itself.

Any classes that extend this class should at a minimum implement the following methods: Depending upon the behavior that they model, the subclasses may also override the following methods of this class.


Nested Class Summary
protected static class Cell.Constraint
           
 
Field Summary
static int BASELINE
          Constant for specifying Baseline alignment (for rows).
static int BOTTOM
          Constant for specifying bottom justified vertical alignment.
protected  BoundSpring boundSpring
           
static int CENTER
          Constant for specifying center justified alignment.
protected  Cell.Constraint constraint
           
protected  int filledSizeX
           
protected  int filledSizeY
           
protected  boolean fixMaxSize
           
static int FOUND_NOTREPLACED
          Returned by replaceCell when the cell to replaced is found but could not be replaced.
static int FOUND_REPLACED
          Returned by replaceCell when the cell to replaced is found and successfully replaced.
protected  byte halign
           
static int JUSTIFIED
          Constant for specifying fully justified alignment.
static int LEFT
          Constant for specifying left justified horizontal alignment.
protected  java.util.Vector<PageLayout.ContainerSizeLink> links
           
static int MAX
          Constant used for especifying maximum length of a gap with maximum flexibility.
protected static Cell NEWROW
           
static int NO_ALIGNMENT
          Constant for specifying no alignment.
static int NOT_FOUND
          Returned by replaceCell when the cell to be replaced is not found.
static int RIGHT
          Constant for specifying right justified horizontal alignment.
protected static Cell SKIP
           
static int TOP
          Constant for specifying top justified vertical alignment.
protected  byte valign
           
 
Constructor Summary
Cell()
          Creates a cell object.
 
Method Summary
protected static void addArgs(CellContainer c, java.lang.Object... o)
           
 void addComponentsToContainer(java.awt.Container container)
          This method may be over-ridden to add components to the container in all the subclasses whose instances may contain components.
 void alignBaseline(java.awt.Component... components)
          Aligns components along the baseline.
protected  void alignBaseline(ComponentCell[] cells, int n)
           
static void checkArgs(java.lang.String method, java.lang.Object... o)
           
abstract  BoundSpring computeBoundSpring()
          Should be implemented by all the subclasses to compute the two-dimensional spring associated with the cell.
 PageLayout createLayout(java.awt.Container container)
          Creates the PageLayout object for the specified container, and sets it be the layout manager for the container.
protected  void dupConstraint(Cell c)
           
abstract  Cell duplicate(ComponentDuplicator c)
           
 int getAlignment(int coord, int defaultValue)
          Used by Row and Column during layout of the elements to determine if the alignment of this cell overrides the default alignment for the container.
 int getBaseline()
          Returns the baseline of a cell.
 BoundSpring getBoundSpring()
          Returns the two-dimensional spring associated with the cell.
 Cell getCellByName(java.lang.String name)
          Recursively traverses the tree of cells formed with this cell as the root to retrieve the cell with the given name.
 Cell getChildAt(int index)
          Should be over-ridden by sub-classes that contain child-cells to return the child associated with the given index, or null if the index is out of bounds.
 java.awt.Component getComponent()
          If this cell is a component cell, this method returns the enclosed component.
 ComponentCell getComponentCell()
           
 ComponentCell getComponentCell(java.awt.Component component)
          Recursively traverses the tree of cells formed with this cell as the root to retrieve the cell containing the given component.
protected  Cell.Constraint getConstraint()
          Used internally by the Row and Column objects for imposing the constraints created by the calls to the linkWidth and linkHeight methods.
 java.awt.Container getContainer()
           
static int getDim(java.awt.Dimension d, int coord)
           
 int getFilledSizeX()
           
 int getFilledSizeY()
           
 java.lang.String getName()
          Returns the name of the cell if it has been given one, otherwise null.
 Cell getParent()
           
 Cell getRootCell()
           
static java.awt.Dimension getSize(java.awt.Component component, int type)
          Depending upon the value of the second parameter, returns the minimum, preferred or the maximum size of the given component.
 void invalidate()
          Invalidates the tree formed with this cell as the root.
protected static boolean isCell(java.lang.Object obj)
           
protected static boolean isCellOrComponent(java.lang.Object obj)
           
 boolean isComponentCell()
          Returns true if this cell encloses a component.
 boolean isFixedHeight(java.awt.Component component)
          Returns true if the height of the component can change if the size of the container allows it.
 boolean isFixedSize(java.awt.Component component)
          Returns true if the width or height of a component can change if the size of the container allows it.
 boolean isFixedWidth(java.awt.Component component)
          Returns true if the width of a component can change if the size of the container allows it.
protected  void layout(int x, int y, int width, int height)
          This method of the top level cell is called by the layout manager whenever the container calls the manager to layout the components within it.
 void linkHeight(java.awt.Component anchor, java.awt.Component[] components, double factor)
          Deprected.
 void linkHeight(java.awt.Component anchor, java.awt.Component[] components, double[] factors)
          This method may be used to constrain the heights of a set of components in a cell to be specified fractions of the height of a specified component.The component cells containing the anchor and the components must all be the immediate children of the same parent.
 void linkHeight(java.awt.Component anchor, double factor, java.awt.Component... components)
          This method may be used to constrain the heights of a set of components in a cell to be specified fractions of the width of a specified component.The component cells containing the anchor and the components must all be the immediate children of the same parent.
 void linkToContainerHeight(java.awt.Component[] components, double[][] affineConstants)
           
 void linkToContainerWidth(java.awt.Component[] components, double[][] affineConstants)
           
 void linkWidth(java.awt.Component anchor, java.awt.Component[] components, double factor)
          Deprecated.
 void linkWidth(java.awt.Component anchor, java.awt.Component[] components, double[] factors)
          This method may be used to constrain the widths of a set of components in a cell to be specified fractions of the width of a specified component.The component cells containing the anchor and the components must all be the immediate children of the same parent.
 void linkWidth(java.awt.Component anchor, double factor, java.awt.Component... components)
          This method may be used to constrain the widths of a set of components in a cell to be specified fractions of the width of a specified component, the anchor.
 int numberOfChildren()
          Should be over-ridden by sub-classes that contain child-cells to return the number of children that the object has.
 java.awt.Container removeAllComponents(java.awt.Container parent)
          Recursively traverses the tree of cells formed with this cell as the root to remove all the cells that contain only components.
 void removeComponent(java.awt.Component component)
          Removes, from the tree that has this cell as the root, the component cell that contains the given component.
 int replaceCell(Cell currentCell, Cell newCell, java.awt.Container parent)
          Replaces an existing cell by a new cell.
 boolean replaceChild(int index, Cell newCell, java.awt.Container parent)
          Should be over-ridden by sub-classes that contain child-cells to replace the child associated with the given index by the new cell.
protected  void setAlignment(int coord, int align)
          Used by CellContianer to set the alignment of the elements of the rows and columns which overrides the default alignment of these containers.
static void setBounds(Cell cell, int x, int y, int w, int h)
           
protected  void setBounds(int x, int y, int width, int height)
          This method does nothing here, but all the subclasses must over-ride it to layout, within the specified rectangle of the container, the components which they or their children enclose.
 void setComponentGaps(int hgap, int vgap)
          Sets the size of the empty area around a component.
static void setDim(java.awt.Dimension d, int coord, int value)
           
 void setFixedHeight(boolean fixed, Cell... cells)
          Depending upon the value of the first parameter sets the height of a set of cells to be fixed or changeable if the space allows it.
 void setFixedHeight(boolean fixed, java.awt.Component... components)
           Depending upon the value of the first parameter sets the height of a set of components to be fixed or changeable if the space allows it.
 void setFixedHeight(Cell[] cells, boolean fixed)
          Depending upon the value of the second parameter sets the height of a set of cells to be fixed or changeable if the space allows it.
 void setFixedHeight(java.awt.Component[] components, boolean fixed)
           Depending upon the value of the first parameter sets the height of a set of components to be fixed or changeable if the space allows it.
 void setFixedHeight(java.awt.Component component, boolean fixed)
          Depending upon the value of the second parameter sets the height of a component to be fixed or changeable if the space allows it.
 void setFixedSize(boolean fixed, java.awt.Component... components)
          Depending upon the value of the first parameter sets the size of a component to be fixed or changeable if the space allows it.
 void setFixedSize(java.awt.Component[] components, boolean fixed)
          Depending upon the value of the second parameter sets the size of a component to be fixed or changeable if the space allows it.
 void setFixedSize(java.awt.Component component, boolean fixed)
          Depending upon the value of the second parameter sets the size of a component to be fixed or changeable if the space allows it.
 void setFixedWidth(boolean fixed, Cell... cells)
          Depending upon the value of the first parameter sets the width of a set of cells to be fixed or changeable if the space allows it.
 void setFixedWidth(boolean fixed, java.awt.Component... components)
          Depending upon the value of the first parameter sets the width of a set of components to be fixed or changeable if the space allows it.
 void setFixedWidth(Cell[] cells, boolean fixed)
          Depending upon the value of the second parameter sets the width of a set of cells to be fixed or changeable if the space allows it.
 void setFixedWidth(java.awt.Component[] components, boolean fixed)
          Depending upon the value of the second parameter sets the width of a set of components to be fixed or changeable if the space allows it.
 void setFixedWidth(java.awt.Component component, boolean fixed)
          Depending upon the value of the second parameter sets the width of a component to be fixed or changeable if the space allows it.
 void setName(java.lang.String name)
          Specifies an identifier for the cell.
protected  void setParent(Cell cell)
           
static void setSize(java.awt.Component component, java.awt.Dimension dimension, int type)
          Depending upon the value of the third parameter, sets the minimum, preferred or the maximum size of the given component to the specified value.
 void setVisible(boolean flag)
          Shows or hides all the components in the cells rooted at this cell.
abstract  void xmlserialize(XMLPrintStream output, ComponentXMLSerializer c)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX

public static final int MAX
Constant used for especifying maximum length of a gap with maximum flexibility.

See Also:
Constant Field Values

NO_ALIGNMENT

public static final int NO_ALIGNMENT
Constant for specifying no alignment. Same as TOP or LEFT.

See Also:
Constant Field Values

TOP

public static final int TOP
Constant for specifying top justified vertical alignment.

See Also:
Constant Field Values

CENTER

public static final int CENTER
Constant for specifying center justified alignment.

See Also:
Constant Field Values

BOTTOM

public static final int BOTTOM
Constant for specifying bottom justified vertical alignment.

See Also:
Constant Field Values

LEFT

public static final int LEFT
Constant for specifying left justified horizontal alignment.

See Also:
Constant Field Values

RIGHT

public static final int RIGHT
Constant for specifying right justified horizontal alignment.

See Also:
Constant Field Values

JUSTIFIED

public static final int JUSTIFIED
Constant for specifying fully justified alignment.

See Also:
Constant Field Values

BASELINE

public static final int BASELINE
Constant for specifying Baseline alignment (for rows).

See Also:
Constant Field Values

FOUND_REPLACED

public static final int FOUND_REPLACED
Returned by replaceCell when the cell to replaced is found and successfully replaced.

See Also:
Constant Field Values

NOT_FOUND

public static final int NOT_FOUND
Returned by replaceCell when the cell to be replaced is not found.

See Also:
Constant Field Values

FOUND_NOTREPLACED

public static final int FOUND_NOTREPLACED
Returned by replaceCell when the cell to replaced is found but could not be replaced.

See Also:
Constant Field Values

boundSpring

protected BoundSpring boundSpring

halign

protected byte halign

valign

protected byte valign

filledSizeX

protected int filledSizeX

filledSizeY

protected int filledSizeY

fixMaxSize

protected boolean fixMaxSize

links

protected java.util.Vector<PageLayout.ContainerSizeLink> links

constraint

protected Cell.Constraint constraint

NEWROW

protected static final Cell NEWROW

SKIP

protected static final Cell SKIP
Constructor Detail

Cell

public Cell()
Creates a cell object. Since this class is abstract, it can be called only by the classes that extend it.

Method Detail

setParent

protected void setParent(Cell cell)

getParent

public Cell getParent()

getRootCell

public Cell getRootCell()

setAlignment

protected void setAlignment(int coord,
                            int align)
Used by CellContianer to set the alignment of the elements of the rows and columns which overrides the default alignment of these containers.

Parameters:
coord - the direction: 0 for for horizontal alignment, 1 for vertical alignment.
align - the alignment.

getAlignment

public int getAlignment(int coord,
                        int defaultValue)
Used by Row and Column during layout of the elements to determine if the alignment of this cell overrides the default alignment for the container.

Parameters:
coord - the direction: 0 for for horizontal alignment, 1 for vertical alignment.
defaultValue - the default alignment for the row or column.
Returns:
defaultValue if the alignment has not been specified for this cell to override the default, or the specified alignment.

createLayout

public PageLayout createLayout(java.awt.Container container)
Creates the PageLayout object for the specified container, and sets it be the layout manager for the container.

Parameters:
container - the container for which the layout manager is to be created.
Returns:
The created PageLayout layout manager.

layout

protected void layout(int x,
                      int y,
                      int width,
                      int height)
This method of the top level cell is called by the layout manager whenever the container calls the manager to layout the components within it. Depending on the preferred and maximum size of the cell, appropriately modified parameters of the bounding rectangle within the container are passed to the setBounds method of this cell. In each cell, the the two-dimensional spring associated with each child is used to determine the actual layout dimension of the box within which the child is to laid out. This process continues recursively till all the components have been laid out.

Parameters:
x - the x-coordinate of the top left of the rectangle.
y - the y-coordinate of the top left of the rectangle.
width - the width of the rectangle.
height - the height of the rectangle.

setName

public void setName(java.lang.String name)
Specifies an identifier for the cell. If each cell is given a unique name, the identifier may be used to extract the associated cell by name by calling getCellByName method of the top level cell.

Parameters:
name - the specified identifier for the cell.

getName

public java.lang.String getName()
Returns the name of the cell if it has been given one, otherwise null.

Returns:
The name of the cell.

addComponentsToContainer

public void addComponentsToContainer(java.awt.Container container)
This method may be over-ridden to add components to the container in all the subclasses whose instances may contain components. This method is called when the PageLayout is first constructed, but may also be called whenever a new component is added via the replaceCell method of this class. Even in the later case, there is no need to call this method directly.

Parameters:
container - the java.awt.Container object to which the components should be added.

setBounds

protected void setBounds(int x,
                         int y,
                         int width,
                         int height)
This method does nothing here, but all the subclasses must over-ride it to layout, within the specified rectangle of the container, the components which they or their children enclose. This method is called every time the container calls the layout manager to layout the components within it.

Parameters:
x - the x-coordinate of the top left of the rectangle.
y - the y-coordinate of the top left of the rectangle.
width - the width of the rectangle.
height - the height of the rectangle.

computeBoundSpring

public abstract BoundSpring computeBoundSpring()
Should be implemented by all the subclasses to compute the two-dimensional spring associated with the cell.

Returns:
The computed two-dimensional spring.

getBoundSpring

public BoundSpring getBoundSpring()
Returns the two-dimensional spring associated with the cell. If the cell has been invalidated, the spring is recomputed.

Returns:
The two-dimensional spring associated with the cell.

invalidate

public void invalidate()
Invalidates the tree formed with this cell as the root. This should be called whenever any cell in the root has been replaced or removed so that the two-dimensional springs associated with cells are recomputed when subsequently needed.


getChildAt

public Cell getChildAt(int index)
Should be over-ridden by sub-classes that contain child-cells to return the child associated with the given index, or null if the index is out of bounds.

Parameters:
index - the index of the cell that is needed.
Returns:
The cell at the given index if it exists or null otherwise.

numberOfChildren

public int numberOfChildren()
Should be over-ridden by sub-classes that contain child-cells to return the number of children that the object has.

Returns:
The number of child cells that this cell has.

getCellByName

public Cell getCellByName(java.lang.String name)
Recursively traverses the tree of cells formed with this cell as the root to retrieve the cell with the given name. Returns null if no such cell is found. Note that it is upto the user to associate unique names with cells.

Parameters:
name - the name of the cell (as specified in setName) to be retrieved.
Returns:
The cell with the given name, and null if no such cell exists.

getComponent

public java.awt.Component getComponent()
If this cell is a component cell, this method returns the enclosed component. Otherwise null is returned.

Returns:
The component enclosed within this cell, null if none exists.

getComponentCell

public ComponentCell getComponentCell(java.awt.Component component)
Recursively traverses the tree of cells formed with this cell as the root to retrieve the cell containing the given component. Returns null if no such cell is found.

Parameters:
component - the component within the cell to be retrieved.
Returns:
The cell enclosing the given component, and null if no such cell exists.

replaceChild

public boolean replaceChild(int index,
                            Cell newCell,
                            java.awt.Container parent)
Should be over-ridden by sub-classes that contain child-cells to replace the child associated with the given index by the new cell.

Parameters:
index - the index of the cell that is to be replaced.
newCell - the new cell that replaces the current cell at the specified index.
parent - the container in which the components of the cells are placed.
Returns:
true if the replacement was successful, otherwise false.

isComponentCell

public boolean isComponentCell()
Returns true if this cell encloses a component.

Returns:
true if this cell encloses a component, false otherwise.

removeComponent

public void removeComponent(java.awt.Component component)
Removes, from the tree that has this cell as the root, the component cell that contains the given component. Does nothing if no cell containg the given component is found in the tree.

Parameters:
component - the component within the cell to be removed.

replaceCell

public int replaceCell(Cell currentCell,
                       Cell newCell,
                       java.awt.Container parent)
Replaces an existing cell by a new cell. If the first argument is null, and this cell is a row or a column, the newCell is added to this cell.

Parameters:
currentCell - current cell that is to be replaced.
newCell - the new cell that replaces the current cell at the specified index.
parent - the container in which the components of the cells are placed.
Returns:
NOT_FOUND if the currentCell was not found, FOUND_NOTREPLACED if it was found but could not be replaced, and FOUND_REPLACED if it was found and successfully replaced.

getSize

public static java.awt.Dimension getSize(java.awt.Component component,
                                         int type)
Depending upon the value of the second parameter, returns the minimum, preferred or the maximum size of the given component.

Parameters:
component - the component whose size is to be retrieved.
type - 0 for retrieving the minimum size, 1 for retrieving the maximum size, and any other number for retrieving the preferred size.
Returns:
The minimum, preferred or the maximum size of the component.

setSize

public static void setSize(java.awt.Component component,
                           java.awt.Dimension dimension,
                           int type)
Depending upon the value of the third parameter, sets the minimum, preferred or the maximum size of the given component to the specified value.

Parameters:
component - the component whose size needs to be reset.
dimension - the new dimension of the component.
type - 0 for setting the minimum size, 1 for setting the maximum size, and any other number for setting the preferred size.

removeAllComponents

public java.awt.Container removeAllComponents(java.awt.Container parent)
Recursively traverses the tree of cells formed with this cell as the root to remove all the cells that contain only components.

Parameters:
parent - the container in which the components are placed. If it is null, the parent is retrieved from the first component that is found in the tree.
Returns:
The parent of the removed components.

linkHeight

public void linkHeight(java.awt.Component anchor,
                       java.awt.Component[] components,
                       double factor)
Deprected. Use linkHeight(Component, double,Component...).

Parameters:
anchor - the component whose height determines the height of the other components.
components - the array of components whose height is linked to the height of the anchor.
factor - numerical factor linking the heights of the components to the height of the anchor. Thus the height of each of the component is constrained to be the fraction factor of the height of the anchor.

linkHeight

public void linkHeight(java.awt.Component anchor,
                       double factor,
                       java.awt.Component... components)
This method may be used to constrain the heights of a set of components in a cell to be specified fractions of the width of a specified component.The component cells containing the anchor and the components must all be the immediate children of the same parent. If anchor height is fixed, the heights of the components are also set to be fixed to be the specified fraction of the height of the anchor. Otherwise the minimum, maximum, and preferred heights of the components are set to be the specified fraction of the corresponding heights of the anchor.

Parameters:
anchor - the component whose height determines the height of the other components.
factor - numerical factor linking the heights of the components to the height of the anchor. Thus the height of each of the component is constrained to be the fraction factor of the height of the anchor.
components - the array of components whose height is linked to the height of the anchor.

linkWidth

public void linkWidth(java.awt.Component anchor,
                      java.awt.Component[] components,
                      double factor)
Deprecated. Use linkWidth(Component, double, Component...).

Parameters:
anchor - the component whose width determines the width of the other components.
components - the array of components whose width is linked to the width of the anchor.
factor - numerical factors linking the widths of the components to the width of the anchor. Thus the width of each of the component is constrained to be the fraction factor of the width of the anchor.

linkWidth

public void linkWidth(java.awt.Component anchor,
                      double factor,
                      java.awt.Component... components)
This method may be used to constrain the widths of a set of components in a cell to be specified fractions of the width of a specified component, the anchor. The component cells containing the anchor and the components must all be the immediate children of the same parent. If anchor width is fixed, the widths of the components are also set to be fixed to be the specified fraction of the width of the anchor. Otherwise the minimum, maximum, and preferred widths of the components are set to be the specified fraction of the corresponding witdths of the anchor.

Parameters:
anchor - the component whose width determines the width of the other components.
factor - numerical factors linking the widths of the components to the width of the anchor. Thus the width of each of the component is constrained to be the fraction factor of the width of the anchor.
components - the array of components whose width is linked to the width of the anchor.

linkWidth

public void linkWidth(java.awt.Component anchor,
                      java.awt.Component[] components,
                      double[] factors)
This method may be used to constrain the widths of a set of components in a cell to be specified fractions of the width of a specified component.The component cells containing the anchor and the components must all be the immediate children of the same parent. If anchor width is fixed, the widths of the components are also set to be fixed to be the specified fraction of the width of the anchor. Otherwise the minimum, maximum, and preferred widths of the components are set to the the specified fraction of the corresponding witdths of the anchor.

Parameters:
anchor - the component whose width determines the width of the other components.
components - the array of components whose width is linked to the width of the anchor.
factors - numerical factors linking the widths of the components to the width of the anchor. Thus the width of the component components[i] is constrained to be the fraction factors[i] of the width of the anchor.

getConstraint

protected Cell.Constraint getConstraint()
Used internally by the Row and Column objects for imposing the constraints created by the calls to the linkWidth and linkHeight methods.


dupConstraint

protected void dupConstraint(Cell c)

linkHeight

public void linkHeight(java.awt.Component anchor,
                       java.awt.Component[] components,
                       double[] factors)
This method may be used to constrain the heights of a set of components in a cell to be specified fractions of the height of a specified component.The component cells containing the anchor and the components must all be the immediate children of the same parent. If anchor height is fixed, the heights of the components are also set to be fixed to be the specified fraction of the height of the anchor. Otherwise the minimum, maximum, and preferred heights of the components are set to be the specified fraction of the corresponding heights of the anchor.

Parameters:
anchor - the component whose height determines the height of the other components.
components - the array of components whose height is linked to the height of the anchor.
factors - numerical factors linking the height of the components to the height of the anchor. Thus the height of the component components[i] is constrained to be the fraction factors[i] of the height of the anchor.

getDim

public static int getDim(java.awt.Dimension d,
                         int coord)

setDim

public static void setDim(java.awt.Dimension d,
                          int coord,
                          int value)

setFixedWidth

public void setFixedWidth(java.awt.Component component,
                          boolean fixed)
Depending upon the value of the second parameter sets the width of a component to be fixed or changeable if the space allows it.

Parameters:
component - The component to be modfied
fixed - If true the horizontal spring of the component is modified to be fixed. Otherwise it's modified to be flexible.

setFixedWidth

public void setFixedWidth(java.awt.Component[] components,
                          boolean fixed)
Depending upon the value of the second parameter sets the width of a set of components to be fixed or changeable if the space allows it. Deprected. Use setFixedWidth(boolean, Component...).

Parameters:
components - The array of components to be modfied
fixed - If true the horizontal springs of the components are modified to be fixed. Otherwise they are modified to be flexible.

setFixedWidth

public void setFixedWidth(boolean fixed,
                          java.awt.Component... components)
Depending upon the value of the first parameter sets the width of a set of components to be fixed or changeable if the space allows it.

Parameters:
fixed - If true the horizontal springs of the components are modified to be fixed. Otherwise they are modified to be flexible.
components - The components to be modfied

setFixedHeight

public void setFixedHeight(java.awt.Component component,
                           boolean fixed)
Depending upon the value of the second parameter sets the height of a component to be fixed or changeable if the space allows it.

Parameters:
component - The component to be modfied
fixed - If true the vertical spring of the component is modified to be fixed. Otherwise it's modified to be flexible.

setFixedHeight

public void setFixedHeight(java.awt.Component[] components,
                           boolean fixed)

Depending upon the value of the first parameter sets the height of a set of components to be fixed or changeable if the space allows it. Deprecated. Use setFixedHeight(boolean,Component... components).

Parameters:
components - The array of components to be modfied
fixed - If true the vertical springs of the components are modified to be fixed. Otherwise they are modified to be flexible.

setFixedHeight

public void setFixedHeight(boolean fixed,
                           java.awt.Component... components)

Depending upon the value of the first parameter sets the height of a set of components to be fixed or changeable if the space allows it.

Parameters:
fixed - If true the vertical springs of the components are modified to be fixed. Otherwise they are modified to be flexible.
components - The array of components to be modfied

setFixedWidth

public void setFixedWidth(Cell[] cells,
                          boolean fixed)
Depending upon the value of the second parameter sets the width of a set of cells to be fixed or changeable if the space allows it. Deprecated. Use setFixedWidth(boolean,Cell...)

Parameters:
cells - The array of cells to be modfied
fixed - If true the horizontal springs of the cells are modified to be fixed. Otherwise they are modified to be flexible.

setFixedWidth

public void setFixedWidth(boolean fixed,
                          Cell... cells)
Depending upon the value of the first parameter sets the width of a set of cells to be fixed or changeable if the space allows it.

Parameters:
fixed - If true the horizontal springs of the cells are modified to be fixed. Otherwise they are modified to be flexible.
cells - The array of cells to be modfied

setFixedHeight

public void setFixedHeight(Cell[] cells,
                           boolean fixed)
Depending upon the value of the second parameter sets the height of a set of cells to be fixed or changeable if the space allows it. Deprecated. Use setFixedHeight(boolean, Cell...).

Parameters:
cells - The array of cells to be modfied
fixed - If true the vertical springs of the cells are modified to be fixed. Otherwise they are modified to be flexible.

setFixedHeight

public void setFixedHeight(boolean fixed,
                           Cell... cells)
Depending upon the value of the first parameter sets the height of a set of cells to be fixed or changeable if the space allows it. Deprecated. Use setFixedHeight(boolean, Cell...).

Parameters:
fixed - If true the vertical springs of the cells are modified to be fixed. Otherwise they are modified to be flexible.
cells - The array of cells to be modfied

setFixedSize

public void setFixedSize(java.awt.Component component,
                         boolean fixed)
Depending upon the value of the second parameter sets the size of a component to be fixed or changeable if the space allows it.

Parameters:
component - The component to be modfied
fixed - If true the horizontal and vertical springs of the component is modified to be fixed. Otherwise they are modified to be flexible.

setFixedSize

public void setFixedSize(java.awt.Component[] components,
                         boolean fixed)
Depending upon the value of the second parameter sets the size of a component to be fixed or changeable if the space allows it. Deprecated. Use setFixedSize(boolean,Component...).

Parameters:
components - The components to be modfied
fixed - If true the horizontal and vertical springs of the component is modified to be fixed. Otherwise they are modified to be flexible.

setFixedSize

public void setFixedSize(boolean fixed,
                         java.awt.Component... components)
Depending upon the value of the first parameter sets the size of a component to be fixed or changeable if the space allows it.

Parameters:
fixed - If true the horizontal and vertical springs of the component is modified to be fixed. Otherwise they are modified to be flexible.
components - The components to be modfied

isFixedHeight

public boolean isFixedHeight(java.awt.Component component)
Returns true if the height of the component can change if the size of the container allows it.

Parameters:
component - the component whose property is being queried.
Returns:
true if the height of the component may change depending upon the available space, otherwise false.

isFixedWidth

public boolean isFixedWidth(java.awt.Component component)
Returns true if the width of a component can change if the size of the container allows it.

Parameters:
component - the component whose property is being queried.
Returns:
true if the width of the component may change depending upon the available space, otherwise false.

isFixedSize

public boolean isFixedSize(java.awt.Component component)
Returns true if the width or height of a component can change if the size of the container allows it.

Parameters:
component - the component whose property is being queried.
Returns:
true if the width or height of the component may change depending upon the available space, otherwise false.

setComponentGaps

public void setComponentGaps(int hgap,
                             int vgap)
Sets the size of the empty area around a component.

Parameters:
hgap - the width of the vertical strips around the vertical edges.
vgap - the height of the horizontal strips around the horizontal edges.

getBaseline

public int getBaseline()
Returns the baseline of a cell. The baseline is defined for components which display a single line of text, and it is the distance between the baseline of the text and the upper edge of the component. In the general case, the baseline is not defined, and this method return -1. The subclasses of this class should override this method to return appropriate values.

Returns:
-1, as for the general case the baseline is not defined.
See Also:
ComponentCell.getBaseline(), Row.getBaseline(), Column.getBaseline()

alignBaseline

public void alignBaseline(java.awt.Component... components)
Aligns components along the baseline. See getBaseline for the definition of the baseline.

Parameters:
components - array of components which have to aligned. Every component which is an element of this array must be in the tree rooted at this cell. For the alignment to make any sense, the components should have been placed in the same Row or GridRow.
See Also:
getBaseline()

alignBaseline

protected void alignBaseline(ComponentCell[] cells,
                             int n)

checkArgs

public static void checkArgs(java.lang.String method,
                             java.lang.Object... o)

addArgs

protected static void addArgs(CellContainer c,
                              java.lang.Object... o)

isCell

protected static boolean isCell(java.lang.Object obj)

isCellOrComponent

protected static boolean isCellOrComponent(java.lang.Object obj)

duplicate

public abstract Cell duplicate(ComponentDuplicator c)

xmlserialize

public abstract void xmlserialize(XMLPrintStream output,
                                  ComponentXMLSerializer c)

getComponentCell

public ComponentCell getComponentCell()

getFilledSizeX

public int getFilledSizeX()

getFilledSizeY

public int getFilledSizeY()

linkToContainerHeight

public void linkToContainerHeight(java.awt.Component[] components,
                                  double[][] affineConstants)

linkToContainerWidth

public void linkToContainerWidth(java.awt.Component[] components,
                                 double[][] affineConstants)

setBounds

public static void setBounds(Cell cell,
                             int x,
                             int y,
                             int w,
                             int h)

getContainer

public java.awt.Container getContainer()

setVisible

public void setVisible(boolean flag)
Shows or hides all the components in the cells rooted at this cell.

Parameters:
flag - true if the components are to be shown, and false if they are to be hidden.