Inheritance diagram for Application:
Public Member Functions | |
Application (String theName) | |
void | addBatchEventHandler (BatchedEventHandler beh) |
void | addDevice (Device dev) |
void | addPenInput (PenInput penInputDevice) |
Add a digital pen (or pen simulator) for this application. | |
void | addSheet (Sheet sheet) |
When a sheet is added to an application, we will need to determine how the pattern maps to the sheet. | |
void | addSheet (Sheet sheet, File patternInfoFile) |
This method is better than the one argument version, because it makes everything explicit. | |
void | addSheet (Sheet sheet, PatternLocationToSheetLocationMapping patternToSheetMapping) |
This method may be the best of the three, because you explicitly construct the patternToSheetMapping (using any method you prefer). | |
List< BatchedEventHandler > | getBatchEventHandlers () |
A Paper Application needs BatchEventHandlers to detect when a person synchronizes a pen with the computer. | |
DebuggingEnvironment | getDebuggingEnvironment () |
PaperToolkit | getHostToolkit () |
String | getName () |
Collection< PatternLocationToSheetLocationMapping > | getPatternMaps () |
We can calculate this set at paper-application runtime, because each sheet has a reference to its pattern map. | |
List< PenInput > | getPenInputDevices () |
List< Sheet > | getSheets () |
boolean | isRunning () |
boolean | isUserChoosingDestinationForPDF () |
void | removeAllSheets () |
Useful for manipulating the application at RUNTIME. | |
void | removeBatchEventHandler (BatchedEventHandler beh) |
void | removeSheet (Sheet sheet) |
We can add and remove sheets before the application starts. | |
void | renderToPDF () |
Feel free to OVERRIDE this too. | |
void | renderToPDF (File parentDirectory, String fileNameWithoutExtension) |
void | setDebuggingEnvironment (DebuggingEnvironment debugEnvironment) |
void | setHostToolkit (PaperToolkit toolkit) |
Set it to null when the application is not running. | |
void | setUserChoosesPDFDestinationFlag (boolean flag) |
String | toString () |
Protected Member Functions | |
void | initializeBeforeStarting () |
Called right before an applications starts. |
An application will consist of Bundles and Sheets, and the actions that are bound to individual regions. A PaperToolkit can load/run an Application. When an Application is running, all events will go through the PaperToolkit's EventEngine.
The Application will be able to dispatch events to the correct handlers. An application will also be able to handle pens, but these pens must be registered with the PaperToolkit to enable the event engine to do its work.
This software is distributed under the BSD License.
Definition at line 42 of file Application.java.
Application | ( | String | theName | ) |
void addBatchEventHandler | ( | BatchedEventHandler | beh | ) |
beh |
Definition at line 104 of file Application.java.
Referenced by CalibrationCaptureApp.CalibrationCaptureApp().
void addDevice | ( | Device | dev | ) |
void addPenInput | ( | PenInput | penInputDevice | ) |
Add a digital pen (or pen simulator) for this application.
An application may have multiple pens.
pen |
Definition at line 120 of file Application.java.
Referenced by CalibrationCaptureApp.CalibrationCaptureApp(), CaptureApplication.CaptureApplication(), and PaperToolkit.startApplication().
void addSheet | ( | Sheet | sheet, | |
PatternLocationToSheetLocationMapping | patternToSheetMapping | |||
) |
This method may be the best of the three, because you explicitly construct the patternToSheetMapping (using any method you prefer).
Highest flexibility, but possibly inconvenient.
sheet | ||
patternInfoFile |
Definition at line 167 of file Application.java.
References Sheet.setPatternLocationToSheetLocationMapping().
void addSheet | ( | Sheet | sheet, | |
File | patternInfoFile | |||
) |
This method is better than the one argument version, because it makes everything explicit.
We MAY deprecate the other one at some point.
sheet | ||
patternInfoFile |
Definition at line 152 of file Application.java.
References Sheet.getPatternLocationToSheetLocationMapping().
void addSheet | ( | Sheet | sheet | ) |
When a sheet is added to an application, we will need to determine how the pattern maps to the sheet.
We will create a PatternLocationToSheetLocationMapping object from this sheet.
WARNING: The current design REQUIRES you to add the sheet AFTER you have added regions to the sheet. This is an unfortunate design (ordering constraints), and should be changed _if possible_.
Alternative, we can warn when there is ambiguity in loading patternInfo files.
sheet |
Definition at line 135 of file Application.java.
References Sheet.getPatternLocationToSheetLocationMapping(), and Sheet.setParentApplication().
List<BatchedEventHandler> getBatchEventHandlers | ( | ) |
A Paper Application needs BatchEventHandlers to detect when a person synchronizes a pen with the computer.
In the future, this may be integrated with standard event handling on a region. Right now, this is not possible, as we need the ability to calibrate the batched coordinates (which are processed by the PAD files) with the streaming coordinates.
Definition at line 196 of file Application.java.
Referenced by PaperToolkit.startApplication(), and PaperToolkit.stopApplication().
PaperToolkit getHostToolkit | ( | ) |
Definition at line 207 of file Application.java.
Referenced by Application.removeSheet(), and DebuggingEnvironment.showFlashView().
String getName | ( | ) |
Definition at line 214 of file Application.java.
Referenced by PaperToolkit.loadApplication(), Application.renderToPDF(), EventHandler.showMe(), PaperToolkit.startApplication(), and PaperToolkit.stopApplication().
Collection<PatternLocationToSheetLocationMapping> getPatternMaps | ( | ) |
We can calculate this set at paper-application runtime, because each sheet has a reference to its pattern map.
Definition at line 224 of file Application.java.
References Sheet.getPatternLocationToSheetLocationMapping(), and Application.getSheets().
Referenced by PaperToolkit.startApplication(), and PaperToolkit.stopApplication().
List<PenInput> getPenInputDevices | ( | ) |
Definition at line 235 of file Application.java.
Referenced by PaperToolkit.startApplication(), and PaperToolkit.stopApplication().
List<Sheet> getSheets | ( | ) |
Definition at line 242 of file Application.java.
Referenced by DebugPCanvas.addVisualComponents(), Application.getPatternMaps(), and PaperToolkit.loadApplication().
void initializeBeforeStarting | ( | ) | [protected] |
Called right before an applications starts.
Override to do anything you like right after a person clicks start, and right before the application actually starts.
Definition at line 250 of file Application.java.
Referenced by PaperToolkit.startApplication().
boolean isRunning | ( | ) |
Definition at line 257 of file Application.java.
Referenced by Application.removeSheet().
boolean isUserChoosingDestinationForPDF | ( | ) |
Definition at line 264 of file Application.java.
void removeBatchEventHandler | ( | BatchedEventHandler | beh | ) |
void removeSheet | ( | Sheet | sheet | ) |
We can add and remove sheets before the application starts.
However, this is also useful for manipulating the application at RUNTIME.
sheet |
Definition at line 301 of file Application.java.
References PaperToolkit.getEventEngine(), Application.getHostToolkit(), Sheet.getPatternLocationToSheetLocationMapping(), Application.isRunning(), and EventEngine.unregisterPatternMapForEventHandling().
void renderToPDF | ( | File | parentDirectory, | |
String | fileNameWithoutExtension | |||
) |
Renders all of the sheets to different PDF files... If there are four Sheets, it will make files as follows: parentDirectory
|_fileName_1.pdf
|_fileName_2.pdf
|_fileName_3.pdf
|_fileName_4.pdf
Feel Free to OVERRIDE this method if you want to attach different behavior to the App Manager's RenderPDF Button.
Definition at line 339 of file Application.java.
References Sheet.getRenderer(), and SheetRenderer.renderToPDF().
void renderToPDF | ( | ) |
Feel free to OVERRIDE this too.
It is called if the userChoosesPDFDestination flag is set to false, and the user presses the Render PDF Button in the App Manager.
Definition at line 318 of file Application.java.
References Application.getName().
void setHostToolkit | ( | PaperToolkit | toolkit | ) |
Set it to null when the application is not running.
Set it to a valid toolkit object when the application is running. This allows the application to access the toolkit object that is hosting it, during RUNTIME.
toolkit |
Definition at line 372 of file Application.java.
Referenced by PaperToolkit.startApplication(), and PaperToolkit.stopApplication().
void setUserChoosesPDFDestinationFlag | ( | boolean | flag | ) |
String toString | ( | ) |