org.jfree.report.content
Class AnchorContentFactoryModule

java.lang.Object
  |
  +--org.jfree.report.content.AnchorContentFactoryModule

public class AnchorContentFactoryModule
extends java.lang.Object
implements ContentFactoryModule

The anchor content factory-module is responsible for creating the AnchorContent from an element containing Anchors. The factory module expects either an Anchor element in the given element or converts the content of the element into a String and uses this string as Anchor value.

Author:
Thomas Morgner
See Also:
Anchor

Constructor Summary
AnchorContentFactoryModule()
          Creates a new FactoryModule.
 
Method Summary
 boolean canHandleContent(java.lang.String contentType)
          Returns true if the module can handle the specified content type, and false otherwise.
static Content createAnchor(java.lang.Object o, StrictPoint position)
          Creates an anchor content wrapper for the given object.
 Content createContentForElement(Element e, ElementLayoutInformation bounds, LayoutSupport ot)
          Creates content for an element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnchorContentFactoryModule

public AnchorContentFactoryModule()
Creates a new FactoryModule.
Method Detail

canHandleContent

public boolean canHandleContent(java.lang.String contentType)
Returns true if the module can handle the specified content type, and false otherwise.
Specified by:
canHandleContent in interface ContentFactoryModule
Parameters:
contentType - the content type.
Returns:
true or false.

createContentForElement

public Content createContentForElement(Element e,
                                       ElementLayoutInformation bounds,
                                       LayoutSupport ot)
                                throws ContentCreationException
Creates content for an element.
Specified by:
createContentForElement in interface ContentFactoryModule
Parameters:
e - the element.
bounds - the bounds.
ot - the output target.
Returns:
the content.
Throws:
ContentCreationException - if there is a problem with the Content creation.

createAnchor

public static Content createAnchor(java.lang.Object o,
                                   StrictPoint position)
Creates an anchor content wrapper for the given object. If the object is an instance of Anchor, the content is generated directly, else the object's string representation is used to construct a new Anchor object.
Parameters:
o - the anchor or an arbitary object that should be converted into an Anchor.
position - the position of the anchor
Returns:
the created content