public class SwingLayoutNode extends PNode
Modifier and Type | Class and Description |
---|---|
static interface |
SwingLayoutNode.Anchor
Determines where nodes are anchored in the area allocated by the Swing
layout manager.
|
PNode.PSceneGraphDelegate
FILL_STRATEGY_ASPECT_COVER, FILL_STRATEGY_ASPECT_FIT, FILL_STRATEGY_EXACT_FIT, PROPERTY_BOUNDS, PROPERTY_CHILDREN, PROPERTY_CHILDREN_PICKABLE, PROPERTY_CLIENT_PROPERTIES, PROPERTY_CODE_BOUNDS, PROPERTY_CODE_CHILDREN, PROPERTY_CODE_CHILDREN_PICKABLE, PROPERTY_CODE_CLIENT_PROPERTIES, PROPERTY_CODE_FULL_BOUNDS, PROPERTY_CODE_PAINT, PROPERTY_CODE_PARENT, PROPERTY_CODE_PICKABLE, PROPERTY_CODE_TRANSFORM, PROPERTY_CODE_TRANSPARENCY, PROPERTY_CODE_VISIBLE, PROPERTY_FULL_BOUNDS, PROPERTY_PAINT, PROPERTY_PARENT, PROPERTY_PICKABLE, PROPERTY_TRANSFORM, PROPERTY_TRANSPARENCY, PROPERTY_VISIBLE, SCENE_GRAPH_DELEGATE
NO_SUCH_PAGE, PAGE_EXISTS
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
void |
addChild(int index,
PNode child)
Add a node to be a new child of this node at the specified index.
|
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)
Add a collection of nodes to be children of this node.
|
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.
|
addActivity, addAttribute, addClientProperty, addInputEventListener, addPropertyChangeListener, addPropertyChangeListener, animateToBounds, animateToColor, animateToPositionScaleRotation, animateToRelativePosition, animateToTransform, animateToTransparency, animateTransformToBounds, centerBoundsOnPoint, centerFullBoundsOnPoint, clone, computeFullBounds, endResizeBounds, findIntersectingNodes, fireChildPropertyChange, firePropertyChange, fullIntersects, fullPaint, fullPick, getAllNodes, getAllNodes, getAttribute, getAttribute, getBooleanAttribute, getBounds, getBoundsChanged, getBoundsReference, getBoundsVolatile, getChild, getChildBoundsInvalid, getChildBoundsVolatile, getChildPaintInvalid, getChildrenCount, getChildrenIterator, getChildrenPickable, getChildrenReference, getClientProperties, getClientProperty, getClientPropertyKeysEnumeration, getClientPropertyKeysIterator, getDoubleAttribute, getFullBounds, getFullBoundsInvalid, getFullBoundsReference, getGlobalBounds, getGlobalFullBounds, getGlobalRotation, getGlobalScale, getGlobalToLocalTransform, getGlobalTranslation, getHeight, getInputEventListeners, getIntegerAttribute, getInverseTransform, getListenerList, getLocalToGlobalTransform, getName, getOccluded, getOffset, getPaint, getPaintInvalid, getParent, getPickable, getPropertyChangeParentMask, getRoot, getRotation, getScale, getTransform, getTransformReference, getTransparency, getUnionOfChildrenBounds, getVisible, getWidth, getX, getXOffset, getY, getYOffset, globalToLocal, globalToLocal, globalToLocal, indexOfChild, internalUpdateBounds, intersects, invalidateFullBounds, invalidateLayout, invalidatePaint, isAncestorOf, isDescendentOf, isDescendentOfRoot, isOpaque, layoutChildren, lerp, localToGlobal, localToGlobal, localToGlobal, localToParent, localToParent, localToParent, moveInBackOf, moveInFrontOf, moveToBack, moveToFront, offset, paint, paintAfterChildren, paramString, parentBoundsChanged, parentToLocal, parentToLocal, parentToLocal, pick, pickAfterChildren, position, print, print, removeChild, removeChildren, removeFromParent, removeInputEventListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaintFrom, reparent, replaceWith, resetBounds, rotate, rotateAboutPoint, rotateAboutPoint, rotateInPlace, scale, scaleAboutPoint, scaleAboutPoint, setBounds, setBounds, setBoundsChanged, setChildBoundsInvalid, setChildBoundsVolatile, setChildPaintInvalid, setChildrenPickable, setFullBoundsInvalid, setGlobalRotation, setGlobalScale, setGlobalTranslation, setHeight, setName, setOccluded, setOffset, setOffset, setPaint, setPaintInvalid, setParent, setPickable, setPropertyChangeParentMask, setRotation, setScale, setTransform, setTransparency, setVisible, setWidth, setX, setY, signalBoundsChanged, startResizeBounds, toImage, toImage, toImage, toImage, transformBy, translate, validateFullBounds, validateFullPaint
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
outpublic 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)
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)
public 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
nodes
- a collection of nodes to be added to this nodepublic 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
Copyright © 1995–2013 Piccolo2D. All rights reserved.