com.jrefinery.report.targets.pageable
Class AlignedLogicalPageWrapper

java.lang.Object
  |
  +--com.jrefinery.report.targets.pageable.AlignedLogicalPageWrapper
All Implemented Interfaces:
LogicalPage

public class AlignedLogicalPageWrapper
extends java.lang.Object
implements LogicalPage

The AlignedLogicalPageWrapper corrects all values of the wrapped LogicalPage so that the bounds are aligned for a given LayoutSupport.

Author:
Thomas Morgner

Constructor Summary
AlignedLogicalPageWrapper(LogicalPage logicalPage, LayoutSupport support)
          Creates a AlignedLogicalPageWrapper, which wraps the logicalpage to obey to the alignment defined by the LayoutSupport.
 
Method Summary
 void addBand(java.awt.geom.Rectangle2D bounds, Band band)
          Adds a band to the logical page.
 void close()
          Closes the page.
 float getHeight()
          Returns the page height, aligned by the vertical alignment of the layout support.
 OutputTarget getOutputTarget()
          Gets the output target.
 java.awt.print.PageFormat getPhysicalPageFormat()
          Returns the aligned physical page format.
 float getWidth()
          Returns the page width, aligned by the horizontal alignment of the layout support.
 boolean isEmpty()
          Returns true if the page is empty, and false otherwise.
 boolean isOpen()
          Returns true if the page is open, and false otherwise.
 LogicalPage newInstance()
          Creates a new instance of a logical page.
 void open()
          Opens the page.
 void replaySpool(Spool operations)
          Replays a spool.A spool is a collection of previously prepared content which should be printed later.
 void setOutputTarget(OutputTarget target)
          Sets the output target for the page.
 Spool spoolBand(java.awt.geom.Rectangle2D bounds, Band band)
          Generate a spool.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AlignedLogicalPageWrapper

public AlignedLogicalPageWrapper(LogicalPage logicalPage,
                                 LayoutSupport support)
Creates a AlignedLogicalPageWrapper, which wraps the logicalpage to obey to the alignment defined by the LayoutSupport.

Parameters:
logicalPage - the logical page that is aligned
support - the layout support which defines the alignment.
Throws:
java.lang.NullPointerException - if one of the parameters is null.
Method Detail

getWidth

public float getWidth()
Returns the page width, aligned by the horizontal alignment of the layout support.

Specified by:
getWidth in interface LogicalPage
Returns:
the page width.

getHeight

public float getHeight()
Returns the page height, aligned by the vertical alignment of the layout support.

Specified by:
getHeight in interface LogicalPage
Returns:
the page height.

isOpen

public boolean isOpen()
Returns true if the page is open, and false otherwise.

Specified by:
isOpen in interface LogicalPage
Returns:
true or false.

isEmpty

public boolean isEmpty()
Returns true if the page is empty, and false otherwise.

Specified by:
isEmpty in interface LogicalPage
Returns:
true or false.

close

public void close()
Closes the page.

Specified by:
close in interface LogicalPage

open

public void open()
Opens the page.

Specified by:
open in interface LogicalPage

replaySpool

public void replaySpool(Spool operations)
Replays a spool.A spool is a collection of previously prepared content which should be printed later.

Specified by:
replaySpool in interface LogicalPage
Parameters:
operations - the spool that should be replayed.

spoolBand

public Spool spoolBand(java.awt.geom.Rectangle2D bounds,
                       Band band)
                throws OutputTargetException
Generate a spool. A spool is a collection (or macro) of lowlevel processing instruction on how to distribute a band and its contents. When a spool is recorded, all operations needed to replay the spool later are created and stored within the spool object.

The spool can be saved, cloned and replayed at a later time.

Specified by:
spoolBand in interface LogicalPage
Parameters:
bounds - the bounds.
band - the band.
Returns:
a spool.
Throws:
OutputTargetException - if there is a problem with the output target.

addBand

public void addBand(java.awt.geom.Rectangle2D bounds,
                    Band band)
             throws OutputTargetException
Adds a band to the logical page.

Specified by:
addBand in interface LogicalPage
Parameters:
bounds - the bounds.
band - the band.
Throws:
OutputTargetException - if there is a problem with the output target.

getPhysicalPageFormat

public java.awt.print.PageFormat getPhysicalPageFormat()
Returns the aligned physical page format.

Specified by:
getPhysicalPageFormat in interface LogicalPage
Returns:
the physical page format.

getOutputTarget

public OutputTarget getOutputTarget()
Gets the output target.

Specified by:
getOutputTarget in interface LogicalPage
Returns:
the output target.

setOutputTarget

public void setOutputTarget(OutputTarget target)
Sets the output target for the page.

Specified by:
setOutputTarget in interface LogicalPage
Parameters:
target - the output target.

newInstance

public LogicalPage newInstance()
Creates a new instance of a logical page.

Specified by:
newInstance in interface LogicalPage
Returns:
a logical page.