| 
 | Oracle Fusion Middleware Java API Reference for Oracle Data Visualization Components 11g Release 1 (11.1.1.4.0) E12063-05 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectoracle.dss.dataView.ViewPrinter
oracle.dss.graph.GraphPrinter
public class GraphPrinter
Printer for a Graph.
 When you use the PrintDialog object from the
 oracle.dss.dataView.gui package, you do not need to call
 the methods in this class.
 When you use your own UI, you call methods on this GraphPrinter
 to specify how to print a Graph and to print the
 Graph.
 If you assume responsibility for page layout and calculation,
 you cannot use the PrintDialog; you must call methods
 on this GraphPrinter to print.
 
 The following example shows how to print a Graph, using the
 oracle.dss.dataView.gui.PrintDialog.
 
    GraphPrinter printer = new GraphPrinter();
    //One way to get a frame in which to display the Print dialog
    Frame frame = oracle.bali.ewt.util.WindowUtils.parentFrame(graph);
    PrintDialog dialog = new PrintDialog(frame, printer);
    dialog.show();
    dialog.dispose();
    dialog = null;
 
 The printing APIs in this class are based on Java 2D printing API. AWT Printing is not supported.
ViewPrinter, 
oracle.dss.dataView.gui.PrintDialog| Nested Class Summary | 
|---|
| Nested classes/interfaces inherited from class oracle.dss.dataView.ViewPrinter | 
|---|
| ViewPrinter.HPosWrapper | 
| Field Summary | 
|---|
| 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 | |
|---|---|
| GraphPrinter(Graph g)Constructor. | |
| Method Summary | |
|---|---|
| protected  boolean | checkForNoData() | 
|  void | endPrint()Sets the Graphback to its original state. | 
| protected  void | fetchAllData() | 
|  Graph | getGraph()Retrieves the Graphthat thisGraphPrinterprints. | 
|  int | getScaleFontSize()Retrieves which text components should be resized when the Graph is scaled to a different size for printing. | 
|  int | getViewPrinterType()Retrieves the type of ViewPrinter. | 
|  boolean | goToFirstPage()Deprecated. As of 1.6.0.9, replaced by prepareFirstPage(Graphics) | 
|  boolean | goToNextPage()Deprecated. As of 1.6.0.9, replaced by prepareNextPage(Graphics) | 
|  boolean | goToPrevPage()Deprecated. As of 1.6.0.9, replaced by preparePrevPage(Graphics) | 
|  boolean | hasNextPage()Indicates whether the view has a physical page after the current physical page. | 
|  boolean | hasPrevPage()Indicates whether the view has a physical page before the current physical page. | 
|  boolean | isFirstPhysicalPage()Indicates whether the current physical page is the first physical page in the current logical page. | 
|  boolean | isLastPhysicalPage()Indicates whether the current physical page is the last physical page in the current logical page. | 
|  boolean | prepareFirstPage(java.awt.Graphics g)Prepares the first physical page in the graph for printing and makes it the current page to print. | 
|  boolean | prepareNextPage(java.awt.Graphics g)Prepares the next physical page for printing and makes it the current page to print. | 
|  boolean | preparePrevPage(java.awt.Graphics g)Prepares the previous physical page for printing and makes it the current page to print. | 
|  boolean | printPage(java.awt.Graphics g)Prints the Graphto aGraphicsobject. | 
| protected  void | printPages(java.awt.PrintJob pjob,
           boolean currentLogPage)Deprecated. As of 3.2.0.16, replaced by 2D printing API | 
| protected  void | printToGraphics(java.awt.Graphics g,
                PaginationRecord record) | 
| protected  void | resetCurrentLogicalPage() | 
| protected  void | setDataview(Dataview dv) | 
|  void | setGraph(Graph graph)Specifies the Graphthat thisGraphPrintershould print. | 
|  boolean | setLogicalPage(int[] hPos)Specifies the logical page to print, when you use the printPagemethod to print. | 
|  void | setScaleFontSize(int mask)Specifies which text components should be resized when the graph is scaled to a different size for printing. | 
|  boolean | startPrint()Puts the Graphin a state for printing. | 
|  boolean | startPrint(boolean bPreviewMode)Puts the Graphin a state for printing. | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
|---|
public GraphPrinter(Graph g)
g - The Graph that this GraphPrinter
          prints.| Method Detail | 
|---|
public int getViewPrinterType()
UIViewPrinter.GRAPH_PRINTERpublic boolean startPrint()
Graph in a state for printing.
 This method saves the original state of the view, then it applies
 printing properties to the Graph.
 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.
startPrint in class ViewPrintertrue if the print job starts successfully,
         false if the data in the view is not available
                           to this GraphPrinter.endPrint(), 
startPrint(boolean), 
printPage(java.awt.Graphics), 
ViewPrinter.print(boolean), 
ViewPrinter.renderPage(java.awt.Graphics)public boolean startPrint(boolean bPreviewMode)
Graph in a state for printing.
 This method saves the original state of the view, then it applies
 printing properties to the Graph.
 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.
 
 Calls to the print method
 belong between calls to startPrint and
 endPrint.
startPrint in interface UIViewPrinterstartPrint in class ViewPrinterbPreviewMode - true if you are previewing the print job,
                     false if you are actually sending
                     the print job to a printer.
true if the print job starts successfully,
         false if the data in the view is not available
                           to this GraphPrinter.endPrint(), 
startPrint(boolean), 
printPage(java.awt.Graphics), 
ViewPrinter.print(boolean), 
ViewPrinter.renderPage(java.awt.Graphics)public void endPrint()
Graph back to its original state.
 This method removes the offscreen image that the
 startPrint method displays, and restores the active
 display of the Graph.
 
 Calls to the print method
 belong between calls to startPrint and
 endPrint.
endPrint in interface UIViewPrinterendPrint in class ViewPrinterstartPrint(), 
ViewPrinter.print(boolean)public boolean isFirstPhysicalPage()
true.
isFirstPhysicalPage in interface UIViewPrinterisFirstPhysicalPage in class ViewPrintertrue if the current physical page is the first
                           physical page in the current logical page,
         false if it is not.ViewPrinter.renderPage(java.awt.Graphics)public boolean isLastPhysicalPage()
true.
isLastPhysicalPage in interface UIViewPrinterisLastPhysicalPage in class ViewPrintertrue if the current physical page is the last
                          physical page in the current logical page,
         false if it is not.ViewPrinter.renderPage(java.awt.Graphics)public Graph getGraph()
Graph that this GraphPrinter
 prints.
Graph that this GraphPrinter
         prints.public void setGraph(Graph graph)
Graph that this GraphPrinter
 should print.
graph - The Graph that needs to be printed.public void setScaleFontSize(int mask)
setScaleFontSize in interface UIViewPrintersetScaleFontSize in class ViewPrintermask - A constant that represents the set of components to
             scale with the graph.
             The constants are listed in the See Also section.ViewPrinter.TEXT_COMPONENTS_ALL, 
ViewPrinter.TEXT_COMPONENTS_NONEpublic int getScaleFontSize()
getScaleFontSize in interface UIViewPrintergetScaleFontSize in class ViewPrinterGraph class,
             and they start with TEXT_COMPONENTS.GraphConstants.TEXT_COMPONENTS_ALL, 
GraphConstants.TEXT_COMPONENTS_NONE
protected void printPages(java.awt.PrintJob pjob,
                          boolean currentLogPage)
printPages in class ViewPrinterpJob - the PrintJob objectcurrentLogPage - true if current logical page only
                       false  if all logical pagespublic boolean printPage(java.awt.Graphics g)
Graph to a Graphics object.
 This method is useful only when you assume responsibility for the
 print job.
 
 This method renders the Graph in the Dimension
 that is specified by the ViewDimension attribute of
 this GraphPrinter.
g - The Graphics object to which to print the
          Graph. The Graphics object must be an instance of
          Graphics2D.
true if the print job is successful,
         false if the data in the view is not available
                           to this GraphPrinter.
protected void printToGraphics(java.awt.Graphics g,
                               PaginationRecord record)
printToGraphics in class ViewPrinterg - the Graphics objectrecord - The pagination record to use for printing on the Graphics object.public boolean goToFirstPage()
prepareFirstPage(Graphics)
prepareFirstPage method respects the
 MarginAdjustment property.
goToFirstPage in class ViewPrinterViewPrinter.setMarginAdjustment(int)public boolean prepareFirstPage(java.awt.Graphics g)
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.
prepareFirstPage in interface UIViewPrinterprepareFirstPage in class ViewPrinterg - The Graphics object to which to print the page.
             The Graphics object must be an instance of Graphics2D.
true if the call is successful,
         false if the first physical page has no data.hasNextPage(), 
prepareNextPage(java.awt.Graphics), 
ViewPrinter.renderPage(java.awt.Graphics)public boolean hasNextPage()
renderPage, when you assume
 responsibility for the print job.
hasNextPage in interface UIViewPrinterhasNextPage in class ViewPrintertrue if the view has another physical page after
                            the current page,
         false if the current physical page is the last
                            physical page.ViewPrinter.renderPage(java.awt.Graphics)public boolean goToNextPage()
prepareNextPage(Graphics)
prepareNextPage method respects the
 MarginAdjustment property.
goToNextPage in class ViewPrinterViewPrinter.setMarginAdjustment(int)public boolean prepareNextPage(java.awt.Graphics g)
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.
prepareNextPage in interface UIViewPrinterprepareNextPage in class ViewPrinterg - The Graphics object to which to print the page.
              The Graphics object must be an instance of Graphics2D.
true if the call is successful,
         false if the next physical page has no data.prepareFirstPage(java.awt.Graphics), 
hasNextPage(), 
ViewPrinter.renderPage(java.awt.Graphics)public boolean hasPrevPage()
renderPage, when you assume
 responsibility for the print job.
hasPrevPage in interface UIViewPrinterhasPrevPage in class ViewPrintertrue if the view has another physical page before
                            the current page,
         false if the current physical page is the first
                            physical page.ViewPrinter.renderPage(java.awt.Graphics)public boolean goToPrevPage()
preparePrevPage(Graphics)
preparePrevPage method respects the
 MarginAdjustment property.
goToPrevPage in class ViewPrinterViewPrinter.setMarginAdjustment(int)public boolean preparePrevPage(java.awt.Graphics g)
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.
preparePrevPage in interface UIViewPrinterpreparePrevPage in class ViewPrinterg - The Graphics object to which to print the page.
              The Graphics object must be an instance of Graphics2D.
true if the call is successful,
         false if the previous physical page has no data.ViewPrinter.renderPage(java.awt.Graphics), 
prepareFirstPage(java.awt.Graphics), 
hasPrevPage()public boolean setLogicalPage(int[] hPos)
printPage method to print.
 Call this method after you call the startPrint method for
 each graph that you print.
      *
setLogicalPage in class ViewPrinterhPos - The hPos array that identifies the logical page
             to print.
true if the logical page has been set,
         false if the data in the view is not available
                           to this ViewPrinter.printPage(java.awt.Graphics), 
oracle.dss.dataView.gui.PrintDialog, 
DataAccess.getFirstHPos(int), 
DataAccess.getNextHPos(int, int[])protected void setDataview(Dataview dv)
setDataview in class ViewPrinterprotected boolean checkForNoData()
checkForNoData in class ViewPrinterprotected void fetchAllData()
protected void resetCurrentLogicalPage()
resetCurrentLogicalPage in class ViewPrinter| 
 | Oracle Fusion Middleware Java API Reference for Oracle Data Visualization Components 11g Release 1 (11.1.1.4.0) E12063-05 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||