edu.umd.cs.jazz.event
Class ZSelectionModifyHandler

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

public class ZSelectionModifyHandler
extends java.lang.Object
implements ZEventHandler, ZMouseListener, ZMouseMotionListener, java.io.Serializable

ZSelectionModifyHandler is a ZEventHandler that allows items to be selected with the mouse, and maintains the current selection. As an event handler, ZSelectionManager directly supports the following actions:

Holding down the SHIFT key while performing the above actions will extend the current selection with the newly selected items, otherwise the previous selection (if any) will be replaced by the new selection.

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, ZSelectionDeleteHandler, ZSelectionMoveHandler, ZSelectionScaleHandler, Serialized Form

Constructor Summary
ZSelectionModifyHandler(ZNode node, ZCamera camera, ZCanvas canvas, ZGroup marqueeLayer)
          Construct a new ZSelectionModifyHandler.
ZSelectionModifyHandler(ZNode node, ZCanvas canvas, ZGroup marqueeLayer)
          Construct a new ZSelectionModifyHandler.
 
Method Summary
 ZCamera getCamera()
          Returns the camera on which this event handler is watching for selection change
 ZCanvas getCanvas()
          Returns the canvas to which this selection manager is attached.
 ZGroup getMarqueeLayer()
          Determine the "marquee" layer that is used for selection.
 ZNode getNode()
          Returns the node to which this selection manager is attached.
 boolean isActive()
          Determines if this event handler is active.
 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
 void setMarqueeLayer(ZGroup layer)
          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
 

Constructor Detail

ZSelectionModifyHandler

public ZSelectionModifyHandler(ZNode node,
                               ZCanvas canvas,
                               ZGroup marqueeLayer)
Construct a new ZSelectionModifyHandler. This event handler will be active on all cameras.
Parameters:
node - The node this event handler attaches to.
canvas - The canvas this event handler attaches to
marqueeLayer - The layer to draw the marquee on

ZSelectionModifyHandler

public ZSelectionModifyHandler(ZNode node,
                               ZCamera camera,
                               ZCanvas canvas,
                               ZGroup marqueeLayer)
Construct a new ZSelectionModifyHandler. This event handler will be active on the specified camera.
Parameters:
node - The node this event handler attaches to.
camera - The camera to which this event handler attaches.
canvas - The canvas this event handler attaches to
marqueeLayer - The layer to draw the marquee on
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

getNode

public ZNode getNode()
Returns the node to which this selection manager is attached. Primarily for use by associated selection handlers.

getCamera

public ZCamera getCamera()
Returns the camera on which this event handler is watching for selection change

getCanvas

public ZCanvas getCanvas()
Returns the canvas to which this selection manager is attached. Primarily for use by associated selection handlers.

setMarqueeLayer

public void setMarqueeLayer(ZGroup layer)
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.
Parameters:
layer - The node that the marquee should be put under

getMarqueeLayer

public ZGroup getMarqueeLayer()
Determine the "marquee" layer that is used for selection.
Returns:
layer The node that the marquee is put under

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.