org.jfree.report.content
Class DrawableContent

java.lang.Object
  extended byorg.jfree.report.content.DrawableContent
All Implemented Interfaces:
Content

public class DrawableContent
extends java.lang.Object
implements Content

A simple wrapper around the DrawableContainer. The ContentImplementation is able to adjust the Clipping Bounds of the DrawableContainer.

Author:
Thomas Morgner

Constructor Summary
DrawableContent(DrawableContainer drawable, java.awt.geom.Point2D contentOrigin)
          Creates a new instance.
 
Method Summary
 java.awt.geom.Rectangle2D getBounds()
          Returns the bounds for the content.
 DrawableContainer getContent()
          Returns the content.
 Content getContentForBounds(java.awt.geom.Rectangle2D bounds)
          Returns the content for the given bounds.
 Content getContentPart(int part)
          Returns a sub-content item.
 int getContentPartCount()
          Returns the number of sub-content items for this item.
 ContentType getContentType()
          Returns the content type (the types include TEXT, IMAGE, SHAPE and CONTAINER).
 java.awt.geom.Rectangle2D getMinimumContentSize()
          Returns the minimum content size.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DrawableContent

public DrawableContent(DrawableContainer drawable,
                       java.awt.geom.Point2D contentOrigin)
Creates a new instance.

Parameters:
drawable - the drawable object.
contentOrigin - the origin.
Method Detail

getContentType

public ContentType getContentType()
Returns the content type (the types include TEXT, IMAGE, SHAPE and CONTAINER).

Specified by:
getContentType in interface Content
Returns:
the content type.

getBounds

public java.awt.geom.Rectangle2D getBounds()
Returns the bounds for the content.

Specified by:
getBounds in interface Content
Returns:
the bounds.

getMinimumContentSize

public java.awt.geom.Rectangle2D getMinimumContentSize()
Returns the minimum content size.

Specified by:
getMinimumContentSize in interface Content
Returns:
the minimum size.

getContentForBounds

public Content getContentForBounds(java.awt.geom.Rectangle2D bounds)
Returns the content for the given bounds. The extracted content is the content that would be displayed in the specific bounds if the content would be printed with clipping enabled at the given boundary.

This method returns null if there is no content in these bounds.

Specified by:
getContentForBounds in interface Content
Parameters:
bounds - the bounds.
Returns:
the content (possibly null).

getContentPartCount

public int getContentPartCount()
Returns the number of sub-content items for this item.

Only subclasses of ContentContainer will return non-zero results.

Specified by:
getContentPartCount in interface Content
Returns:
the number of sub-content items.

getContentPart

public Content getContentPart(int part)
Returns a sub-content item.

Specified by:
getContentPart in interface Content
Parameters:
part - the sub-content index (zero-based).
Returns:
the subcontent (possibly null).

getContent

public DrawableContainer getContent()
Returns the content.

Returns:
The content.