|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectdasher.CDasherComponent
dasher.CDasherModule
dasher.CDasherInput
dasher.net.NetInput
public class NetInput
Dummy implementation of CDasherInput which provides input by virtue of accepting co-ordinates from some external source and reporting them when next GetCoordinates is called.
This is used by NetDasher to relay mouse co-ordinates extracted from an XML document by another class.
| Field Summary | |
|---|---|
private boolean |
coordsAvailable
Flag indicating whether new co-ordinates have been supplied since the last call to GetCoordinates. |
private long[] |
nextCoords
Cache of the most recently specified co-ordinates which will be returned next time GetCoordinates is called. |
| Fields inherited from class dasher.CDasherComponent |
|---|
m_EventHandler, m_SettingsStore |
| Constructor Summary | |
|---|---|
NetInput(CEventHandler events,
CSettingsStore sets)
Creates a new input device; calls our super-constructor with an ID of 12 and a type of 1. |
|
| Method Summary | |
|---|---|
int |
GetCoordinateCount()
Gets the number of co-ordinates this device returns. |
int |
GetCoordinates(int iN,
long[] Coordinates)
Returns the last co-ordinates supplied by setNextCoords if coordsAvailable is true, or (0,0) otherwise. |
void |
setNextCoords(long x,
long y)
Sets the next co-ordinates to be reported by GetCoordinates |
| Methods inherited from class dasher.CDasherInput |
|---|
Activate, Deactivate, SetMaxCoordinates |
| Methods inherited from class dasher.CDasherModule |
|---|
GetID, GetName, GetType, Ref, Unref |
| Methods inherited from class dasher.CDasherComponent |
|---|
GetBoolParameter, GetLongParameter, GetParameterName, GetParameterType, GetStringParameter, HandleEvent, InsertEvent, SetBoolParameter, SetLongParameter, SetStringParameter, UnregisterComponent |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private long[] nextCoords
private boolean coordsAvailable
| Constructor Detail |
|---|
public NetInput(CEventHandler events,
CSettingsStore sets)
events - EventHandler with which to mention ourselvessets - Settings repository to use| Method Detail |
|---|
public int GetCoordinateCount()
CDasherInputAt present, only 1- and 2-axis devices are accepted, but this may be easily upgraded in the future.
GetCoordinateCount in class CDasherInput
public int GetCoordinates(int iN,
long[] Coordinates)
Also sets coordsAvailable to false.
GetCoordinates in class CDasherInputiN - Number of co-ordinates expected.Coordinates - Fill with the current co-ordinates
public void setNextCoords(long x,
long y)
x - X co-ordinate to returny - Y co-ordinate to return
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||