Jazz API Documentation

edu.umd.cs.jazz.event
Class ZSwingEventHandler

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

public class ZSwingEventHandler
extends java.lang.Object
implements ZEventHandler, ZMouseListener, ZMouseMotionListener

Event handler to send MousePressed, MouseReleased, MouseMoved, MouseClicked, and MouseDragged events on Swing components within a ZCanvas

See Also:
ZMouseAdapter, ZMouseEvent, ZMouseListener, ZMouseMotionListener

Field Summary
protected  boolean active
           
protected  ZNode listenNode
           
 
Constructor Summary
ZSwingEventHandler(ZCanvas canvas)
           
ZSwingEventHandler(ZCanvas canvas, ZNode node)
           
 
Method Summary
 boolean isActive()
           
 void mouseClicked(ZMouseEvent e1)
          Invoked when the mouse has been clicked on a component.
 void mouseDragged(ZMouseEvent e1)
          Invoked when a mouse button is pressed on a node and then dragged.
 void mouseEntered(ZMouseEvent e1)
          Invoked when the mouse enters a component.
 void mouseExited(ZMouseEvent e1)
          Invoked when the mouse exits a component.
 void mouseMoved(ZMouseEvent e1)
          Invoked when the mouse button has been moved on a node (with no buttons no down).
 void mousePressed(ZMouseEvent e1)
          Invoked when a mouse button has been pressed on a component.
 void mouseReleased(ZMouseEvent e1)
          Invoked when a mouse button has been released on a component.
 void setActive(boolean active)
          Specifies whether this event handler is active or not.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

listenNode

protected ZNode listenNode

active

protected boolean active
Constructor Detail

ZSwingEventHandler

public ZSwingEventHandler(ZCanvas canvas,
                          ZNode node)

ZSwingEventHandler

public ZSwingEventHandler(ZCanvas canvas)
Method Detail

setActive

public void setActive(boolean active)
Description copied from interface: ZEventHandler
Specifies whether this event handler is active or not.
Specified by:
setActive in interface ZEventHandler
Tags copied from interface: ZEventHandler
Parameters:
active - True to make this event handler active

isActive

public boolean isActive()

mousePressed

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

mouseReleased

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

mouseClicked

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

mouseExited

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

mouseEntered

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

mouseMoved

public void mouseMoved(ZMouseEvent e1)
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

mouseDragged

public void mouseDragged(ZMouseEvent e1)
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

Jazz API Documentation