edu.umd.cs.jazz.event
Class ZSelectionMoveHandler

java.lang.Object
  |
  +--edu.umd.cs.jazz.event.ZSelectionMoveHandler
All Implemented Interfaces:
java.util.EventListener, java.awt.event.KeyListener, java.io.Serializable, ZEventHandler, ZMouseListener, ZMouseMotionListener

public class ZSelectionMoveHandler
extends java.lang.Object
implements ZEventHandler, ZMouseListener, ZMouseMotionListener, java.awt.event.KeyListener, java.io.Serializable

ZSelectionMoveHandler is a selection handler for use with ZSelectionManager. ZSelectionMoveHandler allows the user to translate the current selection in two ways:

It should be noted that this event handler may not have the desired effect if the event handler is globally active and internal cameras are used. This cannot be fixed in a general purpose way for two reasons: the possibility of multiple representations and the possibility of multiple cameras viewing the same nodes. First, an internal camera is a normal visual component and as such can appear in multiple places in a jazz scenegraph. Consequently, if items in an internal camera are selected and the internal camera appears in multiple places, moving these items becomes arbitrary (ie. for which representation do they move appropriately). Second, if two distinct cameras are viewing the same set of selected nodes it is again an arbitrary decision as for which camera the nodes are moved appropriately. As a result, in the case when the event handler is globally active and internal or multiple cameras appear, the nodes are moved first according to the most recently interacted camera or, if none has been interacted, according to the top camera (of the ZCanvas).

Warning: Serialized and ZSerialized objects of this class will not be compatible with future Jazz releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Jazz. A future release of Jazz will provide support for long term persistence.

Author:
Antony Courtney, Yale University, Lance Good, University of Maryland, Benjamin Bederson, University of Maryland
See Also:
ZSelectionManager, ZCompositeSelectionHandler, ZSelectionModifyHandler, ZSelectionDeleteHandler, ZSelectionScaleHandler, Serialized Form

Constructor Summary
ZSelectionMoveHandler(ZNode node, ZCamera camera, ZCanvas canvas)
          Construct a new ZSelectionMoveHandler.
ZSelectionMoveHandler(ZNode node, ZCanvas canvas)
          Construct a new ZSelectionMoveHandler.
 
Method Summary
 boolean isActive()
          Determines if this event handler is active.
 void keyPressed(java.awt.event.KeyEvent e)
          Key press event handler
 void keyReleased(java.awt.event.KeyEvent e)
          Key release event handler
 void keyTyped(java.awt.event.KeyEvent e)
          Key typed event handler
 void mouseClicked(ZMouseEvent e)
          Invoked when the mouse has been clicked on a component.
 void mouseDragged(ZMouseEvent e)
          Mouse drag event handler
 void mouseEntered(ZMouseEvent e)
          Invoked when the mouse enters a component.
 void mouseExited(ZMouseEvent e)
          Invoked when the mouse exits a component.
 void mouseMoved(ZMouseEvent e)
          Invoked when the mouse button has been moved on a node (with no buttons no down).
 void mousePressed(ZMouseEvent e)
          Mouse press event handler
 void mouseReleased(ZMouseEvent e)
          Mouse release event handler
 void setActive(boolean active)
          Specifies whether this event handler is active
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ZSelectionMoveHandler

public ZSelectionMoveHandler(ZNode node,
                             ZCanvas canvas)
Construct a new ZSelectionMoveHandler. This event handler will be active on all cameras.
Parameters:
node - The node to which this event handler attaches
canvas - The canvas to which this event handler attaches

ZSelectionMoveHandler

public ZSelectionMoveHandler(ZNode node,
                             ZCamera camera,
                             ZCanvas canvas)
Construct a new ZSelectionMoveHandler. This event handler will only be active on the specified camera.
Parameters:
node - The node to which this event handler attaches
camera - The camera to which this event handler attaches
canvas - The canvas to which this event handler attaches
Method Detail

setActive

public void setActive(boolean active)
Specifies whether this event handler is active
Specified by:
setActive in interface ZEventHandler
Parameters:
active - True to make this event handler active

isActive

public boolean isActive()
Determines if this event handler is active.
Specified by:
isActive in interface ZEventHandler
Returns:
True if active

keyPressed

public void keyPressed(java.awt.event.KeyEvent e)
Key press event handler
Specified by:
keyPressed in interface java.awt.event.KeyListener
Parameters:
e - The event.

keyReleased

public void keyReleased(java.awt.event.KeyEvent e)
Key release event handler
Specified by:
keyReleased in interface java.awt.event.KeyListener
Parameters:
e - The event.

keyTyped

public void keyTyped(java.awt.event.KeyEvent e)
Key typed event handler
Specified by:
keyTyped in interface java.awt.event.KeyListener
Parameters:
e - The event.

mousePressed

public void mousePressed(ZMouseEvent e)
Mouse press event handler
Specified by:
mousePressed in interface ZMouseListener
Parameters:
e - The event.

mouseDragged

public void mouseDragged(ZMouseEvent e)
Mouse drag event handler
Specified by:
mouseDragged in interface ZMouseMotionListener
Parameters:
e - The event.

mouseReleased

public void mouseReleased(ZMouseEvent e)
Mouse release event handler
Specified by:
mouseReleased in interface ZMouseListener
Parameters:
e - The event.

mouseEntered

public void mouseEntered(ZMouseEvent e)
Invoked when the mouse enters a component.
Specified by:
mouseEntered in interface ZMouseListener

mouseExited

public void mouseExited(ZMouseEvent e)
Invoked when the mouse exits a component.
Specified by:
mouseExited in interface ZMouseListener

mouseClicked

public void mouseClicked(ZMouseEvent e)
Invoked when the mouse has been clicked on a component.
Specified by:
mouseClicked in interface ZMouseListener

mouseMoved

public void mouseMoved(ZMouseEvent e)
Invoked when the mouse button has been moved on a node (with no buttons no down).
Specified by:
mouseMoved in interface ZMouseMotionListener


Copyright © 2001 by University of Maryland, College Park, MD 20742, USA All rights reserved.