public class IlvChartPrintableDocument extends IlvPrintableDocument
IlvChartPrintableDocument
allows you to print an
IlvChart
in multiple pages.
The printing is executed according to several configuration parameters listed
below:
FIT_TO_DIMENSION
mode
resizes the chart so that it fits entirely the printable area independently
of the chart current aspect ratio. The SCALE_TO_DIMENSION
mode
resizes the chart so that it fits the printable area taking into account the
chart current aspect ratio.A document is composed of a set of pages containing printable graphic
objects. Pages are created in the createPages()
method.
Note that an IlvChartPrintableDocument
does not handle the
printing by itself and requires to be associated with an
IlvChartPrintingController
in order to be printed.
IlvChartPrintingController
Modifier and Type | Field and Description |
---|---|
static int |
FIT_TO_DIMENSION
The resize mode value to resize the chart to fit the printable page.
|
static float |
HIGH_RESOLUTION
The high resolution scale factor.
|
static float |
IDENTITY_RESOLUTION
The identity resolution scale factor.
|
static float |
MEDIUM_RESOLUTION
The medium resolution scale factor.
|
static int |
SCALE_TO_DIMENSION
The resize mode value to scale the chart to fit the printable page.
|
static int |
XMAX_YMAX
The XMAX_YMAX scaling alignment value.
|
static int |
XMAX_YMID
The XMAX_YMID scaling alignment value.
|
static int |
XMAX_YMIN
The XMAX_YMIN scaling alignment value.
|
static int |
XMID_YMAX
The XMID_YMAX scaling alignment value.
|
static int |
XMID_YMID
The XMID_YMID scaling alignment value.
|
static int |
XMID_YMIN
The XMID_YMIN scaling alignment value.
|
static int |
XMIN_YMAX
The YMIN_YMAX scaling alignment value.
|
static int |
XMIN_YMID
The XMIN_YMID scaling alignment value.
|
static int |
XMIN_YMIN
The XMIN_YMIN scaling alignment value.
|
ORDERED_BY_COLUMNS, ORDERED_BY_ROWS
NO_SUCH_PAGE, PAGE_EXISTS
UNKNOWN_NUMBER_OF_PAGES
Constructor and Description |
---|
IlvChartPrintableDocument(String name,
IlvChart chart,
boolean repeatYScales,
int pages,
boolean printChart,
IlvDataWindow window,
int orientation,
Paper paperFormat)
Creates a
IlvChartPrintableDocument for the specified
IlvChart using the specified parameters. |
IlvChartPrintableDocument(String name,
IlvChart chart,
boolean repeatYScales,
int pages,
boolean printChart,
IlvDataWindow window,
PageFormat pageFormat)
Creates a
IlvChartPrintableDocument for the specified
IlvChart using the specified parameters. |
IlvChartPrintableDocument(String name,
IlvChart chart,
int orientation,
Paper paperFormat)
Creates a
IlvChartPrintableDocument for the specified
IlvChart using the specified parameters. |
IlvChartPrintableDocument(String name,
IlvChart chart,
PageFormat pageFormat)
Creates a
IlvChartPrintableDocument for the specified
IlvChart using the specified parameters. |
Modifier and Type | Method and Description |
---|---|
protected IlvDataWindow |
computeDataWindow(int pageIdx,
int coordSysIdx)
Returns the data window to print in the specified page for the specified
coordinate system.
|
protected IlvPage[] |
createPages()
Creates the pages and populates this document.
|
protected IlvPrintableChart |
createPrintableChart(IlvPage page,
int pageIdx,
IlvUnit.Rectangle pageArea)
Returns a new
IlvPrintableChart instance to print the
document chart in the specified page. |
Color |
getBackground()
Returns the background color override.
|
IlvChart |
getChart()
Returns the
IlvChart that is printed. |
IlvDataWindow |
getDataWindow()
Returns the data window printed in this document.
|
IlvFlow |
getFlow()
Overwrite the method to disable the usage of the flow
in this type of document.
|
int |
getMultiPageCount()
Returns the number of pages on which the chart is printed.
|
boolean |
getRepeatTitle()
Returns whether the x-scale title should be printed on every pages.
|
boolean |
getRepeatYScales()
Returns whether the Y-Scales should be printed on every pages.
|
int |
getResizeMode()
Returns the resize mode.
|
float |
getResolutionScaleFactor()
Returns the resolution scale factor.
|
int |
getScalingAlignment()
Returns the scaling alignment.
|
boolean |
isPrintingChart()
Returns which of the chart or chart area is printed.
|
void |
setBackground(Color bgColor)
Sets the background color override.
|
void |
setChart(IlvChart chart)
Sets the chart to be printed.
|
void |
setDataWindow(IlvDataWindow window)
Sets the data window printed in this document.
|
void |
setMultiPageCount(int pages)
Sets the number of pages on which the chart is printed..
|
void |
setPrintingChart(boolean printChart)
Sets which of the chart or chart area is printed.
|
void |
setRepeatTitle(boolean repeat)
Sets whether the x-scales title should be printed on every pages.
|
void |
setRepeatYScales(boolean repeat)
Sets whether the Y-Scales should be printed on every pages.
|
void |
setResizeMode(int mode)
Sets the resize mode.
|
void |
setResolutionScaleFactor(float factor)
Sets the resolution scale factor.
|
void |
setScalingAlignment(int align)
Sets the scaling alignment.
|
addPage, addPropertyChangeListener, addPropertyChangeListener, enablePrintStyle, firePropertyChange, getAuthor, getColumnCount, getDate, getFooter, getHeader, getImageableBounds, getName, getNumberOfPages, getOrientation, getPage, getPageFormat, getPageFormat, getPageIndex, getPageOrder, getPaperFormat, getPrintable, getSides, getTemplatePage, invalidateFlowLayout, invalidatePages, isFlowLayoutValid, maybeInvalidatePages, prepareDocument, print, removeAll, removePage, removePropertyChangeListener, removePropertyChangeListener, setAuthor, setColumnCount, setDate, setFooter, setHeader, setName, setOrientation, setPageFormat, setPageOrder, setPages, setPaperFormat, setSides, setTemplatePage
public static final int FIT_TO_DIMENSION
public static final int SCALE_TO_DIMENSION
public static final int XMIN_YMIN
setScalingAlignment(int)
,
Constant Field Valuespublic static final int XMID_YMIN
setScalingAlignment(int)
,
Constant Field Valuespublic static final int XMAX_YMIN
setScalingAlignment(int)
,
Constant Field Valuespublic static final int XMIN_YMID
setScalingAlignment(int)
,
Constant Field Valuespublic static final int XMID_YMID
setScalingAlignment(int)
,
Constant Field Valuespublic static final int XMAX_YMID
setScalingAlignment(int)
,
Constant Field Valuespublic static final int XMIN_YMAX
setScalingAlignment(int)
,
Constant Field Valuespublic static final int XMID_YMAX
setScalingAlignment(int)
,
Constant Field Valuespublic static final int XMAX_YMAX
setScalingAlignment(int)
,
Constant Field Valuespublic static final float HIGH_RESOLUTION
public static final float MEDIUM_RESOLUTION
public static final float IDENTITY_RESOLUTION
public IlvChartPrintableDocument(String name, IlvChart chart, PageFormat pageFormat)
IlvChartPrintableDocument
for the specified
IlvChart
using the specified parameters. The document
creates pages used to print the specified chart. The printed data window
is equal to the data ranges of the default coordinate system axis.name
- The document name.chart
- The chart to print.pageFormat
- The default page format used for pages of the document.
Because a fixed page format is not apppropriate for all
printers and all locales, it is recommended that this
argument be constructed from
IlvPrintingController.getDefaultPageFormat()
or
IlvPrintingController.getDefaultPaperFormat()
.public IlvChartPrintableDocument(String name, IlvChart chart, boolean repeatYScales, int pages, boolean printChart, IlvDataWindow window, PageFormat pageFormat)
IlvChartPrintableDocument
for the specified
IlvChart
using the specified parameters. The document
creates pages used to print the specified chart.
To print multiple pages, you can use the parameter
pages
.name
- The document name.chart
- The chart to print.repeatYScales
- Indicates whether the y-scales are printed
repeatedly on every page.pages
- The number of pages.printChart
- true
to print the chart, false
to print the chart area.window
- The printed data window.pageFormat
- The default page format used for pages of the document.
Because a fixed page format is not apppropriate for all
printers and all locales, it is recommended that this
argument be constructed from
IlvPrintingController.getDefaultPageFormat()
or
IlvPrintingController.getDefaultPaperFormat()
.public IlvChartPrintableDocument(String name, IlvChart chart, int orientation, Paper paperFormat)
IlvChartPrintableDocument
for the specified
IlvChart
using the specified parameters. The document
creates pages used to print the specified chart. The printed data window
is equal to the data ranges of the default coordinate system axis.name
- The document name.chart
- The chart to print.orientation
- One of PageFormat.PORTRAIT
,
PageFormat.LANDSCAPE
,
PageFormat.REVERSE_LANDSCAPE
.paperFormat
- A paper format object, or null
if the paper
format shall be provided by the
IlvPrintingController
, depending on the default
printer or - if no printer is available - depending on
the current locale. Because a fixed page format is not
apppropriate for all printers and all locales, it is
recommended that this argument be null
or
constructed from
IlvPrintingController.getDefaultPaperFormat()
.public IlvChartPrintableDocument(String name, IlvChart chart, boolean repeatYScales, int pages, boolean printChart, IlvDataWindow window, int orientation, Paper paperFormat)
IlvChartPrintableDocument
for the specified
IlvChart
using the specified parameters. The document
creates pages used to print the specified chart.
To print multiple pages, you can use the parameter
pages
.name
- The document name.chart
- The chart to print.repeatYScales
- Indicates whether the y-scales are printed
repeatedly on every page.pages
- The number of pages.printChart
- true
to print the chart, false
to print the chart area.window
- The printed data window.orientation
- One of PageFormat.PORTRAIT
,
PageFormat.LANDSCAPE
,
PageFormat.REVERSE_LANDSCAPE
.paperFormat
- A paper format object, or null
if the paper
format shall be provided by the
IlvPrintingController
, depending on the default
printer or - if no printer is available - depending on
the current locale. Because a fixed page format is not
apppropriate for all printers and all locales, it is
recommended that this argument be null
or
constructed from
IlvPrintingController.getDefaultPaperFormat()
.public IlvChart getChart()
IlvChart
that is printed.setChart(IlvChart)
public void setChart(IlvChart chart)
chart
- The new chart.getChart()
public boolean getRepeatYScales()
setRepeatYScales(boolean)
public void setRepeatYScales(boolean repeat)
public boolean getRepeatTitle()
setRepeatTitle(boolean)
public void setRepeatTitle(boolean repeat)
public int getMultiPageCount()
setMultiPageCount(int)
public void setMultiPageCount(int pages)
public final boolean isPrintingChart()
true
to print the chart, false
to print the chart area.public void setPrintingChart(boolean printChart)
printChart
- true
to print the chart, false
to print the chart area.public IlvDataWindow getDataWindow()
public void setDataWindow(IlvDataWindow window)
public int getResizeMode()
setResizeMode(int)
public void setResizeMode(int mode)
FIT_TO_DIMENSION
,
SCALE_TO_DIMENSION
public int getScalingAlignment()
public void setScalingAlignment(int align)
public float getResolutionScaleFactor()
setResolutionScaleFactor(float)
public void setResolutionScaleFactor(float factor)
public Color getBackground()
null
for the default, possibly Swing
Look&Feel dependent, background color.public void setBackground(Color bgColor)
null
value, it overrides the default background color.
If specified as null
, the default (possibly Swing
Look&Feel dependent) background color is used.public IlvFlow getFlow()
IllegalArgumentException
.getFlow
in class IlvPrintableDocument
IlvPrintableDocument.isFlowLayoutValid()
,
IlvPrintableDocument.invalidateFlowLayout()
protected IlvPage[] createPages()
createPages
in class IlvPrintableDocument
protected IlvPrintableChart createPrintableChart(IlvPage page, int pageIdx, IlvUnit.Rectangle pageArea)
IlvPrintableChart
instance to print the
document chart in the specified page. The default implementation first
creates an IlvDefaultChartPrintContext
initialized
with the data window returned by computeDataWindow(int, int)
. Then it
returns an IlvPrintableChart
instance initialized with this
context.page
- The current printed page.pageIdx
- The page index in the document.pageArea
- The destination printable area (in paper coordinates).IlvPrintableChart
.protected IlvDataWindow computeDataWindow(int pageIdx, int coordSysIdx)
pageIdx
- The page index.coordSysIdx
- The coordinate system index.setDataWindow(ilog.views.chart.IlvDataWindow)
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.