org.umber.crucible.template
Class AsciiTemplate

java.lang.Object
  extended byorg.umber.crucible.template.TemplateBase
      extended byorg.umber.crucible.template.AsciiTemplate
All Implemented Interfaces:
ITemplate

public class AsciiTemplate
extends TemplateBase

Simple template implementation for ASCII files.

Author:
jsheets

Field Summary
static Dimension DEFAULT_PAGE_SIZE
           
 
Constructor Summary
AsciiTemplate()
           
AsciiTemplate(Dimension pageSize)
           
 
Method Summary
protected  ILayoutArea formatContent(IContent content)
          Converts the content object into a layout area.
protected  Page[] paginate(Page[] pages, ILayoutArea[] areas, Rectangle[] regions)
          Renders content from ContentFlow to the given pages, creating new pages if necessary for overflows.
 
Methods inherited from class org.umber.crucible.template.TemplateBase
addContentFlows, addStaticContent, buildContentFlows, buildStaticContent, clearContentFlows, clearStaticContent, getDefaultPageSize, getMargin, layout, setMargin
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_PAGE_SIZE

public static final Dimension DEFAULT_PAGE_SIZE
Constructor Detail

AsciiTemplate

public AsciiTemplate()

AsciiTemplate

public AsciiTemplate(Dimension pageSize)
Method Detail

formatContent

protected ILayoutArea formatContent(IContent content)
Description copied from class: TemplateBase
Converts the content object into a layout area. Should not set the layout area's position.

Specified by:
formatContent in class TemplateBase
Parameters:
content - content object
Returns:
layout area

paginate

protected Page[] paginate(Page[] pages,
                          ILayoutArea[] areas,
                          Rectangle[] regions)
Renders content from ContentFlow to the given pages, creating new pages if necessary for overflows.

Specified by:
paginate in class TemplateBase
Parameters:
pages - pages to render flow to
areas - layout areas to render across pages
regions - areas to render flow content to on each page
Returns:
original page array, or extended one if content overflows