|
||||||||||
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.nodes.PNodeCache
public class PNodeCache
PNodeCache caches a visual representation of it's children into an image and uses this cached image for painting instead of painting it's children directly. This is intended to be used in two ways.
First it can be used as a simple optimization technique. If a node has many descendents it may be faster to paint the cached image representation instead of painting each node.
Second PNodeCache provides a place where "image" effects such as blurring and drop shadows can be added to the Piccolo scene graph. This can be done by overriding the method createImageCache and returing an image with the desired effect applied.
Nested Class Summary |
---|
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 | |
---|---|
PNodeCache()
|
Method Summary | |
---|---|
java.awt.Image |
createImageCache(java.awt.geom.Dimension2D cacheOffsetRef)
Override this method to customize the image cache creation process. |
void |
fullPaint(PPaintContext paintContext)
Paint this node and all of its descendents. |
java.awt.Image |
getImageCache()
|
void |
invalidateCache()
|
void |
invalidatePaint()
Invalidate this node's paint, and mark all of its ancestors as having a node with invalid paint. |
protected boolean |
pickAfterChildren(PPickPath pickPath)
Try to pick this node after its children have had a chance to be picked. |
void |
repaintFrom(PBounds localBounds,
PNode childOrThis)
Pass the given repaint request up the tree, so that any cameras can invalidate that region on their associated canvas. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PNodeCache()
Method Detail |
---|
public java.awt.Image createImageCache(java.awt.geom.Dimension2D cacheOffsetRef)
public java.awt.Image getImageCache()
public void invalidateCache()
public void invalidatePaint()
PNode
invalidatePaint
in class PNode
public void repaintFrom(PBounds localBounds, PNode childOrThis)
PNode
repaintFrom
in class PNode
localBounds
- the bounds to repaintchildOrThis
- if childOrThis does not equal this then this nodes transform will be applied to the localBounds parampublic void fullPaint(PPaintContext paintContext)
PNode
paint
or
paintAfterChildren
instead.
fullPaint
in class PNode
paintContext
- the paint context to use for painting this node and its childrenprotected boolean pickAfterChildren(PPickPath pickPath)
PNode
pickAfterChildren
in class PNode
pickPath
- the pick path used for the pick operation
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |