com.wildcrest.j2printerworks
Interface Flowable

All Known Implementing Classes:
HorizontalLine, J2Pageable, PageEject, VerticalGap

public interface Flowable

This interface is used to implement objects which are able to print incrementally, advancing by one rectangular area at a time.


Method Summary
 boolean doneX()
          Returns whether there is no more of this Flowable object to print horizontally.
 boolean doneY()
          Returns whether there is no more of this Flowable object to print vertically.
 void printFlowable(java.awt.Graphics graphics, int availableWidth, int availableHeight, int nextFullPageWidth, int nextFullPageHeight)
          Print the next sequential section of this Flowable object that fits into the next incremental area.
 void resetFlowable()
          Reset the Flowable object so that it starts printing from the beginning.
 int usedX()
          Returns the amount this Flowable object was able to advance horizontally in the last printFlowable call.
 int usedY()
          Returns the amount this Flowable object was able to advance vertically in the last printFlowable call.
 

Method Detail

printFlowable

public void printFlowable(java.awt.Graphics graphics,
                          int availableWidth,
                          int availableHeight,
                          int nextFullPageWidth,
                          int nextFullPageHeight)
Print the next sequential section of this Flowable object that fits into the next incremental area.

Parameters:
graphics - context into which the page is to be drawn (null means advance but don't actually print)
availableWidth - horizontal amount into which the next sequential amount of this Flowable is to be printed.
availableHeight - vertical amount into which the next sequential amount of this Flowable is to be printed.
nextFullPageWidth - horizontal size of next full page (lets Flowables decide whether to opt for next page).
nextFullPageHeight - vertical size of next full page (lets Flowables decide whether to opt for next page).

The above parameters specify a rectangular area of size width by height (height = down the page) in pixels (72 dpi printing "points"). A Flowable object is assumed to print in "raster" order (over then down). Assumes upon entry that translation and scale are already set up so that 0,0 is the upper left corner to print and width and height are already increased by the overall printer scale. Flowable object must return Graphics context translation and scale to values at entry if changed during printing. Upon return from printFlowable, the doneX, doneY, usedX, and usedY methods describe the resulting state of the Flowable, based on its ability to make progress. Return values of usedX and usedY are to be specified in same scale as availableWidth and availableHeight were given.

Throws:
java.awt.print.PrinterException - thrown when the print job is terminated.

resetFlowable

public void resetFlowable()
Reset the Flowable object so that it starts printing from the beginning.


doneX

public boolean doneX()
Returns whether there is no more of this Flowable object to print horizontally.


doneY

public boolean doneY()
Returns whether there is no more of this Flowable object to print vertically.


usedX

public int usedX()
Returns the amount this Flowable object was able to advance horizontally in the last printFlowable call.


usedY

public int usedY()
Returns the amount this Flowable object was able to advance vertically in the last printFlowable call.