Sheet Class Reference

Inheritance diagram for Sheet:

PDFSheet XMLSheet List of all members.

Public Member Functions

 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.
void addConfigurationPath (File configPath)
void addRegion (Region r)
void addRegion (Region r, Units xOffset, Units yOffset)
void addRegions (File regionConfigurationFile)
 This file must be an XStream-serialized RegionConfiguration object.
boolean containsRegion (Region r)
Set< File > getConfigurationPaths ()
Units getHeight ()
String getName ()
PatternLocationToSheetLocationMapping getPatternLocationToSheetLocationMapping ()
PatternLocationToSheetLocationMapping getPatternLocationToSheetLocationMapping (File patternInfoFile)
 A convenience function for applying a pattern information file (created when the PDF is rendered).
Region getRegion (String regionName)
List< String > getRegionNames ()
Coordinates getRegionOffset (Region r)
List< RegiongetRegions ()
SheetRenderer getRenderer ()
Size getSize ()
Units getWidth ()
void setName (String n)
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)
String toDetailedString ()
String toString ()
String toXML ()
void setParentApplication (Application application)
Application getParentApplication ()

Protected Member Functions

void setSize (Units width, Units height)

Detailed Description

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.

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

Definition at line 49 of file Sheet.java.


Constructor & Destructor Documentation

Sheet ( double  widthInches,
double  heightInches 
)

A convenience method for our American friends.

=)

Parameters:
widthInches 
heightInches 

Definition at line 108 of file Sheet.java.

Sheet ( Units  w,
Units  h 
)

Choose your own units.

Parameters:
width 
height 

Definition at line 118 of file Sheet.java.

References Sheet.setSize().


Member Function Documentation

void addConfigurationPath ( File  configPath  ) 

Parameters:
configPath a directory that we should be aware of, for automatically loading things such as the patternInfo.xml file.

Definition at line 127 of file Sheet.java.

Referenced by Sheet.addRegions(), and PDFSheet.PDFSheet().

void addRegion ( Region  r,
Units  xOffset,
Units  yOffset 
)

Parameters:
r 
xOffset from the top left corner of the sheet
yOffset from the top left corner of the sheet

Definition at line 150 of file Sheet.java.

References Sheet.addRegion(), and Sheet.setRegionOffset().

void addRegion ( Region  r  ) 

Parameters:
r a region to be added to this sheet.

Definition at line 137 of file Sheet.java.

References Region.getName(), and Region.setParentSheet().

Referenced by Sheet.addRegion(), Sheet.addRegions(), FlowPaperLayout.layout(), and XMLSheet.XMLSheet().

void addRegions ( File  regionConfigurationFile  ) 

This file must be an XStream-serialized RegionConfiguration object.

This can be produced by hand, programmatically, or by the R3 Acrobat plugin.

Parameters:
regionConfigurationFile read in this file and add all the regions to this Sheet.

Definition at line 162 of file Sheet.java.

References Sheet.addConfigurationPath(), Sheet.addRegion(), Units.equals(), Sheet.getHeight(), RegionConfiguration.getHeight(), RegionConfiguration.getRegions(), Sheet.getWidth(), and RegionConfiguration.getWidth().

boolean containsRegion ( Region  r  ) 

Parameters:
r 
Returns:
whether this sheet contains a given region r.

Definition at line 187 of file Sheet.java.

Referenced by PatternLocationToSheetLocationMapping.setPatternInformationOfRegion().

Set<File> getConfigurationPaths (  ) 

Returns:
directories to look in for files like the patterned pdf, patternInfo.xml, or regions.xml files.

Definition at line 194 of file Sheet.java.

Units getHeight (  ) 

Returns:
the height of this sheet.

Definition at line 201 of file Sheet.java.

References Size.getHeight().

Referenced by Sheet.addRegions(), DebugPCanvas.addVisualComponents(), FlowPaperLayout.layout(), SheetRenderer.renderToJPEG(), SheetRenderer.renderToPDF(), SheetRenderer.renderToPDFContentLayers(), SheetFrame.SheetFrame(), Sheet.toDetailedString(), and Sheet.toString().

String getName (  ) 

Returns:

Definition at line 208 of file Sheet.java.

Referenced by SheetFrame.SheetFrame().

PatternLocationToSheetLocationMapping getPatternLocationToSheetLocationMapping ( File  patternInfoFile  ) 

A convenience function for applying a pattern information file (created when the PDF is rendered).

Note that if a pattern mapping object already exists for this sheet, it will be overwritten by this method!

Parameters:
patternInfoFile 
Returns:

Definition at line 230 of file Sheet.java.

References Sheet.setPatternLocationToSheetLocationMapping().

PatternLocationToSheetLocationMapping getPatternLocationToSheetLocationMapping (  ) 

Returns:
only one of these per any sheet.

Definition at line 215 of file Sheet.java.

References Sheet.setPatternLocationToSheetLocationMapping().

Referenced by Application.addSheet(), Application.getPatternMaps(), Application.removeSheet(), and SheetRenderer.SheetRenderer().

Region getRegion ( String  regionName  ) 

Parameters:
regionName This will only work if the names are unique.
Returns:
the region with this name...

Definition at line 241 of file Sheet.java.

Referenced by EventEngine.handlePenEvent().

List<String> getRegionNames (  ) 

Returns:

Definition at line 248 of file Sheet.java.

Coordinates getRegionOffset ( Region  r  ) 

Parameters:
r if it doesn't exist, that implies a 0,0 offset.
Returns:

Definition at line 261 of file Sheet.java.

Referenced by FlowPaperLayout.layout(), FlowPaperLayout.layoutRegionGroups(), SheetRenderer.renderToG2D(), and PDFSheetRenderer.renderToG2D().

List<Region> getRegions (  ) 

Returns:
the internal list of regions

Definition at line 272 of file Sheet.java.

Referenced by DebugPCanvas.addVisualComponents(), CodeGenerator.generateInitializePaperUI(), CodeGenerator.generateSetupRegionMethods(), PatternLocationToSheetLocationMapping.PatternLocationToSheetLocationMapping(), SheetRenderer.renderToG2D(), PDFSheetRenderer.renderToG2D(), and SheetFrame.SheetFrame().

SheetRenderer getRenderer (  ) 

Returns:
a new Renderer for this object.

Reimplemented in PDFSheet.

Definition at line 279 of file Sheet.java.

Referenced by Application.renderToPDF().

Size getSize (  ) 

Returns:
a copy of the Size object (so you can't modify the size of this sheet)

Definition at line 286 of file Sheet.java.

References Size.clone().

Units getWidth (  ) 

Returns:

Definition at line 293 of file Sheet.java.

References Size.getWidth().

Referenced by Sheet.addRegions(), DebugPCanvas.addVisualComponents(), FlowPaperLayout.layout(), SheetRenderer.renderToJPEG(), SheetRenderer.renderToPDF(), SheetRenderer.renderToPDFContentLayers(), SheetFrame.SheetFrame(), Sheet.toDetailedString(), and Sheet.toString().

void setName ( String  n  ) 

Parameters:
n 

Definition at line 300 of file Sheet.java.

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.

You can even create such an object manually (experts only). See the PatternLocationToSheetLocationMapping object.

Definition at line 311 of file Sheet.java.

Referenced by Application.addSheet(), and Sheet.getPatternLocationToSheetLocationMapping().

void setRegionOffset ( Region  r,
Units  xOffset,
Units  yOffset 
)

Parameters:
r 
xOffset 
yOffset 

Definition at line 320 of file Sheet.java.

Referenced by Sheet.addRegion(), FlowPaperLayout.layout(), and FlowPaperLayout.layoutRegionGroups().

void setSize ( Units  width,
Units  height 
) [protected]

Parameters:
width 
height 

Definition at line 328 of file Sheet.java.

References Size.setSize().

Referenced by PDFSheet.PDFSheet(), Sheet.Sheet(), and XMLSheet.XMLSheet().

String toDetailedString (  ) 

Returns:

Definition at line 335 of file Sheet.java.

References Sheet.getHeight(), and Sheet.getWidth().

String toString (  ) 

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

Definition at line 363 of file Sheet.java.

References Sheet.getHeight(), and Sheet.getWidth().

String toXML (  ) 

Returns:

Definition at line 371 of file Sheet.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