Jazz API Documentation

edu.umd.cs.jazz.event
Class ZLinkEventHandler

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

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

ZLinkEventHandler is a simple event handler for interactively creating hyperlinks. This supports clicking on an object to define a link from that object, and then click on another object to define a link to that second object as a destination. This inserts a ZAnchorGroup which can then be used to follow the link.

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.

See Also:
Serialized Form

Constructor Summary
ZLinkEventHandler(ZNode node, ZCanvas canvas)
          Create a new link event handler.
 
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)
          Invoked when a mouse button is pressed on a node and then dragged.
 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)
          Invoked when a mouse button has been pressed on a component.
 void mouseReleased(ZMouseEvent e)
          Invoked when a mouse button has been released on a component.
 void setActive(boolean active)
          Specifies whether this event handler is active or not.
protected  void updateHilite(ZMouseEvent e)
          Internal method to update the hilite on the object the mouse moves over.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ZLinkEventHandler

public ZLinkEventHandler(ZNode node,
                         ZCanvas canvas)
Create a new link event handler. It handles the interaction to interactively create a hyperlink.
Parameters:
node - The node this event handler attaches to.
canvas - The canvas this event handler attaches to
Method Detail

setActive

public void setActive(boolean active)
Specifies whether this event handler is active or not.
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

updateHilite

protected void updateHilite(ZMouseEvent e)
Internal method to update the hilite on the object the mouse moves over. It draws a box around the object, and also shows the link if there is one.
Parameters:
e - The mouse event that generated the hilite request

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.

mouseMoved

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

mousePressed

public void mousePressed(ZMouseEvent e)
Description copied from interface: ZMouseListener
Invoked when a mouse button has been pressed on a component.
Specified by:
mousePressed in interface ZMouseListener

mouseDragged

public void mouseDragged(ZMouseEvent e)
Description copied from interface: ZMouseMotionListener
Invoked when a mouse button is pressed on a node and then dragged. Mouse drag events will continue to be delivered to the node where the first originated until the mouse button is released (regardless of whether the mouse position is within the bounds of the node).
Specified by:
mouseDragged in interface ZMouseMotionListener

mouseReleased

public void mouseReleased(ZMouseEvent e)
Description copied from interface: ZMouseListener
Invoked when a mouse button has been released on a component.
Specified by:
mouseReleased in interface ZMouseListener

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

Jazz API Documentation