edu.umd.cs.piccolox.nodes
Class PClip

java.lang.Object
  extended by edu.umd.cs.piccolo.PNode
      extended by edu.umd.cs.piccolo.nodes.PPath
          extended by edu.umd.cs.piccolox.nodes.PClip
All Implemented Interfaces:
Printable, Serializable, Cloneable

public class PClip
extends PPath

PClip is a simple node that applies a clip before rendering or picking its children. PClip is a subclass of PPath, the clip applies is the GeneralPath wrapped by its super class. See piccolo2d/examples ClipExample.

Version:
1.0
Author:
Jesse Grosjean
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class edu.umd.cs.piccolo.PNode
PNode.PSceneGraphDelegate
 
Field Summary
 
Fields inherited from class edu.umd.cs.piccolo.nodes.PPath
PROPERTY_CODE_PATH, PROPERTY_CODE_STROKE, PROPERTY_CODE_STROKE_PAINT, PROPERTY_PATH, PROPERTY_STROKE, PROPERTY_STROKE_PAINT
 
Fields inherited from class edu.umd.cs.piccolo.PNode
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
 
Fields inherited from interface java.awt.print.Printable
NO_SUCH_PAGE, PAGE_EXISTS
 
Constructor Summary
PClip()
           
 
Method Summary
 PBounds computeFullBounds(PBounds dstBounds)
          Computes the full bounds and stores them in dstBounds, if dstBounds is null, create a new Bounds and returns it.
 boolean fullPick(PPickPath pickPath)
          Try to pick this node and all of its descendants if they are visible in the clipping region.
protected  void paint(PPaintContext paintContext)
          Paint's this node as a solid rectangle if paint is provided, clipping appropriately.
protected  void paintAfterChildren(PPaintContext paintContext)
          Paints a border around this node if it has a stroke and stroke paint provided.
 void repaintFrom(PBounds localBounds, PNode childOrThis)
          Callback that receives notification of repaint requests from nodes in this node's tree.
 
Methods inherited from class edu.umd.cs.piccolo.nodes.PPath
append, closePath, createEllipse, createLine, createPolyline, createPolyline, createRectangle, createRoundRectangle, curveTo, endResizeBounds, getPathBoundsWithStroke, getPathReference, getStroke, getStrokePaint, internalUpdateBounds, intersects, lineTo, moveTo, quadTo, reset, setPathTo, setPathToEllipse, setPathToPolyline, setPathToPolyline, setPathToRectangle, setStroke, setStrokePaint, startResizeBounds, updateBoundsFromPath
 
Methods inherited from class edu.umd.cs.piccolo.PNode
addActivity, addAttribute, addChild, addChild, addChildren, addClientProperty, addInputEventListener, addPropertyChangeListener, addPropertyChangeListener, animateToBounds, animateToColor, animateToPositionScaleRotation, animateToRelativePosition, animateToTransform, animateToTransparency, animateTransformToBounds, centerBoundsOnPoint, centerFullBoundsOnPoint, clone, findIntersectingNodes, fireChildPropertyChange, firePropertyChange, fullIntersects, fullPaint, 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, invalidateFullBounds, invalidateLayout, invalidatePaint, isAncestorOf, isDescendentOf, isDescendentOfRoot, isOpaque, layoutChildren, lerp, localToGlobal, localToGlobal, localToGlobal, localToParent, localToParent, localToParent, moveInBackOf, moveInFrontOf, moveToBack, moveToFront, offset, paramString, parentBoundsChanged, parentToLocal, parentToLocal, parentToLocal, pick, pickAfterChildren, position, print, print, removeAllChildren, removeChild, removeChild, removeChildren, removeFromParent, removeInputEventListener, removePropertyChangeListener, removePropertyChangeListener, repaint, 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, toImage, toImage, toImage, toImage, transformBy, translate, validateFullBounds, validateFullPaint
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PClip

public PClip()
Method Detail

computeFullBounds

public PBounds computeFullBounds(PBounds dstBounds)
Computes the full bounds and stores them in dstBounds, if dstBounds is null, create a new Bounds and returns it.

Overrides:
computeFullBounds in class PNode
Parameters:
dstBounds - output parameter where computed bounds will be stored
Returns:
the computed full bounds

repaintFrom

public void repaintFrom(PBounds localBounds,
                        PNode childOrThis)
Callback that receives notification of repaint requests from nodes in this node's tree.

Overrides:
repaintFrom in class PNode
Parameters:
localBounds - region in local coordinations the needs repainting
childOrThis - the node that emitted the repaint notification

paint

protected void paint(PPaintContext paintContext)
Paint's this node as a solid rectangle if paint is provided, clipping appropriately.

Overrides:
paint in class PPath
Parameters:
paintContext - context into which this node will be painted

paintAfterChildren

protected void paintAfterChildren(PPaintContext paintContext)
Paints a border around this node if it has a stroke and stroke paint provided.

Overrides:
paintAfterChildren in class PNode
Parameters:
paintContext - context into which the border will be drawn

fullPick

public boolean fullPick(PPickPath pickPath)
Try to pick this node and all of its descendants if they are visible in the clipping region.

Overrides:
fullPick in class PNode
Parameters:
pickPath - the pick path to add the node to if its picked
Returns:
true if this node or one of its descendants was picked.


Copyright © 1995-2010 Piccolo2D. All Rights Reserved.