|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jrefinery.report.targets.pageable.output.AbstractOutputTarget
com.jrefinery.report.targets.pageable.output.PlainTextOutputTarget
An outputtarget, that generates plaintext. The text can be enriched with escape sequences for Epson- or IBM-Compatible printers.
This target does not support images, shapes or different fonts. The output generation is needle-printer oriented, the pageformat is translated into a text page, graphics coordinates are aligned along the character grid of the text mode.
It is assumed that all characters have the same width, proportional printing is not supported.
The output mode is defined by supplying a suitable PrinterCommandSet. Depending on the target printer, you can supply several PrinterCommandSets:
Suitable for all Epson ESC/P compatible printers. The content will be formated with ESC/P escape sequences.
Suitable for all IBM Compatible needle printers. The content will be formated using IBM escape sequences.
Suitable for unsupported printers and for text file output. The content will be written without any printer control sequences.
PrinterCommandSet
,
IBMPrinterCommandSet
,
EpsonPrinterCommandSet
,
PlainTextPage
Field Summary |
Fields inherited from interface com.jrefinery.report.targets.pageable.OutputTarget |
AUTHOR, TITLE |
Constructor Summary | |
PlainTextOutputTarget(LogicalPage logicalPage,
PrinterCommandSet commandSet)
Creates a new PlainTextOutputTarget which uses the given command set to write the generated content. |
|
PlainTextOutputTarget(java.awt.print.PageFormat logical,
java.awt.print.PageFormat physical,
PrinterCommandSet commandSet)
Creates a new PlainTextOutputTarget which uses the given command set to write the generated content. |
|
PlainTextOutputTarget(java.awt.print.PageFormat format,
PrinterCommandSet commandSet)
Creates a new PlainTextOutputTarget which uses the given command set to write the generated content. |
Method Summary | |
void |
beginPage(PhysicalPage page)
Signals that a page is being started. |
void |
close()
Closes the target. |
void |
configure(ReportConfiguration config)
Does nothing, the OutputTarget is configured by supplying a valid PrinterCommand set. |
protected ContentFactory |
createContentFactory()
Creates a content factory. |
OutputTarget |
createDummyWriter()
Creates an output target that mimics a real output target, but produces no output. |
SizeCalculator |
createTextSizeCalculator(FontDefinition font)
Creates a size calculator for the current state of the output target. |
void |
drawDrawable(DrawableContainer drawable)
Draws a drawable relative to the current position. |
void |
drawImage(ImageReference image)
This method is empty, as the PlainTextOutputTarget does not support images. |
void |
drawShape(java.awt.Shape shape)
This method is empty, as the PlainTextOutputTarget does not support shapes. |
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)
This method is empty, as the PlainTextOutputTarget does not support shapes. |
PrinterCommandSet |
getCommandSet()
Gets the printercommandset used to format the text. |
FontDefinition |
getFont()
Returns the current font. |
float |
getHorizontalAlignmentBorder()
Returns the element alignment. |
java.awt.Paint |
getPaint()
Returns the current paint. |
java.awt.Stroke |
getStroke()
Returns the current stroke. |
float |
getVerticalAlignmentBorder()
Returns the element alignment. |
boolean |
isOpen()
Returns true if the target is open, and false otherwise. |
void |
open()
Opens the target. |
void |
restoreState()
Restores the state of this graphics. |
void |
setFont(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 |
getContentFactory, getLogicalPage, getOperationBounds, getProperty, getProperty, getPropertyNames, setOperationBounds, setProperty |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PlainTextOutputTarget(java.awt.print.PageFormat format, PrinterCommandSet commandSet)
format
- the page format.commandSet
- the printer commandset used to write the generated content.
java.lang.NullPointerException
- if the printer command set is nullpublic PlainTextOutputTarget(java.awt.print.PageFormat logical, java.awt.print.PageFormat physical, PrinterCommandSet commandSet)
commandSet
- the printer commandset used to write the generated content.logical
- the page format used by this target for layouting.physical
- the page format used by this target for printing.
java.lang.NullPointerException
- if the printer command set is nullpublic PlainTextOutputTarget(LogicalPage logicalPage, PrinterCommandSet commandSet)
commandSet
- the printer commandset used to write the generated content.logicalPage
- the page format used by this target for layouting.
java.lang.NullPointerException
- if the printer command set is nullMethod Detail |
public PrinterCommandSet getCommandSet()
public void open() throws OutputTargetException
OutputTargetException
- if there is some problem opening the target.public boolean isOpen()
public void close()
public void beginPage(PhysicalPage page)
page
- the physical page.public void endPage() throws OutputTargetException
OutputTargetException
- if there is some problem with the target.public void restoreState() throws OutputTargetException
OutputTargetException
- if the argument is not an instance of G2State.public FontDefinition getFont()
public void setFont(FontDefinition font) throws OutputTargetException
font
- the font.
OutputTargetException
- if there is a problem setting the font.public java.awt.Stroke getStroke()
public void setStroke(java.awt.Stroke stroke) throws OutputTargetException
stroke
- the stroke.
OutputTargetException
- if there is a problem setting the stroke.public java.awt.Paint getPaint()
public void setPaint(java.awt.Paint paint) throws OutputTargetException
paint
- The paint.
OutputTargetException
- if there is a problem setting the paint.public void drawString(java.lang.String text)
text
- the text.public void drawShape(java.awt.Shape shape)
shape
- the shape to draw.public void fillShape(java.awt.Shape shape)
shape
- the shape to draw.public void drawImage(ImageReference image) throws OutputTargetException
image
- The image to draw (as ImageReference for possible embedding of raw data).
OutputTargetException
- if there is a problem setting the paint.public OutputTarget createDummyWriter()
public void configure(ReportConfiguration config)
config
- the configuration.public SizeCalculator createTextSizeCalculator(FontDefinition font) throws OutputTargetException
font
- the font.
OutputTargetException
- if there is a problem with the output target.public float getHorizontalAlignmentBorder()
mod(X, horizontalAlignment) == 0
and
mod(Y, verticalAlignment) == 0
getHorizontalAlignmentBorder
in interface LayoutSupport
getHorizontalAlignmentBorder
in class AbstractOutputTarget
public float getVerticalAlignmentBorder()
mod(X, horizontalAlignment) == 0
and
mod(Y, verticalAlignment) == 0
getVerticalAlignmentBorder
in interface LayoutSupport
getVerticalAlignmentBorder
in class AbstractOutputTarget
protected ContentFactory createContentFactory()
createContentFactory
in class AbstractOutputTarget
public void drawDrawable(DrawableContainer drawable)
drawable
- the drawable to draw.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |