|
Parkinson Disease Database | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttablet.Tablet
public class Tablet
Class that communicates with tablet dll library. Accomplish all tablet specific tasks.
Copyright: Copyright (c) 2005 Miroslav Skrbek, Jan Dolezel
Company: ČVUT FEL, Prague
Field Summary | |
---|---|
private static boolean |
capturing
|
private static Tablet |
instance
|
private java.util.List<TabletListener> |
listeners
Array of listeners for tablet packets |
private boolean |
opened
specifies whether is tablet ready for use |
private static boolean |
start
|
private java.lang.Thread |
thread
Runs on background and listens to tablet |
private static TabletInfo |
ti
Information about opened tablet |
private static int |
timeout
|
Constructor Summary | |
---|---|
private |
Tablet(TabletInfo tabletInfo)
Creates new tablet with provided information |
Method Summary | |
---|---|
void |
addTabletListener(TabletListener listener)
adds new TabletListener to list of listeners |
void |
close()
stops listening to tablet |
static Tablet |
getInstance(TabletInfo tabletInfo,
int time)
Třída Tablet je jedináček. |
TabletInfo |
getTabletInfo()
returns information about tablet |
boolean |
isOpen()
specifies whether is tablet ready for use |
protected void |
notifyListeners(int[] packet)
notify listeners about new tablet packet |
protected void |
notifyListenersTimeout()
Informuj posluchače, že jsou data sbírána příliš dlouho |
void |
open()
tries to initialize tablet |
void |
removeTabletListener(TabletListener listener)
removes TabletListener from list of listeners |
void |
run()
loop for handling tablet specific events Method loops until interrupted. |
void |
setTabletInfo(TabletInfo tabletInfo)
sets new tablet information |
void |
startCapture(boolean start)
starts capturing packets from tablet If tablet is opened, method runs new thread for listening and exits. |
void |
stopCapture()
stops capturing packets |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static Tablet instance
private static boolean capturing
private static boolean start
private static int timeout
private java.util.List<TabletListener> listeners
private static TabletInfo ti
private java.lang.Thread thread
private boolean opened
Constructor Detail |
---|
private Tablet(TabletInfo tabletInfo)
tabletInfo
- tablet measuresMethod Detail |
---|
public static Tablet getInstance(TabletInfo tabletInfo, int time)
tabletInfo
- TabletInfotime
- int
public void close()
public void open()
public void run()
Method loops until interrupted. When recieve packets from tablets, it converts them to tablet points and let know listeners. First notifing is performed after the tablet pen has touched the surface.
run
in interface java.lang.Runnable
public void startCapture(boolean start)
If tablet is opened, method runs new thread for listening and exits.
public void stopCapture()
protected void notifyListeners(int[] packet)
packet
- array for creating new TabletPointprotected void notifyListenersTimeout()
public TabletInfo getTabletInfo()
public void setTabletInfo(TabletInfo tabletInfo)
tabletInfo
- tablet measurespublic void addTabletListener(TabletListener listener)
listener
- class capable process TabletPacketpublic void removeTabletListener(TabletListener listener)
public boolean isOpen()
|
Parkinson Disease Database | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |