|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.miginfocom.util.print.PrintPainter
public abstract class PrintPainter
A painter that is to be used in a printing context. Might for instance be used to decorate the DateAreaContainer
with titles, footers, headers, a legend or a custom border.
NOTE! If layer index is > 100 the graphics will be painted above the "printable", therwise it will be painted below and might be invisible!
| Constructor Summary | |
|---|---|
protected |
PrintPainter()
|
protected |
PrintPainter(int layerIndex)
Constructor. |
| Method Summary | |
|---|---|
int |
compareTo(java.lang.Object o)
Sorts according to layerIndex. |
int |
getLayerIndex()
Property: The layerIndex that this panter will paint in. |
abstract void |
paint(java.awt.Graphics2D g,
java.awt.print.PageFormat pf,
java.awt.geom.Rectangle2D printableBounds,
java.awt.Point currentPage,
java.awt.Dimension pageCount)
Called by the Printable implementation to normally "decorate" the prntable object with borders, titles, legends
and such. |
void |
setLayerIndex(int layerIndex)
Property: The layerIndex that this panter will paint in. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected PrintPainter()
protected PrintPainter(int layerIndex)
layerIndex - The layerIndex that this panter will paint in. Lower values are panted before (under) other layers. The "printable" will be painted in layerIndex 100.
NOTE! If layer index is > 100 the graphics will be painted above the "printable", therwise it will be painted below and might be invisible!| Method Detail |
|---|
public int getLayerIndex()
100.
NOTE! If layer index is > 100 the graphics will be painted above the "printable", therwise it will be painted below and might be invisible!
200.public void setLayerIndex(int layerIndex)
100.
layerIndex - The new layer. Default is 200.public int compareTo(java.lang.Object o)
compareTo in interface java.lang.Comparableo - Another PrintPainter
getLayerIndex() - ((PrintPainter) o).getLayerIndex().
public abstract void paint(java.awt.Graphics2D g,
java.awt.print.PageFormat pf,
java.awt.geom.Rectangle2D printableBounds,
java.awt.Point currentPage,
java.awt.Dimension pageCount)
Printable implementation to normally "decorate" the prntable object with borders, titles, legends
and such.
Note that it is easy to get the total bounds of the whole paintable area and/or the current page's bounds from the PageFormat using
pf.getImagagableX(), pf.getImagagableY(), pf.getImagagableWidth() and pf.getImagagableHeight().
Bounds for current page:
new Rectangle2D.Double(pf.getImageableX(), pf.getImageableY(), pf.getImageableWidth(), pf.getImageableHeight()
Bounds for whole imageable area:
new Rectangle2D.Double(pf.getImageableX() - p.x * pf.getImageableWidth(), pf.getImageableY() - p.y * pf.getImageableHeight(),
pf.getImageableWidth() * dim.getWidth(), pf.getImageableHeight() * dim.getHeight()
g - The graphics object to paint in. Will have clip set to printableBounds. The coordinate system has it origin in the current page that
is printed.pf - The type of page that is printed to.printableBounds - The bounds of the printable.currentPage - The current page that is printed. Zero based.pageCount - The total number of pages in both directions.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||