Skip navigation links


com.essbase.eas.utils.print
Class CDefaultPrint

java.lang.Object
  extended by com.essbase.eas.utils.print.CDefaultPrint

All Implemented Interfaces:
CBook
Direct Known Subclasses:
CPrint

public class CDefaultPrint
extends java.lang.Object
implements CBook

implements the book interface

Since:
6.5.1
Version:
7.1.0
Author:
Sree Menon

Nested Class Summary
static class CDefaultPrint.ComponentObject
           
static class CDefaultPrint.CPrintBook
           
static class CDefaultPrint.LineBreak
           
static class CDefaultPrint.PageBreak
           
 class CDefaultPrint.PrintTree
           

 

Field Summary
protected static java.lang.String EOL
           
static int FIT_HEIGHT_TO_PAGE
           
static int FIT_TO_PAGE
           
static int FIT_WIDTH_TO_PAGE
           
protected  PageHeader header
           
protected  java.awt.Font headerFont
           
protected  java.awt.print.PrinterJob job
           
static int LIMIT_COMPONENT_HEIGHT
           
static int LIMIT_COMPONENT_SIZE
           
static int LIMIT_COMPONENT_WIDTH
           
protected static CDefaultPrint.LineBreak lineBreak
           
protected  java.util.ArrayList<java.lang.Object> lines
           
protected static CDefaultPrint.PageBreak pageBreak
           
protected  java.awt.Font pageFont
           
protected  java.awt.print.PageFormat pageFormat
           
protected  javax.swing.JComponent previewComp
           
protected  java.lang.String title
           
static int USE_COMPONENT_SIZE
           

 

Constructor Summary
CDefaultPrint()
           
CDefaultPrint(PageHeader header)
           
CDefaultPrint(java.lang.String title)
           
CDefaultPrint(java.lang.String title, PageHeader header)
           

 

Method Summary
 void addBoldObject(java.lang.Object o)
          Adds an object with a bold font.
 void addDocument(javax.swing.text.Document doc)
           
 void addJComponentObject(java.awt.Component jcomp)
           
 void addJComponentObject(java.awt.Component jcomp, int mode)
           
 void addJList(javax.swing.JList list)
           
 void addKeyValue(java.lang.String key, java.lang.String value)
          Adds a lable and value.
 void addListModel(javax.swing.DefaultListModel model)
           
 void addObject(java.lang.Object o)
          Adds an object to the print The object could be one of the following: TableModel JTable TreeNode TreeModel JTree String Color Font Component Incase the object is a string, its broken up into multiple lines if it has new line characters in it.
 void addObjects(java.lang.Object[] objects)
          Adds an array of objects, each starting on a new line
 void addObjects(java.lang.Object[] objects, java.awt.Font font)
          Adds an array of objects using the font, each starting on a new line
 void addRAFObjects(java.lang.Object[] objects)
           
 void addRootTreeNode(javax.swing.tree.TreeNode node)
           
 void addStringWithPagebreaks(java.lang.String text)
           
 void addTable(javax.swing.JTable table)
           
 void addTableModel(javax.swing.table.TableModel model)
           
 void addTextComponent(javax.swing.text.JTextComponent txt)
           
 void addTree(javax.swing.JTree tree)
           
 void addTreeModel(javax.swing.tree.TreeModel model)
           
 java.awt.print.Pageable createBook()
           
protected  CDefaultPrint.CPrintBook createBook(javax.swing.JProgressBar bar)
           
 void dispose()
           
static void disposeObject(java.lang.Object obj)
           
 java.awt.Font getHeaderFont()
          Returns the current font used to draw the page heading
 java.awt.Font getPageFont()
          Returns the font used to draw the page
 java.awt.print.PageFormat getPageFormat()
           
 javax.swing.JComponent getPreviewComponent()
           
protected  java.lang.Object getTextPainter(java.lang.String text)
           
 java.lang.String getTitle()
          Returns the title
static void pageSetup()
           
 void print()
           
 boolean print(java.awt.print.Pageable book)
           
 void setHeader(PageHeader header)
          Sets the header class
 void setHeaderFont(java.awt.Font font)
          Sets the font used to draw the page heading
 void setPageFont(java.awt.Font font)
          Sets the font used to draw the page
 void setPreviewComponent(javax.swing.JComponent comp)
           
 void setTitle(java.lang.String title)
          Sets the title for each page
 void startNewLine()
          Explicitly starts a new line
 void startNewPage()
          Explicitly starts a new page

 

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

 

Field Detail

USE_COMPONENT_SIZE

public static final int USE_COMPONENT_SIZE
See Also:
Constant Field Values

FIT_WIDTH_TO_PAGE

public static final int FIT_WIDTH_TO_PAGE
See Also:
Constant Field Values

FIT_HEIGHT_TO_PAGE

public static final int FIT_HEIGHT_TO_PAGE
See Also:
Constant Field Values

LIMIT_COMPONENT_WIDTH

public static final int LIMIT_COMPONENT_WIDTH
See Also:
Constant Field Values

LIMIT_COMPONENT_HEIGHT

public static final int LIMIT_COMPONENT_HEIGHT
See Also:
Constant Field Values

LIMIT_COMPONENT_SIZE

public static final int LIMIT_COMPONENT_SIZE
See Also:
Constant Field Values

FIT_TO_PAGE

public static final int FIT_TO_PAGE
See Also:
Constant Field Values

pageFormat

protected java.awt.print.PageFormat pageFormat

job

protected java.awt.print.PrinterJob job

header

protected PageHeader header

headerFont

protected java.awt.Font headerFont

pageFont

protected java.awt.Font pageFont

lines

protected java.util.ArrayList<java.lang.Object> lines

title

protected java.lang.String title

previewComp

protected javax.swing.JComponent previewComp

EOL

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

lineBreak

protected static final CDefaultPrint.LineBreak lineBreak

pageBreak

protected static final CDefaultPrint.PageBreak pageBreak

Constructor Detail

CDefaultPrint

public CDefaultPrint()

CDefaultPrint

public CDefaultPrint(java.lang.String title)

CDefaultPrint

public CDefaultPrint(PageHeader header)

CDefaultPrint

public CDefaultPrint(java.lang.String title,
                     PageHeader header)

Method Detail

setTitle

public void setTitle(java.lang.String title)
Description copied from interface: CBook
Sets the title for each page
Specified by:
setTitle in interface CBook
Parameters:
title - the title of the book

getTitle

public java.lang.String getTitle()
Description copied from interface: CBook
Returns the title
Specified by:
getTitle in interface CBook
Returns:
the title

setHeaderFont

public void setHeaderFont(java.awt.Font font)
Description copied from interface: CBook
Sets the font used to draw the page heading
Specified by:
setHeaderFont in interface CBook
Parameters:
font - the font used for the header of the book

getHeaderFont

public java.awt.Font getHeaderFont()
Description copied from interface: CBook
Returns the current font used to draw the page heading
Specified by:
getHeaderFont in interface CBook
Returns:
header font

setPageFont

public void setPageFont(java.awt.Font font)
Description copied from interface: CBook
Sets the font used to draw the page
Specified by:
setPageFont in interface CBook
Parameters:
font - page font

getPageFont

public java.awt.Font getPageFont()
Description copied from interface: CBook
Returns the font used to draw the page
Specified by:
getPageFont in interface CBook
Returns:
page font

startNewLine

public void startNewLine()
Description copied from interface: CBook
Explicitly starts a new line
Specified by:
startNewLine in interface CBook

startNewPage

public void startNewPage()
Description copied from interface: CBook
Explicitly starts a new page
Specified by:
startNewPage in interface CBook

addBoldObject

public void addBoldObject(java.lang.Object o)
Description copied from interface: CBook
Adds an object with a bold font. Uses to print tab titles. The line is moved to next line
Specified by:
addBoldObject in interface CBook
Parameters:
o - the object to be draw bold

addKeyValue

public void addKeyValue(java.lang.String key,
                        java.lang.String value)
Description copied from interface: CBook
Adds a lable and value. The label will be printed using the current font and the value using a bold font
Specified by:
addKeyValue in interface CBook
Parameters:
key - the key (drawn in bold)
value - the value (drawn plain)

addObject

public void addObject(java.lang.Object o)
Description copied from interface: CBook
Adds an object to the print The object could be one of the following: Incase the object is a string, its broken up into multiple lines if it has new line characters in it. Incase of Component, it will be drawn with the current width and height.
Specified by:
addObject in interface CBook
Parameters:
o - object

addRAFObjects

public void addRAFObjects(java.lang.Object[] objects)

addJComponentObject

public void addJComponentObject(java.awt.Component jcomp)

addJComponentObject

public void addJComponentObject(java.awt.Component jcomp,
                                int mode)

addObjects

public void addObjects(java.lang.Object[] objects)
Description copied from interface: CBook
Adds an array of objects, each starting on a new line
Specified by:
addObjects in interface CBook
Parameters:
objects - array of objects

addObjects

public void addObjects(java.lang.Object[] objects,
                       java.awt.Font font)
Description copied from interface: CBook
Adds an array of objects using the font, each starting on a new line
Specified by:
addObjects in interface CBook
Parameters:
objects - array of objects
font - the font to be used for the objects.

setHeader

public void setHeader(PageHeader header)
Description copied from interface: CBook
Sets the header class
Specified by:
setHeader in interface CBook
Parameters:
header - custom page header

addRootTreeNode

public void addRootTreeNode(javax.swing.tree.TreeNode node)

addTreeModel

public void addTreeModel(javax.swing.tree.TreeModel model)

addTable

public void addTable(javax.swing.JTable table)

addTableModel

public void addTableModel(javax.swing.table.TableModel model)

addJList

public void addJList(javax.swing.JList list)

addListModel

public void addListModel(javax.swing.DefaultListModel model)

addTextComponent

public void addTextComponent(javax.swing.text.JTextComponent txt)

addDocument

public void addDocument(javax.swing.text.Document doc)

addTree

public void addTree(javax.swing.JTree tree)

pageSetup

public static void pageSetup()

createBook

public java.awt.print.Pageable createBook()

print

public void print()

print

public boolean print(java.awt.print.Pageable book)

createBook

protected CDefaultPrint.CPrintBook createBook(javax.swing.JProgressBar bar)

getPreviewComponent

public javax.swing.JComponent getPreviewComponent()

setPreviewComponent

public void setPreviewComponent(javax.swing.JComponent comp)

dispose

public void dispose()

addStringWithPagebreaks

public void addStringWithPagebreaks(java.lang.String text)

getTextPainter

protected java.lang.Object getTextPainter(java.lang.String text)

getPageFormat

public java.awt.print.PageFormat getPageFormat()

disposeObject

public static void disposeObject(java.lang.Object obj)

Skip navigation links


Copyright © 2001, 2012, Oracle. All rights reserved.