Class PageNumberPageDecoration
- java.lang.Object
-
- org.eclipse.nebula.paperclips.core.page.PageNumberPageDecoration
-
- All Implemented Interfaces:
PageDecoration
public class PageNumberPageDecoration extends java.lang.Object implements 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.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) intalign(package private) org.eclipse.swt.graphics.FontDatafontData(package private) PageNumberFormatformat(package private) org.eclipse.swt.graphics.RGBrgb
-
Constructor Summary
Constructors Constructor Description PageNumberPageDecoration()Constructs a PageNumberPageDecoration with default font, alignment, and page number format.PageNumberPageDecoration(int align)Constructs a PageNumberPageDecoration with the given alignment.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private intcheckAlign(int align)PrintcreatePrint(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.booleanequals(java.lang.Object obj)intgetAlign()Returns the horizontal text alignment.org.eclipse.swt.graphics.FontDatagetFontData()Returns the font.PageNumberFormatgetFormat()Returns the page number format.org.eclipse.swt.graphics.RGBgetRGB()Returns the text color.inthashCode()voidsetAlign(int align)Sets the horizontal text alignment.voidsetFontData(org.eclipse.swt.graphics.FontData fontData)Sets the font.voidsetFormat(PageNumberFormat format)Sets the page number format.voidsetRGB(org.eclipse.swt.graphics.RGB rgb)Sets the text color.
-
-
-
Field Detail
-
fontData
org.eclipse.swt.graphics.FontData fontData
-
align
int align
-
rgb
org.eclipse.swt.graphics.RGB rgb
-
format
PageNumberFormat format
-
-
Constructor Detail
-
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 Detail
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
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.
-
checkAlign
private int checkAlign(int align)
-
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
public PageNumberFormat getFormat()
Returns the page number format.- Returns:
- the page number format.
-
setFormat
public void setFormat(PageNumberFormat format)
Sets the page number format.- Parameters:
format- the page number format.
-
createPrint
public Print createPrint(PageNumber pageNumber)
Description copied from interface:PageDecorationReturns a decorator Print for the page with the given page number, or null if no decoration is provided for the given page.- Specified by:
createPrintin 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.
-
-