|
ElegantJ Tables Java API Specification v1.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.elegantj.util.printer.Printer
Printer which implements functionality of the Printer which provides the page setup, preview and print facility for any component also provides the special implementation of the JTable, JTextPane, JTextArea AWTTextArea for the print also provides the header, footer,and margins
| Field Summary | |
static int |
A2_ENVELOP_TYPE
The paper type |
static int |
A4_TYPE
The paper type |
static int |
A5_TYPE
The paper type |
static int |
A6_CARD_TYPE
The paper type |
protected static int |
ASCENT
protected value of ascent |
static int |
B5_TYPE
The paper type |
protected double |
bottomMargin
holds the value of the bottom margin in pixels |
protected double |
bottomMarginDInch
holds the value of the bottom margin in inches |
com.elegantj.editors.C1 |
c1
|
static int |
C6_ENVELOP_TYPE
The paper type |
protected java.lang.String |
centerFooter
holds the center footer value |
protected java.lang.String |
centerHeader
holds the center header value |
static java.lang.String |
CURRENT_DATE
To display the current date in the header or footer |
static java.lang.String |
CURRENT_TIME
To display the current time in the header or footer |
static int |
CUSTOM_TYPE
The paper type |
protected static int |
DESCENT
protected value of descent |
static int |
DL_ENVELOP_TYPE
The paper type |
static int |
EXECUTIVE_TYPE
The paper type |
protected double |
gapAboveFooter
holds the value of the gap above footer in pixels |
protected double |
gapAboveFooterDInch
holds the value of the gap above footer in inches |
protected double |
gapBelowHeader
holds the value of the gap below header in pixels |
protected double |
gapBelowHeaderDInch
holds the value of the gap below header in inches |
static int |
HAGAKI_CARD_TYPE
The paper type |
static int |
INDEX_CARD_4x6_TYPE
The paper type |
static int |
INDEX_CARD_5x8_TYPE
The paper type |
static int |
LANDSCAPE
The orientation of the page(s) |
protected java.lang.String |
leftFooter
holds the left footer value |
protected java.lang.String |
leftHeader
holds the left header value |
protected double |
leftMargin
holds the value of the left margin in pixels |
protected double |
leftMarginDInch
holds the value of the left margin in inches |
static int |
LEGAL_TYPE
The paper type |
static int |
LETTER_TYPE
The paper type |
static int |
N010_ENVELOP_TYPE
The paper type |
protected int |
noOfCopies
the no of copies value |
static java.lang.String |
PAGE_NO
To display the page number in the header or footer |
protected int |
pageOrientation
the value of the page orientation either PORTRAIT or LANDSCAPE |
protected double |
paperHeight
paper height in pixels |
protected double |
paperHeightDInch
paper height in inches |
protected int |
paperType
the paper type |
protected double |
paperWidth
paper width in pixels |
protected double |
paperWidthDInch
paper width in inches |
static int |
PORTRAIT
The orientation of the page(s) |
static java.util.ResourceBundle |
RESOURCE_BUNDLE
Specifies the resurce bundle |
protected java.lang.String |
rightFooter
holds the right footer value |
protected java.lang.String |
rightHeader
holds the right header value |
protected double |
rightMargin
holds the value of the right margin in pixels |
protected double |
rightMarginDInch
holds the value of the right margin in inches |
protected boolean |
showLineAboveFooter
wheather to show line above header or not |
protected boolean |
showLineBelowHeader
wheather to show line below header or not |
protected boolean |
showPrintDialog
wheather show print dialog or not |
protected double |
topMargin
holds the value of the top margin in pixels |
protected double |
topMarginDInch
holds the value of the top margin in inches |
static java.lang.String |
TOTAL_PAGES
To display the total pages number in the header or footer |
| Fields inherited from interface java.awt.print.Printable |
NO_SUCH_PAGE, PAGE_EXISTS |
| Constructor Summary | |
Printer()
Default constructor |
|
| Method Summary | |
void |
addPrinterListener(PrinterListener l)
Adds the printer listener |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener l)
Method which adds the PropertyChangeListener |
protected java.awt.Dialog |
createPageSetupDialog(java.awt.Frame frame)
Creates the dialog for page setup |
protected PreviewPage |
createPreviewPage(int width,
int height,
java.awt.Image image,
int pageIndex)
Method which creates the preview page |
protected void |
drawHeaders(java.awt.Graphics2D g,
int pageIndex)
method which draws headers for the every pages |
javax.swing.JFrame |
findFrame(java.awt.Component component)
Utility method for find a frame |
void |
firePrinterEvent(PrinterEvent e)
fires the PrinterEvent |
void |
firePropertyChange(java.lang.String property,
java.lang.Object oldValue,
java.lang.Object newValue)
Method which fires the property change |
double |
getActualPaperHeight()
Returns the actual paper height |
double |
getActualPaperWidth()
Returns the actual paper width |
int |
getBookSize()
Returns the book size |
double |
getBottomMargin()
Returns the bottom margin of the page(s), in inches |
java.lang.String |
getCenterFooter()
Returns the center footer of the page(s) |
java.lang.String |
getCenterHeader()
Returns the center header of the page(s) |
double |
getGapAboveFooter()
Returns the value of gap above footer of the page(s), in inches |
double |
getGapBelowHeader()
Returns the value of gap below header of the page(s), in inches |
double |
getImageablePaperHeight()
Returns the imageable paper height |
double |
getImageablePaperWidth()
Returns the imageable paper width |
java.lang.String |
getLeftFooter()
Returns the left footer of the page(s) |
java.lang.String |
getLeftHeader()
Returns the left header of the page(s) |
double |
getLeftMargin()
Returns the left margin of the page(s), in inches |
java.lang.String |
getLicenseKey()
Returns the license key of the bean |
int |
getNoOfCopies()
Returns the no of copies of the page(s) |
int |
getNoOfPages()
Method which returns the no of pages |
int |
getPageOrientation()
Returns the page orientation of the page(s) |
double |
getPaperHeight()
Returns the value of property paper height, in inches |
int |
getPaperType()
Returns the value of paper type property |
double |
getPaperWidth()
Returns the value of property paper width, in inches |
java.lang.String |
getPort()
Returns the target port |
java.awt.Dimension |
getPreferredSize()
Method which returns the preferred size |
java.lang.String |
getPrintJobName()
Returns the print job name |
java.lang.String |
getRightFooter()
Returns the right footer of the page(s) |
java.lang.String |
getRightHeader()
Returns the right header of the page(s) |
double |
getRightMargin()
Returns the right margin of the page(s), in inches |
double |
getTopMargin()
Returns the top margin of the page(s), in inches |
boolean |
isPrintBookIndividually()
Returns the wheather print the book of pages individually or not |
boolean |
isScaleComponentToSinglePage()
Returns the wheather scale the component to fit to the single page If true, the big component will be scaled to fit to the single page If false, the big component will be wrapped and component will be printed on multiple pages instead of single page |
boolean |
isShowLineAboveFooter()
Returns The boolean value of, is line above footer to be drawn? |
boolean |
isShowLineBelowHeader()
Returns The boolean value of, is line below header to be drawn? |
boolean |
isShowPrintDialog()
Returns The boolean value of, is display the print dialog while print method is called |
void |
pageSetup()
Displays the page setup dialog |
void |
pageSetup(java.awt.Frame frame)
Displays the page setup dialog |
void |
preview()
Displays the preview dialog |
void |
preview(java.awt.Frame frame)
Displays the preview dialog |
void |
print()
Call this method to take print outs If the value of the ShowPrintDialog set true, then this method first of shows the print dialog and then takes print. This print dialog will be shown only if the value of PrintBookIndividually is false. Note : If the no. |
void |
print(byte[] bytes)
Reads the contents of bytes array and send it to the printer for print outs. |
void |
print(byte[] bytes,
java.lang.String port)
Reads the contents of bytes array and send it to the specified printer port for print outs. |
void |
print(java.io.FileInputStream fis)
Reads the contents from FileInputStream and send it to the printer for print outs. |
void |
print(java.io.FileInputStream fis,
java.lang.String port)
Reads the contents from FileInputStream and send it to the specified printer port for print outs. |
int |
print(java.awt.Graphics g,
java.awt.print.PageFormat pageFormat,
int pageIndex)
Implementation of the Printable |
protected int |
Print(java.awt.Graphics g,
java.awt.print.PageFormat pageFormat,
int pageIndex)
Method which is called from print |
void |
print(int pageIndex)
Prints the page at the specified page index |
void |
print(int startPageIndex,
int endPageIndex)
Prints the pages from startPageIndex(inclusive) to the endPageIndex(inclusive) |
protected int |
printPreview(java.awt.Graphics g,
java.awt.print.PageFormat pageFormat,
int pageIndex)
This method called during print preview |
void |
readExternal(java.io.ObjectInput in)
Implementation of writeExternal method |
void |
removePrinterListener(PrinterListener l)
Removes the printer listener |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener l)
Method which removes the PropertyChangeListener |
void |
setAWTTextArea(java.awt.TextArea textArea)
Sets the awt TextArea for taking print |
void |
setBookSize(int bookSize)
Sets the book size |
void |
setBottomMargin(double bottomMargin)
Sets the bottom margin of the page(s), in inches |
void |
setCenterFooter(java.lang.String centerFooter)
Sets the center footer of the page(s) |
void |
setCenterHeader(java.lang.String centerHeader)
Sets the center header of the page(s) |
void |
setComponent(java.awt.Component component)
Sets the component for taking print |
void |
setGapAboveFooter(double gapAboveFooter)
Sets the value of gap above footer of the page(s), in inches |
void |
setGapBelowHeader(double gapBelowHeader)
Sets the value of gap below header of the page(s), in inches |
void |
setJTable(javax.swing.JTable table)
Sets the JTable for taking print |
void |
setJTextArea(javax.swing.JTextArea textArea)
Sets the JTextArea for taking print |
void |
setJTextPane(javax.swing.JTextPane textPane)
Sets the JTextPane for taking print |
void |
setLeftFooter(java.lang.String leftFooter)
Sets the left footer of the page(s) |
void |
setLeftHeader(java.lang.String leftHeader)
Sets the left header of the page(s) |
void |
setLeftMargin(double leftMargin)
Sets the left margin of the page(s), in inches |
void |
setLicenseKey(java.lang.String licenseKey)
Methods which sets the license key |
void |
setNoOfCopies(int noOfCopies)
Sets the no of copies of the page(s) |
void |
setPageOrientation(int pageOrientation)
Sets the page orientation of the page(s) |
void |
setPaperSize(double width,
double height)
Sets the paper's size |
void |
setPaperType(int paperType)
Sets the value of paper type property |
void |
setPort(java.lang.String port)
Sets the target port, printer use this port to print pages |
void |
setPrintBookIndividually(boolean isPrintBookIndividually)
Sets the wheather user want to print the book of pages individually or not |
void |
setPrintJobName(java.lang.String jobName)
Returns the print job name |
void |
setRightFooter(java.lang.String rightFooter)
Sets the right footer of the page(s) |
void |
setRightHeader(java.lang.String rightHeader)
Sets the right header of the page(s) |
void |
setRightMargin(double rightMargin)
Sets the right margin of the page(s), in inches |
void |
setScaleComponentToSinglePage(boolean isScaleComponentToSinglePage)
Sets the wheather scale the component to fit to the single page If true, the big component will be scaled to fit to the single page If false, the big component will be wrapped and component will be printed on multiple pages instead of single page |
void |
setShowLineAboveFooter(boolean showLineAboveFooter)
Sets the boolean value of, is line above footer to be drawn? |
void |
setShowLineBelowHeader(boolean showLineBelowHeader)
Sets the boolean value of, is line below header to be drawn? |
void |
setShowPrintDialog(boolean showPrintDialog)
Sets the boolean value of, is display the print dialog while print method is called |
void |
setTopMargin(double topMargin)
Sets the top margin of the page(s), in inches |
void |
writeExternal(java.io.ObjectOutput out)
Implementation of writeExternal method |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final java.util.ResourceBundle RESOURCE_BUNDLE
public static int PORTRAIT
public static int LANDSCAPE
public static int LETTER_TYPE
public static int LEGAL_TYPE
public static int EXECUTIVE_TYPE
public static int A4_TYPE
public static int A5_TYPE
public static int B5_TYPE
public static int N010_ENVELOP_TYPE
public static int A2_ENVELOP_TYPE
public static int DL_ENVELOP_TYPE
public static int C6_ENVELOP_TYPE
public static int INDEX_CARD_4x6_TYPE
public static int INDEX_CARD_5x8_TYPE
public static int A6_CARD_TYPE
public static int HAGAKI_CARD_TYPE
public static int CUSTOM_TYPE
public static java.lang.String CURRENT_DATE
public static java.lang.String CURRENT_TIME
public static java.lang.String PAGE_NO
public static java.lang.String TOTAL_PAGES
protected static int ASCENT
protected static int DESCENT
protected int pageOrientation
protected int noOfCopies
protected boolean showLineBelowHeader
protected boolean showLineAboveFooter
protected boolean showPrintDialog
protected java.lang.String leftHeader
protected java.lang.String centerHeader
protected java.lang.String rightHeader
protected java.lang.String leftFooter
protected java.lang.String centerFooter
protected java.lang.String rightFooter
protected double leftMarginDInch
protected double leftMargin
protected double rightMarginDInch
protected double rightMargin
protected double topMarginDInch
protected double topMargin
protected double bottomMarginDInch
protected double bottomMargin
protected double gapBelowHeaderDInch
protected double gapBelowHeader
protected double gapAboveFooterDInch
protected double gapAboveFooter
protected int paperType
protected double paperWidthDInch
protected double paperWidth
protected double paperHeightDInch
protected double paperHeight
public transient com.elegantj.editors.C1 c1
| Constructor Detail |
public Printer()
| Method Detail |
public void setComponent(java.awt.Component component)
component - the componentpublic void setJTable(javax.swing.JTable table)
table - The JTablepublic void setJTextPane(javax.swing.JTextPane textPane)
textPane - The JTextPanepublic void setJTextArea(javax.swing.JTextArea textArea)
public void setAWTTextArea(java.awt.TextArea textArea)
textArea - The awt TextAreapublic void pageSetup()
public void pageSetup(java.awt.Frame frame)
frame - The frame on to which this page setup dialog is added
if frame is null then new Frame created internallyprotected java.awt.Dialog createPageSetupDialog(java.awt.Frame frame)
frame - The frame on to which this page setup dialog is added
public void preview()
public void preview(java.awt.Frame frame)
frame - The frame on to which this preview dialog is added
if frame is null then new Frame created internallypublic void print()
public void print(int pageIndex)
pageIndex - The specified page index
public void print(int startPageIndex,
int endPageIndex)
startPageIndex - The start page indexendPageIndex - The end page index
protected int printPreview(java.awt.Graphics g,
java.awt.print.PageFormat pageFormat,
int pageIndex)
public int print(java.awt.Graphics g,
java.awt.print.PageFormat pageFormat,
int pageIndex)
print in interface java.awt.print.Printable
protected int Print(java.awt.Graphics g,
java.awt.print.PageFormat pageFormat,
int pageIndex)
public void print(java.io.FileInputStream fis)
fis - The specified FileInputStream
Note : The port property will be considered while user
takes print outs using this method.
public void print(java.io.FileInputStream fis,
java.lang.String port)
fis - The specified FileInputStreamport - The specified printer port on to which print out will be takenpublic void print(byte[] bytes)
bytes - The specified bytes arry
public void print(byte[] bytes,
java.lang.String port)
bytes - The specified bytes arrayport - The specified printer port on to which print out will be takenpublic int getNoOfPages()
protected void drawHeaders(java.awt.Graphics2D g,
int pageIndex)
public java.awt.Dimension getPreferredSize()
public javax.swing.JFrame findFrame(java.awt.Component component)
component - The component for which frame requiredpublic void setPaperType(int paperType)
paperType - The int value for paper type propertypublic int getPaperType()
public void setPaperSize(double width,
double height)
width - The width of the pageheight - The height of the pagepublic double getPaperWidth()
public double getPaperHeight()
public double getImageablePaperWidth()
public double getImageablePaperHeight()
public double getActualPaperWidth()
public double getActualPaperHeight()
public void setLeftHeader(java.lang.String leftHeader)
leftHeader - The left header of the page(s)public java.lang.String getLeftHeader()
public void setCenterHeader(java.lang.String centerHeader)
centerHeader - The center header of the page(s)public java.lang.String getCenterHeader()
public void setRightHeader(java.lang.String rightHeader)
rightHeader - The right header of the page(s)public java.lang.String getRightHeader()
public void setLeftFooter(java.lang.String leftFooter)
leftFooter - The left footer of the page(s)public java.lang.String getLeftFooter()
public void setCenterFooter(java.lang.String centerFooter)
centerFooter - The center footer of the page(s)public java.lang.String getCenterFooter()
public void setRightFooter(java.lang.String rightFooter)
rightFooter - The right footer of the page(s)public java.lang.String getRightFooter()
public void setLeftMargin(double leftMargin)
leftMargin - the left margin of the page(s), in inchespublic double getLeftMargin()
public void setRightMargin(double rightMargin)
rightMargin - the right margin of the page(s), in inchespublic double getRightMargin()
public void setTopMargin(double topMargin)
topMargin - the top margin of the page(s), in inchespublic double getTopMargin()
public void setBottomMargin(double bottomMargin)
bottomMargin - the bottom margin of the page(s), in inchespublic double getBottomMargin()
public void setPageOrientation(int pageOrientation)
pageOrientation - The page orientation of the page(s)public int getPageOrientation()
public void setNoOfCopies(int noOfCopies)
noOfCopies - The no of copies of the page(s)public int getNoOfCopies()
public void setGapBelowHeader(double gapBelowHeader)
gapBelowHeader - The value of gap below header of the page(s), in inchespublic double getGapBelowHeader()
public void setGapAboveFooter(double gapAboveFooter)
public double getGapAboveFooter()
public void setShowLineBelowHeader(boolean showLineBelowHeader)
showLineBelowHeader - The boolean value of, is line below header to be drawn?public boolean isShowLineBelowHeader()
public void setShowLineAboveFooter(boolean showLineAboveFooter)
showLineAboveFooter - The boolean value of, is line above footer to be drawn?public boolean isShowLineAboveFooter()
public void setShowPrintDialog(boolean showPrintDialog)
showPrintDialog - The boolean value of, is display the print dialog while print method is calledpublic boolean isShowPrintDialog()
public void setPrintJobName(java.lang.String jobName)
public java.lang.String getPrintJobName()
public void setScaleComponentToSinglePage(boolean isScaleComponentToSinglePage)
isScaleComponentToSinglePage - The specified value either scale or wrap componentpublic boolean isScaleComponentToSinglePage()
public void setPort(java.lang.String port)
port - The target portpublic java.lang.String getPort()
public void setPrintBookIndividually(boolean isPrintBookIndividually)
isPrintBookIndividually - Wheather user want to print the book of pages individually or notpublic boolean isPrintBookIndividually()
public void setBookSize(int bookSize)
bookSize - The book sizepublic int getBookSize()
public void setLicenseKey(java.lang.String licenseKey)
public java.lang.String getLicenseKey()
protected PreviewPage createPreviewPage(int width,
int height,
java.awt.Image image,
int pageIndex)
width - The width for the preview pageheight - The height for the preview pageimage - The image for the preview pagepageIndex - The pageIndex for the preview pagepublic void addPrinterListener(PrinterListener l)
l - The printer listenerpublic void removePrinterListener(PrinterListener l)
l - The printer listenerpublic void firePrinterEvent(PrinterEvent e)
e - The PrinterEventpublic void addPropertyChangeListener(java.beans.PropertyChangeListener l)
l - The PropertyChangeListenerpublic void removePropertyChangeListener(java.beans.PropertyChangeListener l)
l - The PropertyChangeListener
public void firePropertyChange(java.lang.String property,
java.lang.Object oldValue,
java.lang.Object newValue)
property - The property nameoldValue - The old valuenewValue - The new value
public void writeExternal(java.io.ObjectOutput out)
throws java.io.IOException
writeExternal in interface java.io.Externalizablejava.io.IOException
public void readExternal(java.io.ObjectInput in)
throws java.io.IOException,
java.lang.ClassNotFoundException
readExternal in interface java.io.Externalizablejava.io.IOException
java.lang.ClassNotFoundException
|
ElegantJ Tables Java API Specification v1.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||