Inheritance diagram for Sheet:
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< Region > | getRegions () |
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) |
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.
Definition at line 49 of file Sheet.java.
Sheet | ( | double | widthInches, | |
double | heightInches | |||
) |
A convenience method for our American friends.
=)
widthInches | ||
heightInches |
Definition at line 108 of file Sheet.java.
Choose your own units.
width | ||
height |
Definition at line 118 of file Sheet.java.
References Sheet.setSize().
void addConfigurationPath | ( | File | configPath | ) |
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().
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 | ) |
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.
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 | ) |
r |
Definition at line 187 of file Sheet.java.
Referenced by PatternLocationToSheetLocationMapping.setPatternInformationOfRegion().
Set<File> getConfigurationPaths | ( | ) |
Definition at line 194 of file Sheet.java.
Units getHeight | ( | ) |
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 | ( | ) |
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!
patternInfoFile |
Definition at line 230 of file Sheet.java.
References Sheet.setPatternLocationToSheetLocationMapping().
PatternLocationToSheetLocationMapping getPatternLocationToSheetLocationMapping | ( | ) |
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 | ) |
regionName | This will only work if the names are unique. |
Definition at line 241 of file Sheet.java.
Referenced by EventEngine.handlePenEvent().
List<String> getRegionNames | ( | ) |
Coordinates getRegionOffset | ( | Region | r | ) |
r | if it doesn't exist, that implies a 0,0 offset. |
Definition at line 261 of file Sheet.java.
Referenced by FlowPaperLayout.layout(), FlowPaperLayout.layoutRegionGroups(), SheetRenderer.renderToG2D(), and PDFSheetRenderer.renderToG2D().
List<Region> getRegions | ( | ) |
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 | ( | ) |
Reimplemented in PDFSheet.
Definition at line 279 of file Sheet.java.
Referenced by Application.renderToPDF().
Size getSize | ( | ) |
Definition at line 286 of file Sheet.java.
References Size.clone().
Units getWidth | ( | ) |
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 | ) |
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().
r | ||
xOffset | ||
yOffset |
Definition at line 320 of file Sheet.java.
Referenced by Sheet.addRegion(), FlowPaperLayout.layout(), and FlowPaperLayout.layoutRegionGroups().
width | ||
height |
Definition at line 328 of file Sheet.java.
References Size.setSize().
Referenced by PDFSheet.PDFSheet(), Sheet.Sheet(), and XMLSheet.XMLSheet().
String toDetailedString | ( | ) |
Definition at line 335 of file Sheet.java.
References Sheet.getHeight(), and Sheet.getWidth().
String toString | ( | ) |
Definition at line 363 of file Sheet.java.
References Sheet.getHeight(), and Sheet.getWidth().
String toXML | ( | ) |