Public Member Functions | |
PatternLocationToSheetLocationMapping (Sheet s) | |
One mapping object per sheet. | |
PatternLocationToSheetLocationMapping (Sheet s, File patternInfoFile) | |
These XML files are created automatically when you render a patterned PDF. | |
PatternCoordinateConverter | getCoordinateConverterForSample (PenSample sample) |
Checks whether this mapping contains the pen sample (streamed coordinates). | |
PatternCoordinateConverter | getPatternBoundsOfRegion (Region r) |
Map< Region, PatternCoordinateConverter > | getRegionToPatternMapping () |
An advanced method, to allow us to inspect the region <--> pattern mapping. | |
Sheet | getSheet () |
void | initializeMap (List< Region > regions) |
For all ACTIVE regions, we need a coordinate converter that will enable us to find out where the pen is on the region. | |
void | printMapping () |
For debugging. | |
void | saveConfigurationToXML (File xmlFile) |
Due to xstream's inability to serial/unserialize really complicated classes, we will save only a regionName+origin --> pattern info mapping. | |
void | setPatternInformationOfRegion (Region r, PatternCoordinateConverter coordinateInfo) |
For a region on our sheet, update the coordinate information so that it can be accessed at runtime by our EventEngine. | |
void | setPatternInformationOfRegion (Region region, PatternDots x, PatternDots y, PatternDots width, PatternDots height) |
A convenience function for mapping a contiguous (single-tile) patterned area to a region object. | |
void | setSheet (Sheet s) |
String | toString () |
Package Functions | |
SuppressWarnings ("unchecked") public void loadConfigurationFromXML(File xmlFile) | |
On Nov 9, 2006, I changed this to use the interface. |
An instance of this object should be built when a PDF is rendered with pattern. At that moment, regions on a sheet are bound to specific physical coordinates. Each application should store this mapping per sheet.
The SheetRenderer class uses this class to save the mapping to disk, so that a future instance can load the mapping and run the application.
This software is distributed under the BSD License.
Definition at line 47 of file PatternLocationToSheetLocationMapping.java.
One mapping object per sheet.
Create this object after you have added all the regions that you need to the sheet. This class will maintain a mapping of Regions to physical (streaming) and logical (batched) pen coordinates.
This constructor will try to load the pattern configuration automatically. If you want to set the mapping manually, you will need to load the map with TiledPatternCoordinateConverters so that active regions can be accessed.
s |
Definition at line 74 of file PatternLocationToSheetLocationMapping.java.
References Sheet.getRegions(), and PatternLocationToSheetLocationMapping.initializeMap().
PatternLocationToSheetLocationMapping | ( | Sheet | s, | |
File | patternInfoFile | |||
) |
These XML files are created automatically when you render a patterned PDF.
s | ||
patternInfoFile |
Definition at line 88 of file PatternLocationToSheetLocationMapping.java.
References Sheet.getRegions(), and PatternLocationToSheetLocationMapping.initializeMap().
PatternCoordinateConverter getCoordinateConverterForSample | ( | PenSample | sample | ) |
Checks whether this mapping contains the pen sample (streamed coordinates).
If it does, it returns the TiledPatternCoordinateConverter object for that sample. If not, it returns null.
sample |
Definition at line 103 of file PatternLocationToSheetLocationMapping.java.
PatternCoordinateConverter getPatternBoundsOfRegion | ( | Region | r | ) |
r | find the coordinate converter for this region. |
Definition at line 133 of file PatternLocationToSheetLocationMapping.java.
References Region.getName().
Map<Region, PatternCoordinateConverter> getRegionToPatternMapping | ( | ) |
An advanced method, to allow us to inspect the region <--> pattern mapping.
We can tell if the pattern map has an area of 0, which probably means it is uninitialized!
Definition at line 146 of file PatternLocationToSheetLocationMapping.java.
Sheet getSheet | ( | ) |
void initializeMap | ( | List< Region > | regions | ) |
For all ACTIVE regions, we need a coordinate converter that will enable us to find out where the pen is on the region.
We should be able to add new regions to a sheet after the fact, so we should have the ability to reinitialize this map later on.
regions |
Definition at line 164 of file PatternLocationToSheetLocationMapping.java.
Referenced by PatternLocationToSheetLocationMapping.PatternLocationToSheetLocationMapping().
void saveConfigurationToXML | ( | File | xmlFile | ) |
Due to xstream's inability to serial/unserialize really complicated classes, we will save only a regionName+origin --> pattern info mapping.
xmlFile |
Definition at line 243 of file PatternLocationToSheetLocationMapping.java.
Referenced by SheetRenderer.savePatternInformation().
void setPatternInformationOfRegion | ( | Region | region, | |
PatternDots | x, | |||
PatternDots | y, | |||
PatternDots | width, | |||
PatternDots | height | |||
) |
A convenience function for mapping a contiguous (single-tile) patterned area to a region object.
region | ||
x | ||
y | ||
width | ||
height |
Definition at line 295 of file PatternLocationToSheetLocationMapping.java.
References Region.getName(), Units.getValue(), and PatternLocationToSheetLocationMapping.setPatternInformationOfRegion().
void setPatternInformationOfRegion | ( | Region | r, | |
PatternCoordinateConverter | coordinateInfo | |||
) |
For a region on our sheet, update the coordinate information so that it can be accessed at runtime by our EventEngine.
The coordinateInfo object will translate incoming samples to coordinates relative to the region.
r | ||
coordinateInfo |
Definition at line 274 of file PatternLocationToSheetLocationMapping.java.
References Sheet.containsRegion().
Referenced by PatternLocationToSheetLocationMapping.setPatternInformationOfRegion().
void setSheet | ( | Sheet | s | ) |
SuppressWarnings | ( | "unchecked" | ) | [package] |
On Nov 9, 2006, I changed this to use the interface.
.. I'll need to run some regression tests to make sure I didn't break anything.
xmlFile |
Definition at line 212 of file PatternLocationToSheetLocationMapping.java.
String toString | ( | ) |
Definition at line 312 of file PatternLocationToSheetLocationMapping.java.