|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.stanford.hci.r3.pattern.coordinates.PatternLocationToSheetLocationMapping
public class PatternLocationToSheetLocationMapping
This class stores mappings from regions of pattern (and their coordinates in Anoto space) to Sheets and locations on those sheets. This mapping works both ways. Given a location on the sheet, we should be able to find the pattern coordinate. Given a coordinate, we should be able to find the location on the sheet.
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.
| Constructor Summary | |
|---|---|
PatternLocationToSheetLocationMapping(Sheet s)
One mapping object per sheet. |
|
PatternLocationToSheetLocationMapping(Sheet s,
java.io.File patternInfoFile)
These XML files are created automatically when you render a patterned PDF. |
|
| Method Summary | |
|---|---|
PatternCoordinateConverter |
getCoordinateConverterForSample(PenSample sample)
Checks whether this mapping contains the pen sample (streamed coordinates). |
PatternCoordinateConverter |
getPatternBoundsOfRegion(Region r)
|
java.util.Map<Region,PatternCoordinateConverter> |
getRegionToPatternMapping()
An advanced method, to allow us to inspect the region <--> pattern mapping. |
Sheet |
getSheet()
|
void |
initializeMap(java.util.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 |
loadConfigurationFromXML(java.io.File xmlFile)
On Nov 9, 2006, I changed this to use the interface... |
void |
printMapping()
For debugging. |
void |
saveConfigurationToXML(java.io.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)
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public PatternLocationToSheetLocationMapping(Sheet s)
s -
public PatternLocationToSheetLocationMapping(Sheet s,
java.io.File patternInfoFile)
s - patternInfoFile - | Method Detail |
|---|
public PatternCoordinateConverter getCoordinateConverterForSample(PenSample sample)
sample -
public PatternCoordinateConverter getPatternBoundsOfRegion(Region r)
r - find the coordinate converter for this region.
public java.util.Map<Region,PatternCoordinateConverter> getRegionToPatternMapping()
public Sheet getSheet()
public void initializeMap(java.util.List<Region> regions)
regions - public void loadConfigurationFromXML(java.io.File xmlFile)
xmlFile - public void printMapping()
public void saveConfigurationToXML(java.io.File xmlFile)
xmlFile -
public void setPatternInformationOfRegion(Region r,
PatternCoordinateConverter coordinateInfo)
r - coordinateInfo -
public void setPatternInformationOfRegion(Region region,
PatternDots x,
PatternDots y,
PatternDots width,
PatternDots height)
region - x - y - width - height - public void setSheet(Sheet s)
s - public java.lang.String toString()
toString in class java.lang.ObjectObject.toString()
|
Copyright 2006 Stanford University | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||