|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectpagelayout.Cell
pagelayout.CellContainer
public abstract class CellContainer
The class CellContainer is the (abstract) superclass of
the classes
Column and
Row
in which the elements are
arranged sequentially in the vertical or horizontal direction.
Components, gaps, or Cell objects can be
added to a row or column by using the
add methods of this class.
Cell,
Column,
Row| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class pagelayout.Cell |
|---|
Cell.Constraint |
| Field Summary | |
|---|---|
protected CellVector |
cells
The collection of cells in a Vector of Cell objects. |
protected int |
halignment
The horizontal alignment parameter. |
protected java.util.Vector<java.lang.Integer> |
parallelAlignment
|
protected int |
valignment
The vertical alignment parameter. |
| Fields inherited from class pagelayout.Cell |
|---|
BASELINE, BOTTOM, boundSpring, CENTER, constraint, filledSizeX, filledSizeY, fixMaxSize, FOUND_NOTREPLACED, FOUND_REPLACED, halign, JUSTIFIED, LEFT, links, MAX, NEWROW, NO_ALIGNMENT, NOT_FOUND, RIGHT, SKIP, TOP, valign |
| Constructor Summary | |
|---|---|
CellContainer(int halignment,
int valignment,
boolean isRow)
Creates a CellContainer with the given alignment specifications and orientation. |
|
| Method Summary | |
|---|---|
CellContainer |
add(Cell... cellarray)
Adds cells to the cell-container. |
CellContainer |
add(java.awt.Component... components)
Adds a components to this cell-container. |
CellContainer |
add(java.awt.Component component,
int horizontalGap,
int verticalGap)
Adds a component to this cell-container with specified gaps around the component. |
CellContainer |
add(int gap)
Adds a fixed gap to the cell-container. |
CellContainer |
add(int align,
Cell... cellarray)
Adds cells to the cell-container with specified alignment that may be different from the alignment for the container. |
CellContainer |
add(int align,
java.awt.Component... components)
Adds components to the cell-container with specified alignment that may be different from the alignment for the container. |
CellContainer |
add(int minGap,
int preferredGap,
int maxGap)
Adds a flexible gap to the cell-container. |
void |
addComponentsToContainer(java.awt.Container container)
Recursively calls the addComponentsToContainer
method of each cell within this row or column to add the components of the cells
to the container of the type java.awt.Container . |
void |
changeAlignment(int halign,
int valign)
|
void |
clear()
|
abstract BoundSpring |
computeBoundSpring()
The abstract method for computing the BoundSpring of the
cell-container. |
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. |
Cell |
getChildAt(int index)
Return the cell associated with the given index within this cell-container , with the first cell corresponding the the zero'th index. |
protected int |
getParallelAlignment(int i)
|
protected abstract boolean |
isHorizontal()
Returns true if this container is a row. |
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. |
static int |
limitAlignment(int x,
boolean isRow)
|
int |
numberOfChildren()
Returns the number of elements contained in this row or column. |
boolean |
replaceChild(int index,
Cell newCell,
java.awt.Container parent)
Replace the cell at the specified index with a new cell. |
java.lang.String |
toString()
Returns a string representation of this object. |
void |
xmlserialize(XMLPrintStream out,
ComponentXMLSerializer c)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected int valignment
protected int halignment
protected CellVector cells
Vector of Cell objects.
protected java.util.Vector<java.lang.Integer> parallelAlignment
| Constructor Detail |
|---|
public CellContainer(int halignment,
int valignment,
boolean isRow)
halignment - the horizontal alignment parameter.valignment - the vertical alignment parameter.isRow - true if this cell-container is a row, false if column.| Method Detail |
|---|
protected abstract boolean isHorizontal()
true if this container is a row.
true for a row, and false for a column.public abstract BoundSpring computeBoundSpring()
BoundSpring of the
cell-container.
computeBoundSpring in class Cellpublic CellContainer add(java.awt.Component... components)
components - the components to be added.
add may be made in a single statement.
public CellContainer add(int align,
java.awt.Component... components)
align - the alignment of the components to be added.
This overrides the default alignment of the row or column.
For a row, it is the
vertical alignment and for a column it is the horizontal alignment.components - the components to be added.
add may be made in a single statement.protected int getParallelAlignment(int i)
public CellContainer add(java.awt.Component component,
int horizontalGap,
int verticalGap)
component - the component to be added.horizontalGap - the width of empty strip to add around the vertical edges of the component.verticalGap - the height of empty strip to add around the horizontal edges of the component.
add may be made in a single statement.public CellContainer add(int gap)
gap - the length of the gap to be added.
add may be made in a single statement.
public CellContainer add(int minGap,
int preferredGap,
int maxGap)
minGap - the minimum length of the gap to be added.preferredGap - the preferred length of the gap to be added.maxGap - the maximum length of the gap to be added.
add may be made in a single statement.public CellContainer add(Cell... cellarray)
cellarray - the Cell objects to be added.
add may be made in a single statement.
public CellContainer add(int align,
Cell... cellarray)
align - the alignment of the cells to be added.
This overrides the default alignment for the column or row.
For a row, it is the
vertical alignment and for a column it is the horizontal alignment.cellarray - the Cell objects to be added.
add may be made in a single statement.
public static int limitAlignment(int x,
boolean isRow)
public java.lang.String toString()
toString in class java.lang.Objectpublic void addComponentsToContainer(java.awt.Container container)
addComponentsToContainer
method of each cell within this row or column to add the components of the cells
to the container of the type java.awt.Container .
addComponentsToContainer in class Cellcontainer - the container to which the components of the cells need to be added.public int numberOfChildren()
numberOfChildren in class Cellpublic Cell getChildAt(int index)
getChildAt in class Cellindex - the index of the cell to be returned.
public boolean replaceChild(int index,
Cell newCell,
java.awt.Container parent)
replaceChild in class Cellindex - the index of the cell to be replaced.newCell - the cell that replaces the current cell at the specified index.parent - the container (java.awt.Container) in which the components of the cells are placed.
true if the replacement was successful, otherwise false.
public void changeAlignment(int halign,
int valign)
public int getAlignment(int coord,
int defaultValue)
CellRow and
Column
during layout of the elements to determine if the alignment
of this cell overrides the default alignment for the container.
getAlignment in class Cellcoord - the direction: 0 for for horizontal alignment, 1 for
vertical alignment.defaultValue - the default alignment for the row or column.
defaultValue if the alignment has not
been specified for this cell to override the default, or the
specified alignment.
protected void layout(int x,
int y,
int width,
int height)
CellsetBounds 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.
layout in class Cellx - 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.
public void xmlserialize(XMLPrintStream out,
ComponentXMLSerializer c)
xmlserialize in class Cellpublic void clear()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||