|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.umd.cs.piccolo.util.PPickPath
public class PPickPath
PPickPath represents a ordered list of nodes that have been picked. The topmost ancestor node is the first node in the list (and should be a camera), the bottommost child node is at the end of the list. It is this bottom node that is given first chance to handle events, and that any active event handlers usually manipulate.
Note that because of layers (which can be picked by multiple camera's) the ordered list of nodes in a pick path do not all share a parent child relationship with the nodes in the list next to them. This means that the normal localToGlobal methods don't work when trying to transform geometry up and down the pick path, instead you should use the pick paths canvasToLocal methods to get the mouse event points into your local coord system.
Note that PInputEvent wraps most of the useful PPickPath methods, so often you can use a PInputEvent directly instead of having to access its pick path.
PInputEvent
Field Summary | |
---|---|
static PPickPath |
CURRENT_PICK_PATH
|
Constructor Summary | |
---|---|
PPickPath(PCamera aCamera,
PBounds aScreenPickBounds)
|
Method Summary | |
---|---|
boolean |
acceptsNode(PNode node)
|
java.awt.geom.Dimension2D |
canvasToLocal(java.awt.geom.Dimension2D canvasDimension,
PNode nodeOnPath)
Convert the given dimension from the canvas coordinates, down through the pick path (and through any camera view transforms applied to the path) to the local coordinates of the given node. |
java.awt.geom.Point2D |
canvasToLocal(java.awt.geom.Point2D canvasPoint,
PNode nodeOnPath)
Convert the given point from the canvas coordinates, down through the pick path (and through any camera view transforms applied to the path) to the local coordinates of the given node. |
java.awt.geom.Rectangle2D |
canvasToLocal(java.awt.geom.Rectangle2D canvasRectangle,
PNode nodeOnPath)
Convert the given rectangle from the canvas coordinates, down through the pick path (and through any camera view transforms applied to the path) to the local coordinates of the given node. |
PCamera |
getBottomCamera()
Get the bottom camera on the pick path. |
PStack |
getNodeStackReference()
|
PAffineTransform |
getPathTransformTo(PNode nodeOnPath)
|
PBounds |
getPickBounds()
|
PNode |
getPickedNode()
Get the bottom node on the pick path node stack. |
double |
getScale()
|
PCamera |
getTopCamera()
Get the top camera on the pick path. |
PNode |
nextPickedNode()
Return the next node that will be picked after the current picked node. |
void |
popNode(PNode aNode)
|
void |
popTransform(PAffineTransform aTransform)
|
void |
processEvent(PInputEvent aEvent,
int type)
|
void |
pushNode(PNode aNode)
|
void |
pushTransform(PAffineTransform aTransform)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static PPickPath CURRENT_PICK_PATH
Constructor Detail |
---|
public PPickPath(PCamera aCamera, PBounds aScreenPickBounds)
Method Detail |
---|
public PBounds getPickBounds()
public boolean acceptsNode(PNode node)
public void pushNode(PNode aNode)
public void popNode(PNode aNode)
public PNode getPickedNode()
public PNode nextPickedNode()
public PCamera getTopCamera()
public PCamera getBottomCamera()
public PStack getNodeStackReference()
public double getScale()
public void pushTransform(PAffineTransform aTransform)
public void popTransform(PAffineTransform aTransform)
public PAffineTransform getPathTransformTo(PNode nodeOnPath)
public void processEvent(PInputEvent aEvent, int type)
processEvent
in interface PInputEventListener
public java.awt.geom.Point2D canvasToLocal(java.awt.geom.Point2D canvasPoint, PNode nodeOnPath)
public java.awt.geom.Dimension2D canvasToLocal(java.awt.geom.Dimension2D canvasDimension, PNode nodeOnPath)
public java.awt.geom.Rectangle2D canvasToLocal(java.awt.geom.Rectangle2D canvasRectangle, PNode nodeOnPath)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |