|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--y.view.Graph2DPrinter
This class is responsible for printing the contents of
a Graph2DView
on one or more pages.
This class implements the Printable
interface and can thus be passed to a PrinterJob instance for printing.
Field Summary | |
static byte |
CLIP_GRAPH
Clip type specifier constant. |
static byte |
CLIP_VIEW
Clip type specifier constant. |
static byte |
SCALING_AUTO
Scaling type specifier constant. |
static byte |
SCALING_FIX
Scaling type specifier constant. |
Fields inherited from interface java.awt.print.Printable |
NO_SUCH_PAGE, PAGE_EXISTS |
Constructor Summary | |
Graph2DPrinter(Graph2DView view)
Instantiates a new Graph2DPrinter for the given Graph2DView. |
Method Summary | |
byte |
getClipType()
Returns the clipping type to be applied for printing. |
int |
getPosterColumns()
Returns the number of page columns to be used for printing. |
int |
getPosterRows()
Returns the number of page rows to be used for printing. |
boolean |
getPrintPosterCoords()
Whether or not to number the pages by poster coordinates. |
double |
getScalingFactor()
Returns the scale factor which is used when scale type is set to Graph2DPrinter.SCALING_FIX . |
byte |
getScalingType()
Sets the scaling type to be applied for printing. |
int |
print(Graphics g1d,
PageFormat pf,
int pi)
Printable implementation. |
void |
setClipType(byte clipType)
Sets the clipping type to be applied for printing. |
void |
setPosterColumns(int columns)
Sets the number of page columns to be used for printing. |
void |
setPosterRows(int rows)
Sets the number of page rows to be used for printing. |
void |
setPrintPosterCoords(boolean ppc)
Whether or not to number the pages by poster coordinates. |
void |
setScalingFactor(double scalingFactor)
Sets the scale factor which is used when the scaling type is set to Graph2DPrinter.SCALING_FIX . |
void |
setScalingType(byte scalingType)
Sets the scaling type to be applied for printing. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final byte SCALING_AUTO
public static final byte SCALING_FIX
Graph2DPrinter.setScalingFactor(double)
,
Constant Field Valuespublic static final byte CLIP_VIEW
Graph2DPrinter.setClipType(byte)
,
Constant Field Valuespublic static final byte CLIP_GRAPH
Graph2DPrinter.setClipType(byte)
,
Constant Field ValuesConstructor Detail |
public Graph2DPrinter(Graph2DView view)
Method Detail |
public void setPrintPosterCoords(boolean ppc)
public boolean getPrintPosterCoords()
Graph2DPrinter.setPrintPosterCoords(boolean)
public void setPosterRows(int rows)
public void setPosterColumns(int columns)
public int getPosterRows()
Graph2DPrinter.setPosterRows(int)
public int getPosterColumns()
Graph2DPrinter.setPosterColumns(int)
public void setClipType(byte clipType)
Graph2DPrinter.CLIP_GRAPH
is set.
clipType
- One of Graph2DPrinter.CLIP_VIEW
, Graph2DPrinter.CLIP_GRAPH
.public byte getClipType()
Graph2DPrinter.setClipType(byte)
public void setScalingFactor(double scalingFactor)
Graph2DPrinter.SCALING_FIX
.
scalingFactor
- scale factor, must be positive.public double getScalingFactor()
Graph2DPrinter.SCALING_FIX
.
Graph2DPrinter.setScalingFactor(double)
public void setScalingType(byte scalingType)
scalingType
- One of Graph2DPrinter.SCALING_AUTO
, Graph2DPrinter.SCALING_FIX
.public byte getScalingType()
Graph2DPrinter.SCALING_AUTO
, Graph2DPrinter.SCALING_FIX
.Graph2DPrinter.setScalingType(byte)
public int print(Graphics g1d, PageFormat pf, int pi) throws PrinterException
getPosterColumns()*getPosterRows()
number
of pages. The clipped part of the document will be printed
centered on these pages with maximum uniform scaling
applied.
This method can also be used to produce (print) preview images. In such cases it is important that there is a clip defined on the given graphics context.
print
in interface Printable
PrinterException
|
© Copyright 2000-2003, yWorks GmbH. All rights reserved. 2003 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |