public class IlvGanttPrintableDocument extends IlvPrintableDocument
IlvGanttPrintableDocument
allows you to print an
IlvGanttChart
or an IlvScheduleChart
in
multiple pages.ORDERED_BY_COLUMNS, ORDERED_BY_ROWS
NO_SUCH_PAGE, PAGE_EXISTS
UNKNOWN_NUMBER_OF_PAGES
Constructor and Description |
---|
IlvGanttPrintableDocument(String name,
IlvHierarchyChart chart,
int cols,
boolean repeatTable,
double divider,
int pagesPerBand,
boolean printAllRange,
Date start,
Date end,
int orientation,
Paper paperFormat)
Creates an
IlvGanttPrintableDocument for the specified
IlvHierarchyChart using the specified parameters. |
IlvGanttPrintableDocument(String name,
IlvHierarchyChart chart,
int cols,
boolean repeatTable,
double divider,
int pagesPerBand,
boolean printAllRange,
Date start,
Date end,
PageFormat pageFormat)
Creates an
IlvGanttPrintableDocument for the specified
IlvHierarchyChart using the specified parameters. |
IlvGanttPrintableDocument(String name,
IlvHierarchyChart chart,
int cols,
boolean repeatTable,
double divider,
int pagesPerBand,
boolean printAllRange,
int orientation,
Paper paperFormat)
Creates an
IlvGanttPrintableDocument for the specified
IlvHierarchyChart using the specified parameters. |
IlvGanttPrintableDocument(String name,
IlvHierarchyChart chart,
int cols,
boolean repeatTable,
double divider,
int pagesPerBand,
boolean printAllRange,
PageFormat pageFormat)
Creates an
IlvGanttPrintableDocument for the specified
IlvHierarchyChart using the specified parameters. |
IlvGanttPrintableDocument(String name,
IlvHierarchyChart chart,
int cols,
boolean repeatTable,
double divider,
int pagesPerBand,
Date start,
Date end,
PageFormat pageFormat)
Creates an
IlvGanttPrintableDocument for the specified
IlvHierarchyChart using the specified parameters. |
IlvGanttPrintableDocument(String name,
IlvHierarchyChart chart,
int cols,
boolean repeatTable,
double divider,
int pagesPerBand,
PageFormat pageFormat)
Creates an
IlvGanttPrintableDocument for the specified
IlvHierarchyChart using the specified parameters. |
Modifier and Type | Method and Description |
---|---|
protected IlvTimeInterval |
computeEntireRangeForEmptyModel()
Returns the range to be printed for an empty model.
|
protected IlvUnit.Measure |
computeHorizontalSpaceForGanttSheet()
Computes the available width for printing the Gantt sheet.
|
protected IlvPage[] |
createPages()
Creates the pages of this document.
|
protected IlvTimeInterval |
expandBeautifying(IlvTimeInterval interval)
Beautifies a time interval by expanding it enough so that it begins and
ends on an even time increment.
|
protected IlvTimeInterval |
expandIncludingAllGraphics(IlvTimeInterval interval,
IlvUnit.Measure hspace)
Expands a time interval so that it covers all graphic objects in the view,
for a transformer computed to match the given horizontal space.
|
IlvHierarchyChart |
getChart()
Returns the
IlvHierarchyChart that is printed. |
double |
getDividerPosition()
Returns the divider position, as the fractional position on the page that separates
the table and the Gantt sheet.
|
protected IlvDuration |
getDuration(int pageIndex)
Returns the duration for the specified page within a band.
|
IlvTimeInterval |
getEffectiveRange()
Returns the time interval from the start date of the first page in a band
to the last date of the last page in a band.
|
Date |
getEnd()
Returns the end date of the last page in a band.
|
IlvTimeInterval |
getEntireRange()
Returns the range to be printed, corresponding to the entire contents of
the Gantt model.
|
IlvFlow |
getFlow()
This method is overridden to disable the usage of the flow
in this type of document.
|
int |
getPagesPerBand()
Returns the number of pages per band.
|
boolean |
getRepeatTable()
Returns whether the table should be printed on every page.
|
Date |
getStart()
Returns the start date of the first page in a band.
|
protected Date |
getStart(int pageIndex)
Returns the start date for the specified page within a band.
|
int |
getTableColumnCount()
Returns the number of table columns to be printed.
|
boolean |
isPrintingAllRange()
Returns
true if the time range to be printed is the entire
time range, that is, the smallest range that includes all activities in
the model. |
boolean |
isPrintingWithBackground()
Returns whether the background is painted when printing.
|
protected void |
maybeInvalidatePages()
Overridden to invalidate the pages when the result of
getEffectiveRange() has changed. |
void |
setChart(IlvHierarchyChart chart)
Sets the chart to be printed.
|
void |
setDividerPosition(double divider)
Sets the divider position, as the fractional position on the page that separates
the table and the Gantt sheet.
|
void |
setEnd(Date end)
Sets the end date of the last page in a band.
|
void |
setPagesPerBand(int pages)
Sets the number of pages per band.
|
void |
setPrintingAllRange(boolean printAllRange)
Specifies whether to print the entire time range.
|
void |
setPrintingWithBackground(boolean includeBackground)
Sets whether the background is painted when printing.
|
void |
setRepeatTable(boolean repeat)
Sets whether the table should be printed on every page.
|
void |
setStart(Date start)
Sets the start date of the first page in a band.
|
void |
setTableColumnCount(int count)
Sets the number of table columns to be printed.
|
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, prepareDocument, print, removeAll, removePage, removePropertyChangeListener, removePropertyChangeListener, setAuthor, setColumnCount, setDate, setFooter, setHeader, setName, setOrientation, setPageFormat, setPageOrder, setPages, setPaperFormat, setSides, setTemplatePage
public IlvGanttPrintableDocument(String name, IlvHierarchyChart chart, int cols, boolean repeatTable, double divider, int pagesPerBand, PageFormat pageFormat)
IlvGanttPrintableDocument
for the specified
IlvHierarchyChart
using the specified parameters. The document
creates pages used to print the specified Gantt chart or Schedule chart.
The printed Gantt sheet will keep the same visible duration as the
specified Gantt chart. To print multiple pages, you can use
the parameter pagesPerBand
. Note that if the page
is not high enough to print all rows of the specified Gantt chart or
Schedule chart, more pages than the specified pagesPerBand
will be generated. The total number of pages will equal the specified
pagesPerBand
times the number of bands required to print
all the rows.name
- The name of the document.chart
- The Gantt chart or Schedule chart to be printed.cols
- Indicates the number of table columns to be printed.repeatTable
- Indicates whether the table should be printed
repeatedly on every page.divider
- Defines the position on the page that separates the
table and the Gantt sheet. The value must be between 0
an 1
.pagesPerBand
- The number of pages.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 IlvGanttPrintableDocument(String name, IlvHierarchyChart chart, int cols, boolean repeatTable, double divider, int pagesPerBand, boolean printAllRange, PageFormat pageFormat)
IlvGanttPrintableDocument
for the specified
IlvHierarchyChart
using the specified parameters. The document
creates pages used to print the specified Gantt chart or Schedule chart.
The printed Gantt sheet will keep the same visible duration as the
specified Gantt chart. To print multiple pages, you can use
the parameter pagesPerBand
. Note that if the page
is not high enough to print all rows of the specified Gantt chart or
Schedule chart, more pages than the specified pagesPerBand
will be generated. The total number of pages will equal the specified
pagesPerBand
times the number of bands required to print
all the rows.name
- The name of the document.chart
- The Gantt chart or Schedule chart to be printed.cols
- Indicates the number of table columns to be printed.repeatTable
- Indicates whether the table should be printed
repeatedly on every page.divider
- Defines the position on the page that separates the
table and the Gantt sheet. The value must be between 0
an 1
.pagesPerBand
- The number of pages.printAllRange
- Whether to print the entire time range.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 IlvGanttPrintableDocument(String name, IlvHierarchyChart chart, int cols, boolean repeatTable, double divider, int pagesPerBand, Date start, Date end, PageFormat pageFormat)
IlvGanttPrintableDocument
for the specified
IlvHierarchyChart
using the specified parameters. The document
creates pages used to print the specified Gantt chart or Schedule chart.
The time interval of the printed Gantt sheet on the first page is
specified by the start
and the end
parameters. To print multiple pages, you can use
the parameter pagesPerBand
. Note that if the page
is not high enough to print all rows of the specified Gantt chart or
Schedule chart, more pages than the specified pagesPerBand
will be generated. The total number of pages will equal the specified
pagesPerBand
times the number of bands required to print
all the rows.name
- The name of the document.chart
- The Gantt chart or Schedule chart to be printed.cols
- Indicates the number of table columns to be printed.repeatTable
- Indicates whether the table should be printed
repeatedly on every page.divider
- Defines the position on the page that separates the
table and the Gantt sheet, the value must be between 0
and 1
.pagesPerBand
- The number of pages.start
- The start date for the first page.end
- The end date for the last page in a band.
This parameter has no effect if repeatTable
is set to true
.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 IlvGanttPrintableDocument(String name, IlvHierarchyChart chart, int cols, boolean repeatTable, double divider, int pagesPerBand, boolean printAllRange, Date start, Date end, PageFormat pageFormat)
IlvGanttPrintableDocument
for the specified
IlvHierarchyChart
using the specified parameters. The document
creates pages used to print the specified Gantt chart or Schedule chart.
The time interval of the printed Gantt sheet on the first page is
specified by the start
and the end
parameters. To print multiple pages, you can use
the parameter pagesPerBand
. Note that if the page
is not high enough to print all rows of the specified Gantt chart or
Schedule chart, more pages than the specified pagesPerBand
will be generated. The total number of pages will equal the specified
pagesPerBand
times the number of bands required to print
all the rows.name
- The name of the document.chart
- The Gantt chart or Schedule chart to be printed.cols
- Indicates the number of table columns to be printed.repeatTable
- Indicates whether the table should be printed
repeatedly on every page.divider
- Defines the position on the page that separates the
table and the Gantt sheet, the value must be between 0
and 1
.pagesPerBand
- The number of pages.printAllRange
- Whether to print the entire time range.start
- The start date for the first page.end
- The end date for the last page in a band.
This parameter has no effect if repeatTable
is set to true
.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 IlvGanttPrintableDocument(String name, IlvHierarchyChart chart, int cols, boolean repeatTable, double divider, int pagesPerBand, boolean printAllRange, int orientation, Paper paperFormat)
IlvGanttPrintableDocument
for the specified
IlvHierarchyChart
using the specified parameters. The document
creates pages used to print the specified Gantt chart or Schedule chart.
The printed Gantt sheet will keep the same visible duration as the
specified Gantt chart. To print multiple pages, you can use
the parameter pagesPerBand
. Note that if the page
is not high enough to print all rows of the specified Gantt chart or
Schedule chart, more pages than the specified pagesPerBand
will be generated. The total number of pages will equal the specified
pagesPerBand
times the number of bands required to print
all the rows.name
- The name of the document.chart
- The Gantt chart or Schedule chart to be printed.cols
- Indicates the number of table columns to be printed.repeatTable
- Indicates whether the table should be printed
repeatedly on every page.divider
- Defines the position on the page that separates the
table and the Gantt sheet. The value must be between 0
an 1
.pagesPerBand
- The number of pages.printAllRange
- Whether to print the entire time range.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 IlvGanttPrintableDocument(String name, IlvHierarchyChart chart, int cols, boolean repeatTable, double divider, int pagesPerBand, boolean printAllRange, Date start, Date end, int orientation, Paper paperFormat)
IlvGanttPrintableDocument
for the specified
IlvHierarchyChart
using the specified parameters. The document
creates pages used to print the specified Gantt chart or Schedule chart.
The time interval of the printed Gantt sheet on the first page is
specified by the start
and the end
parameters. To print multiple pages, you can use
the parameter pagesPerBand
. Note that if the page
is not high enough to print all rows of the specified Gantt chart or
Schedule chart, more pages than the specified pagesPerBand
will be generated. The total number of pages will equal the specified
pagesPerBand
times the number of bands required to print
all the rows.name
- The name of the document.chart
- The Gantt chart or Schedule chart to be printed.cols
- Indicates the number of table columns to be printed.repeatTable
- Indicates whether the table should be printed
repeatedly on every page.divider
- Defines the position on the page that separates the
table and the Gantt sheet, the value must be between 0
and 1
.pagesPerBand
- The number of pages.printAllRange
- Whether to print the entire time range.start
- The start date for the first page.end
- The end date for the last page in a band.
This parameter has no effect if repeatTable
is set to true
.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 IlvHierarchyChart getChart()
IlvHierarchyChart
that is printed.setChart(IlvHierarchyChart)
public void setChart(IlvHierarchyChart chart)
chart
- The new chart.getChart()
public boolean isPrintingAllRange()
true
if the time range to be printed is the entire
time range, that is, the smallest range that includes all activities in
the model.getEffectiveRange()
public void setPrintingAllRange(boolean printAllRange)
printAllRange
- If true
, the entire time range is
printed. If false
, the range from
getStart()
to getEnd()
is
printed.setStart(Date)
,
setEnd(Date)
public Date getStart()
Note: This start date is ignored while isPrintingAllRange()
is
true.
setStart(java.util.Date)
,
getEffectiveRange()
public void setStart(Date start)
Note: This start date is ignored while isPrintingAllRange()
is
true.
start
- The new start date.getStart()
,
setPrintingAllRange(boolean)
public Date getEnd()
Note: This end date is ignored while isPrintingAllRange()
is
true.
setEnd(java.util.Date)
,
getEffectiveRange()
public void setEnd(Date end)
Note: This end date is ignored while isPrintingAllRange()
is
true.
end
- The new end date.getEnd()
,
setPrintingAllRange(boolean)
public boolean getRepeatTable()
setRepeatTable(boolean)
public void setRepeatTable(boolean repeat)
repeat
- true
to repeat the table on every page, or
false
to print the table only on the first page of each band.getRepeatTable()
public int getTableColumnCount()
setTableColumnCount(int)
public void setTableColumnCount(int count)
count
- The new number of table columns to print.getTableColumnCount()
public double getDividerPosition()
0
and
1
.setDividerPosition(double)
public void setDividerPosition(double divider)
divider
- The divider position. The value must be between
0
and 1
.getDividerPosition()
public int getPagesPerBand()
setPagesPerBand(int)
public void setPagesPerBand(int pages)
pages
- The number of pages per band.getPagesPerBand()
public boolean isPrintingWithBackground()
true
if the background is painted when printingsetPrintingWithBackground(boolean)
public void setPrintingWithBackground(boolean includeBackground)
false
: By default, no background is
printed.includeBackground
- true
if the background shall be
painted when printingisPrintingWithBackground()
,
IlvManagerView.setBackground(Color)
,
IlvManagerView.setBackgroundPatternLocation(URL)
public IlvFlow getFlow()
IllegalArgumentException
.getFlow
in class IlvPrintableDocument
IlvPrintableDocument.isFlowLayoutValid()
,
IlvPrintableDocument.invalidateFlowLayout()
protected IlvUnit.Measure computeHorizontalSpaceForGanttSheet()
This method should be overridden to be consistent with the horizontal space
that createPages()
allocates for the Gantt sheet.
protected IlvTimeInterval expandIncludingAllGraphics(IlvTimeInterval interval, IlvUnit.Measure hspace)
interval
- The previous estimation for the time interval.hspace
- The available horizontal space.protected IlvTimeInterval expandBeautifying(IlvTimeInterval interval)
interval
- The time interval to beautify.protected IlvTimeInterval computeEntireRangeForEmptyModel()
The default implementation returns a single day interval.
public IlvTimeInterval getEntireRange()
The default implementation returns an interval that is slightly larger than the smallest interval that contains all activities in the model.
Note: The result of this method depends on the bean properties
repeatTable
,
tableColumnCount
,
dividerPosition
,
pagesPerBand
,
and on the contents of the Gantt sheet.
public IlvTimeInterval getEffectiveRange()
Note: This method takes into account the isPrintingAllRange()
setting.
Note: The result of this method depends on the bean properties
printingAllRange
,
start
, end
,
repeatTable
,
tableColumnCount
,
dividerPosition
,
pagesPerBand
,
and on the contents of the Gantt sheet.
isPrintingAllRange()
,
getStart()
,
getEnd()
protected void maybeInvalidatePages()
getEffectiveRange()
has changed.maybeInvalidatePages
in class IlvPrintableDocument
IlvPrintableDocument.invalidatePages()
protected Date getStart(int pageIndex)
pageIndex
- The index of the page in a band.protected IlvDuration getDuration(int pageIndex)
pageIndex
- The index of the page in a band.protected IlvPage[] createPages()
createPages
in class IlvPrintableDocument
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.