edu.umd.cs.jazz.event
Class ZSelectionEventHandler
java.lang.Object
|
+--edu.umd.cs.jazz.event.ZEventHandler
|
+--edu.umd.cs.jazz.event.ZSelectionEventHandler
- public class ZSelectionEventHandler
- extends ZEventHandler
ZSelectionEventHandler provides event handlers for basic
selection interaction.
Click to select/unselect an item.
Shift-click to extend the selection.
Click-and-drag on the background to marquee select.
Drag a selected item to move all of the selected items.
|
Method Summary |
void |
deactivate()
Deactivates this event handler. |
void |
keyPressed(java.awt.event.KeyEvent e)
Key press event handler |
void |
mouseDragged(java.awt.event.MouseEvent e)
Mouse drag event handler |
void |
mousePressed(java.awt.event.MouseEvent e)
Mouse press event handler |
void |
mouseReleased(java.awt.event.MouseEvent e)
Mouse release event handler |
protected void |
preScale(ZNode node,
float dz,
float x,
float y)
Scale the node using preConcatenation which will result in the
scale happening in global coordinates. |
protected void |
preTranslate(ZNode node,
float dx,
float dy)
Translate the node using preConcatenation which will result in the
translate happening in global coordinates. |
void |
setSelectionLayer(ZNode node)
Specify the node that the selection "marquee" should be put on. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
pt
protected java.awt.geom.Point2D pt
prevMotionSelection
protected java.util.Vector prevMotionSelection
selNode
protected ZNode selNode
prevPt
protected java.awt.geom.Point2D prevPt
pressPt
protected java.awt.geom.Point2D pressPt
marquee
protected ZNode marquee
selectionLayer
protected ZNode selectionLayer
scaleUpKey
protected int scaleUpKey
scaleDownKey
protected int scaleDownKey
translateLeftKey
protected int translateLeftKey
translateRightKey
protected int translateRightKey
translateUpKey
protected int translateUpKey
translateDownKey
protected int translateDownKey
deleteKey
protected int deleteKey
ZSelectionEventHandler
public ZSelectionEventHandler(java.awt.Component c,
ZSurface v,
ZNode selectionLayer)
- Constructs a new ZSelectionEventHandler.
- Parameters:
c - The component that this event handler listens to events onv - The camera that is selected within
deactivate
public void deactivate()
- Deactivates this event handler.
This results in all selected objects becoming unselected
- Overrides:
- deactivate in class ZEventHandler
setSelectionLayer
public void setSelectionLayer(ZNode node)
- Specify the node that the selection "marquee" should be put on.
The marquee is the rectangle that the user drags around to select things within.
keyPressed
public void keyPressed(java.awt.event.KeyEvent e)
- Key press event handler
- Parameters:
e - The event.- Overrides:
- keyPressed in class ZEventHandler
mousePressed
public void mousePressed(java.awt.event.MouseEvent e)
- Mouse press event handler
- Parameters:
e - The event.- Overrides:
- mousePressed in class ZEventHandler
mouseDragged
public void mouseDragged(java.awt.event.MouseEvent e)
- Mouse drag event handler
- Parameters:
e - The event.- Overrides:
- mouseDragged in class ZEventHandler
mouseReleased
public void mouseReleased(java.awt.event.MouseEvent e)
- Mouse release event handler
- Parameters:
e - The event.- Overrides:
- mouseReleased in class ZEventHandler
preScale
protected void preScale(ZNode node,
float dz,
float x,
float y)
- Scale the node using preConcatenation which will result in the
scale happening in global coordinates.
preTranslate
protected void preTranslate(ZNode node,
float dx,
float dy)
- Translate the node using preConcatenation which will result in the
translate happening in global coordinates.