Class SimplePageDefinition
- java.lang.Object
-
- org.pentaho.reporting.engine.classic.core.SimplePageDefinition
-
- All Implemented Interfaces:
Serializable
,Cloneable
,PageDefinition
public class SimplePageDefinition extends Object implements PageDefinition
A simple page definition defines a logical page, for which all physical pages have the same size. The page area is a rectangle.- Author:
- Thomas Morgner
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SimplePageDefinition(PageFormat format)
Creates a 1x1 page defintion.SimplePageDefinition(PageFormat format, int x, int y)
Creates a new SimplePageDefinition object.SimplePageDefinition(PageSize papersize)
Creates a 1x1 page defintion.SimplePageDefinition(PageSize papersize, int orientation, Insets margins)
Creates a 1x1 page defintion.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
clone()
Creates a copy of this page definition.boolean
equals(Object obj)
Checks whether this page definition object is equal to the given object.float
getHeight()
Returns the total height of the logical page.int
getPageCount()
Returns the number of physical pages in this page definition.int
getPageCountHorizontal()
Returns the number of horizontal pages in this page definition.int
getPageCountVertical()
Returns the number of vertical pages in this page definition.PageFormat
getPageFormat()
PageFormat
getPageFormat(int pos)
Returns the physical page format for the given position.Rectangle2D
getPagePosition(int index)
Returns the printable area within the logical page area covered by the physical page at the given position.Rectangle2D[]
getPagePositions()
Returns all page position known to this page definition.float
getWidth()
Returns the total width of the logical page.int
hashCode()
Computes a hashcode for this page definition.String
toString()
-
-
-
Constructor Detail
-
SimplePageDefinition
public SimplePageDefinition(PageFormat format, int x, int y)
Creates a new SimplePageDefinition object.- Parameters:
format
- the pageformat used as base.x
- the number of physical pages in a row.y
- the number of physical pages in a column.
-
SimplePageDefinition
public SimplePageDefinition(PageFormat format)
Creates a 1x1 page defintion. The physical page size is equal to the logical page size.- Parameters:
format
- the pageformat.
-
SimplePageDefinition
public SimplePageDefinition(PageSize papersize, int orientation, Insets margins)
Creates a 1x1 page defintion. The physical page size is equal to the logical page size.
-
SimplePageDefinition
public SimplePageDefinition(PageSize papersize)
Creates a 1x1 page defintion. The physical page size is equal to the logical page size.
-
-
Method Detail
-
getPageCount
public int getPageCount()
Returns the number of physical pages in this page definition.- Specified by:
getPageCount
in interfacePageDefinition
- Returns:
- the number of pages.
-
getPageFormat
public PageFormat getPageFormat(int pos)
Returns the physical page format for the given position.- Specified by:
getPageFormat
in interfacePageDefinition
- Parameters:
pos
- the position in the page grid.- Returns:
- a clone of the pageformat at the specified positon.
-
getPagePosition
public Rectangle2D getPagePosition(int index)
Returns the printable area within the logical page area covered by the physical page at the given position.- Specified by:
getPagePosition
in interfacePageDefinition
- Parameters:
index
- the positon.- Returns:
- the printable area for the page.
-
getPagePositions
public Rectangle2D[] getPagePositions()
Returns all page position known to this page definition.- Specified by:
getPagePositions
in interfacePageDefinition
- Returns:
- the page positions.
- See Also:
PageDefinition.getPagePosition(int)
-
getHeight
public float getHeight()
Returns the total height of the logical page.- Specified by:
getHeight
in interfacePageDefinition
- Returns:
- the height of the page.
-
getWidth
public float getWidth()
Returns the total width of the logical page.- Specified by:
getWidth
in interfacePageDefinition
- Returns:
- the width of the page.
-
clone
public Object clone() throws CloneNotSupportedException
Creates a copy of this page definition.- Specified by:
clone
in interfacePageDefinition
- Overrides:
clone
in classObject
- Returns:
- a clone of this page definition object.
- Throws:
CloneNotSupportedException
-
equals
public boolean equals(Object obj)
Checks whether this page definition object is equal to the given object.
-
getPageCountHorizontal
public int getPageCountHorizontal()
Returns the number of horizontal pages in this page definition. That number is always greater than zero.- Returns:
- the horizontal page count.
-
getPageCountVertical
public int getPageCountVertical()
Returns the number of vertical pages in this page definition. That number is always greater than zero.- Returns:
- the vertical page count.
-
hashCode
public int hashCode()
Computes a hashcode for this page definition.
-
getPageFormat
public PageFormat getPageFormat()
-
-