PatternPackage Class Reference

List of all members.

Public Member Functions

 PatternPackage (File location)
PatternDots getMinPatternX ()
PatternDots getMinPatternY ()
String getName ()
double getNumDotsHorizontalBetweenPages ()
double getNumDotsVerticalBetweenPages ()
int getNumPatternColsPerFile ()
int getNumPatternRowsPerFile ()
StreamedPatternCoordinates getPatternCoordinateOfOriginOfFile (int patternFileNumber)
 Given a starting pattern file, we can determine the origin (top left corner) based on our knowledge of the origin of the first file, and the distance between each file.
String[] readPatternFromFile (int numPatternFile, Units originX, Units originY, Units width, Units height)
 We verify that numDotsX and numDotsY do not exceed the amount of dots in one file.
String toString ()

Static Public Member Functions

static Map< String, PatternPackagegetAvailablePatternPackages (File patternLocation)

Detailed Description

Represents a set of pattern files. One can tile these files, and create Postscript and PDF files out of them. This package can load specific pattern files into byte[][] so that you can index them for drawing on screen or into little graphics that represent pattern buttons.

All interaction with the specific pattern files should go in this class. This class also contains the mapping between Streamed Pattern Coordinates and Batched Coordinates (from docking the pen). This mapping is read from the XML file, and determined experimentally, by the Calibration classes.

This software is distributed under the BSD License.

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

Definition at line 43 of file PatternPackage.java.


Constructor & Destructor Documentation

PatternPackage ( File  location  ) 

Parameters:
location this directory contains .pattern files (text files that contain the pattern as described by Anoto) and a config.xml file, which describes the physical coordinates, among other things.

Definition at line 164 of file PatternPackage.java.

Referenced by PatternPackage.getAvailablePatternPackages().


Member Function Documentation

static Map<String, PatternPackage> getAvailablePatternPackages ( File  patternLocation  )  [static]

Returns:
the Pattern Packages that are available to the system. Packages are stored in the directory (pattern/). We return a Map<String, PatternPackage> so you can address the package by name.

Definition at line 50 of file PatternPackage.java.

References PatternPackage.getName(), and PatternPackage.PatternPackage().

PatternDots getMinPatternX (  ) 

Returns:
the minimum horizontal physical (streamed) coordinate

Definition at line 240 of file PatternPackage.java.

PatternDots getMinPatternY (  ) 

Returns:
the minimum vertical physical (streamed) coordinate

Definition at line 247 of file PatternPackage.java.

String getName (  ) 

Returns:
the name of the package (same as the directory's name)

Definition at line 254 of file PatternPackage.java.

Referenced by PatternPackage.getAvailablePatternPackages().

double getNumDotsHorizontalBetweenPages (  ) 

Returns:

Definition at line 261 of file PatternPackage.java.

Referenced by TiledPattern.getNumHorizDotsBetweenTiles().

double getNumDotsVerticalBetweenPages (  ) 

Returns:

Definition at line 268 of file PatternPackage.java.

Referenced by TiledPattern.getNumVertDotsBetweenTiles().

int getNumPatternColsPerFile (  ) 

Returns:

Definition at line 275 of file PatternPackage.java.

Referenced by TiledPatternGenerator.displayTilingInformation(), TiledPatternGenerator.getPattern(), and TiledPattern.TiledPattern().

int getNumPatternRowsPerFile (  ) 

Returns:

Definition at line 282 of file PatternPackage.java.

Referenced by TiledPatternGenerator.displayTilingInformation(), TiledPatternGenerator.getPattern(), and TiledPattern.TiledPattern().

StreamedPatternCoordinates getPatternCoordinateOfOriginOfFile ( int  patternFileNumber  ) 

Given a starting pattern file, we can determine the origin (top left corner) based on our knowledge of the origin of the first file, and the distance between each file.

Parameters:
patternFileNumber 
Returns:

Definition at line 293 of file PatternPackage.java.

References Units.getValue().

Referenced by TiledPattern.TiledPattern().

String [] readPatternFromFile ( int  numPatternFile,
Units  originX,
Units  originY,
Units  width,
Units  height 
)

We verify that numDotsX and numDotsY do not exceed the amount of dots in one file.

If so, the requested number of dots are modified to fit. Thus, the dimension of the String[] may be smaller than you requested. You may want to make sure numDotsX/Y are correct if you do not want to be surprised.

Parameters:
numPatternFile The number of the pattern file (numPatternFile.pattern).
originX Which column of pattern to start from (0 dots is the leftmost column)
originY Which row of pattern to start reading from (0 dots is the topmost column)
width How many dots across do we need? (in whatever Units is most convenient for you)
height How many dots down do we need?
Returns:
a String[] representing the requested pattern (encoded as uldr directions) each entry of the array represents one row of pattern. The columns are represented in the String. We expect this will be much easier to manipulate, especially since we do not need to index dots randomly.

Definition at line 324 of file PatternPackage.java.

References Units.getValueInPatternDots().

String toString (  ) 

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

Definition at line 451 of file PatternPackage.java.


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