com.jrefinery.report.ext.junit.base.functionality
Class DebugOutputTarget

java.lang.Object
  |
  +--com.jrefinery.report.targets.pageable.output.AbstractOutputTarget
        |
        +--com.jrefinery.report.ext.junit.base.functionality.DebugOutputTarget
All Implemented Interfaces:
com.jrefinery.report.targets.base.layout.LayoutSupport, com.jrefinery.report.targets.pageable.OutputTarget

public class DebugOutputTarget
extends com.jrefinery.report.targets.pageable.output.AbstractOutputTarget


Field Summary
 
Fields inherited from interface com.jrefinery.report.targets.pageable.OutputTarget
AUTHOR, TITLE
 
Constructor Summary
DebugOutputTarget(java.awt.print.PageFormat format)
          Creates a new output target.
 
Method Summary
 void beginPage(com.jrefinery.report.targets.pageable.physicals.PhysicalPage page)
          Signals that a page is being started.
 void close()
          Closes the target.
 void configure(com.jrefinery.report.util.ReportConfiguration config)
          Configures the output target.
 com.jrefinery.report.targets.pageable.OutputTarget createDummyWriter()
          Creates an output target that mimics a real output target, but produces no output.
 com.jrefinery.report.targets.base.layout.SizeCalculator createTextSizeCalculator(com.jrefinery.report.targets.FontDefinition font)
          Creates a size calculator for the current state of the output target.
 void drawDrawable(com.jrefinery.report.DrawableContainer drawable)
          Draws a drawable relative to the current position.
 void drawImage(com.jrefinery.report.ImageReference image)
          Draws a image relative to the specified coordinates.
 void drawShape(java.awt.Shape shape)
          Draws a shape relative to the current position.
 void drawString(java.lang.String text)
          Draws a string at the current cursor position.
 void endPage()
          Signals that the current page is ended.
 void fillShape(java.awt.Shape shape)
          Fills the shape relative to the current position.
 com.jrefinery.report.targets.FontDefinition getFont()
          Returns the current font.
 java.awt.Paint getPaint()
          Returns the current paint.
 java.awt.Stroke getStroke()
          Returns the current stroke.
 boolean isOpen()
          Returns true if the target is open, and false otherwise.
 void open()
          Opens the target.
 void setFont(com.jrefinery.report.targets.FontDefinition font)
          Sets the font.
 void setPaint(java.awt.Paint paint)
          Sets the paint.
 void setStroke(java.awt.Stroke stroke)
          Defines the current stroke for the target.
 
Methods inherited from class com.jrefinery.report.targets.pageable.output.AbstractOutputTarget
createContentFactory, getContentFactory, getHorizontalAlignmentBorder, getLogicalPage, getOperationBounds, getProperty, getProperty, getPropertyNames, getVerticalAlignmentBorder, setOperationBounds, setProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DebugOutputTarget

public DebugOutputTarget(java.awt.print.PageFormat format)
Creates a new output target. Both the logical page size and the physical page size will be the same.

Parameters:
format - the page format.
Method Detail

open

public void open()
          throws com.jrefinery.report.targets.pageable.OutputTargetException
Opens the target.

Throws:
com.jrefinery.report.targets.pageable.OutputTargetException - if there is some problem opening the target.

isOpen

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

Returns:
true or false.

close

public void close()
Closes the target.


beginPage

public void beginPage(com.jrefinery.report.targets.pageable.physicals.PhysicalPage page)
Signals that a page is being started. Stores the state of the target to make it possible to restore the complete output target.

Parameters:
page - the physical page.

endPage

public void endPage()
             throws com.jrefinery.report.targets.pageable.OutputTargetException
Signals that the current page is ended. Some targets need to know when a page is finished, others can simply ignore this message.

Throws:
com.jrefinery.report.targets.pageable.OutputTargetException - if there is some problem with the target.

getFont

public com.jrefinery.report.targets.FontDefinition getFont()
Returns the current font.

Returns:
the current font.

setFont

public void setFont(com.jrefinery.report.targets.FontDefinition font)
             throws com.jrefinery.report.targets.pageable.OutputTargetException
Sets the font.

Parameters:
font - the font.
Throws:
com.jrefinery.report.targets.pageable.OutputTargetException - if there is a problem setting the font.

getStroke

public java.awt.Stroke getStroke()
Returns the current stroke.

Returns:
the stroke.

setStroke

public void setStroke(java.awt.Stroke stroke)
               throws com.jrefinery.report.targets.pageable.OutputTargetException
Defines the current stroke for the target.

The stroke is used to draw the outlines of shapes.

Parameters:
stroke - the stroke.
Throws:
com.jrefinery.report.targets.pageable.OutputTargetException - if there is a problem setting the stroke.

getPaint

public java.awt.Paint getPaint()
Returns the current paint.

Returns:
the paint.

setPaint

public void setPaint(java.awt.Paint paint)
              throws com.jrefinery.report.targets.pageable.OutputTargetException
Sets the paint.

Parameters:
paint - The paint.
Throws:
com.jrefinery.report.targets.pageable.OutputTargetException - if there is a problem setting the paint.

drawString

public void drawString(java.lang.String text)
Draws a string at the current cursor position.

Parameters:
text - the text.

drawShape

public void drawShape(java.awt.Shape shape)
Draws a shape relative to the current position.

Parameters:
shape - the shape to draw.

fillShape

public void fillShape(java.awt.Shape shape)
Fills the shape relative to the current position.

Parameters:
shape - the shape to draw.

drawDrawable

public void drawDrawable(com.jrefinery.report.DrawableContainer drawable)
Draws a drawable relative to the current position.

Parameters:
drawable - the drawable to draw.

drawImage

public void drawImage(com.jrefinery.report.ImageReference image)
               throws com.jrefinery.report.targets.pageable.OutputTargetException
Draws a image relative to the specified coordinates.

Parameters:
image - The image to draw (as ImageReference for possible embedding of raw data).
Throws:
com.jrefinery.report.targets.pageable.OutputTargetException - if there is a problem setting the paint.

createDummyWriter

public com.jrefinery.report.targets.pageable.OutputTarget createDummyWriter()
Creates an output target that mimics a real output target, but produces no output. This is used by the reporting engine when it makes its first pass through the report, calculating page boundaries etc. The second pass will use a real output target.

Returns:
a dummy output target.

configure

public void configure(com.jrefinery.report.util.ReportConfiguration config)
Configures the output target.

Parameters:
config - the configuration.

createTextSizeCalculator

public com.jrefinery.report.targets.base.layout.SizeCalculator createTextSizeCalculator(com.jrefinery.report.targets.FontDefinition font)
                                                                                 throws com.jrefinery.report.targets.base.layout.SizeCalculatorException
Creates a size calculator for the current state of the output target. The calculator is used to calculate the string width and line height and later maybe more...

Parameters:
font - the font.
Returns:
the size calculator.
Throws:
com.jrefinery.report.targets.base.layout.SizeCalculatorException - if there is a problem with the output target.