Public Member Functions | |
EventEngine () | |
This object handles event dispatch by hooking up pen listeners to local and remote pen servers. | |
void | addEventHandlerForUnmappedEvents (EventHandler handler) |
This can detect and process events when it's outside of any other region. | |
EventReplayManager | getEventReplayManager () |
void | handlePenEvent (PenEvent penEvent) |
All pen events go through here. | |
void | handlePenUpEvent (PenEvent event) |
Send the penUp to the event handlers. | |
void | register (PenInput pen) |
If you register a pen multiple times, a different pen listener will be attached to the pen. | |
void | registerPatternMapForEventHandling (PatternLocationToSheetLocationMapping mapping) |
Really, this is the only method we need to do runtime binding. | |
void | registerPatternMapsForEventHandling (Collection< PatternLocationToSheetLocationMapping > patternMaps) |
Keep track of the pattern on sheets, so we can dispatch events appropriately. | |
void | removeEventHandlerForUnmappedEvents (EventHandler handler) |
void | unregisterAllPatternMaps () |
To reset the event engine at runtime. | |
void | unregisterPatternMapForEventHandling (PatternLocationToSheetLocationMapping patternMap) |
void | unregisterPatternMapsForEventHandling (Collection< PatternLocationToSheetLocationMapping > patternMaps) |
Remove these maps from our runtime list. | |
void | unregisterPen (PenInput pen) |
Stop watching this pen input device. |
This class is responsible for sending data to the event handlers, which will create clicks, drags, etc.
This software is distributed under the BSD License.
Definition at line 38 of file EventEngine.java.
EventEngine | ( | ) |
This object handles event dispatch by hooking up pen listeners to local and remote pen servers.
It will figure out where to dispatch incoming pen samples... and will activate the correct event handlers.
Definition at line 94 of file EventEngine.java.
void addEventHandlerForUnmappedEvents | ( | EventHandler | handler | ) |
This can detect and process events when it's outside of any other region.
..
handler |
Definition at line 103 of file EventEngine.java.
EventReplayManager getEventReplayManager | ( | ) |
Definition at line 151 of file EventEngine.java.
void handlePenEvent | ( | PenEvent | penEvent | ) |
All pen events go through here.
We dispatch it to the right handlers in this method. Will this have a ConcurrentModification problem, because we are iterating through the actual patternToSheetMaps list that can be updated at runtime?
TODO: Should this be multithreaded, for performance reasons?
TODO: Should this have synchronized access to patternToSheetMaps, for race conditions?
penEvent |
Definition at line 222 of file EventEngine.java.
References Region.getEventHandlers(), PenEvent.getOriginalSample(), Sheet.getRegion(), PatternCoordinateConverter.getRegionName(), PatternCoordinateConverter.getRelativeLocation(), PenEvent.getStreamedPatternCoordinate(), and PenEvent.setPercentageLocation().
Referenced by EventReplayManager.replay().
void handlePenUpEvent | ( | PenEvent | event | ) |
Send the penUp to the event handlers.
..
event |
Definition at line 315 of file EventEngine.java.
References PenEvent.setPercentageLocation().
Referenced by EventReplayManager.replay().
void register | ( | PenInput | pen | ) |
If you register a pen multiple times, a different pen listener will be attached to the pen.
Only ONE EventEngine listener will be attached to a pen at one time. Otherwise, multiple events would get fired by the same pen.
Why would you want to register a single pen multiple times? I dunnno. For some reason I added support for it... but perhaps I'll remove it in the future. :)
pen |
Definition at line 347 of file EventEngine.java.
Referenced by PaperToolkit.startApplication().
void registerPatternMapForEventHandling | ( | PatternLocationToSheetLocationMapping | mapping | ) |
Really, this is the only method we need to do runtime binding.
Who cares if the sheet doesn't have the right mapping, anyways?
mapping |
Definition at line 368 of file EventEngine.java.
void registerPatternMapsForEventHandling | ( | Collection< PatternLocationToSheetLocationMapping > | patternMaps | ) |
Keep track of the pattern on sheets, so we can dispatch events appropriately.
patternMaps |
Definition at line 381 of file EventEngine.java.
Referenced by PaperToolkit.startApplication().
void removeEventHandlerForUnmappedEvents | ( | EventHandler | handler | ) |
void unregisterPatternMapForEventHandling | ( | PatternLocationToSheetLocationMapping | patternMap | ) |
patternMap |
Definition at line 417 of file EventEngine.java.
Referenced by Application.removeSheet().
void unregisterPatternMapsForEventHandling | ( | Collection< PatternLocationToSheetLocationMapping > | patternMaps | ) |
Remove these maps from our runtime list.
patternMaps |
Definition at line 426 of file EventEngine.java.
Referenced by PaperToolkit.stopApplication().
void unregisterPen | ( | PenInput | pen | ) |
Stop watching this pen input device.
pen |
Definition at line 436 of file EventEngine.java.
Referenced by PaperToolkit.stopApplication().