|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.paperclips.PagePrint
public class PagePrint
A decorator Print which displays page headers and footers around a document body, with page numbering capabilities.
PagePrint is horizontally and vertically greedy. Greedy prints take up all the available space on the page.
Note: Avoid wrapping PagePrint in prints with space-optimizing semantics (e.g. ColumnPrint equalizes columns on the last page), as this may cause the total page count to be incorrect on some pages. At this time there is no known fix. If wrapping a PagePrint is unavoidable, consider using a custom PageNumberFormat which does not display the total page count.
Constructor Summary | |
---|---|
PagePrint(PageDecoration header,
int headerGap,
Print body)
Constructs a PagePrint with the given header and body. |
|
PagePrint(PageDecoration header,
int headerGap,
Print body,
int footerGap,
PageDecoration footer)
Constructs a PagePrint with the given body, header and footer. |
|
PagePrint(PageDecoration header,
Print body)
Constructs a PagePrint with the given header and body. |
|
PagePrint(PageDecoration header,
Print body,
PageDecoration footer)
Constructs a PagePrint with the given body, header and footer. |
|
PagePrint(Print body)
Constructs a PagePrint with the given body. |
|
PagePrint(Print body,
int footerGap,
PageDecoration footer)
Constructs a PagePrint with the given body, header and footer. |
|
PagePrint(Print body,
PageDecoration footer)
Constructs a PagePrint with the given body and footer. |
|
PagePrint(Print body,
PageDecoration header,
PageDecoration footer)
Deprecated. PagePrint(PageDecoration, Print, PageDecoration) instead. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object obj)
|
Print |
getBody()
Returns the page body. |
PageDecoration |
getFooter()
Returns the page footer. |
int |
getFooterGap()
Returns the gap between the body and footer, expressed in points. |
PageDecoration |
getHeader()
Returns the page header. |
int |
getHeaderGap()
Returns the gap between the header and body, expressed in points. |
int |
hashCode()
|
PrintIterator |
iterator(org.eclipse.swt.graphics.Device device,
org.eclipse.swt.graphics.GC gc)
Returns a PrintIterator for laying out the contents of this Print. |
void |
setBody(Print body)
Sets the page body to the argument. |
void |
setFooter(PageDecoration footer)
Sets the page footer to the argument. |
void |
setFooterGap(int points)
Sets the gap between the body and footer to the argument, expressed in points. |
void |
setHeader(PageDecoration header)
Sets the page header to the argument. |
void |
setHeaderGap(int points)
Sets the gap between the header and body to the argument, expressed in points. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PagePrint(PageDecoration header, int headerGap, Print body)
header
- a PageDecoration for creating the header. May be null.headerGap
- the gap between the header and body, in points.body
- the Print being decorated.public PagePrint(PageDecoration header, Print body)
body
- the Print being decorated.header
- a PageDecoration for creating the header. May be null.public PagePrint(Print body)
body
- the Print being decorated.public PagePrint(Print body, PageDecoration footer)
body
- the Print being decorated.footer
- a PageDecoration for creating the footer. may be null.public PagePrint(Print body, int footerGap, PageDecoration footer)
body
- the Print being decorated.footerGap
- the gap between the body and footer, in points.footer
- a PageDecoration for creating the footer. May be null.public PagePrint(Print body, PageDecoration header, PageDecoration footer)
body
- the Print being decorated.header
- a PageDecoration for creating the header. May be null.footer
- a PageDecoration for creating the footer. may be null.public PagePrint(PageDecoration header, Print body, PageDecoration footer)
header
- a PageDecoration for creating the header. May be null.body
- the Print being decorated.footer
- a PageDecoration for creating the footer. may be null.public PagePrint(PageDecoration header, int headerGap, Print body, int footerGap, PageDecoration footer)
header
- a PageDecoration for creating the header. May be null.headerGap
- the gap between the header and body, in points.body
- the Print being decorated.footerGap
- the gap between the body and footer, in points.footer
- a PageDecoration for creating the footer. May be null.Method Detail |
---|
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public PageDecoration getHeader()
public void setHeader(PageDecoration header)
header
- a PageDecoration which creates the header. May be null.public int getHeaderGap()
public void setHeaderGap(int points)
points
- the new gap between the header and body, expressed in points.
72 points = 1".public Print getBody()
public void setBody(Print body)
body
- the new page body.public PageDecoration getFooter()
public void setFooter(PageDecoration footer)
footer
- a PageDecoration which creates the footer. May be null.public int getFooterGap()
public void setFooterGap(int points)
points
- the new gap between the body and footer (if there is a
footer).public PrintIterator iterator(org.eclipse.swt.graphics.Device device, org.eclipse.swt.graphics.GC gc)
Print
iterator
in interface Print
device
- the graphics device this Print will be drawn onto.gc
- the graphics context to be used for calculating layout and
drawing the Print's contents.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |