|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.umd.cs.piccolo.PNode
edu.umd.cs.piccolox.swing.SwingLayoutNode
public class SwingLayoutNode
Uses Swing layout managers to position PNodes.
Nested Class Summary | |
---|---|
static interface |
SwingLayoutNode.Anchor
Determines where nodes are anchored in the area allocated by the Swing layout manager. |
Nested classes/interfaces inherited from class edu.umd.cs.piccolo.PNode |
---|
PNode.PSceneGraphDelegate |
Field Summary |
---|
Fields inherited from interface java.awt.print.Printable |
---|
NO_SUCH_PAGE, PAGE_EXISTS |
Constructor Summary | |
---|---|
SwingLayoutNode()
Construct a SwingLayoutNode that uses FlowLayout. |
|
SwingLayoutNode(Container container)
Constructs a SwingLayoutNode that lays out its children as though they were children of the provided Container. |
|
SwingLayoutNode(LayoutManager layoutManager)
Constructs a SwingLayoutNode that uses the provided LayoutManager to layout its children. |
Method Summary | |
---|---|
void |
addChild(int index,
PNode child)
|
void |
addChild(int index,
PNode child,
Object constraints)
Adds a child at the specified index. |
void |
addChild(int index,
PNode child,
Object constraints,
SwingLayoutNode.Anchor childAnchor)
Adds a child at the specified index. |
void |
addChild(int index,
PNode child,
SwingLayoutNode.Anchor anchor)
Adds a child at the specified index. |
void |
addChild(PNode child)
Adds a child to the end of the node list. |
void |
addChild(PNode child,
Object constraints)
Adds a child to the end of the node list and specifies the given constraints. |
void |
addChild(PNode child,
Object constraints,
SwingLayoutNode.Anchor anchor)
Adds a child to the end of the node list. |
void |
addChild(PNode child,
SwingLayoutNode.Anchor anchor)
Adds a child to the end of the node list. |
void |
addChildren(Collection nodes)
|
void |
addChildren(Collection nodes,
Object constraints)
Adds a collection of nodes to the end of the list. |
void |
addChildren(Collection nodes,
Object constraints,
SwingLayoutNode.Anchor anchor)
Adds a collection of nodes to the end of the list. |
void |
addChildren(Collection nodes,
SwingLayoutNode.Anchor anchor)
Adds a collection of nodes to the end of the list. |
SwingLayoutNode.Anchor |
getAnchor()
Returns the anchor being used by this LayoutManager. |
Container |
getContainer()
Some Swing layout managers (like BoxLayout) require a reference to the proxy Container. |
void |
removeAllChildren()
PNode.removeAllChildren does not call removeChild, it manipulates an internal data structure. |
PNode |
removeChild(int index)
Removes a node at a specified index. |
void |
setAnchor(SwingLayoutNode.Anchor anchor)
Sets the default anchor. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SwingLayoutNode()
public SwingLayoutNode(LayoutManager layoutManager)
layoutManager
- LayoutManager to use for laying out children. Must
not be null.public SwingLayoutNode(Container container)
container
- Container in which child nodes will effectively be laid
outMethod Detail |
---|
public void setAnchor(SwingLayoutNode.Anchor anchor)
anchor
- anchor to use when a node is added but its anchor is not
specifiedpublic SwingLayoutNode.Anchor getAnchor()
public Container getContainer()
SwingLayoutNode layoutNode = new SwingLayoutNode();
layoutNode.setLayout( new BoxLayout( layoutNode.getContainer(), BoxLayout.Y_AXIS ) );
public void addChild(int index, PNode child, Object constraints, SwingLayoutNode.Anchor childAnchor)
index
- 0 based index at which to add the childchild
- child to be addedconstraints
- constraints the layout manager uses when laying out
the childchildAnchor
- specifies the location from which layout takes placepublic void addChild(int index, PNode child)
addChild
in class PNode
public void addChild(int index, PNode child, Object constraints)
index
- 0 based index at which to add the childchild
- child to be addedconstraints
- constraints the layout manager uses when laying out
the childpublic void addChild(int index, PNode child, SwingLayoutNode.Anchor anchor)
index
- 0 based index at which to add the childchild
- child to be addedanchor
- specifies the location from which layout takes placepublic void addChild(PNode child, Object constraints, SwingLayoutNode.Anchor anchor)
child
- child to be addedconstraints
- constraints the layout manager uses when laying out
the childanchor
- specifies the location from which layout takes placepublic void addChild(PNode child)
addChild
in class PNode
child
- child to be addedpublic void addChild(PNode child, Object constraints)
child
- child to be addedconstraints
- constraints the layout manager uses when laying out
the childpublic void addChild(PNode child, SwingLayoutNode.Anchor anchor)
child
- child to be addedanchor
- specifies the location from which layout takes placepublic void addChildren(Collection nodes, Object constraints, SwingLayoutNode.Anchor anchor)
nodes
- nodes to add to the end of the listconstraints
- constraints the layout manager uses when laying out
the childanchor
- specifies the location from which layout takes placepublic void addChildren(Collection nodes)
addChildren
in class PNode
public void addChildren(Collection nodes, Object constraints)
nodes
- nodes to add to the end of the listconstraints
- constraints the layout manager uses when laying out
the childpublic void addChildren(Collection nodes, SwingLayoutNode.Anchor anchor)
nodes
- nodes to add to the end of the listanchor
- specifies the location from which layout takes placepublic PNode removeChild(int index)
removeChild
in class PNode
index
- 0 based index of the child to be removedpublic void removeAllChildren()
removeAllChildren
in class PNode
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |