public class PRoot extends PNode
Modifier and Type | Class and Description |
---|---|
static interface |
PRoot.InputSource
This interfaces is for advanced use only.
|
PNode.PSceneGraphDelegate
Modifier and Type | Field and Description |
---|---|
protected boolean |
processingInputs
Whether this not is currently processing inputs.
|
protected boolean |
processInputsScheduled
Whether this node needs to have its inputs processed.
|
static int |
PROPERTY_CODE_INPUT_SOURCES
The property code that identifies a change in the set of this root's
input sources (see
InputSource ). |
static int |
PROPERTY_CODE_INTERACTING_CHANGED
The property code that identifies a change in this node's interacting
state.
|
static String |
PROPERTY_INPUT_SOURCES
The property name that identifies a change in the set of this root's
input sources (see
InputSource ). |
static String |
PROPERTY_INTERACTING_CHANGED
The property name that identifies a change in this node's interacting
state.
|
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 |
---|
PRoot()
Construct a new PRoot().
|
Modifier and Type | Method and Description |
---|---|
boolean |
addActivity(PActivity activity)
Add an activity to the activity scheduler associated with this root.
|
void |
addInputSource(PRoot.InputSource inputSource)
Advanced.
|
Timer |
createTimer(int delay,
ActionListener listener)
Returns a new timer.
|
PActivityScheduler |
getActivityScheduler()
Get the activity scheduler associated with this root.
|
PInputManager |
getDefaultInputManager()
Get the default input manager to be used when processing input events.
|
long |
getGlobalTime()
Get the global Piccolo2D time.
|
boolean |
getInteracting()
Return true if this root has been marked as interacting.
|
PRoot |
getRoot()
Since getRoot is handled recursively, and root is the lowest point in the
hierarchy, simply returns itself.
|
void |
processInputs()
This is the heartbeat of the Piccolo2D framework.
|
void |
removeInputSource(PRoot.InputSource inputSource)
Advanced.
|
void |
scheduleProcessInputsIfNeeded()
Schedule process inputs if needed.
|
void |
setChildBoundsInvalid(boolean childLayoutInvalid)
Set the flag indicating that one of this node's descendants has invalid
bounds.
|
void |
setChildPaintInvalid(boolean childPaintInvalid)
Mark this node as having a child with invalid paint.
|
void |
setFullBoundsInvalid(boolean fullLayoutInvalid)
Set the full bounds invalid flag.
|
void |
setInteracting(boolean isInteracting)
Set if this root is interacting.
|
void |
setPaintInvalid(boolean paintInvalid)
Mark this node as having invalid paint.
|
void |
waitForActivities()
Wait for all scheduled activities to finish before returning from this
method.
|
addAttribute, addChild, addChild, addChildren, 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, getClientPropertyKeysEnumeration, getDoubleAttribute, getFullBounds, getFullBoundsInvalid, getFullBoundsReference, getGlobalBounds, getGlobalFullBounds, getGlobalRotation, getGlobalScale, getGlobalToLocalTransform, getGlobalTranslation, getHeight, getInputEventListeners, getIntegerAttribute, getInverseTransform, getListenerList, getLocalToGlobalTransform, getName, getOccluded, getOffset, getPaint, getPaintInvalid, getParent, getPickable, getPropertyChangeParentMask, 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, lower, lower, lowerBelow, lowerToBottom, lowerToBottom, offset, paint, paintAfterChildren, parentBoundsChanged, parentToLocal, parentToLocal, parentToLocal, pick, pickAfterChildren, print, print, raise, raise, raiseAbove, raiseToTop, raiseToTop, removeAllChildren, removeChild, removeChild, removeChildren, removeFromParent, removeInputEventListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaintFrom, reparent, replaceWith, resetBounds, rotate, rotateAboutPoint, rotateAboutPoint, rotateInPlace, scale, scaleAboutPoint, scaleAboutPoint, setBounds, setBounds, setBoundsChanged, setChildBoundsVolatile, setChildrenPickable, setGlobalRotation, setGlobalScale, setGlobalTranslation, setHeight, setName, setOccluded, setOffset, setOffset, setPaint, setParent, setPickable, setPropertyChangeParentMask, setRotation, setScale, setTransform, setTransparency, setVisible, setWidth, setX, setY, signalBoundsChanged, startResizeBounds, toImage, toImage, toImage, toImage, transformBy, translate, validateFullBounds, validateFullPaint
public static final String PROPERTY_INPUT_SOURCES
InputSource
). In any property
change event the new value will be a reference to the list of this root's
input sources, but old value will always be null.public static final int PROPERTY_CODE_INPUT_SOURCES
InputSource
). In any property
change event the new value will be a reference to the list of this root's
input sources, but old value will always be null.public static final String PROPERTY_INTERACTING_CHANGED
public static final int PROPERTY_CODE_INTERACTING_CHANGED
protected transient boolean processingInputs
protected transient boolean processInputsScheduled
public PRoot()
public boolean addActivity(PActivity activity)
processInputs
method. When the activity has finished running
it will automatically get removed.addActivity
in class PNode
activity
- Activity that should be scheduledpublic PActivityScheduler getActivityScheduler()
public void waitForActivities()
public PRoot getRoot()
public PInputManager getDefaultInputManager()
public boolean getInteracting()
public void setInteracting(boolean isInteracting)
isInteracting
- True if this root has user interaction taking placePCanvas.setInteracting(boolean)
public void addInputSource(PRoot.InputSource inputSource)
inputSource
- An input source that should be addedpublic void removeInputSource(PRoot.InputSource inputSource)
inputSource
- input source that should no longer be asked about
input eventspublic Timer createTimer(int delay, ActionListener listener)
delay
- # of milliseconds before action listener is invokedlistener
- listener to be invoked after delaypublic long getGlobalTime()
processInputs
method.
Activities should usually use this global time instead of System.
currentTimeMillis() so that multiple activities will be synchronized.public void processInputs()
public void setFullBoundsInvalid(boolean fullLayoutInvalid)
setFullBoundsInvalid
in class PNode
fullLayoutInvalid
- true=invalid, false=validpublic void setChildBoundsInvalid(boolean childLayoutInvalid)
setChildBoundsInvalid
in class PNode
childLayoutInvalid
- true=invalid, false=validpublic void setPaintInvalid(boolean paintInvalid)
setPaintInvalid
in class PNode
paintInvalid
- true if this node should be repaintedpublic void setChildPaintInvalid(boolean childPaintInvalid)
setChildPaintInvalid
in class PNode
childPaintInvalid
- true if this node has a child with invalid paintpublic void scheduleProcessInputsIfNeeded()
Copyright © 1995-2013 Piccolo2D. All Rights Reserved.