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

java.lang.Object
  extended bycom.jrefinery.report.targets.pageable.operations.OperationModule
Direct Known Subclasses:
DrawableOperationModule, ImageOperationModule, ShapeOperationModule, TextOperationModule

public abstract class OperationModule
extends java.lang.Object

The base class for an operation module. Operation modules can be either specific modules for a certain specialized type of content ("text/plain", for instance) or a module can be a generic handler for a certain group of content ("text/*").

While a generic handler may not be as performant as a specialized handler, that handler may be useful for displaying at least some of the content.

todo: add support for generic handlers to the operation factory.

Author:
Thomas Morgner

Constructor Summary
protected OperationModule(java.lang.String content)
          Creates a new module.
 
Method Summary
 boolean canHandleContent(java.lang.String contentType)
          Returns true if the module can handle the specified content type, and false otherwise.
abstract  void createOperations(PhysicalOperationsCollector col, Element e, Content value, java.awt.geom.Rectangle2D bounds)
          Creates a list of operations for an element.
 java.lang.String getModuleContentType()
          Returns the module content type.
 boolean isGeneric()
          Returns true if this is a 'generic' module, and false otherwise.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OperationModule

protected OperationModule(java.lang.String content)
Creates a new module.

Parameters:
content - the content type (null not permitted).
Method Detail

getModuleContentType

public java.lang.String getModuleContentType()
Returns the module content type.

Returns:
the type.

isGeneric

public boolean isGeneric()
Returns true if this is a 'generic' module, and false otherwise.

Returns:
true or false.

canHandleContent

public boolean canHandleContent(java.lang.String contentType)
Returns true if the module can handle the specified content type, and false otherwise.

Parameters:
contentType - the content type.
Returns:
true or false.

createOperations

public abstract void createOperations(PhysicalOperationsCollector col,
                                      Element e,
                                      Content value,
                                      java.awt.geom.Rectangle2D bounds)
Creates a list of operations for an element.

Parameters:
e - the element.
value - the value.
bounds - the bounds.
col - the operations collector.