Class CustomPageDefinition
- java.lang.Object
-
- org.pentaho.reporting.engine.classic.core.CustomPageDefinition
-
- All Implemented Interfaces:
Serializable
,Cloneable
,PageDefinition
public class CustomPageDefinition extends Object implements PageDefinition
A page definition, that consists of one or many pages. The pages are allowed to overlapp or to leave areas of the page uncovered.- Author:
- Thomas Morgner
- See Also:
PageDefinition
, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description CustomPageDefinition()
Creates a new (initialy empty and therefore invalid) page definition.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addPageFormat(PageFormat format, float x, float y)
Adds a new page format to the page definition.Object
clone()
Clones the given page definition object.boolean
equals(Object obj)
Checks whether the given object is equal to this one.float
getHeight()
Returns the total height of the page definition.int
getPageCount()
Returns the number of physical pages in the logical page definition.PageFormat
getPageFormat(int pos)
Returns the page format for the given page number.Rectangle2D
getPagePosition(int index)
Describes the internal position of the given page within the logical page.Rectangle2D[]
getPagePositions()
Returns all page positions as array.float
getWidth()
Returns the total width of the page definition.int
hashCode()
Computes the hashcode of this page definition.
-
-
-
Method Detail
-
addPageFormat
public void addPageFormat(PageFormat format, float x, float y)
Adds a new page format to the page definition.- Parameters:
format
- the page formatx
- the x-position to where the imageable-x of the pageformat is mapped.y
- the y-position to where the imageable-y of the pageformat is mapped.
-
getPageCount
public int getPageCount()
Returns the number of physical pages in the logical page definition.- Specified by:
getPageCount
in interfacePageDefinition
- Returns:
- the number of physical pages.
-
getPageFormat
public PageFormat getPageFormat(int pos)
Returns the page format for the given page number. The page format contains local coordinates - that means that the point (0,0) denotes the upper left corner of this returned page format and not global coordinates.- Specified by:
getPageFormat
in interfacePageDefinition
- Parameters:
pos
- the position of the pageformat within the page- Returns:
- the given pageformat.
-
getPagePosition
public Rectangle2D getPagePosition(int index)
Describes the internal position of the given page within the logical page. The logical page does not include any page margins, the printable area for a page starts at (0,0).- Specified by:
getPagePosition
in interfacePageDefinition
- Parameters:
index
- the index of the page.- Returns:
- the position of the page (within the global page).
-
getPagePositions
public Rectangle2D[] getPagePositions()
Returns all page positions as array.- Specified by:
getPagePositions
in interfacePageDefinition
- Returns:
- the collected page positions
- See Also:
PageDefinition.getPagePosition(int)
-
getWidth
public float getWidth()
Returns the total width of the page definition.- Specified by:
getWidth
in interfacePageDefinition
- Returns:
- the total width of the page definition.
-
getHeight
public float getHeight()
Returns the total height of the page definition.- Specified by:
getHeight
in interfacePageDefinition
- Returns:
- the total height of the page definition.
-
clone
public Object clone() throws CloneNotSupportedException
Clones the given page definition object.- Specified by:
clone
in interfacePageDefinition
- Overrides:
clone
in classObject
- Returns:
- a clone of this page definition.
- Throws:
CloneNotSupportedException
- if an error occured.
-
equals
public boolean equals(Object obj)
Checks whether the given object is equal to this one.
-
-