org.pentaho.reporting.engine.classic.core
Class SimplePageDefinition

java.lang.Object
  extended by 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
SimplePageDefinition(PageFormat format)
          Creates a 1x1 page defintion.
SimplePageDefinition(PageFormat format, int x, int y)
          Creates a new SimplePageDefinition object.
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

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.
Method Detail

getPageCount

public int getPageCount()
Returns the number of physical pages in this page definition.

Specified by:
getPageCount in interface PageDefinition
Returns:
the number of pages.

getPageFormat

public PageFormat getPageFormat(int pos)
Returns the physical page format for the given position.

Specified by:
getPageFormat in interface PageDefinition
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 interface PageDefinition
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 interface PageDefinition
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 interface PageDefinition
Returns:
the height of the page.

getWidth

public float getWidth()
Returns the total width of the logical page.

Specified by:
getWidth in interface PageDefinition
Returns:
the width of the page.

clone

public Object clone()
             throws CloneNotSupportedException
Creates a copy of this page definition.

Specified by:
clone in interface PageDefinition
Overrides:
clone in class Object
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.

Overrides:
equals in class Object
Parameters:
obj - the other object.
Returns:
true, if that object is the same as this object, false otherwise.

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.

Overrides:
hashCode in class Object
Returns:
the hashcode.

getPageFormat

public PageFormat getPageFormat()