org.foray.layout
Class LayoutStrategy

java.lang.Object
  extended by org.foray.layout.LayoutStrategy
All Implemented Interfaces:
org.axsl.layout.Layout, org.axsl.text.line.LineBreakHandler
Direct Known Subclasses:
PioneerLS

public abstract class LayoutStrategy
extends Object
implements org.axsl.text.line.LineBreakHandler, org.axsl.layout.Layout

Abstract base class for all Layout systems.


Constructor Summary
LayoutStrategy(org.apache.commons.logging.Log logger)
          Constructor.
 
Method Summary
 void formatPageSequence(org.axsl.area.PageCollection pageCollection)
           
 void formatStaticContent(org.axsl.area.PageArea pageArea)
          Formats the static content of the current page.
 org.apache.commons.logging.Log getLogger()
          Returns the logger.
 void handleLineBreakNonText(org.axsl.text.line.LineOutput lineOutput, org.axsl.text.line.LineNonText nonText, int sizeInline)
           
 void handleLineBreakText(org.axsl.text.line.LineOutput lineOutput, org.axsl.text.line.LineText text, int startOffset, int sizeInChars, int sizeInline, boolean hasDiscretionaryHyphen, boolean hasFauxSmallCaps, boolean isLastItemOnLine)
           
abstract  void layoutStaticContent(org.axsl.fo.fo.PageSequence pageSequence, org.axsl.fo.fo.Region region, org.axsl.area.RegionRefArea area)
          For a given region, layout the static content for that region.
 org.axsl.area.LineContentFactory popInlineStack()
          Pops an item off of the inline stack.
abstract  void processPageSequence(org.axsl.area.PageCollection pageCollection)
          Performs layout on one PageCollection.
 void pushInlineStack(org.axsl.area.LineContentFactory areaNode)
          Pushes an item onto the inline stack, that is, the stack of areas that are currently inside the active LineArea.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LayoutStrategy

public LayoutStrategy(org.apache.commons.logging.Log logger)
Constructor.

Parameters:
logger - The logger.
Method Detail

formatPageSequence

public void formatPageSequence(org.axsl.area.PageCollection pageCollection)
                        throws org.axsl.area.AreaTreeException
Specified by:
formatPageSequence in interface org.axsl.layout.Layout
Throws:
org.axsl.area.AreaTreeException

processPageSequence

public abstract void processPageSequence(org.axsl.area.PageCollection pageCollection)
                                  throws org.axsl.area.AreaTreeException
Performs layout on one PageCollection.

Parameters:
pageCollection - The (empty) page collection into which layout should be placed. (The PageCollection has a reference to the FOTree PageSequence that has the content to be laid out).
Throws:
org.axsl.area.AreaTreeException - For errors during layout.

layoutStaticContent

public abstract void layoutStaticContent(org.axsl.fo.fo.PageSequence pageSequence,
                                         org.axsl.fo.fo.Region region,
                                         org.axsl.area.RegionRefArea area)
                                  throws org.axsl.area.AreaTreeException
For a given region, layout the static content for that region. This method allows PageCollection to generate blank pages as needed, and to call back to the LayoutStrategy for layout of the static content, without having to know the specifics of the layout process.

Parameters:
pageSequence - The page sequence whose static content is being processed.
region - The page region whose static content is being laid out.
area - The region area into which the static content should be placed.
Throws:
org.axsl.area.AreaTreeException - For errors during layout.

handleLineBreakText

public void handleLineBreakText(org.axsl.text.line.LineOutput lineOutput,
                                org.axsl.text.line.LineText text,
                                int startOffset,
                                int sizeInChars,
                                int sizeInline,
                                boolean hasDiscretionaryHyphen,
                                boolean hasFauxSmallCaps,
                                boolean isLastItemOnLine)
                         throws org.axsl.text.TextException
Specified by:
handleLineBreakText in interface org.axsl.text.line.LineBreakHandler
Throws:
org.axsl.text.TextException

handleLineBreakNonText

public void handleLineBreakNonText(org.axsl.text.line.LineOutput lineOutput,
                                   org.axsl.text.line.LineNonText nonText,
                                   int sizeInline)
                            throws org.axsl.text.TextException
Specified by:
handleLineBreakNonText in interface org.axsl.text.line.LineBreakHandler
Throws:
org.axsl.text.TextException

getLogger

public org.apache.commons.logging.Log getLogger()
Returns the logger.

Returns:
The logger.

formatStaticContent

public void formatStaticContent(org.axsl.area.PageArea pageArea)
                         throws org.axsl.area.AreaTreeException
Formats the static content of the current page.

Parameters:
pageArea - The page area whose static content should be laid out.
Throws:
org.axsl.area.AreaTreeException - For errors during layout.

pushInlineStack

public void pushInlineStack(org.axsl.area.LineContentFactory areaNode)
Pushes an item onto the inline stack, that is, the stack of areas that are currently inside the active LineArea.

Parameters:
areaNode - The AreaNode to be pushed onto the stack.

popInlineStack

public org.axsl.area.LineContentFactory popInlineStack()
Pops an item off of the inline stack.

Returns:
The AreaNode popped from the inline stack.


Copyright © 2017. All rights reserved.