|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object pagelayout.Cell pagelayout.CardCell
public class CardCell
An object of the class CardCell
is a
collection of named cells of which only one is visible at a
given time. The method showCell
of
this class can be used to change the currently visible cell.
For an example, see CardExample
.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class pagelayout.Cell |
---|
Cell.Constraint |
Field Summary |
---|
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 | |
---|---|
CardCell()
Creates a CardCell object. |
Method Summary | |
---|---|
void |
add(java.lang.String name,
Cell cell)
Adds a cell to the CardCell . |
void |
add(java.lang.String name,
java.awt.Component component)
Adds a component to the CardCell . |
void |
addComponentsToContainer(java.awt.Container parent)
Recursively calls the addComponentsToContainer
method of each cell within the card to add the components of the cells
to the container. |
BoundSpring |
computeBoundSpring()
Computes the two-dimensional spring associated with the currently visible cell or component. |
Cell |
duplicate(ComponentDuplicator c)
|
Cell |
getChildAt(int i)
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 the currently visble cell is a component cell, this method returns the enclosed component. |
boolean |
isComponentCell()
Returns true if the currently visble cell encloses a component. |
int |
numberOfChildren()
Returns 1 , since only one cell is visible at any time. |
java.awt.Container |
removeAllComponents(java.awt.Container parent)
Calls the removeAllComponents
method for all the cells in this CardCell . |
protected void |
setBounds(int x,
int y,
int width,
int height)
Lays out the currently visble cell or component within the specified rectangle of the container. |
void |
showCell(java.lang.String name)
Changes the currently visible cell. |
void |
xmlserialize(XMLPrintStream out,
ComponentXMLSerializer c)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CardCell()
CardCell
object.
Method Detail |
---|
public void add(java.lang.String name, java.awt.Component component)
CardCell
.
name
- the identifier for the component.
The name can be used
in the call to
the method showCell
of this class to hide the currently visible component/cell
and show the component with the given name.component
- the component to be added. To addpublic void add(java.lang.String name, Cell cell)
CardCell
.
name
- the identifier for the cell.
The name can be used
in the call to
the method showCell
of this class to hide the currently visible component/cell
and show the component with the given name.cell
- the cell to be added.public BoundSpring computeBoundSpring()
computeBoundSpring
in class Cell
public void addComponentsToContainer(java.awt.Container parent)
addComponentsToContainer
method of each cell within the card to add the components of the cells
to the container.
addComponentsToContainer
in class Cell
parent
- the container to which the components of the cells need to added.protected void setBounds(int x, int y, int width, int height)
setBounds
in class Cell
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.public java.awt.Container removeAllComponents(java.awt.Container parent)
removeAllComponents
method for all the cells in this CardCell
.
removeAllComponents
in class Cell
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.
public boolean isComponentCell()
true
if the currently visble cell encloses a component.
isComponentCell
in class Cell
true
if the currently visible cell encloses a component, false
otherwise.public java.awt.Component getComponent()
null
is returned.
getComponent
in class Cell
null
if none exists.public Cell duplicate(ComponentDuplicator c)
duplicate
in class Cell
public void xmlserialize(XMLPrintStream out, ComponentXMLSerializer c)
xmlserialize
in class Cell
public int numberOfChildren()
1
, since only one cell is visible at any time.
numberOfChildren
in class Cell
public Cell getChildAt(int i)
Cell
null
if
the index is out of bounds.
getChildAt
in class Cell
i
- the index of the cell that is needed.
public void showCell(java.lang.String name)
name
- the name of the cell used in the call to the
add
or
add
method of
this class.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |