|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.stanford.hci.r3.paper.Sheet
public class Sheet
Represents one sheet of interactive/augmented paper. This sheet can be large (like a GIGAprint) or it can be smaller, like an 8.5x11" print.
The Sheet can be rendered in many different contexts. It can be rendered to a PDF/PS file, or printed to a Java2D printer. It can also be rendered to the screen for a quick preview. Each of these options has different advantages/disadvantages. For example, when rendering to the screen or Java2D, no dot pattern is drawn by default. This is because doing so would be inefficient.
The dimensions of the sheet is kept in Units objects, and is only normalized (usually to Points) when necessary (i.e., when rendering a PDF).
On Coordinate Systems: To maintain the analogue with GUI development, we will choose the origin (0,0) to be the top-left corner of the document (I can hear the screams of PDF/Postscript enthusiasts already--I'm sorry). We will make it easy to flip the coordinate systems to a more Postscript-friendly way later. Possibly, we'll have a call like setCoordinateSystem(GUI | POSTSCRIPT).
This software is distributed under the BSD License.
Constructor Summary | |
---|---|
Sheet()
Defaults to US Letter. |
|
Sheet(double widthInches,
double heightInches)
A convenience method for our American friends. |
|
Sheet(Units w,
Units h)
Choose your own units. |
Method Summary | |
---|---|
void |
addConfigurationPath(java.io.File configPath)
|
void |
addRegion(Region r)
|
void |
addRegion(Region r,
Units xOffset,
Units yOffset)
|
void |
addRegions(java.io.File regionConfigurationFile)
This file must be an XStream-serialized RegionConfiguration object. |
boolean |
containsRegion(Region r)
|
java.util.Set<java.io.File> |
getConfigurationPaths()
|
Units |
getHeight()
|
java.lang.String |
getName()
|
Application |
getParentApplication()
|
PatternLocationToSheetLocationMapping |
getPatternLocationToSheetLocationMapping()
|
PatternLocationToSheetLocationMapping |
getPatternLocationToSheetLocationMapping(java.io.File patternInfoFile)
A convenience function for applying a pattern information file (created when the PDF is rendered). |
Region |
getRegion(java.lang.String regionName)
|
java.util.List<java.lang.String> |
getRegionNames()
|
Coordinates |
getRegionOffset(Region r)
|
java.util.List<Region> |
getRegions()
|
SheetRenderer |
getRenderer()
|
Size |
getSize()
|
Units |
getWidth()
|
void |
setName(java.lang.String n)
|
void |
setParentApplication(Application application)
|
void |
setPatternLocationToSheetLocationMapping(PatternLocationToSheetLocationMapping mapping)
Pass in a mapping object, that can be created by passing in this Sheet object to a new PatternLocationToSheetLocationMapping object, with an optional pattern info file. |
void |
setRegionOffset(Region r,
Units xOffset,
Units yOffset)
|
protected void |
setSize(Units width,
Units height)
|
java.lang.String |
toDetailedString()
|
java.lang.String |
toString()
|
java.lang.String |
toXML()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Sheet()
public Sheet(double widthInches, double heightInches)
widthInches
- heightInches
- public Sheet(Units w, Units h)
width
- height
- Method Detail |
---|
public void addConfigurationPath(java.io.File configPath)
configPath
- a directory that we should be aware of, for automatically loading things such as the
patternInfo.xml file.public void addRegion(Region r)
r
- a region to be added to this sheet.public void addRegion(Region r, Units xOffset, Units yOffset)
r
- xOffset
- from the top left corner of the sheetyOffset
- from the top left corner of the sheetpublic void addRegions(java.io.File regionConfigurationFile)
regionConfigurationFile
- read in this file and add all the regions to this Sheet.public boolean containsRegion(Region r)
r
-
public java.util.Set<java.io.File> getConfigurationPaths()
public Units getHeight()
public java.lang.String getName()
public PatternLocationToSheetLocationMapping getPatternLocationToSheetLocationMapping()
public PatternLocationToSheetLocationMapping getPatternLocationToSheetLocationMapping(java.io.File patternInfoFile)
patternInfoFile
-
public Region getRegion(java.lang.String regionName)
regionName
- This will only work if the names are unique.
public java.util.List<java.lang.String> getRegionNames()
public Coordinates getRegionOffset(Region r)
r
- if it doesn't exist, that implies a 0,0 offset.
public java.util.List<Region> getRegions()
public SheetRenderer getRenderer()
public Size getSize()
public Units getWidth()
public void setName(java.lang.String n)
n
- public void setPatternLocationToSheetLocationMapping(PatternLocationToSheetLocationMapping mapping)
public void setRegionOffset(Region r, Units xOffset, Units yOffset)
r
- xOffset
- yOffset
- protected void setSize(Units width, Units height)
width
- height
- public java.lang.String toDetailedString()
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public java.lang.String toXML()
public void setParentApplication(Application application)
public Application getParentApplication()
|
Copyright 2006 Stanford University | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |