com.jrefinery.report.targets.pageable.operations
Class BoundsAlignment

java.lang.Object
  extended bycom.jrefinery.report.targets.pageable.operations.BoundsAlignment
Direct Known Subclasses:
HorizontalBoundsAlignment, VerticalBoundsAlignment

public abstract class BoundsAlignment
extends java.lang.Object

An abstract base class for performing alignment of one Rectangle2D to another.

Author:
Thomas Morgner

Constructor Summary
protected BoundsAlignment(java.awt.geom.Rectangle2D bounds)
          Creates a new alignment object.
 
Method Summary
abstract  java.awt.geom.Rectangle2D align(java.awt.geom.Rectangle2D r)
          Aligns a rectangle with this object's reference bounds.
protected  java.awt.geom.Rectangle2D getReferenceBounds()
          Returns the internal reference bounds.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BoundsAlignment

protected BoundsAlignment(java.awt.geom.Rectangle2D bounds)
Creates a new alignment object.

Parameters:
bounds - the reference bounds (alignment will be performed relative to this rectangle).
Method Detail

getReferenceBounds

protected java.awt.geom.Rectangle2D getReferenceBounds()
Returns the internal reference bounds. This is no clone or copy, so take care!

Returns:
the reference bounds.

align

public abstract java.awt.geom.Rectangle2D align(java.awt.geom.Rectangle2D r)
Aligns a rectangle with this object's reference bounds.

Subclasses determine the exact alignment behaviour (for example, the TopAlignment class will align a rectangle to the top of the reference bounds).

Parameters:
r - the rectangle to be aligned with this object's reference bounds.
Returns:
the aligned rectangle.