|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objecty.view.Graph2DPrinter
public class 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.
| Nested Class Summary | |
|---|---|
static class |
Graph2DPrinter.DefaultFooterDrawable
Default footer drawable implementation. |
static class |
Graph2DPrinter.DefaultTitleDrawable
Default title drawable implementation. |
static interface |
Graph2DPrinter.FooterDrawable
Interface for classes that want to add a footer to the printed page. |
static class |
Graph2DPrinter.PrintContext
Class that encapsulates contextual information when printing a page. |
static interface |
Graph2DPrinter.TitleDrawable
Interface for classes that want to add a title to the printed page. |
| Field Summary | |
|---|---|
static byte |
CLIP_CUSTOM
Clip type specifier constant. |
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. |
Rectangle2D |
getCustomClip()
Returns the custom area clip measured in world coordinates. |
Dimension |
getFixedScalingPosterDimension(PageFormat pf)
Returns the best-fit poster dimension measured in number of page columns and page rows. |
Graph2DPrinter.FooterDrawable |
getFooterDrawable()
Returns the footer drawable of this class. |
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 SCALING_FIX. |
byte |
getScalingType()
Sets the scaling type to be applied for printing. |
Graph2DPrinter.TitleDrawable |
getTitleDrawable()
Returns the title drawable of this class. |
int |
print(Graphics g1d,
PageFormat pf,
int pi)
Printable implementation. |
void |
setClipType(byte clipType)
Sets the clipping type to be applied for printing. |
void |
setCustomClip(Rectangle2D clip)
Sets the custom area clip measured in world coordinates. |
void |
setFooterDrawable(Graph2DPrinter.FooterDrawable fd)
Sets the footer drawable of this class. |
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 SCALING_FIX. |
void |
setScalingType(byte scalingType)
Sets the scaling type to be applied for printing. |
void |
setTitleDrawable(Graph2DPrinter.TitleDrawable td)
Sets the title drawable of this class. |
| 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
setScalingFactor(double),
Constant Field Valuespublic static final byte CLIP_VIEW
setClipType(byte),
Constant Field Valuespublic static final byte CLIP_GRAPH
setClipType(byte),
Constant Field Valuespublic static final byte CLIP_CUSTOM
setCustomClip(Rectangle2D)
setClipType(byte),
Constant Field Values| Constructor Detail |
|---|
public Graph2DPrinter(Graph2DView view)
| Method Detail |
|---|
public void setPrintPosterCoords(boolean ppc)
public boolean getPrintPosterCoords()
setPrintPosterCoords(boolean)public void setPosterRows(int rows)
public void setPosterColumns(int columns)
public int getPosterRows()
setPosterRows(int)public int getPosterColumns()
setPosterColumns(int)public void setClipType(byte clipType)
CLIP_GRAPH is set.
clipType - One of CLIP_VIEW, CLIP_GRAPH.public byte getClipType()
setClipType(byte)public void setScalingFactor(double scalingFactor)
SCALING_FIX.
scalingFactor - scale factor, must be positive.public double getScalingFactor()
SCALING_FIX.
setScalingFactor(double)public void setScalingType(byte scalingType)
scalingType - One of SCALING_AUTO, SCALING_FIX.public byte getScalingType()
SCALING_AUTO, SCALING_FIX.setScalingType(byte)public void setCustomClip(Rectangle2D clip)
CLIP_CUSTOM is specified.
public Rectangle2D getCustomClip()
CLIP_CUSTOM is specified.
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 PrintablePrinterExceptionpublic Dimension getFixedScalingPosterDimension(PageFormat pf)
public void setTitleDrawable(Graph2DPrinter.TitleDrawable td)
public Graph2DPrinter.TitleDrawable getTitleDrawable()
public void setFooterDrawable(Graph2DPrinter.FooterDrawable fd)
public Graph2DPrinter.FooterDrawable getFooterDrawable()
|
© Copyright 2000-2008, yWorks GmbH. All rights reserved. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||