SheetRenderer Class Reference

Inheritance diagram for SheetRenderer:

PDFSheetRenderer List of all members.

Public Member Functions

 SheetRenderer (Sheet s)
 Create a new TiledPatternGenerator for this Sheet.
 SheetRenderer (Sheet s, TiledPatternGenerator patternGenerator)
 Feel free to share TiledPatternGenerator between Sheets.
PatternLocationToSheetLocationMapping getPatternInformation ()
void renderToG2D (Graphics2D g2d)
 We assume the g2d is big enough for us to draw this Sheet to.
void renderToJPEG (File file)
 Use the default pixels per inch.
void renderToJPEG (File destJPEGFile, Pixels destUnits)
void renderToPDF (File destPDFFile)
 Uses the iText package to render a PDF file from scratch.
void savePatternInformation ()
 This saves an xml file with the same name/path, but different extension as the most-recently rendered PDF file.
void savePatternInformation (File patternInfoFile)
 After Rendering Pattern, we now know the particulars of the pattern coordinates for each region.
void setPatternColor (Color pColor)
void setPatternGenerator (TiledPatternGenerator tiledPatternGenerator)
 Useful for when rendering many sheets at a time.
void setRenderActiveRegionsWithPattern (boolean activeWithPattern)
void useLargerPatternDots ()
void useSmallerPatternDots ()

Protected Member Functions

void renderToPDFContentLayers (File destPDFFile, PdfContentByte topLayer, PdfContentByte bottomLayer)

Protected Attributes

boolean renderActiveRegionsWithPattern = true
 By default, any active regions will be overlaid with pattern (unique to at least this sheet, unless otherwise specified).
Sheet sheet
 The sheet we are to render.

Detailed Description

This class will render a Sheet into a JPEG, PDF, or Java2D graphics context.

For individual regions, it will use specific region renderers (e.g., ImageRenderer, PolygonRenderer, and TextRenderer).

This software is distributed under the BSD License.

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

Definition at line 51 of file SheetRenderer.java.


Constructor & Destructor Documentation

SheetRenderer ( Sheet  s  ) 

Create a new TiledPatternGenerator for this Sheet.

Parameters:
s 

Definition at line 97 of file SheetRenderer.java.

SheetRenderer ( Sheet  s,
TiledPatternGenerator  patternGenerator 
)

Feel free to share TiledPatternGenerator between Sheets.

That way, you can get unique pattern across multiple Sheets.

Parameters:
s 
patternGenerator 

Definition at line 108 of file SheetRenderer.java.

References Sheet.getPatternLocationToSheetLocationMapping(), and SheetRenderer.sheet.


Member Function Documentation

PatternLocationToSheetLocationMapping getPatternInformation (  ) 

Returns:

Definition at line 117 of file SheetRenderer.java.

void renderToG2D ( Graphics2D  g2d  ) 

We assume the g2d is big enough for us to draw this Sheet to.

By default, the transforms works at 72 dots per inch. Scale the transform beforehand if you would like better or worse rendering.

Parameters:
g2d 

Reimplemented in PDFSheetRenderer.

Definition at line 211 of file SheetRenderer.java.

References Sheet.getRegionOffset(), Sheet.getRegions(), Units.getValueInPoints(), Coordinates.getX(), Coordinates.getY(), and SheetRenderer.sheet.

Referenced by SheetRenderer.renderToJPEG(), and SheetRenderer.renderToPDFContentLayers().

void renderToJPEG ( File  destJPEGFile,
Pixels  destUnits 
)

Parameters:
destJPEGFile 
destUnits Converts the graphics2D object into a new coordinate space based on the destination units' pixels per inch. This is for the purposes of rendering the document to screen, where Graphics2D's default 72ppi isn't always the right way to do it.

Definition at line 250 of file SheetRenderer.java.

References Units.getConversionTo(), Sheet.getHeight(), Units.getValueIn(), Sheet.getWidth(), SheetRenderer.renderToG2D(), and SheetRenderer.sheet.

void renderToJPEG ( File  file  ) 

Use the default pixels per inch.

Specified in our configuration file.

Parameters:
file 

Definition at line 239 of file SheetRenderer.java.

void renderToPDF ( File  destPDFFile  ) 

Uses the iText package to render a PDF file from scratch.

iText is nice because we can write to a Graphics2D context. Alternatively, we can use PDF-like commands.

Parameters:
destPDFFile 

Reimplemented in PDFSheetRenderer.

Definition at line 282 of file SheetRenderer.java.

References Sheet.getHeight(), Units.getValueInPoints(), Sheet.getWidth(), SheetRenderer.renderToPDFContentLayers(), SheetRenderer.savePatternInformation(), and SheetRenderer.sheet.

Referenced by BundleRenderer.renderToIndividualPDFs(), and Application.renderToPDF().

void renderToPDFContentLayers ( File  destPDFFile,
PdfContentByte  topLayer,
PdfContentByte  bottomLayer 
) [protected]

Parameters:
destPDFFile 
topLayer 
bottomLayer 

Definition at line 314 of file SheetRenderer.java.

References Sheet.getHeight(), Units.getValueInPoints(), Sheet.getWidth(), SheetRenderer.renderActiveRegionsWithPattern, SheetRenderer.renderToG2D(), and SheetRenderer.sheet.

Referenced by SheetRenderer.renderToPDF(), and PDFSheetRenderer.renderToPDF().

void savePatternInformation ( File  patternInfoFile  ) 

After Rendering Pattern, we now know the particulars of the pattern coordinates for each region.

Save that information to disk.

Parameters:
patternInfoFile 

Definition at line 370 of file SheetRenderer.java.

References PatternLocationToSheetLocationMapping.saveConfigurationToXML().

void setPatternColor ( Color  pColor  ) 

Parameters:
pColor 

Definition at line 379 of file SheetRenderer.java.

void setPatternGenerator ( TiledPatternGenerator  tiledPatternGenerator  ) 

Useful for when rendering many sheets at a time.

This can guarantee that the pattern is unique across sheets. If you want to reset the pattern, or pick a particular sheet, you may, by interacting with the generator object.

Parameters:
tiledPatternGenerator 

Definition at line 390 of file SheetRenderer.java.

void setRenderActiveRegionsWithPattern ( boolean  activeWithPattern  ) 

Parameters:
activeWithPattern 

Definition at line 397 of file SheetRenderer.java.

References SheetRenderer.renderActiveRegionsWithPattern.


The documentation for this class was generated from the following file:
Generated on Sat Apr 14 18:21:44 2007 for R3 Paper Toolkit by  doxygen 1.4.7