|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object pagelayout.Cell pagelayout.PanelCell
public class PanelCell
A PanelCell
is a cell associated with a child component
(usually a panel,
an object of the class javax.swing.Janel
)
which itself contains other child components. The layout of such
a panel can be managed in one of the two ways. The
first option is to set a new layout manager for the panel,
which may or may not be an instance
of the class PageLayout
, and
to add the panel to its container in
the manner required by the
layout manager of the parent of the panel (e.g.
PageLayout
requires
that the panel not be directly be added to the parent, but to
the tree of cells whose root is the parent's top level cell). The
PanelCell
offers an alternative
that may be simpler, at least within the context of
PageLayout
.
An object of the class PanelCell
is created by
using the panel together with its
top level cell. Once instantiated, this PanelCell
object can be added to other cells of the parent container just like
any other cell, and thus there is no need to create a separate
layout manager for the panel.
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 | |
---|---|
PanelCell(java.awt.Container container,
Cell cell)
Creates the PanelCell associated with
the given container. |
Method Summary | |
---|---|
void |
addComponentsToContainer(java.awt.Container parent)
Adds the panel of this PanelCell to the parent, and the components contained in the top level cell of this object to the panel. |
BoundSpring |
computeBoundSpring()
Computes the BoundSpring of the panel associated with this object on the basis of the BoundSpring of the top level cell. |
Cell |
duplicate(ComponentDuplicator c)
|
Cell |
getCell()
|
Cell |
getChildAt(int index)
Return the top level cell of this panel. |
java.awt.Component |
getComponent()
Returns the panel wrapped by this object. |
ComponentCell |
getComponentCell()
|
boolean |
isComponentCell()
Returns true as this cell encloses a component. |
int |
numberOfChildren()
Returns 1, as a panel cell has only one child, the top level cell. |
java.awt.Container |
removeAllComponents(java.awt.Container parent)
Removes the panel associated with this object from its parent, and all the components that are in the tree of the cells that has its root the top level cell of the panel. |
int |
replaceCell(Cell currentCell,
Cell newCell,
java.awt.Container parent)
Replaces an existing cell by a new cell. |
protected void |
setBounds(int x,
int y,
int width,
int height)
Lays out panel of this PanelCell and its children within the specified rectangle of the panel's parent. |
void |
setComponentGaps(int hgap,
int vgap)
Sets the size of the empty area around all enclosed components. |
void |
setContainerGaps(int hgap,
int vgap)
|
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 PanelCell(java.awt.Container container, Cell cell)
PanelCell
associated with
the given container.
container
- the container of this PanelCell
.cell
- the top level cell of the container.Method Detail |
---|
public BoundSpring computeBoundSpring()
computeBoundSpring
in class Cell
public void addComponentsToContainer(java.awt.Container parent)
addComponentsToContainer
in class Cell
parent
- The container that contains the panel of this PanelCell.public int numberOfChildren()
numberOfChildren
in class Cell
public Cell getChildAt(int index)
getChildAt
in class Cell
index
- the index of the cell to be returned. This is ignored.
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
in class Cell
parent
- not used.
public boolean isComponentCell()
true
as this cell encloses a component.
isComponentCell
in class Cell
true
as this cell encloses a component.public java.awt.Component getComponent()
getComponent
in class Cell
public int replaceCell(Cell currentCell, Cell newCell, java.awt.Container parent)
null
, and this cell is a row or a column,
the newCell
is added to this cell.
replaceCell
in class Cell
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.
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.public void setComponentGaps(int hgap, int vgap)
setComponentGaps
in class Cell
hgap
- the width of the vertical strips around the vertical edges.vgap
- the height of the horizontal strips around the horizontal edges.public void setContainerGaps(int hgap, int vgap)
public Cell duplicate(ComponentDuplicator c)
duplicate
in class Cell
public Cell getCell()
public void xmlserialize(XMLPrintStream out, ComponentXMLSerializer c)
xmlserialize
in class Cell
public ComponentCell getComponentCell()
getComponentCell
in class Cell
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |