|
JTablet 1.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cello.jtablet.TabletManager
public abstract class TabletManager
TabletManager
is responsible for detecting interesting
events, translating them into TabletEvent
objects, and finally broadcasting them to all registered
TabletListener
s.
TabletManager
relies on concrete private subclasses to
grab events from particular native libraries (e.g. Wacom's WinTab
driver, Cocoa's NSEvent system, or X11's XInput). Given the
difficulty in determining if a particular native library is
supported on the end-user's system, we provide the simple static
TabletManager
.getDefaultManager()
method that is guarnteed to return a TabletManager
which
is compatible.
Example usage:
// Get tablet managerTabletManager
manager =TabletManager
.getDefaultManager()
; // Add tablet listener to component manager.addTabletListener
(component, newTabletAdapter
() { public voidcursorDragged
(TabletEvent
event) { // Print out tablet drag events as they occur to system output System.out.println("dragged " + event); } });
TabletListener
Constructor Summary | |
---|---|
protected |
TabletManager()
To obtain a reference to a TabletManager, call the static TabletManager .getDefaultManager() method. |
Method Summary | |
---|---|
abstract void |
addScreenTabletListener(TabletListener listener)
Adds a TabletListener to the entire screen. |
abstract void |
addTabletListener(Component component,
TabletListener listener)
Adds a TabletListener to a specific Component. |
static TabletManager |
getDefaultManager()
Returns a shared tablet manager with the default settings. |
DriverStatus |
getDriverStatus()
Returns the tablet driver status for this tablet manager. |
abstract void |
removeScreenTabletListener(TabletListener listener)
Removes a TabletListener previously added with addScreenTabletListener(TabletListener) . |
abstract void |
removeTabletListener(Component component,
TabletListener listener)
Removes a TabletListener previously added to a specific component with addTabletListener(Component,TabletListener) . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected TabletManager()
TabletManager
.getDefaultManager()
method.
Method Detail |
---|
public static TabletManager getDefaultManager()
public abstract void addScreenTabletListener(TabletListener listener)
TabletListener
to the entire screen. This works very much like adding a MouseListener
and
MouseMotionListener
on the component, meaning:
Implementation Note: behavior for this method is undefined when working with mouse input (i.e. no
native library was loaded or the user is not using the tablet). Please use
addTabletListener(Component, TabletListener)
when working with on-screen components.
listener
- the listener to addTabletListener
,
addTabletListener(Component, TabletListener)
public abstract void removeScreenTabletListener(TabletListener listener)
addScreenTabletListener(TabletListener)
. It is safe to
call this method if the specified listener has not been added (or already removed).
listener
- the listener to removepublic abstract void addTabletListener(Component component, TabletListener listener)
MouseListener
and
MouseMotionListener
on the component, meaning:
component
- component to add the listener tolistener
- the listener to send events toTabletListener
public abstract void removeTabletListener(Component component, TabletListener listener)
addTabletListener(Component,TabletListener)
. It is safe to call this method if the specified listener
has not been added to the given component (or already removed).
component
- component to remove the listener fromlistener
- the listener to removepublic DriverStatus getDriverStatus()
|
JTablet 1.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |