org.jfree.report.content
Class ContentContainer

java.lang.Object
  |
  +--org.jfree.report.content.ContentContainer
Direct Known Subclasses:
TextContent, TextParagraph

public class ContentContainer
extends java.lang.Object
implements MultipartContent

A report content item that contains other report content items.

Author:
Thomas Morgner

Constructor Summary
protected ContentContainer(StrictBounds bounds)
          Creates a new content container.
 
Method Summary
protected  void addContentPart(Content cp)
          Adds content to the container.
 StrictBounds getBounds()
          Returns the bounds for the content.
 Content getContentForBounds(StrictBounds bounds)
          Returns the content items from the container that intersect with the specified area.
 Content getContentPart(int part)
          Returns a content item from the container.
 int getContentPartCount()
          Returns the number of content items in the container.
 ContentType getContentType()
          Returns the content type, in this case ContentType.CONTAINER.
 StrictBounds getMinimumContentSize()
          Returns the minimum content size for the container.
protected  void setBounds(long x, long y, long width, long height)
          Sets the bounds of the content.
 java.lang.String toString()
          Returns a string describing this object.
 void translate(long x, long y)
          Hack-Attack: Used for alignment of the content.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ContentContainer

protected ContentContainer(StrictBounds bounds)
Creates a new content container.
Parameters:
bounds - the content bounds.
Method Detail

getContentType

public ContentType getContentType()
Returns the content type, in this case ContentType.CONTAINER.
Returns:
the content type.

getBounds

public StrictBounds getBounds()
Returns the bounds for the content.
Returns:
the bounds.

setBounds

protected void setBounds(long x,
                         long y,
                         long width,
                         long height)
Sets the bounds of the content.
Parameters:
x - the x-coordinate.
y - the y-coordinate.
width - the width.
height - the height.

addContentPart

protected void addContentPart(Content cp)
Adds content to the container.
Parameters:
cp - the content to add.

getContentPartCount

public int getContentPartCount()
Returns the number of content items in the container.
Specified by:
getContentPartCount in interface MultipartContent
Returns:
the item count.

getContentPart

public Content getContentPart(int part)
Returns a content item from the container.
Specified by:
getContentPart in interface MultipartContent
Parameters:
part - the content index (zero-based).
Returns:
the content.

getContentForBounds

public Content getContentForBounds(StrictBounds bounds)
Returns the content items from the container that intersect with the specified area.
Parameters:
bounds - the area.
Returns:
a container holding the content items.

getMinimumContentSize

public StrictBounds getMinimumContentSize()
Returns the minimum content size for the container.
Returns:
the minimum size or null, if this container has no content.

toString

public java.lang.String toString()
Returns a string describing this object.
Overrides:
toString in class java.lang.Object
Returns:
The string.

translate

public void translate(long x,
                      long y)
Hack-Attack: Used for alignment of the content.
Parameters:
x - the x translation.
y - the y translation.