Package net.sf.paperclips
Class PageNumberPageDecoration
java.lang.Object
net.sf.paperclips.PageNumberPageDecoration
- All Implemented Interfaces:
PageDecoration
A PageDecoration which displays the page number. This convenience class helps
avoid the need for writing a new PageDecoration class if only a page number
is needed. Getter and setter methods are provided for all the properties
available in the PagePrint class itself.
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a PageNumberPageDecoration with default font, alignment, and page number format.PageNumberPageDecoration
(int align) Constructs a PageNumberPageDecoration with the given alignment. -
Method Summary
Modifier and TypeMethodDescriptioncreatePrint
(PageNumber pageNumber) Returns a decorator Print for the page with the given page number, or null if no decoration is provided for the given page.boolean
int
getAlign()
Returns the horizontal text alignment.org.eclipse.swt.graphics.FontData
Returns the font.Returns the page number format.org.eclipse.swt.graphics.RGB
getRGB()
Returns the text color.int
hashCode()
void
setAlign
(int align) Sets the horizontal text alignment.void
setFontData
(org.eclipse.swt.graphics.FontData fontData) Sets the font.void
setFormat
(PageNumberFormat format) Sets the page number format.void
setRGB
(org.eclipse.swt.graphics.RGB rgb) Sets the text color.
-
Constructor Details
-
PageNumberPageDecoration
public PageNumberPageDecoration()Constructs a PageNumberPageDecoration with default font, alignment, and page number format. -
PageNumberPageDecoration
public PageNumberPageDecoration(int align) Constructs a PageNumberPageDecoration with the given alignment.- Parameters:
align
- horizontal text alignment.
-
-
Method Details
-
hashCode
public int hashCode() -
equals
-
getFontData
public org.eclipse.swt.graphics.FontData getFontData()Returns the font.- Returns:
- the font.
-
setFontData
public void setFontData(org.eclipse.swt.graphics.FontData fontData) Sets the font.- Parameters:
fontData
- the new font.
-
getAlign
public int getAlign()Returns the horizontal text alignment.- Returns:
- the horizontal text alignment.
-
setAlign
public void setAlign(int align) Sets the horizontal text alignment.- Parameters:
align
- the horizontal text alignment.
-
getRGB
public org.eclipse.swt.graphics.RGB getRGB()Returns the text color.- Returns:
- the text color.
-
setRGB
public void setRGB(org.eclipse.swt.graphics.RGB rgb) Sets the text color.- Parameters:
rgb
- the new text color.
-
getFormat
Returns the page number format.- Returns:
- the page number format.
-
setFormat
Sets the page number format.- Parameters:
format
- the page number format.
-
createPrint
Description copied from interface:PageDecoration
Returns a decorator Print for the page with the given page number, or null if no decoration is provided for the given page.- Specified by:
createPrint
in interfacePageDecoration
- Parameters:
pageNumber
- the page number of the page being decorated.- Returns:
- a decorator Print for the page with the given page number, or null if no decoration is provided for the given page.
-