Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Data Visualization Components
11g Release 1 (11.1.1.0.0)

E12063-01


oracle.dss.dataView
Class ViewPrinter

java.lang.Object
  extended by oracle.dss.dataView.ViewPrinter

All Implemented Interfaces:
java.awt.print.Printable, UIViewPrinter
Direct Known Subclasses:
GraphPrinter

public abstract class ViewPrinter
extends java.lang.Object
implements java.awt.print.Printable, UIViewPrinter

Base class for printing or previewing data-aware controls. If you use the PrinterDialog class in oracle.dss.dataView.gui, then you do not need to call any of the methods in this class. Instead, you need only to create an instance of the appropriate subclass of this class and pass it in the PrinterDialog constructor. The ViewPrinter takes responsibility for the printer job. It takes ownership of the entire page that is printed, and it manages pagination and other printing tasks.

If you create your own UI, then you call methods of a ViewPrinter subclass.

There are three different methods for printing:

The printing APIs in this class are based on Java 2D printing API. AWT Printing is not supported.

See Also:
print(boolean), renderPage(java.awt.Graphics), GraphPrinter.printPage(Graphics), oracle.dss.crosstab.CrosstabPrinter#printPage, oracle.dss.crosstab.CrosstabPrinter#printPage(Graphics, DataSubsetRecord), oracle.dss.table.TablePrinter#printPage(Graphics), oracle.dss.table.TablePrinter#printPage(Graphics, DataSubsetRecord), oracle.dss.dataView.gui.PrintDialog

Nested Class Summary
 class ViewPrinter.HPosWrapper
           

 

Field Summary
protected  CustomHeaderAndFooterCallback _callback
           
static int ABOVE_FOOTER
          Position for line.
static int ADJUST_FOR_HEADERS_AND_FOOTERS
          Margin adjustment: When headers or footers do not fit in the specified margin, the margins are enlarged so that the headers or footers fit.
static int ALL_LOGICAL_PAGES
          Range type: Print all the logical pages in the view.
static int BELOW_HEADER
          Position for line.
static int BOTTOM_FORMATTED_TEXT_AREA
          ID for dataView bottom FormattedTextArea.
protected  int bottomFTAHeight
           
protected  int bottomMargin
           
protected  int callbackMask
           
protected  HeaderAndFooterPainter CenterFooter
           
protected  HeaderAndFooterPainter CenterHeader
           
static int CURRENT_LOGICAL_PAGE
          Range type: Print only the current logical page of the view.
protected  boolean currentLogicalPage
           
protected  ViewPrinter.HPosWrapper currLogPage
           
protected static java.lang.String dataUnavailableMsg
           
protected  Dataview dataView
           
protected  java.awt.Dimension dimension
           
protected  int fitToNumPagesTall
           
protected  int fitToNumPagesWide
           
static int FOOTER_CENTER
          The center footer.
static int FOOTER_LEFT
          The left footer.
static int FOOTER_RIGHT
          The right footer.
protected  int footerHeight
           
protected  Footnote footnote
           
static int FOOTNOTE
          ID for dataView footnote.
protected  int footnoteHeight
           
static int GRIDVIEW_COLUMN_HEADER
          ID for GridView column header.
static int GRIDVIEW_ROW_HEADER
          ID for GridView row header.
static int HEADER_CENTER
          The center header.
static int HEADER_LEFT
          The left header.
static int HEADER_RIGHT
          The right header.
protected  int headerHeight
           
static int HEADERS_AND_FOOTERS_ALL
          All headers and footers.
static int HEADERS_AND_FOOTERS_NONE
          No headers or footers.
static int IGNORE_HEADERS_AND_FOOTERS
          Margin adjustment: When headers or footers do not fit in the specified margin, they are printed over the view in the printable area.
protected  HeaderAndFooterPainter LeftFooter
           
protected  HeaderAndFooterPainter LeftHeader
           
protected  int leftMargin
           
protected  int[] logicalPage
           
protected  int m_aboveFooterWidth
           
protected  int m_belowHeaderWidth
           
protected  FormattedText m_bottomFormattedText
           
protected  boolean m_bPreviewMode
           
protected  int m_graphPrintScaleType
           
protected  boolean m_gridlinesVisible
           
protected  int m_gridViewPrintScaleType
           
protected static java.lang.String m_insuffSpace
           
protected  java.awt.print.PageFormat m_pageFormat
           
protected  int m_repeatComponents
           
protected  java.util.Vector m_selectedHPos
           
protected  int m_seqPageNumber
           
protected  TokenSubstitution m_tokenSubstitution
           
protected  FormattedText m_topFormattedText
           
protected  int MarginAdjustment
           
static int MIN_PRINT_ZOOM_FACTOR
           
static int OCCLUDE_HEADERS_AND_FOOTERS
          Margin adjustment: When headers or footers do not fit in the specified margin, the margins are unchanged.
protected  java.awt.Dimension oldBottomFTASize
           
protected  java.awt.Dimension oldFootnoteSize
           
protected  java.awt.Dimension oldSubtitleSize
           
protected  java.awt.Dimension oldTitleSize
           
protected  java.awt.Dimension oldTopFTASize
           
static int ORIGINAL_SIZE
          Print scale type: Print the view at its current size.
static int PAGE_HEADER
          ID for page header.
protected static int PAGING_CONTROL_GAP
           
protected  java.awt.Rectangle pagingControlBounds
           
protected  int paperHeight
           
protected  int paperWidth
           
protected  int pIndex
           
protected  int printableHeight
           
protected  int printableWidth
           
protected  boolean printByColumns
           
protected  int printZoomFactor
           
protected  int rangeType
           
protected  PaginationRecord record
           
protected  int repeatAdornHeight
           
protected  boolean resize
           
protected  HeaderAndFooterPainter RightFooter
           
protected  HeaderAndFooterPainter RightHeader
           
protected  int rightMargin
           
static int SCALE_TO_FIT_FULL_PAGE
          Print scale type: Print the graph so that it fills the entire physical page.
static int SCALE_TO_FIT_PAGE
          Print scale type: Print the graph so that it fills the physical page, keeping its on-screen proportions.
static int SCALE_TO_FIT_PAGES
          Print scale type: Scale the view to fit on the specified numbers of pages.
static int SCALE_TO_ZOOM_FACTOR
          Print scale type: Scale the view according to the PrintZoomFactor property of this ViewPrinter.
static int SELECTED_LOGICAL_PAGES
          Range type: Print selected logical pages in the view.
protected  DataSubsetRecord subSetRecord
           
protected  Subtitle subtitle
           
static int SUBTITLE
          ID for dataView subtitle.
protected  int subtitleHeight
           
static int TEXT_COMPONENTS_ALL
          Font scale property: Print the graph so that it scales the original font sizes of all text components according to on-screen proportions.
static int TEXT_COMPONENTS_NONE
          Font scale property: Print the graph so that it preserves the original font sizes of all text components.
protected  Title title
           
static int TITLE
          ID for dataView title.
protected  int titleHeight
           
static int TOP_FORMATTED_TEXT_AREA
          ID for dataView top FormattedTextArea.
protected  int topFTAHeight
           
protected  int topMargin
           
protected  int totalAdornHeight
           
static int UNIT_CM
           
static int UNIT_INCHES
           
static int UNIT_PIXELS
           
protected  int units
           
protected  java.awt.Dimension viewDim
           
protected  ViewPrinter.HPosWrapper viewLogPage
           
protected  int viewLogPageNum
           

 

Fields inherited from interface java.awt.print.Printable
NO_SUCH_PAGE, PAGE_EXISTS

 

Fields inherited from interface oracle.dss.dataView.UIViewPrinter
CROSSTAB_PRINTER, GRAPH_PRINTER, TABLE_PRINTER, WORKSHEET_WITH_CROSSTAB_AND_GRAPH_PRINTER, WORKSHEET_WITH_CROSSTAB_PRINTER, WORKSHEET_WITH_GRAPH_PRINTER, WORKSHEET_WITH_TABLE_AND_GRAPH_PRINTER, WORKSHEET_WITH_TABLE_PRINTER

 

Constructor Summary
ViewPrinter(Dataview dv)
          Constructor.

 

Method Summary
protected  void adjustMargins()
           
protected  void calcAdornmentsDimension(int printableWidth)
           
 void calcHeaderAndFooterHeights(java.awt.Graphics g)
           
protected  void calcMargins(java.awt.Graphics g)
           
protected  boolean changePageEdgeCurrentHPos(int[] hPos, int maxLayerSpecified)
           
protected  boolean checkDataSourceLogPage()
           
protected  boolean checkForNoData()
           
abstract  void endPrint()
          Sets the view back to its original state.
protected  int fetchRowBlock(int firstRow, int lastRow)
           
 int getBottomMargin()
          Retrieves the height of the bottom margin of printed physical pages.
 CustomHeaderAndFooterCallback getCustomHeaderAndFooterCallback()
          Retrieves the callback that this ViewPrinter uses for displaying custom headers and footers.
 Dataview getDataview()
          Retrieves the Dataview that this ViewPrinter prints.
 java.awt.Cursor getDefaultCursor()
           
 int getFitToNumPagesTall()
          Retrieves the number of physical pages on which a printed view is required to fit vertically.
 int getFitToNumPagesWide()
          Retrieves the number of physical pages on which a printed view is required to fit horizontally.
 int getFooterMargin()
          Retrieves the height of the footer margin.
 HeaderAndFooterPainter getFooterPainter()
          Deprecated. As of 1.6.0.9, replaced by getHeaderAndFooterPainter(int)
 int getGraphPrintScaleType()
          Retrieves information about how the Graph is scaled for printing.
 int getGridViewPrintScaleType()
          Retrieves information about how the GridView is scaled for printing.
 HeaderAndFooterPainter getHeaderAndFooterPainter(int headerOrFooterID)
          Retrieves a header or footer painter.
 int getHeaderMargin()
          Retrieves the height of the header margin.
 HeaderAndFooterPainter getHeaderPainter()
          Deprecated. As of 1.6.0.9, replaced by getHeaderAndFooterPainter(int)
 int getHeadersAndFootersUsingCallback()
          Retrieves the headers and footers that use a custom callback.
 int getLeftMargin()
          Retrieves the left margin of printed physical pages.
 int getLineWidth(int position)
          Retrieves the width of the line printed at the given position.
 java.util.Locale getLocale()
          Retrives the locale of the View to be printed by this UIViewPrinter
 int[] getLogicalPage()
          Retrieves the logical page to be printed, when you use the printPage method to print.
 ViewPrinter.HPosWrapper getLogicalPageInUse()
           
 int getMarginAdjustment()
          Retrieves the setting for how the margin responds when a header or footer does not fit.
 java.awt.print.PageFormat getPageFormat()
          Retrieves the PageFormat object that specifies the paper size for this ViewPrinter.
 java.awt.PrintJob getPrintJob()
          Deprecated. As of 3.2.0.16, replaced by 2D printing API
 int getPrintScaleType()
          Deprecated. As of 3.2.0.1, replaced by getGraphPrintScaleType(), getGridViewPrintScaleType()
 int getPrintZoomFactor()
          Retrieves the zoom factor for printing.
 int getRangeType()
          Retrieves information about how much of the view will be printed.
 int getRightMargin()
          Retrieves the width of the right margin of printed physical pages.
abstract  int getScaleFontSize()
          Retrieves the text components to resize when a graph is scaled to a different size for printing.
 java.util.Vector getSelectedHPos()
          Retrieves the hierarchical addresses of the logical pages to print, when RangeType is set to SELECTED_LOGICAL_PAGES.
 int getSequentialPageNumber()
          Retrieves the current physical page number that this ViewPrinter has printed.
 TokenSubstitution getTokenSubstitution()
          Retrieves the handler for token substitution in this ViewPrinter.
 int getTopMargin()
          Retrieves the height of the top margin of printed physical pages.
 int getUnits()
          Retrieves the unit value: UNIT_PIXEL, UNIT_INCHES, UNIT_CM.
 java.awt.Dimension getViewDimension()
          Retrieves the space allowed for printing a view, when you assume responsibility for a print job.
 java.awt.Cursor getWaitCursor()
           
abstract  boolean goToFirstPage()
          Deprecated. As of 1.6.0.9, replaced by prepareFirstPage(Graphics)
 boolean goToFirstPage(java.awt.Graphics g)
           
 boolean goToLastPage(java.awt.Graphics g)
           
abstract  boolean goToNextPage()
          Deprecated. As of 1.6.0.9, replaced by prepareNextPage(Graphics)
abstract  boolean goToPrevPage()
          Deprecated. As of 1.6.0.9, replaced by preparePrevPage(Graphics)
abstract  boolean hasNextPage()
          Indicates whether the view has a physical page after the current physical page.
abstract  boolean hasPrevPage()
          Indicates whether the view has a physical page before the current physical page.
 boolean isDataviewFootnoteVisible()
          Indicates if DataviewFootnote is visble in the View to be printed.
 boolean isDataviewSubtitleVisible()
          Indicates if DataviewSubtitle is visble in the View to be printed.
 boolean isDataviewTitleVisible()
          Indicates if DataviewTitle is visble in the View to be printed.
abstract  boolean isFirstPhysicalPage()
          Indicates whether the current physical page is the first physical page in the current logical page.
 boolean isGridlinesVisible()
          Indicates whether gridlines appear in a printed GridView.
abstract  boolean isLastPhysicalPage()
          Indicates whether the current physical page is the last physical page in the current logical page.
 boolean isPrintByColumns()
          Indicates whether physical pages are printed by rows (left-to-right then top-to-bottom) or by columns(top-to-bottom then left-to-right).
 boolean isRepeatComponent(int component)
          Indicates whether the component is displayed on every physical page, when a table or crosstab is printed on multiple physical pages.
 boolean isRepeatHeaders()
          Indicates whether the column and row headers are displayed on every physical page, when a table or crosstab is printed on multiple physical pages.
abstract  boolean prepareFirstPage(java.awt.Graphics g)
          Prepares the first physical page in the view for printing and makes it the current page to print.
abstract  boolean prepareNextPage(java.awt.Graphics g)
          Prepares the next physical page for printing and makes it the current page to print.
abstract  boolean preparePrevPage(java.awt.Graphics g)
          Prepares the previous physical page for printing and makes it the current page to print.
 boolean print(boolean endPrintJob)
          Deprecated. As of 3.2.0.16, replaced by print(Graphics, PageFormat, int)
protected  void print(boolean currentLogPage, boolean endPrintJob)
          Deprecated. As of 3.2.0.16, replaced by 2D printing API
 int print(java.awt.Graphics graphics, java.awt.print.PageFormat pageFormat, int pageIndex)
          Prints a physical page of this Dataview to a Graphics.
protected  void printHeaderAndFooter(java.awt.Graphics g)
           
protected abstract  void printPages(java.awt.PrintJob pjob, boolean currentLogPage)
          Deprecated. As of 3.2.0.16, replaced by 2D printing API
protected abstract  void printToGraphics(java.awt.Graphics g, PaginationRecord record)
           
 boolean renderFirstPage(java.awt.Graphics g)
           
 boolean renderLastPage(java.awt.Graphics g)
           
 boolean renderPage(java.awt.Graphics g)
          Renders a physical page of a view to a Graphics object.
protected  void resetAdornmentsSize()
           
protected abstract  void resetCurrentLogicalPage()
           
protected  void restoreTitlesFocus()
           
protected  void saveAdornmentsSize()
           
protected  void saveTitlesFocus()
           
 void setBottomFormattedText(FormattedText fta)
           
 void setBottomMargin(int mrgn)
          Specifies the height of the bottom margin of printed physical pages.
 void setCustomHeaderAndFooterCallback(CustomHeaderAndFooterCallback callback)
          Registers a custom callback with this ViewPrinter.
protected  void setDataview(Dataview dv)
           
 void setFitToNumPagesTall(int num)
          Specifies the number of physical pages on which to fit a printed view vertically.
 void setFitToNumPagesWide(int num)
          Specifies the number of physical pages on which to fit a printed view horizontally.
 void setFooterMargin(int mrgn)
          Specifies the height of the footer margin.
 void setGraphPrintScaleType(int type)
          Specifies how to scale the Graph for printing.
 void setGridlinesVisible(boolean visible)
          Specifies whether gridlines appear in a printed GridView.
 void setGridViewPrintScaleType(int type)
          Specifies how to scale the GridView for printing.
 void setHeaderMargin(int mrgn)
          Specifies the height of the header margin.
 void setHeadersAndFootersUsingCallback(int mask)
          Specifies the headers and footers to which a custom callback applies.
 void setLeftMargin(int mrgn)
          Specifies the width of left margin of printed physical pages.
 void setLineWidth(int position, int width)
          Specifies the width of the line to be printed at the given position.
 boolean setLogicalPage(int[] hPos)
          Specifies the logical page to print, when you use the printPage method to print.
 void setMarginAdjustment(int adjustment)
          Specifies how the margin behaves when a header or footer does not fit in the margin.
 void setPageFormat(java.awt.print.PageFormat pf)
          Specifies the PageFormat object that specifies paper size for this ViewPrinter.
 void setPrintByColumns(boolean byColumns)
          Specifies whether physical pages are printed by columns (left-to-right then top-to-bottom) or by rows(top-to-bottom then left-to-right).
 void setPrintJob(java.awt.PrintJob job)
          Deprecated. As of 3.2.0.16, replaced by 2D printing API
 void setPrintScaleType(int type)
          Deprecated. As of 3.2.0.1, replaced by setGraphPrintScaleType(int), setGridViewPrintScaleType(int)
 void setPrintZoomFactor(int zoom)
          Specifies the zoom factor for printing.
 void setRangeType(int type)
          Specifies whether to print the current logical page or all logical pages.
 void setRepeatComponent(int component, boolean repeat)
          Specifies whether to repeat the component on every physical page, when a table or crosstab is printed on multiple physical pages.
 void setRepeatHeaders(boolean repeat)
          Specifies whether to display the column and row headers on every physical page, when a table or crosstab is printed on multiple physical pages.
 void setRightMargin(int mrgn)
          Specifies the width of the right margin of printed physical pages.
abstract  void setScaleFontSize(int mask)
          Specifies text components to resize when a graph is scaled to a different size for printing.
 void setSelectedHPos(java.util.Vector printHPos)
          Specifies logical pages to print, when the RangeType is SELECTED_LOGICAL_PAGES.
 void setSequentialPageNumber(int pageNum)
          Specifies the starting page number for this ViewPrinter.
 void setTokenSubstitution(TokenSubstitution token)
          Specifies a handler for token substitution in this ViewPrinter.
 void setTopFormattedText(FormattedText fta)
           
 void setTopMargin(int mrgn)
          Specifies the height of the top margin of printed physical pages.
 void setUnits(int iUnit)
          Specifies which unit value to use: UNIT_PIXEL, UNIT_INCHES, UNIT_CM..
 void setViewDimension(java.awt.Dimension dim)
          Specifies the space allowed for printing a view.
 boolean showPrintJob()
          Deprecated. As of 3.2.0.16, replaced by 2D printing API
abstract  boolean startPrint()
          Puts the view in a state for printing.
abstract  boolean startPrint(boolean bPreviewMode)
          Puts the view in a state for printing.

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Methods inherited from interface oracle.dss.dataView.UIViewPrinter
getViewPrinterType

 

Field Detail

CURRENT_LOGICAL_PAGE

public static final int CURRENT_LOGICAL_PAGE
Range type: Print only the current logical page of the view.
See Also:
Constant Field Values

ALL_LOGICAL_PAGES

public static final int ALL_LOGICAL_PAGES
Range type: Print all the logical pages in the view.
See Also:
Constant Field Values

SELECTED_LOGICAL_PAGES

public static final int SELECTED_LOGICAL_PAGES
Range type: Print selected logical pages in the view. To specify the range to print, call the setSelectedHPos method.
See Also:
setSelectedHPos(java.util.Vector), Constant Field Values

ORIGINAL_SIZE

public static final int ORIGINAL_SIZE
Print scale type: Print the view at its current size. When you set PrintScaleType to this value, the view is printed at its current size, as determined by its ZoomFactor property.
See Also:
Constant Field Values

SCALE_TO_ZOOM_FACTOR

public static final int SCALE_TO_ZOOM_FACTOR
Print scale type: Scale the view according to the PrintZoomFactor property of this ViewPrinter. When you set PrintScaleType to this value, you must also call setPrintZoomFactor to specify the scale for printing.

If you use the printPage method to print, and you use this scale type, then set the margins to 0 before you call the startPrint method.

See Also:
setPrintScaleType(int), setPrintZoomFactor(int), Constant Field Values

SCALE_TO_FIT_PAGES

public static final int SCALE_TO_FIT_PAGES
Print scale type: Scale the view to fit on the specified numbers of pages. When you set PrintScaleType to this value, you must also call setFitToNumPagesTall and setFitToNumPagesWide to specify the number of pages on which you want the view to fit.

This value does not work in a GraphPrinter. If you use it, the graph will be printed at its original size.

If you use the printPage method to print, and you use this scale type, then set the margins to 0 before you call the startPrint method.

See Also:
setPrintScaleType(int), setFitToNumPagesTall(int), setFitToNumPagesWide(int), Constant Field Values

SCALE_TO_FIT_FULL_PAGE

public static final int SCALE_TO_FIT_FULL_PAGE
Print scale type: Print the graph so that it fills the entire physical page. The graph might not have the same proportions that it has on screen.

If you use the printPage method to print, and you use this scale type, then set the margins to 0 before you call the startPrint method.

See Also:
Constant Field Values

SCALE_TO_FIT_PAGE

public static final int SCALE_TO_FIT_PAGE
Print scale type: Print the graph so that it fills the physical page, keeping its on-screen proportions.

If you use the printPage method to print, and you use this scale type, then set the margins to 0 before you call the startPrint method.

See Also:
Constant Field Values

TEXT_COMPONENTS_ALL

public static final int TEXT_COMPONENTS_ALL
Font scale property: Print the graph so that it scales the original font sizes of all text components according to on-screen proportions.
See Also:
Constant Field Values

TEXT_COMPONENTS_NONE

public static final int TEXT_COMPONENTS_NONE
Font scale property: Print the graph so that it preserves the original font sizes of all text components.
See Also:
Constant Field Values

BELOW_HEADER

public static final int BELOW_HEADER
Position for line. Used by set/getLineWidth() method.
See Also:
Constant Field Values

ABOVE_FOOTER

public static final int ABOVE_FOOTER
Position for line. Used by set/getLineWidth() method.
See Also:
Constant Field Values

GRIDVIEW_COLUMN_HEADER

public static final int GRIDVIEW_COLUMN_HEADER
ID for GridView column header.
See Also:
Constant Field Values

GRIDVIEW_ROW_HEADER

public static final int GRIDVIEW_ROW_HEADER
ID for GridView row header.
See Also:
Constant Field Values

PAGE_HEADER

public static final int PAGE_HEADER
ID for page header.
See Also:
Constant Field Values

TITLE

public static final int TITLE
ID for dataView title.
See Also:
Constant Field Values

SUBTITLE

public static final int SUBTITLE
ID for dataView subtitle.
See Also:
Constant Field Values

FOOTNOTE

public static final int FOOTNOTE
ID for dataView footnote.
See Also:
Constant Field Values

TOP_FORMATTED_TEXT_AREA

public static final int TOP_FORMATTED_TEXT_AREA
ID for dataView top FormattedTextArea.
See Also:
Constant Field Values

BOTTOM_FORMATTED_TEXT_AREA

public static final int BOTTOM_FORMATTED_TEXT_AREA
ID for dataView bottom FormattedTextArea.
See Also:
Constant Field Values

HEADER_LEFT

public static final int HEADER_LEFT
The left header.
See Also:
Constant Field Values

HEADER_CENTER

public static final int HEADER_CENTER
The center header.
See Also:
Constant Field Values

HEADER_RIGHT

public static final int HEADER_RIGHT
The right header.
See Also:
Constant Field Values

FOOTER_LEFT

public static final int FOOTER_LEFT
The left footer.
See Also:
Constant Field Values

FOOTER_CENTER

public static final int FOOTER_CENTER
The center footer.
See Also:
Constant Field Values

FOOTER_RIGHT

public static final int FOOTER_RIGHT
The right footer.
See Also:
Constant Field Values

HEADERS_AND_FOOTERS_ALL

public static final int HEADERS_AND_FOOTERS_ALL
All headers and footers.
See Also:
setHeadersAndFootersUsingCallback(int), Constant Field Values

HEADERS_AND_FOOTERS_NONE

public static final int HEADERS_AND_FOOTERS_NONE
No headers or footers.
See Also:
setHeadersAndFootersUsingCallback(int), Constant Field Values

IGNORE_HEADERS_AND_FOOTERS

public static final int IGNORE_HEADERS_AND_FOOTERS
Margin adjustment: When headers or footers do not fit in the specified margin, they are printed over the view in the printable area.
See Also:
Constant Field Values

ADJUST_FOR_HEADERS_AND_FOOTERS

public static final int ADJUST_FOR_HEADERS_AND_FOOTERS
Margin adjustment: When headers or footers do not fit in the specified margin, the margins are enlarged so that the headers or footers fit. The printable area becomes smaller.
See Also:
Constant Field Values

OCCLUDE_HEADERS_AND_FOOTERS

public static final int OCCLUDE_HEADERS_AND_FOOTERS
Margin adjustment: When headers or footers do not fit in the specified margin, the margins are unchanged. The part of the header or footer that does not fit in the margin is not visible. It is occluded by the view in the printable area.
See Also:
Constant Field Values

MIN_PRINT_ZOOM_FACTOR

public static final int MIN_PRINT_ZOOM_FACTOR
See Also:
Constant Field Values

UNIT_PIXELS

public static final int UNIT_PIXELS
See Also:
Constant Field Values

UNIT_INCHES

public static final int UNIT_INCHES
See Also:
Constant Field Values

UNIT_CM

public static final int UNIT_CM
See Also:
Constant Field Values

paperWidth

protected int paperWidth

paperHeight

protected int paperHeight

leftMargin

protected int leftMargin

rightMargin

protected int rightMargin

topMargin

protected int topMargin

bottomMargin

protected int bottomMargin

units

protected int units

printZoomFactor

protected int printZoomFactor

fitToNumPagesTall

protected int fitToNumPagesTall

fitToNumPagesWide

protected int fitToNumPagesWide

m_gridViewPrintScaleType

protected int m_gridViewPrintScaleType

m_graphPrintScaleType

protected int m_graphPrintScaleType

rangeType

protected int rangeType

headerHeight

protected int headerHeight

footerHeight

protected int footerHeight

logicalPage

protected int[] logicalPage

printableWidth

protected int printableWidth

printableHeight

protected int printableHeight

currLogPage

protected ViewPrinter.HPosWrapper currLogPage

viewLogPage

protected ViewPrinter.HPosWrapper viewLogPage

m_selectedHPos

protected java.util.Vector m_selectedHPos

viewLogPageNum

protected int viewLogPageNum

m_seqPageNumber

protected int m_seqPageNumber

printByColumns

protected boolean printByColumns

currentLogicalPage

protected boolean currentLogicalPage

resize

protected boolean resize

m_gridlinesVisible

protected boolean m_gridlinesVisible

m_repeatComponents

protected int m_repeatComponents

record

protected PaginationRecord record

subSetRecord

protected DataSubsetRecord subSetRecord

LeftHeader

protected HeaderAndFooterPainter LeftHeader

CenterHeader

protected HeaderAndFooterPainter CenterHeader

RightHeader

protected HeaderAndFooterPainter RightHeader

LeftFooter

protected HeaderAndFooterPainter LeftFooter

CenterFooter

protected HeaderAndFooterPainter CenterFooter

RightFooter

protected HeaderAndFooterPainter RightFooter

_callback

protected CustomHeaderAndFooterCallback _callback

callbackMask

protected int callbackMask

MarginAdjustment

protected int MarginAdjustment

pagingControlBounds

protected java.awt.Rectangle pagingControlBounds

m_tokenSubstitution

protected TokenSubstitution m_tokenSubstitution

m_topFormattedText

protected FormattedText m_topFormattedText

m_bottomFormattedText

protected FormattedText m_bottomFormattedText

title

protected Title title

subtitle

protected Subtitle subtitle

footnote

protected Footnote footnote

dataView

protected Dataview dataView

oldTitleSize

protected java.awt.Dimension oldTitleSize

oldSubtitleSize

protected java.awt.Dimension oldSubtitleSize

oldFootnoteSize

protected java.awt.Dimension oldFootnoteSize

oldTopFTASize

protected java.awt.Dimension oldTopFTASize

oldBottomFTASize

protected java.awt.Dimension oldBottomFTASize

titleHeight

protected int titleHeight

subtitleHeight

protected int subtitleHeight

footnoteHeight

protected int footnoteHeight

topFTAHeight

protected int topFTAHeight

bottomFTAHeight

protected int bottomFTAHeight

totalAdornHeight

protected int totalAdornHeight

repeatAdornHeight

protected int repeatAdornHeight

m_aboveFooterWidth

protected int m_aboveFooterWidth

m_belowHeaderWidth

protected int m_belowHeaderWidth

m_bPreviewMode

protected boolean m_bPreviewMode

m_pageFormat

protected java.awt.print.PageFormat m_pageFormat

viewDim

protected java.awt.Dimension viewDim

dimension

protected java.awt.Dimension dimension

dataUnavailableMsg

protected static final java.lang.String dataUnavailableMsg
See Also:
Constant Field Values

m_insuffSpace

protected static final java.lang.String m_insuffSpace
See Also:
Constant Field Values

PAGING_CONTROL_GAP

protected static final int PAGING_CONTROL_GAP
See Also:
Constant Field Values

pIndex

protected int pIndex

Constructor Detail

ViewPrinter

public ViewPrinter(Dataview dv)
Constructor.
Parameters:
dv - The Dataview that this ViewPrinter prints.

Method Detail

setTopFormattedText

public void setTopFormattedText(FormattedText fta)
Parameters:
fta - the FormattedText to be printed above the View.

setBottomFormattedText

public void setBottomFormattedText(FormattedText fta)
Parameters:
fta - the FormattedText to be printed below the View.

print

public boolean print(boolean endPrintJob)
Deprecated. As of 3.2.0.16, replaced by print(Graphics, PageFormat, int)
Prints a Dataview, onto multiple physical pages if necessary. The call to this method belongs between calls to startPrint and endPrint.
Parameters:
endPrintJob - true to end the print job with this method, false not to end the print job. Pass false only when you plan to print another object, after this Dataview, using the same print job.
Returns:
true if the view is successfully printed, false if the data in the view is not available to this ViewPrinter.
See Also:
startPrint(), endPrint()

setUnits

public void setUnits(int iUnit)
Description copied from interface: UIViewPrinter
Specifies which unit value to use: UNIT_PIXEL, UNIT_INCHES, UNIT_CM..
Specified by:
setUnits in interface UIViewPrinter
Parameters:
iUnit - The unit value to set: UNIT_PIXEL, UNIT_INCHES, UNIT_CM..

getUnits

public int getUnits()
Description copied from interface: UIViewPrinter
Retrieves the unit value: UNIT_PIXEL, UNIT_INCHES, UNIT_CM. By default, the unit type is UNIT_PIXEL.
Specified by:
getUnits in interface UIViewPrinter
Returns:
The unit value.

setLeftMargin

public void setLeftMargin(int mrgn)
Specifies the width of left margin of printed physical pages. When the entire page is available for printing a view, then the margin should be at least 18 pixels wide, to prevent the view from being cropped around the edges by the printer device. Remember that large margins reduce the printing area for the view. This method does not impose limits on the margin size. By default, the margin is 72 pixels.

This method has no effect when you use the printPage method to print.

Specified by:
setLeftMargin in interface UIViewPrinter
Parameters:
mrgn - The width of the left margin, pixels.

getLeftMargin

public int getLeftMargin()
Retrieves the left margin of printed physical pages. By default, the margin is 72 pixels.
Specified by:
getLeftMargin in interface UIViewPrinter
Returns:
The width of the left margin, in pixels.

setRightMargin

public void setRightMargin(int mrgn)
Specifies the width of the right margin of printed physical pages. When the entire page is available for printing a view, then the margin should be at least 18 pixels wide, to prevent the view from being cropped around the edges by the printer device. Remember that large margins reduce the printing area for the view. This method does not impose limits on the margin size. By default, the margin is 72 pixels.

This method has no effect when you use the printPage method to print.

Specified by:
setRightMargin in interface UIViewPrinter
Parameters:
mrgn - The width of the right margin, in pixels.

getRightMargin

public int getRightMargin()
Retrieves the width of the right margin of printed physical pages. By default, the margin is 72 pixels.
Specified by:
getRightMargin in interface UIViewPrinter
Returns:
The width of the right margin, in pixels.

setTopMargin

public void setTopMargin(int mrgn)
Specifies the height of the top margin of printed physical pages. When the entire page is available for printing a view, then the margin should be at least 18 pixels high, to prevent the view from being cropped around the edges by the printer device. Remember that large margins reduce the printing area for the view. This method does not impose limits on the margin size. By default, the margin is 72 pixels.

This method has no effect when you use the printPage method to print.

Specified by:
setTopMargin in interface UIViewPrinter
Parameters:
mrgn - The height of the top margin, in pixels.

getTopMargin

public int getTopMargin()
Retrieves the height of the top margin of printed physical pages. By default, the margin is 72 pixels.
Specified by:
getTopMargin in interface UIViewPrinter
Returns:
The height of the top margin, in pixels.

setBottomMargin

public void setBottomMargin(int mrgn)
Specifies the height of the bottom margin of printed physical pages. When the entire page is available for printing a view, then the margin should be at least 18 pixels high, to prevent the view from being cropped around the edges by the printer device. Remember that large margins reduce the printing area for the view. This method does not impose limits on the margin size. By default, the margin is 72 pixels.

This method has no effect when you use the printPage method to print.

Specified by:
setBottomMargin in interface UIViewPrinter
Parameters:
mrgn - The height of the bottom margin, in pixels.

getBottomMargin

public int getBottomMargin()
Retrieves the height of the bottom margin of printed physical pages. By default, the margin is 72 pixels.
Specified by:
getBottomMargin in interface UIViewPrinter
Returns:
The height of the bottom margin, in pixels.

setHeaderMargin

public void setHeaderMargin(int mrgn)
Specifies the height of the header margin. When the entire page is available for printing a view, then the margin should be at least 18 pixels high, to prevent the view from being cropped around the edges by the printer device. This method does not impose limits on the margin size. By default, the margin is 18 pixels.

This method has no effect when you use the printPage method to print.

Specified by:
setHeaderMargin in interface UIViewPrinter
Parameters:
mrgn - The height of the header margin, in pixels.

getHeaderMargin

public int getHeaderMargin()
Retrieves the height of the header margin. By default, the margin is 18 pixels.
Specified by:
getHeaderMargin in interface UIViewPrinter
Returns:
The height of the header margin, in pixels.

setFooterMargin

public void setFooterMargin(int mrgn)
Specifies the height of the footer margin. When the entire page is available for printing a view, then the margin should be at least 18 pixels high, to prevent the view from being cropped around the edges by the printer device. This method does not impose limits on the margin size. By default, the margin is 18 pixels.

This method has no effect when you use the printPage method to print.

Specified by:
setFooterMargin in interface UIViewPrinter
Parameters:
mrgn - The height of the footer margin, in pixels.

getFooterMargin

public int getFooterMargin()
Retrieves the height of the footer margin. By default, the margin is 18 pixels.
Specified by:
getFooterMargin in interface UIViewPrinter
Returns:
The height of the footer margin, in pixels.

setPrintZoomFactor

public void setPrintZoomFactor(int zoom)
Specifies the zoom factor for printing. The print zoom factor is the amount by which the DataView is enlarged or reduced for printing. The value of the PrintZoomFactor property takes effect only when the PrintScaleType property is set to SCALE_TO_ZOOM_FACTOR.

By default, the view is printed at full size (100 percent).

Specified by:
setPrintZoomFactor in interface UIViewPrinter
Parameters:
zoom - The percentage at which to print the view. This methods logs an error if the value is less than 10.
See Also:
setPrintScaleType(int)

getPrintZoomFactor

public int getPrintZoomFactor()
Retrieves the zoom factor for printing. The print zoom factor is the amount by which the DataView is enlarged or reduced for printing. The value of the PrintZoomFactor property takes effect only when the PrintScaleType property is set to SCALE_TO_ZOOM_FACTOR.

By default, the view is printed at full size (100 percent).

Specified by:
getPrintZoomFactor in interface UIViewPrinter
Returns:
The percentage at which the view will be printed.
See Also:
setPrintScaleType(int)

setPrintScaleType

public void setPrintScaleType(int type)
Deprecated. As of 3.2.0.1, replaced by setGraphPrintScaleType(int), setGridViewPrintScaleType(int)
Specifies how to scale the DataView for printing. By default, the view is printed at its original size.
Parameters:
type - A constant that indicates how to scale the DataView for printing. Constants are listed in the See Also section.
See Also:
ORIGINAL_SIZE, SCALE_TO_FIT_PAGES, SCALE_TO_ZOOM_FACTOR, SCALE_TO_FIT_PAGE, SCALE_TO_FIT_FULL_PAGE

getPrintScaleType

public int getPrintScaleType()
Deprecated. As of 3.2.0.1, replaced by getGraphPrintScaleType(), getGridViewPrintScaleType()
Retrieves information about how the DataView is scaled for printing.
Returns:
A constant that indicates how the DataView is scaled for printing. Constants are listed in the See Also section.
See Also:
ORIGINAL_SIZE, SCALE_TO_FIT_PAGES, SCALE_TO_ZOOM_FACTOR, SCALE_TO_FIT_PAGE, SCALE_TO_FIT_FULL_PAGE

setGraphPrintScaleType

public void setGraphPrintScaleType(int type)
Specifies how to scale the Graph for printing. By default, the view is printed at its original size.
Specified by:
setGraphPrintScaleType in interface UIViewPrinter
Parameters:
type - A constant that indicates how to scale the DataView for printing. Constants are listed in the See Also section.
See Also:
ORIGINAL_SIZE, SCALE_TO_FIT_PAGE, SCALE_TO_FIT_FULL_PAGE

getGraphPrintScaleType

public int getGraphPrintScaleType()
Retrieves information about how the Graph is scaled for printing.
Specified by:
getGraphPrintScaleType in interface UIViewPrinter
Returns:
A constant that indicates how the DataView is scaled for printing. Constants are listed in the See Also section.
See Also:
ORIGINAL_SIZE, SCALE_TO_FIT_PAGE, SCALE_TO_FIT_FULL_PAGE

setGridViewPrintScaleType

public void setGridViewPrintScaleType(int type)
Specifies how to scale the GridView for printing. By default, the view is printed at its original size.
Specified by:
setGridViewPrintScaleType in interface UIViewPrinter
Parameters:
type - A constant that indicates how to scale the DataView for printing. Constants are listed in the See Also section.
See Also:
ORIGINAL_SIZE, SCALE_TO_FIT_PAGES, SCALE_TO_ZOOM_FACTOR

getGridViewPrintScaleType

public int getGridViewPrintScaleType()
Retrieves information about how the GridView is scaled for printing.
Specified by:
getGridViewPrintScaleType in interface UIViewPrinter
Returns:
A constant that indicates how the DataView is scaled for printing. Constants are listed in the See Also section.
See Also:
ORIGINAL_SIZE, SCALE_TO_FIT_PAGES, SCALE_TO_ZOOM_FACTOR

setFitToNumPagesTall

public void setFitToNumPagesTall(int num)
Specifies the number of physical pages on which to fit a printed view vertically. This method does nothing in a GraphPrinter.

For example, suppose that you have a crosstab that has four columns and 40 rows. Suppose that this crosstab would normally print on two sheets of paper, the first 30 rows on page 1 and the remainder on page 2. You could set FitToNumPagesTall to 1 in order to reduce the printed size of the crosstab so that all 40 rows are printed on one sheet of paper.

The view is scaled to fit the number of pages that you specify only when the PrintScaleType property is set to SCALE_TO_FIT_PAGES.

Specified by:
setFitToNumPagesTall in interface UIViewPrinter
Parameters:
num - The number of pages on which the view should fit vertically.
See Also:
setPrintScaleType(int)

getFitToNumPagesTall

public int getFitToNumPagesTall()
Retrieves the number of physical pages on which a printed view is required to fit vertically. The view is scaled to fit the returned number of pages only when the PrintScaleType property is set to SCALE_TO_FIT_PAGES.
Specified by:
getFitToNumPagesTall in interface UIViewPrinter
Returns:
The number of pages on which the view is required to fit vertically.
See Also:
setPrintScaleType(int)

setFitToNumPagesWide

public void setFitToNumPagesWide(int num)
Specifies the number of physical pages on which to fit a printed view horizontally. This method does nothing in a GraphPrinter.

For example, suppose you have a crosstab that has 20 columns and 10 rows. Suppose that this crosstab would normally print on two sheets of paper, the first 12 columns on page 1 and the remainder on page 2. You could set FitToNumPagesWide to 1 in order to reduce the printed size of the crosstab so that all 20 columns are printed on one sheet of paper. The view is scaled to fit the number of pages that you specify only when the PrintScaleType property is set to SCALE_TO_FIT_PAGES.

Specified by:
setFitToNumPagesWide in interface UIViewPrinter
Parameters:
num - The number of pages on which the view should fit horizontally.
See Also:
setPrintScaleType(int)

getFitToNumPagesWide

public int getFitToNumPagesWide()
Retrieves the number of physical pages on which a printed view is required to fit horizontally. The view is scaled to fit the returned number of pages only when the PrintScaleType property is set to SCALE_TO_FIT_PAGES.
Specified by:
getFitToNumPagesWide in interface UIViewPrinter
Returns:
The number of pages on which the view is required to fit horizontally.
See Also:
setPrintScaleType(int)

setGridlinesVisible

public void setGridlinesVisible(boolean visible)
Specifies whether gridlines appear in a printed GridView. This method does nothing in a GraphPrinter.
Specified by:
setGridlinesVisible in interface UIViewPrinter
Parameters:
visible - true to make gridlines appear in a printed GridView. false to hide gridlines.

isGridlinesVisible

public boolean isGridlinesVisible()
Indicates whether gridlines appear in a printed GridView.
Specified by:
isGridlinesVisible in interface UIViewPrinter
Returns:
true if gridlines appear in the GridView when it is printed, false if they do not appear.

setLogicalPage

public boolean setLogicalPage(int[] hPos)
Specifies the logical page to print, when you use the printPage method to print. Call this method after you call the startPrint method for each view that you print.
Parameters:
hPos - The hPos array that identifies the logical page to print.
Returns:
true if the logical page has been set, false if the data in the view is not available to this ViewPrinter.
See Also:
GraphPrinter.printPage(Graphics), oracle.dss.crosstab.CrosstabPrinter#printPage, oracle.dss.crosstab.CrosstabPrinter#printPage(Graphics, DataSubsetRecord), oracle.dss.table.TablePrinter#printPage(Graphics), oracle.dss.table.TablePrinter#printPage(Graphics, DataSubsetRecord), oracle.dss.dataView.gui.PrintDialog, DataAccess.getFirstHPos(int), DataAccess.getNextHPos(int, int[])

getLogicalPage

public int[] getLogicalPage()
Retrieves the logical page to be printed, when you use the printPage method to print.
Returns:
The hPos array that identifies the logical page.
See Also:
GraphPrinter.printPage(Graphics), oracle.dss.crosstab.CrosstabPrinter#printPage, oracle.dss.crosstab.CrosstabPrinter#printPage(Graphics, DataSubsetRecord), oracle.dss.table.TablePrinter#printPage(Graphics), oracle.dss.table.TablePrinter#printPage(Graphics, DataSubsetRecord), oracle.dss.dataView.gui.PrintDialog, DataAccess.getNextHPos(int, int[])

setSelectedHPos

public void setSelectedHPos(java.util.Vector printHPos)
Specifies logical pages to print, when the RangeType is SELECTED_LOGICAL_PAGES. Each logical page to print is specified as an HPos.
Specified by:
setSelectedHPos in interface UIViewPrinter
Parameters:
printHPos - A Vector that contains an HPos for each logical page that you want to print.
See Also:
SELECTED_LOGICAL_PAGES, setRangeType(int), DataAccess.getMemberHPos(int, int, int)

getSelectedHPos

public java.util.Vector getSelectedHPos()
Retrieves the hierarchical addresses of the logical pages to print, when RangeType is set to SELECTED_LOGICAL_PAGES.
Specified by:
getSelectedHPos in interface UIViewPrinter
Returns:
A Vector that contains an HPos for each logical page to print.
See Also:
SELECTED_LOGICAL_PAGES, setRangeType(int), DataAccess.getMemberHPos(int, int, int)

setRangeType

public void setRangeType(int type)
Specifies whether to print the current logical page or all logical pages.

This method works only when you use the print method or the renderPage method to print. To set the page to print when you use the printPage method to print, call setLogicalPage.

Specified by:
setRangeType in interface UIViewPrinter
Parameters:
type - A constant that identifies how much of the view to print.
See Also:
ALL_LOGICAL_PAGES, CURRENT_LOGICAL_PAGE, SELECTED_LOGICAL_PAGES, setLogicalPage(int[])

getRangeType

public int getRangeType()
Retrieves information about how much of the view will be printed.
Specified by:
getRangeType in interface UIViewPrinter
Returns:
A constant that identifies whether the current logical page or all logical pages will be printed.
See Also:
ALL_LOGICAL_PAGES, CURRENT_LOGICAL_PAGE, SELECTED_LOGICAL_PAGES

getFooterPainter

public HeaderAndFooterPainter getFooterPainter()
Deprecated. As of 1.6.0.9, replaced by getHeaderAndFooterPainter(int)
There are now three different HeaderAndFooterPainter objects for footers. To retrieve a footer, pass FOOTER_LEFT, FOOTER_CENTER, or FOOTER_RIGHT to getHeaderAndFooterPainter.

getHeaderPainter

public HeaderAndFooterPainter getHeaderPainter()
Deprecated. As of 1.6.0.9, replaced by getHeaderAndFooterPainter(int)
There are now three different HeaderAndFooterPainter objects for headers. To retrieve a header, pass HEADER_LEFT, HEADER_CENTER, or HEADER_RIGHT to getHeaderAndFooterPainter.

getHeaderAndFooterPainter

public HeaderAndFooterPainter getHeaderAndFooterPainter(int headerOrFooterID)
Retrieves a header or footer painter. You set properties on the header or footer painter to specify what appears in the header or footer. There are three headers and three footers.
Specified by:
getHeaderAndFooterPainter in interface UIViewPrinter
Parameters:
headerOrFooterID - A constant that specifies which header or footer painter you want.
Returns:
The painter for the specified header or footer.
See Also:
HEADER_LEFT, HEADER_CENTER, HEADER_RIGHT, FOOTER_LEFT, FOOTER_CENTER, FOOTER_RIGHT

setCustomHeaderAndFooterCallback

public void setCustomHeaderAndFooterCallback(CustomHeaderAndFooterCallback callback)
Registers a custom callback with this ViewPrinter. Use this method when you have implemented a CustomHeaderAndFooterCallback, to be able to print different headers and footers on different physical pages of a print job. To specify which headers and footers the callback should be used for, call setHeadersAndFootersUsingCallback.
Parameters:
callback - The callback that this ViewPrinter should use for custom headers and footers.
See Also:
setHeadersAndFootersUsingCallback(int)

getCustomHeaderAndFooterCallback

public CustomHeaderAndFooterCallback getCustomHeaderAndFooterCallback()
Retrieves the callback that this ViewPrinter uses for displaying custom headers and footers.
Returns:
The callback that this ViewPrinter uses to print custom headers and footers. If no custom callback has been registered with this ViewPrinter, then this method returns null.

setHeadersAndFootersUsingCallback

public void setHeadersAndFootersUsingCallback(int mask)
Specifies the headers and footers to which a custom callback applies. Use this method, when you implement a CustomHeaderAndFooterCallback, to specify which headers, footers, or both will use the custom callback.
Parameters:
mask - A constant that identifies the header or footer that uses a custom callback. You can combine the constants by using the OR operator (|).
See Also:
HEADER_LEFT, HEADER_CENTER, HEADER_RIGHT, FOOTER_LEFT, FOOTER_CENTER, FOOTER_RIGHT, HEADERS_AND_FOOTERS_ALL, HEADERS_AND_FOOTERS_NONE, setCustomHeaderAndFooterCallback(oracle.dss.dataView.CustomHeaderAndFooterCallback)

getHeadersAndFootersUsingCallback

public int getHeadersAndFootersUsingCallback()
Retrieves the headers and footers that use a custom callback.
Returns:
A constant that identifies the header or footer that uses a custom callback, or a bitmask that identifies multiple headers and footers.
See Also:
HEADER_LEFT, HEADER_CENTER, HEADER_RIGHT, FOOTER_LEFT, FOOTER_CENTER, FOOTER_RIGHT, setCustomHeaderAndFooterCallback(oracle.dss.dataView.CustomHeaderAndFooterCallback)

setMarginAdjustment

public void setMarginAdjustment(int adjustment)
Specifies how the margin behaves when a header or footer does not fit in the margin. By default, the margin ignores the size of the headers and footers, so if a header or footer is too big for a margin, it prints over the printable area of the view.
Parameters:
adjustment - A constant that represents how you want the margin to react to headers and footers that do not fit in the margin.
See Also:
ADJUST_FOR_HEADERS_AND_FOOTERS, IGNORE_HEADERS_AND_FOOTERS, OCCLUDE_HEADERS_AND_FOOTERS

getMarginAdjustment

public int getMarginAdjustment()
Retrieves the setting for how the margin responds when a header or footer does not fit.
Returns:
A constant that indicates how the margin responds when a header or footer does not fit.
See Also:
ADJUST_FOR_HEADERS_AND_FOOTERS, IGNORE_HEADERS_AND_FOOTERS, OCCLUDE_HEADERS_AND_FOOTERS

setViewDimension

public void setViewDimension(java.awt.Dimension dim)
Specifies the space allowed for printing a view.

When you call print to print a view, you do not need to call this method. The ViewPrinter gets the size of the paper from the print job.

When you call renderPage to print, then margins are taken out of the Dimension that you pass in this method. If you want to print on a full sheet of paper, then set the size of the paper in the Dimension.

If you call printPage, then the full Dimension is used to print the view. You should account for margins when you specify the Dimension.

Parameters:
dim - The Dimension that specifies the size of the area that is alloted on the page, for the view.
See Also:
print(boolean), renderPage(java.awt.Graphics), oracle.dss.crosstab.CrosstabPrinter#printPage, GraphPrinter.printPage(Graphics), oracle.dss.crosstab.CrosstabPrinter#printPage(Graphics, DataSubsetRecord), oracle.dss.table.TablePrinter#printPage(Graphics), oracle.dss.table.TablePrinter#printPage(Graphics, DataSubsetRecord)

getViewDimension

public java.awt.Dimension getViewDimension()
Retrieves the space allowed for printing a view, when you assume responsibility for a print job.
Specified by:
getViewDimension in interface UIViewPrinter
Returns:
The Dimension that specifies the area for the view.

setPrintByColumns

public void setPrintByColumns(boolean byColumns)
Specifies whether physical pages are printed by columns (left-to-right then top-to-bottom) or by rows(top-to-bottom then left-to-right).

For example, suppose that you have a table that has 30 rows and 20 columns, and that 15 rows and 10 columns can fit on a printed sheet of paper. When PrintByColumns is true (the default), then the pages are printed as follows:

When PrintByColumns is false, then the pages are printed as follows:

This method does nothing in a GraphPrinter.

Specified by:
setPrintByColumns in interface UIViewPrinter
Parameters:
byRows - true if physical pages are printed by columns, false if physical pages are printed by rows.

isPrintByColumns

public boolean isPrintByColumns()
Indicates whether physical pages are printed by rows (left-to-right then top-to-bottom) or by columns(top-to-bottom then left-to-right). This method does nothing in a GraphPrinter.
Specified by:
isPrintByColumns in interface UIViewPrinter
Returns:
true if physical pages are printed by columns, false if physical pages are printed by rows.

getPrintJob

public java.awt.PrintJob getPrintJob()
Deprecated. As of 3.2.0.16, replaced by 2D printing API
Retrieves the PrintJob object for this ViewPrinter.
Returns:
The PrintJob object.

getDataview

public Dataview getDataview()
Retrieves the Dataview that this ViewPrinter prints.
Returns:
The Dataview that this ViewPrinter prints.

showPrintJob

public boolean showPrintJob()
Deprecated. As of 3.2.0.16, replaced by 2D printing API
Displays the standard Print dialog box. The standard Print dialog box is java.awt.Toolkit.DefaultToolkit. The user can specify the page dimensions in the standard Print dialog box and can accept or cancel the print job.
Returns:
true if the user presses the OK button in the Print dialog box, false if the user presses the Cancel button.

setPrintJob

public void setPrintJob(java.awt.PrintJob job)
Deprecated. As of 3.2.0.16, replaced by 2D printing API
Specifies the PrintJob to use for printing.
Parameters:
job - The PrintJob object to use.

renderPage

public boolean renderPage(java.awt.Graphics g)
Renders a physical page of a view to a Graphics object. Use this method when you want to print to an area less than the full page, or when you want to print more of a view than just one logical page, but not all pages.

For example, you would call this method if you had a linked crosstab and graph, and you wanted to print all the physical pages of one logical page of the crosstab, and then the same logical page of a graph, and then the next logical page of a crosstab, and then that logical page of a graph, and so on.

You should also call this method if you want to print a view and any other object on the same piece of paper.

You also call this method if you provide your own user interface for print preview.

Before you call this method, you must call prepareFirstPage, which performs initialization for printing.

Specified by:
renderPage in interface UIViewPrinter
Parameters:
g - The Graphics object onto which to render the page of the view. The Graphics object must be an instance of Graphics2D.
Returns:
true if the page is successfully rendered, false if the data in the view is not available to this ViewPrinter.
See Also:
prepareFirstPage(java.awt.Graphics), hasNextPage(), prepareNextPage(java.awt.Graphics), hasPrevPage(), preparePrevPage(java.awt.Graphics), isFirstPhysicalPage(), isLastPhysicalPage()

isFirstPhysicalPage

public abstract boolean isFirstPhysicalPage()
Indicates whether the current physical page is the first physical page in the current logical page. Use this method when you use the renderPage method.
Specified by:
isFirstPhysicalPage in interface UIViewPrinter
Returns:
true if the current physical page is the first physical page in the current logical page, false if the current physical page is not the first in the logical page.
See Also:
renderPage(java.awt.Graphics)

isLastPhysicalPage

public abstract boolean isLastPhysicalPage()
Indicates whether the current physical page is the last physical page in the current logical page. Use this method when you use the renderPage method.
Specified by:
isLastPhysicalPage in interface UIViewPrinter
Returns:
true if the current physical page is the last physical page in the current logical page, false if the current physical page is not the last in the logical page.
See Also:
renderPage(java.awt.Graphics)

setSequentialPageNumber

public void setSequentialPageNumber(int pageNum)
Specifies the starting page number for this ViewPrinter. This ViewPrinter increments or decrements this page number whenever the ViewPrinter moves to the next page or to the previous page.

You normally call this method when you print multiple views, and you print the same logical page of each view before moving to the next logical page. After you print the first logical page of the first view, you call getSequentialPageNumber method of the ViewPrinter for that view to get the current physical page number. You then pass the return value to the setSequentialPageNumber method of the second ViewPrinter.

Specified by:
setSequentialPageNumber in interface UIViewPrinter
Parameters:
pageNum - The page number of the physical page.
See Also:
getSequentialPageNumber()

getSequentialPageNumber

public int getSequentialPageNumber()
Retrieves the current physical page number that this ViewPrinter has printed.
Specified by:
getSequentialPageNumber in interface UIViewPrinter
Returns:
The current physical page number.
See Also:
setSequentialPageNumber(int)

print

public int print(java.awt.Graphics graphics,
                 java.awt.print.PageFormat pageFormat,
                 int pageIndex)
          throws java.awt.print.PrinterException
Prints a physical page of this Dataview to a Graphics. The java.awt.print.PrinterJob class calls this method. Application developers should not need call this method.
Specified by:
print in interface java.awt.print.Printable
Parameters:
graphics - The context into which the page is drawn.
pageFormat - The size and orientation of the page that is drawn.
pageIndex - The zero-based index of the page to be drawn.
Returns:
java.awt.print.Printable.PAGE_EXISTS if the page is rendered successfully, java.awt.print.Printable.NO_SUCH_PAGE if pageIndex specifies a nonexistent page.
Throws:
java.awt.print.PrinterException

print

protected void print(boolean currentLogPage,
                     boolean endPrintJob)
Deprecated. As of 3.2.0.16, replaced by 2D printing API
Parameters:
currentLogPage - true if current logical page only false if all logical pages
endPrintJob - true to end print job after printing, false to not end print job; normally the print job should be ended

printHeaderAndFooter

protected void printHeaderAndFooter(java.awt.Graphics g)
Parameters:
g - The Graphics object. prints header and footer

calcAdornmentsDimension

protected void calcAdornmentsDimension(int printableWidth)

saveAdornmentsSize

protected void saveAdornmentsSize()

resetAdornmentsSize

protected void resetAdornmentsSize()

saveTitlesFocus

protected void saveTitlesFocus()

restoreTitlesFocus

protected void restoreTitlesFocus()

setDataview

protected void setDataview(Dataview dv)

calcMargins

protected void calcMargins(java.awt.Graphics g)

adjustMargins

protected void adjustMargins()

calcHeaderAndFooterHeights

public void calcHeaderAndFooterHeights(java.awt.Graphics g)

checkForNoData

protected boolean checkForNoData()

startPrint

public abstract boolean startPrint()
Puts the view in a state for printing. This method saves the original state of the view, then it applies printing properties to the view. It displays the offscreen image (which has the snapshot of the view) on the screen, so that any modifications done to the view during printing will not be seen.

Calling this method is equivalent to calling startPrint(false). It is appropriate for printing or previewing graphs, or printing tables and crosstabs. To preview a table or crosstab, call startPrint(true).

Calls to the print method belong between calls to startPrint and endPrint.

Returns:
true if the print job starts successfully, false if the data in the view is not available to this ViewPrinter.
See Also:
endPrint(), print(boolean), renderPage(java.awt.Graphics), startPrint(boolean), oracle.dss.crosstab.CrosstabPrinter#printPage, GraphPrinter.printPage(Graphics), oracle.dss.crosstab.CrosstabPrinter#printPage(Graphics, DataSubsetRecord), oracle.dss.table.TablePrinter#printPage(Graphics), oracle.dss.table.TablePrinter#printPage(Graphics, DataSubsetRecord)

startPrint

public abstract boolean startPrint(boolean bPreviewMode)
Puts the view in a state for printing. This method saves the original state of the view, then it applies printing properties to the view. It displays the offscreen image (which has the snapshot of the view) on the screen, so that any modifications done to the view during printing will not be seen.

Use this method, with the renderPage method, when you preview a table or crosstab. Passing true in the bPreviewMode parameter allows this ViewPrinter to cache information to improve performance.

Calls to the print method belong between calls to startPrint and endPrint.

Specified by:
startPrint in interface UIViewPrinter
Parameters:
bPreviewMode - true if you are previewing the print job, false if you are actually sending the print job to a printer.
Returns:
true if the print job starts successfully, false if the data in the view is not available to this ViewPrinter.
See Also:
endPrint(), print(boolean), renderPage(java.awt.Graphics), GraphPrinter.printPage(Graphics), oracle.dss.crosstab.CrosstabPrinter#printPage, oracle.dss.crosstab.CrosstabPrinter#printPage(Graphics, DataSubsetRecord), oracle.dss.table.TablePrinter#printPage(Graphics), oracle.dss.table.TablePrinter#printPage(Graphics, DataSubsetRecord)

endPrint

public abstract void endPrint()
Sets the view back to its original state. This method removes the offscreen image that the startPrint method displays, and restores the active display of the view.

Calls to the print method belong between calls to startPrint and endPrint.

Specified by:
endPrint in interface UIViewPrinter
See Also:
startPrint(), print(boolean), renderPage(java.awt.Graphics), oracle.dss.crosstab.CrosstabPrinter#printPage, GraphPrinter.printPage(Graphics), oracle.dss.crosstab.CrosstabPrinter#printPage(Graphics, DataSubsetRecord), oracle.dss.table.TablePrinter#printPage(Graphics), oracle.dss.table.TablePrinter#printPage(Graphics, DataSubsetRecord)

setRepeatHeaders

public void setRepeatHeaders(boolean repeat)
Specifies whether to display the column and row headers on every physical page, when a table or crosstab is printed on multiple physical pages.

When RepeatHeaders is true, then the title, subtitle, footnote, and paging component are also repeated on each page.

When RepeatHeaders is false, then the title, subtitle, and paging component appear only on the first page. The footnote appears only on the last page. The column headers appear only on pages that display the first column, and the row headers appear only on pages that display the first row.

Parameters:
repeat - true to repeat row and column headers and titles, false to prevent repeating.

isRepeatHeaders

public boolean isRepeatHeaders()
Indicates whether the column and row headers are displayed on every physical page, when a table or crosstab is printed on multiple physical pages.

When RepeatHeaders is true, then the title, subtitle, footnote, and paging component are also repeated on each page.

When RepeatHeaders is false, then the title, subtitle, and paging component appear only on the first page. The footnote appears only on the last page. The column headers appear only on pages that display the first column, and the row headers appear only on pages that display the first row.

Parameters:
repeat - true if row and column headers and titles appear on each page, false if they do not.

setRepeatComponent

public void setRepeatComponent(int component,
                               boolean repeat)
Specifies whether to repeat the component on every physical page, when a table or crosstab is printed on multiple physical pages. A logical page of a graph always prints to a single physical page, so this method has no effect in a graph.
Specified by:
setRepeatComponent in interface UIViewPrinter
Parameters:
component - A constant that represents the components. Valid constants are listed in the See Also section.
repeat - true to repeat component, false to prevent repeating.
See Also:
GRIDVIEW_COLUMN_HEADER, GRIDVIEW_ROW_HEADER, PAGE_HEADER, TITLE, SUBTITLE, FOOTNOTE, TOP_FORMATTED_TEXT_AREA, BOTTOM_FORMATTED_TEXT_AREA

isRepeatComponent

public boolean isRepeatComponent(int component)
Indicates whether the component is displayed on every physical page, when a table or crosstab is printed on multiple physical pages. A logical page of a graph always prints to a single physical page, so this method always returns false in a GraphPrinter.
Specified by:
isRepeatComponent in interface UIViewPrinter
Parameters:
component - A constant that represents the components. Valid constants are listed in the See Also section.
Returns:
true if the component appears on each page, false if they do not.
See Also:
GRIDVIEW_COLUMN_HEADER, GRIDVIEW_ROW_HEADER, PAGE_HEADER, TITLE, SUBTITLE, FOOTNOTE, TOP_FORMATTED_TEXT_AREA, BOTTOM_FORMATTED_TEXT_AREA

printPages

protected abstract void printPages(java.awt.PrintJob pjob,
                                   boolean currentLogPage)
Deprecated. As of 3.2.0.16, replaced by 2D printing API
Parameters:
pJob - the PrintJob object
currentLogPage - true if current logical page only false if all logical pages

printToGraphics

protected abstract void printToGraphics(java.awt.Graphics g,
                                        PaginationRecord record)
Parameters:
g - the Graphics object
record - The pagination record to use for printing on the Graphics object.

goToFirstPage

public abstract boolean goToFirstPage()
Deprecated. As of 1.6.0.9, replaced by prepareFirstPage(Graphics)
The prepareFirstPage method respects the MarginAdjustment property.
See Also:
setMarginAdjustment(int)

goToNextPage

public abstract boolean goToNextPage()
Deprecated. As of 1.6.0.9, replaced by prepareNextPage(Graphics)
The prepareNextPage method respects the MarginAdjustment property.
See Also:
setMarginAdjustment(int)

goToPrevPage

public abstract boolean goToPrevPage()
Deprecated. As of 1.6.0.9, replaced by preparePrevPage(Graphics)
The preparePrevPage method respects the MarginAdjustment property.
See Also:
setMarginAdjustment(int)

prepareFirstPage

public abstract boolean prepareFirstPage(java.awt.Graphics g)
Prepares the first physical page in the view for printing and makes it the current page to print. Call this method before you call renderPage to print. Call this method before you call any of the other methods for changing pages. Call this method, even if you only print one physical page. This method performs initialization for printing.
Specified by:
prepareFirstPage in interface UIViewPrinter
Parameters:
g - The Graphics object to which to print the page. The Graphics object must be an instance of Graphics2D.
Returns:
true if the call is successful, false if the first physical page has no data.
See Also:
renderPage(java.awt.Graphics), hasNextPage(), prepareNextPage(java.awt.Graphics)

prepareNextPage

public abstract boolean prepareNextPage(java.awt.Graphics g)
Prepares the next physical page for printing and makes it the current page to print. Use this method when you use renderPage to print. Unless you are certain that there is a next page, you should call hasNextPage before you call this method. Also, before calling this method, call prepareFirstPage.
Specified by:
prepareNextPage in interface UIViewPrinter
Parameters:
g - The Graphics object to which to print the page. The Graphics object must be an instance of Graphics2D.
Returns:
true if the call is successful, false if the next physical page has no data.
See Also:
renderPage(java.awt.Graphics), prepareFirstPage(java.awt.Graphics), hasNextPage()

setScaleFontSize

public abstract void setScaleFontSize(int mask)
Specifies text components to resize when a graph is scaled to a different size for printing.
Specified by:
setScaleFontSize in interface UIViewPrinter
Parameters:
mask - A constant that represents the set of components to scale with the graph. The constants are listed in the See Also section.
See Also:
GraphConstants.TEXT_COMPONENTS_ALL, GraphConstants.TEXT_COMPONENTS_NONE

getScaleFontSize

public abstract int getScaleFontSize()
Retrieves the text components to resize when a graph is scaled to a different size for printing.
Specified by:
getScaleFontSize in interface UIViewPrinter
Returns:
A constant that represents which text components should be resized when the Graph is scaled to a different size for printing. The constants are listed in the See Also section.
See Also:
GraphConstants.TEXT_COMPONENTS_ALL, GraphConstants.TEXT_COMPONENTS_NONE

preparePrevPage

public abstract boolean preparePrevPage(java.awt.Graphics g)
Prepares the previous physical page for printing and makes it the current page to print. Use this method when you use renderPage to print. Unless you are certain that there is a previous page, you should call hasPrevPage before you call this method. Also, before calling this method, call prepareFirstPage.
Specified by:
preparePrevPage in interface UIViewPrinter
Parameters:
g - The Graphics object to which to print the page. The Graphics object must be an instance of Graphics2D.
Returns:
true if the call is successful, false if the previous physical page has no data.
See Also:
renderPage(java.awt.Graphics), prepareFirstPage(java.awt.Graphics), hasPrevPage()

hasNextPage

public abstract boolean hasNextPage()
Indicates whether the view has a physical page after the current physical page. Use this method when you use renderPage to print. Call this method before you call prepareNextPage.
Specified by:
hasNextPage in interface UIViewPrinter
Returns:
true if the view has another physical page after the current page, false if the current physical page is the last physical page.
See Also:
renderPage(java.awt.Graphics), prepareNextPage(java.awt.Graphics)

hasPrevPage

public abstract boolean hasPrevPage()
Indicates whether the view has a physical page before the current physical page. Use this method when you use renderPage to print. Call this method before you call preparePrevPage.
Specified by:
hasPrevPage in interface UIViewPrinter
Returns:
true if the view has another physical page before the current page, false if the current physical page is the first physical page.
See Also:
renderPage(java.awt.Graphics), preparePrevPage(java.awt.Graphics)

setTokenSubstitution

public void setTokenSubstitution(TokenSubstitution token)
Specifies a handler for token substitution in this ViewPrinter. Token substitution handlers make it possible for users to insert tokens (such as a token for the current dimension member) in the headers and footers of this ViewPrinter. This method sets the TokenSubstitution on this ViewPrinter and on all six of headers and footers that this ViewPrinter maintains. By default, the TokenSubstitution on this ViewPrinter and on each header and footer is null. You can also set a TokenSubstitution on each individual header and footer separately.
Specified by:
setTokenSubstitution in interface UIViewPrinter
Parameters:
token - The token substitution handler for this ViewPrinter.

setPageFormat

public void setPageFormat(java.awt.print.PageFormat pf)
Specifies the PageFormat object that specifies paper size for this ViewPrinter. The PageSetupDialog calls this method to set the PageFormat object that it modifies, to set the paper size on the print job.
Specified by:
setPageFormat in interface UIViewPrinter
Parameters:
pf - The PageFormat object that specifies the paper size.

getPageFormat

public java.awt.print.PageFormat getPageFormat()
Retrieves the PageFormat object that specifies the paper size for this ViewPrinter. The PageSetupDialog calls this method to retrieve the PageFormat in its initialization. If you use the PageSetupDialog but not the PrintDialog, then you should call this method to set the PageFormat on the PageSetupDialog.
Specified by:
getPageFormat in interface UIViewPrinter
Returns:
The PageFormat object that specifies the paper size for this ViewPrinter.

getTokenSubstitution

public TokenSubstitution getTokenSubstitution()
Retrieves the handler for token substitution in this ViewPrinter. Token substitution handlers make it possible for users to insert tokens (such as a token for the current dimension member) in the headers and footers of this ViewPrinter. You can also set a TokenSubstitution on each individual header and footer separately. This method gets the TokenSubstitution that is set on this ViewPrinter, which may be overridden in one or more headers or footers. By default, the TokenSubstitution on this ViewPrinter and on each header and footer is null.
Specified by:
getTokenSubstitution in interface UIViewPrinter
Returns:
The token substitution handler for this ViewPrinter.

getLocale

public java.util.Locale getLocale()
Retrives the locale of the View to be printed by this UIViewPrinter
Specified by:
getLocale in interface UIViewPrinter
Returns:
The Locale of the View

isDataviewTitleVisible

public boolean isDataviewTitleVisible()
Indicates if DataviewTitle is visble in the View to be printed.
Specified by:
isDataviewTitleVisible in interface UIViewPrinter
Returns:
true if visible false otherwise

isDataviewSubtitleVisible

public boolean isDataviewSubtitleVisible()
Indicates if DataviewSubtitle is visble in the View to be printed.
Specified by:
isDataviewSubtitleVisible in interface UIViewPrinter
Returns:
true if visible false otherwise

isDataviewFootnoteVisible

public boolean isDataviewFootnoteVisible()
Indicates if DataviewFootnote is visble in the View to be printed.
Specified by:
isDataviewFootnoteVisible in interface UIViewPrinter
Returns:
true if visible false otherwise

setLineWidth

public void setLineWidth(int position,
                         int width)
Specifies the width of the line to be printed at the given position. A line width of 0 indicates that there is no line at the given position. Default value is 0.
Specified by:
setLineWidth in interface UIViewPrinter
Parameters:
position - position of the line Valid constants are listed in the See Also section.
width - the width of the line
See Also:
ABOVE_FOOTER, BELOW_HEADER

getLineWidth

public int getLineWidth(int position)
Retrieves the width of the line printed at the given position. A line width of 0 indicates that there is no line at the given position. Default value is 0.
Specified by:
getLineWidth in interface UIViewPrinter
Parameters:
position - position of the line Valid constants are listed in the See Also section.
Returns:
the width of the line
See Also:
ABOVE_FOOTER, BELOW_HEADER

renderFirstPage

public boolean renderFirstPage(java.awt.Graphics g)
Specified by:
renderFirstPage in interface UIViewPrinter

renderLastPage

public boolean renderLastPage(java.awt.Graphics g)
Specified by:
renderLastPage in interface UIViewPrinter

goToFirstPage

public boolean goToFirstPage(java.awt.Graphics g)
Specified by:
goToFirstPage in interface UIViewPrinter

goToLastPage

public boolean goToLastPage(java.awt.Graphics g)
Specified by:
goToLastPage in interface UIViewPrinter

getWaitCursor

public java.awt.Cursor getWaitCursor()
Specified by:
getWaitCursor in interface UIViewPrinter

getDefaultCursor

public java.awt.Cursor getDefaultCursor()
Specified by:
getDefaultCursor in interface UIViewPrinter

checkDataSourceLogPage

protected boolean checkDataSourceLogPage()
Returns:
false if the DataSource logical page had to be changed true otherwise

fetchRowBlock

protected int fetchRowBlock(int firstRow,
                            int lastRow)
Parameters:
firstRow - 0-based index of the first row to fetch
lastRow - 0-based index of the last row to fetch
Returns:
0-based index of the last row fetched

resetCurrentLogicalPage

protected abstract void resetCurrentLogicalPage()

changePageEdgeCurrentHPos

protected boolean changePageEdgeCurrentHPos(int[] hPos,
                                            int maxLayerSpecified)
                                     throws EdgeOutOfRangeException,
                                            LayerOutOfRangeException,
                                            SliceOutOfRangeException,
                                            DataDirectorException
Parameters:
hPos - An array of relative indexes starting with the outermost layer and working in at least to maxLayerSpecified. This array indicates the set of new values to give to the various layers that specify the new current slice.
maxLayerSpecified - The maximum index into hPos (layer) that this method should use in making the change to the current slice.
Returns:
true if the current slice change is successful, false if the current slice change is not successful.
Throws:
EdgeOutOfRangeException - If edge is too large.
LayerOutOfRangeException - If the number of layers in hPos is too large.
SliceOutOfRangeException - If the indexes in the hPos are out of range.
DataDirectorException - If an error occurs during the operation.

getLogicalPageInUse

public ViewPrinter.HPosWrapper getLogicalPageInUse()

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Data Visualization Components
11g Release 1 (11.1.1.0.0)

E12063-01


Copyright © 1997, 2008, Oracle. All rights reserved.