edu.stanford.hci.r3.pattern
Class TiledPatternGenerator

java.lang.Object
  extended by edu.stanford.hci.r3.pattern.TiledPatternGenerator

public class TiledPatternGenerator
extends java.lang.Object

Creates arbitrary-sized pattern blocks, assuming you have enough pattern files to supply it with.

This object keeps track of what pattern blocks you have used. It stores it in a map of each page (basically a Rectangle2D bounds). Once a request comes in that is not servicable by this SINGLE page, it will increment the patternFile Number, and allow you to get pattern from the next page.

This software is distributed under the BSD License.


Field Summary
static java.lang.String DEFAULT_PATTERN_PACKAGE_NAME
          The name of the default pattern package (stored in pattern/default/).
 
Constructor Summary
TiledPatternGenerator()
          Default Pattern Path Location (PaperToolkit\data\pattern), automatically copied by eclipse to the export folder: PaperToolkit\bin\pattern.
TiledPatternGenerator(java.io.File patternPathLocation)
          Customize the location of pattern definition files.
 
Method Summary
 void displayTilingInformation(Units horizontal, Units vertical)
          Prints out some information on the tiling...
 PatternPackage getCurrentPatternPackage()
           
 TiledPattern getPattern(Units width, Units height)
          Returned pattern that is tiled appropriately, and automatically selected from the pattern package.
 PatternPackage getPatternPackageByName(java.lang.String name)
           
 java.util.List<java.lang.String> listAvailablePatternPackageNames()
           
 void resetUniquePatternTracker()
          Resets the tracked history in this object.
 void setPatternFileNumber(int num)
          Explicitly manipulate the page number which will be the source of pattern for the next call to getPattern(...)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_PATTERN_PACKAGE_NAME

public static final java.lang.String DEFAULT_PATTERN_PACKAGE_NAME
The name of the default pattern package (stored in pattern/default/).

See Also:
Constant Field Values
Constructor Detail

TiledPatternGenerator

public TiledPatternGenerator()
Default Pattern Path Location (PaperToolkit\data\pattern), automatically copied by eclipse to the export folder: PaperToolkit\bin\pattern. This will have to change at some point, when we move to the .jar deployment.


TiledPatternGenerator

public TiledPatternGenerator(java.io.File patternPathLocation)
Customize the location of pattern definition files.

Method Detail

displayTilingInformation

public void displayTilingInformation(Units horizontal,
                                     Units vertical)
Prints out some information on the tiling...


getCurrentPatternPackage

public PatternPackage getCurrentPatternPackage()
Returns:
the current pattern package.

getPattern

public TiledPattern getPattern(Units width,
                               Units height)
Returned pattern that is tiled appropriately, and automatically selected from the pattern package. By default, this pattern generator class will keep track of which pattern it has given you, and will give you unique pattern (if possible) every time you call this method.

Parameters:
width - the amount of pattern we need
height -
Returns:

getPatternPackageByName

public PatternPackage getPatternPackageByName(java.lang.String name)
Parameters:
name -
Returns:
a PatternPackage, indexed by name.

listAvailablePatternPackageNames

public java.util.List<java.lang.String> listAvailablePatternPackageNames()
Returns:

resetUniquePatternTracker

public void resetUniquePatternTracker()
Resets the tracked history in this object. The next call to getPattern(...) will start over at the default state after calling this function.


setPatternFileNumber

public void setPatternFileNumber(int num)
Explicitly manipulate the page number which will be the source of pattern for the next call to getPattern(...)

Parameters:
num -

Copyright 2006 Stanford University