edu.umd.cs.piccolox.pswing
Class PSwingEventHandler

java.lang.Object
  extended by edu.umd.cs.piccolox.pswing.PSwingEventHandler
All Implemented Interfaces:
PInputEventListener, java.util.EventListener

public class PSwingEventHandler
extends java.lang.Object
implements PInputEventListener

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

Author:
Ben Bederson, Lance Good, Sam Reid

Constructor Summary
PSwingEventHandler(PSwingCanvas canvas)
          Constructs a new PSwingEventHandler for the given canvas.
PSwingEventHandler(PSwingCanvas canvas, PNode node)
          Constructs a new PSwingEventHandler for the given canvas, and a node that will recieve the mouse events.
 
Method Summary
 boolean isActive()
          Determines if this event handler is active.
 void processEvent(PInputEvent aEvent, int type)
          Process a piccolo event and (if active) dispatch the corresponding Swing event.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PSwingEventHandler

public PSwingEventHandler(PSwingCanvas canvas,
                          PNode node)
Constructs a new PSwingEventHandler for the given canvas, and a node that will recieve the mouse events.

Parameters:
canvas - the canvas associated with this PSwingEventHandler.
node - the node the mouse listeners will be attached to.

PSwingEventHandler

public PSwingEventHandler(PSwingCanvas canvas)
Constructs a new PSwingEventHandler for the given canvas.

Method Detail

isActive

public boolean isActive()
Determines if this event handler is active.

Returns:
True if active

processEvent

public void processEvent(PInputEvent aEvent,
                         int type)
Process a piccolo event and (if active) dispatch the corresponding Swing event.

Specified by:
processEvent in interface PInputEventListener
Parameters:
aEvent -
type -


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