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

java.lang.Object
  extended by 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
CustomPageDefinition()
          Creates a new (initialy empty and therefore invalid) page definition.
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CustomPageDefinition

public CustomPageDefinition()
Creates a new (initialy empty and therefore invalid) 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 format
x - 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 interface PageDefinition
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 interface PageDefinition
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 interface PageDefinition
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 interface PageDefinition
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 interface PageDefinition
Returns:
the total width of the page definition.

getHeight

public float getHeight()
Returns the total height of the page definition.

Specified by:
getHeight in interface PageDefinition
Returns:
the total height of the page definition.

clone

public Object clone()
             throws CloneNotSupportedException
Clones the given page definition object.

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

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

hashCode

public int hashCode()
Computes the hashcode of this page definition.

Overrides:
hashCode in class Object
Returns:
the hashcode.