JTablet 1.2.0 API

cello.jtablet.event
Class TabletFunneler

java.lang.Object
  extended by cello.jtablet.event.TabletFunneler
All Implemented Interfaces:
TabletListener

public abstract class TabletFunneler
extends Object
implements TabletListener

A convenience class that implements TabletListener as a funnel to a single abstract method you can implement to handle all events. Override and implement the handleEvent(TabletEvent) method to receive all events in one place.

Example:

TabletListener listener = new TabletFunneler() {
     protected void handleEvent(TabletEvent ev) {
         System.out.println(ev.toString());
     }          
 }
 

Author:
marcello

Constructor Summary
TabletFunneler()
           
 
Method Summary
 void cursorDragged(TabletEvent ev)
          Invoked when the cursor is dragged (pressed+moved).
 void cursorEntered(TabletEvent ev)
          Invoked either when the cursor enters the given component, either spatially or through proximity.
 void cursorExited(TabletEvent ev)
          Invoked either when the cursor exits the given component, either spatially or through proximity.
 void cursorGestured(TabletEvent ev)
          Invoked when the user executes a gesture.
 void cursorMoved(TabletEvent ev)
          Invoked when the cursor is moved.
 void cursorPressed(TabletEvent ev)
          Invoked when a button is pressed.
 void cursorReleased(TabletEvent ev)
          Invoked when a button is released.
 void cursorScrolled(TabletEvent ev)
          Invoked when the user scrolls with a wheel or multi-touch scroll device.
protected abstract  void handleEvent(TabletEvent ev)
          Override this method to receive all possible TabletEvents that would go to this listener.
 void levelChanged(TabletEvent ev)
          Invoked when a level has changed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TabletFunneler

public TabletFunneler()
Method Detail

cursorDragged

public void cursorDragged(TabletEvent ev)
Description copied from interface: TabletListener
Invoked when the cursor is dragged (pressed+moved).

Specified by:
cursorDragged in interface TabletListener
Parameters:
ev - the event details object
See Also:
MouseMotionListener.mouseDragged(MouseEvent)

cursorEntered

public void cursorEntered(TabletEvent ev)
Description copied from interface: TabletListener
Invoked either when the cursor enters the given component, either spatially or through proximity.

Specified by:
cursorEntered in interface TabletListener
Parameters:
ev - the event details object
See Also:
MouseListener.mouseEntered(MouseEvent)

cursorExited

public void cursorExited(TabletEvent ev)
Description copied from interface: TabletListener
Invoked either when the cursor exits the given component, either spatially or through proximity.

Specified by:
cursorExited in interface TabletListener
Parameters:
ev - the event details object
See Also:
MouseListener.mouseExited(MouseEvent)

cursorGestured

public void cursorGestured(TabletEvent ev)
Description copied from interface: TabletListener
Invoked when the user executes a gesture.

Specified by:
cursorGestured in interface TabletListener
Parameters:
ev - the event details object
See Also:
TabletEvent.Type.SWIPED, TabletEvent.Type.ROTATED, TabletEvent.Type.ZOOMED

cursorMoved

public void cursorMoved(TabletEvent ev)
Description copied from interface: TabletListener
Invoked when the cursor is moved.

Specified by:
cursorMoved in interface TabletListener
Parameters:
ev - the event details object
See Also:
MouseMotionListener.mouseMoved(MouseEvent)

cursorPressed

public void cursorPressed(TabletEvent ev)
Description copied from interface: TabletListener
Invoked when a button is pressed.

Specified by:
cursorPressed in interface TabletListener
Parameters:
ev - the event details object
See Also:
MouseListener.mousePressed(MouseEvent)

cursorReleased

public void cursorReleased(TabletEvent ev)
Description copied from interface: TabletListener
Invoked when a button is released.

Specified by:
cursorReleased in interface TabletListener
Parameters:
ev - the event details object
See Also:
MouseListener.mouseReleased(MouseEvent)

cursorScrolled

public void cursorScrolled(TabletEvent ev)
Description copied from interface: TabletListener
Invoked when the user scrolls with a wheel or multi-touch scroll device.

Specified by:
cursorScrolled in interface TabletListener
Parameters:
ev - the event details object
See Also:
TabletEvent.Type.SCROLLED, TabletEvent.getScrollX(), TabletEvent.getScrollY()

levelChanged

public void levelChanged(TabletEvent ev)
Description copied from interface: TabletListener
Invoked when a level has changed. This will occur if some level (pressure, side pressure, tilt, rotation) changes without the actual position changing.

Specified by:
levelChanged in interface TabletListener
Parameters:
ev - the event details object

handleEvent

protected abstract void handleEvent(TabletEvent ev)
Override this method to receive all possible TabletEvents that would go to this listener.

Parameters:
ev -

JTablet 1.2.0 API