edu.umd.cs.jazz.event
Class ZSelectionDeleteHandler

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

public class ZSelectionDeleteHandler
extends java.lang.Object
implements ZEventHandler, java.awt.event.KeyListener, java.io.Serializable

ZSelectionDeleteHandler is a selection handler for use with a ZSelectionManager. ZSelectionDeleteHandler allows the user to delete the current selection by pressing the DEL key.

ZSelectionDeleteHandler also allows registration of ZGroupListener instances to be notified when items are deleted.

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, Univesity of Maryland, Benjamin Bederson, University of Maryland
See Also:
ZSelectionManager, ZCompositeSelectionHandler, Serialized Form

Field Summary
protected  javax.swing.event.EventListenerList listenerList
          registered event listeners
 
Constructor Summary
ZSelectionDeleteHandler(ZNode node, ZCamera camera, ZCanvas canvas)
          Construct a new ZSelectionDeleteHandler.
ZSelectionDeleteHandler(ZNode node, ZCanvas canvas)
          Construct a new ZSelectionDeleteHandler.
 
Method Summary
 void addGroupListener(ZGroupListener l)
          Add a ZGroupListener, registered for nodeRemoved events.
protected  void fireGroupEvent(int id, ZGroup parent, ZNode child)
          Notifies all listeners that have registered interest for notification on this event type.
 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 removeGroupListener(ZGroupListener l)
          Remove a ZGroupListener, registered for nodeRemoved events.
 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
 

Field Detail

listenerList

protected transient javax.swing.event.EventListenerList listenerList
registered event listeners
Constructor Detail

ZSelectionDeleteHandler

public ZSelectionDeleteHandler(ZNode node,
                               ZCanvas canvas)
Construct a new ZSelectionDeleteHandler. Uses the canvas' camera in obtaining selected nodes.
Parameters:
node - The node this delete handler attaches to
canvas - The canvas this handler is active on

ZSelectionDeleteHandler

public ZSelectionDeleteHandler(ZNode node,
                               ZCamera camera,
                               ZCanvas canvas)
Construct a new ZSelectionDeleteHandler.
Parameters:
node - The node this delete handler attaches to
camera - The camera this delete handler attaches to
canvas - The canvas this handler is active 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

addGroupListener

public void addGroupListener(ZGroupListener l)
Add a ZGroupListener, registered for nodeRemoved events.

removeGroupListener

public void removeGroupListener(ZGroupListener l)
Remove a ZGroupListener, registered for nodeRemoved events.

fireGroupEvent

protected void fireGroupEvent(int id,
                              ZGroup parent,
                              ZNode child)
Notifies all listeners that have registered interest for notification on this event type. The event instance is lazily created using the parameters passed into the fire method. The listener list is processed in last to first order.
Parameters:
id - The event id (NODE_ADDED, NODE_REMOVED)
child - The child being added or removed from this node
See Also:
EventListenerList

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.


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