edu.stanford.hci.r3
Class PaperToolkit

java.lang.Object
  extended by edu.stanford.hci.r3.PaperToolkit

public class PaperToolkit
extends java.lang.Object

Every PaperToolit has one EventEngine that handles input from users, and schedules output for the system. A PaperToolkit can run one or more Applications at the same time. You can also deactivate applications (to pause them). Or, you can remove them altogether. (These features are not yet fully implemented.)

This software is distributed under the BSD License.

TODOS:


Field Summary
static java.lang.String CONFIG_FILE_KEY
           
static java.lang.String CONFIG_FILE_VALUE
           
static java.lang.String CONFIG_PATTERN_PATH_KEY
           
static java.lang.String CONFIG_PATTERN_PATH_VALUE
           
static java.io.File PATTERN_PATH
          Where to find the directories that store our pattern definition files.
 
Constructor Summary
PaperToolkit()
          Start up a paper toolkit.
PaperToolkit(boolean useAppManager)
           
PaperToolkit(boolean useLookAndFeel, boolean useAppManager, boolean useHandwritingRecognitionServer)
           
 
Method Summary
static java.lang.Object fromXML(java.io.File xmlFile)
          Loads an object from an XML File.
 javax.swing.JFrame getApplicationManager()
          Allows an end user to stop, start, and otherwise manage loaded applications.
 EventEngine getEventEngine()
          EXPERTS ONLY: Interact with the EventEngine at runtime!
static java.io.File getPatternPath()
           
static java.io.File getPenSynchDataPath()
           
 java.lang.String getProperty(java.lang.String propertyKey)
           
static java.io.File getResourceFile(java.lang.String resourcePath)
          Can only point to files...
static java.io.File getToolkitRootPath()
          Before 1.0, we will need to make sure this can work with a JAR-style deployment.
static void initializeLookAndFeel()
          Sets up parameters for any Java Swing UI we need.
static void initializeNativeLookAndFeel()
           
 void loadApplication(Application app)
          Adds an application to the loaded list, and displays the application manager.
 void loadMostRecentPatternMappings()
           
static void main(java.lang.String[] args)
          Alternatively, try using the batch files instead.
 void print(Sheet sheet)
          TODO: Figure out the easiest way to send a PDF (with or without regions) to the default printer.
static void runApplication(Application paperApp)
          Convenience function that uses an internal PaperToolkit object.
static void startAcrobatDesigner()
           
 void startApplication(Application paperApp)
          Start this application and register all live pens with the event engine.
 void stopApplication(Application paperApp)
          Remove the application and stop receiving events from its pens....
static java.lang.String toXML(java.lang.Object obj)
           
static void toXML(java.lang.Object object, java.io.File outputFile)
           
static void toXML(java.lang.Object object, java.io.OutputStream stream)
           
static java.lang.String toXMLNoLineBreaks(java.lang.Object o)
           
 void unloadApplication(Application app)
           
 void useApplicationManager(boolean flag)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONFIG_FILE_KEY

public static final java.lang.String CONFIG_FILE_KEY
See Also:
Constant Field Values

CONFIG_FILE_VALUE

public static final java.lang.String CONFIG_FILE_VALUE
See Also:
Constant Field Values

CONFIG_PATTERN_PATH_KEY

public static final java.lang.String CONFIG_PATTERN_PATH_KEY
See Also:
Constant Field Values

CONFIG_PATTERN_PATH_VALUE

public static final java.lang.String CONFIG_PATTERN_PATH_VALUE
See Also:
Constant Field Values

PATTERN_PATH

public static final java.io.File PATTERN_PATH
Where to find the directories that store our pattern definition files.

Constructor Detail

PaperToolkit

public PaperToolkit()
Start up a paper toolkit. A toolkit can load multiple applications, and dispatch events accordingly (and between applications, ideally). There will be one event engine in the paper toolkit, and all events that applications generate will be fed through this single event engine.


PaperToolkit

public PaperToolkit(boolean useAppManager)
Parameters:
useAppManager -

PaperToolkit

public PaperToolkit(boolean useLookAndFeel,
                    boolean useAppManager,
                    boolean useHandwritingRecognitionServer)
Parameters:
useAppManager -
Method Detail

fromXML

public static java.lang.Object fromXML(java.io.File xmlFile)
Loads an object from an XML File.

Parameters:
xmlFile -
Returns:

getPatternPath

public static java.io.File getPatternPath()
Returns:
the location of pattern data, from the configuration files.

getPenSynchDataPath

public static java.io.File getPenSynchDataPath()
Returns:
the place where new XML files show up, when we synch our pen.

getResourceFile

public static java.io.File getResourceFile(java.lang.String resourcePath)
Can only point to files...

Parameters:
resourcePath -
Returns:

getToolkitRootPath

public static java.io.File getToolkitRootPath()
Before 1.0, we will need to make sure this can work with a JAR-style deployment. Currently, this does NOT work as a packaged jar.

Returns:
the root path to the toolkit (or some other canonical path where we can expect to find certain resources, like the HandwritingRecognition Server)

initializeLookAndFeel

public static void initializeLookAndFeel()
Sets up parameters for any Java Swing UI we need. Feel free to call this from an external class. If you use the default PaperToolkit() constructor, it will also use the custom look and feel. All PaperToolkit utility classes will also use this look and feel.


initializeNativeLookAndFeel

public static void initializeNativeLookAndFeel()

main

public static void main(java.lang.String[] args)
Alternatively, try using the batch files instead.

Parameters:
args -

runApplication

public static void runApplication(Application paperApp)
Convenience function that uses an internal PaperToolkit object.

Parameters:
paperApp -

startAcrobatDesigner

public static void startAcrobatDesigner()

toXML

public static java.lang.String toXML(java.lang.Object obj)
Parameters:
obj -
Returns:
a string representing the object translated into XML

toXML

public static void toXML(java.lang.Object object,
                         java.io.File outputFile)
Parameters:
object -
outputFile -

toXML

public static void toXML(java.lang.Object object,
                         java.io.OutputStream stream)
Parameters:
object -
stream - write the xml to disk or another output stream.

toXMLNoLineBreaks

public static java.lang.String toXMLNoLineBreaks(java.lang.Object o)
Parameters:
o -
Returns:
an XML string representation of the object, without line breaks.

getApplicationManager

public javax.swing.JFrame getApplicationManager()
Allows an end user to stop, start, and otherwise manage loaded applications.

Returns:

getEventEngine

public EventEngine getEventEngine()
EXPERTS ONLY: Interact with the EventEngine at runtime!

Returns:

getProperty

public java.lang.String getProperty(java.lang.String propertyKey)

loadApplication

public void loadApplication(Application app)
Adds an application to the loaded list, and displays the application manager.

Parameters:
app -

loadMostRecentPatternMappings

public void loadMostRecentPatternMappings()

print

public void print(Sheet sheet)
TODO: Figure out the easiest way to send a PDF (with or without regions) to the default printer.

Parameters:
sheet -

startApplication

public void startApplication(Application paperApp)
Start this application and register all live pens with the event engine. The event engine will then start dispatching events for this application until the application is stopped.

Parameters:
paperApp -

stopApplication

public void stopApplication(Application paperApp)
Remove the application and stop receiving events from its pens....

Parameters:
paperApp -

unloadApplication

public void unloadApplication(Application app)
Parameters:
app -

useApplicationManager

public void useApplicationManager(boolean flag)
Parameters:
flag - whether or not to load the app manager when you load an application.

Copyright 2006 Stanford University