Application Class Reference

Inheritance diagram for Application:

CaptureApplication List of all members.

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< BatchedEventHandlergetBatchEventHandlers ()
 A Paper Application needs BatchEventHandlers to detect when a person synchronizes a pen with the computer.
DebuggingEnvironment getDebuggingEnvironment ()
PaperToolkit getHostToolkit ()
String getName ()
Collection< PatternLocationToSheetLocationMappinggetPatternMaps ()
 We can calculate this set at paper-application runtime, because each sheet has a reference to its pattern map.
List< PenInputgetPenInputDevices ()
List< SheetgetSheets ()
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.

Detailed Description

The R3 approach suggests that you create Application objects to wrap your entire paper + digital application. This is only ONE approach to solving the paper + digital integration, as you can actually use R3's components separately...

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.

Author:
Ron B Yeh (ronyeh(AT)cs.stanford.edu)

Definition at line 42 of file Application.java.


Constructor & Destructor Documentation

Application ( String  theName  ) 

Parameters:
theName 

Definition at line 97 of file Application.java.


Member Function Documentation

void addBatchEventHandler ( BatchedEventHandler  beh  ) 

Parameters:
beh 

Definition at line 104 of file Application.java.

Referenced by CalibrationCaptureApp.CalibrationCaptureApp().

void addDevice ( Device  dev  ) 

Parameters:
dev 

Definition at line 111 of file Application.java.

void addPenInput ( PenInput  penInputDevice  ) 

Add a digital pen (or pen simulator) for this application.

An application may have multiple pens.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Returns:

Definition at line 196 of file Application.java.

Referenced by PaperToolkit.startApplication(), and PaperToolkit.stopApplication().

PaperToolkit getHostToolkit (  ) 

Returns:
the toolkit object that is running this application.

Definition at line 207 of file Application.java.

Referenced by Application.removeSheet(), and DebuggingEnvironment.showFlashView().

String getName (  ) 

Returns:
the application's name

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.

Returns:
the information that maps a pattern location to a location on a sheet.

Definition at line 224 of file Application.java.

References Sheet.getPatternLocationToSheetLocationMapping(), and Application.getSheets().

Referenced by PaperToolkit.startApplication(), and PaperToolkit.stopApplication().

List<PenInput> getPenInputDevices (  ) 

Returns:
the list of pens. The EventEngine will have to get the listeners to these pens...

Definition at line 235 of file Application.java.

Referenced by PaperToolkit.startApplication(), and PaperToolkit.stopApplication().

List<Sheet> getSheets (  ) 

Returns:

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 (  ) 

Returns:
true if this application is currently running.

Definition at line 257 of file Application.java.

Referenced by Application.removeSheet().

boolean isUserChoosingDestinationForPDF (  ) 

Returns:
whether to let the user choose where to render the Sheets...

Definition at line 264 of file Application.java.

void removeBatchEventHandler ( BatchedEventHandler  beh  ) 

Parameters:
beh 

Definition at line 291 of file Application.java.

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.

Parameters:
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.

Parameters:
toolkit 

Definition at line 372 of file Application.java.

Referenced by PaperToolkit.startApplication(), and PaperToolkit.stopApplication().

void setUserChoosesPDFDestinationFlag ( boolean  flag  ) 

Parameters:
flag 

Definition at line 394 of file Application.java.

String toString (  ) 

See also:
java.lang.Object.toString()

Definition at line 401 of file Application.java.


The documentation for this class was generated from the following file:
Generated on Sat Apr 14 18:21:40 2007 for R3 Paper Toolkit by  doxygen 1.4.7