edu.sdsc.inca.consumer
Class CategoryBean

java.lang.Object
  extended by org.jfree.data.general.AbstractDataset
      extended by org.jfree.data.category.DefaultCategoryDataset
          extended by edu.sdsc.inca.consumer.CategoryBean
All Implemented Interfaces:
de.laures.cewolf.DatasetProducer, de.laures.cewolf.links.CategoryItemLinkGenerator, de.laures.cewolf.links.LinkGenerator, de.laures.cewolf.tooltips.CategoryToolTipGenerator, de.laures.cewolf.tooltips.ToolTipGenerator, java.io.ObjectInputValidation, java.io.Serializable, java.lang.Cloneable, org.jfree.data.category.CategoryDataset, org.jfree.data.general.Dataset, org.jfree.data.KeyedValues2D, org.jfree.data.Values2D

public class CategoryBean
extends org.jfree.data.category.DefaultCategoryDataset
implements de.laures.cewolf.DatasetProducer, de.laures.cewolf.tooltips.CategoryToolTipGenerator, de.laures.cewolf.links.CategoryItemLinkGenerator

Extension of DefaultCategoryDataset class that can be used in Cewolf and supports mouseovers and links.

Author:
Shava Smallen <ssmallen@sdsc.edu>
See Also:
Serialized Form

Field Summary
static java.lang.String NAMESPACE_DECLS
           
 
Fields inherited from interface de.laures.cewolf.DatasetProducer
PRODUCER_ATTRIBUTE_NAME
 
Constructor Summary
CategoryBean()
          Create a new category dataset
CategoryBean(java.lang.String id)
          Create a new category dataset with a specific id
 
Method Summary
 void addLink(java.lang.String link, int row, int column)
          Add a link to a dataset value.
 void addTooltip(java.lang.String tooltip, int row, int column)
          Add a tooltip for dataset value.
 java.lang.String generateLink(java.lang.Object dataset, int row, java.lang.Object columnKey)
          Called by CeWolf when generating graph to get the link for a specific value in the dataset.
 java.lang.String generateToolTip(org.jfree.data.category.CategoryDataset data, int row, int column)
          Text to display when a bar is moused over
 java.lang.String getProducerId()
          Returns a unique id for this dataset
 boolean hasExpired(java.util.Map params, java.util.Date since)
          This method influences Cewolf's caching behaviour.
 java.lang.Object produceDataset(java.util.Map params)
          Return this object as the dataset
 void setProducerId(java.lang.String id)
          Set the id for this dataset (for CeWolf)
 
Methods inherited from class org.jfree.data.category.DefaultCategoryDataset
addValue, addValue, clear, clone, equals, getColumnCount, getColumnIndex, getColumnKey, getColumnKeys, getRowCount, getRowIndex, getRowKey, getRowKeys, getValue, getValue, hashCode, incrementValue, removeColumn, removeColumn, removeRow, removeRow, removeValue, setValue, setValue
 
Methods inherited from class org.jfree.data.general.AbstractDataset
addChangeListener, fireDatasetChanged, getGroup, hasListener, notifyListeners, removeChangeListener, setGroup, validateObject
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jfree.data.general.Dataset
addChangeListener, getGroup, removeChangeListener, setGroup
 

Field Detail

NAMESPACE_DECLS

public static final java.lang.String NAMESPACE_DECLS
See Also:
Constant Field Values
Constructor Detail

CategoryBean

public CategoryBean()
Create a new category dataset


CategoryBean

public CategoryBean(java.lang.String id)
Create a new category dataset with a specific id

Parameters:
id - a string containing an identifier for this dataset
Method Detail

addLink

public void addLink(java.lang.String link,
                    int row,
                    int column)
Add a link to a dataset value. A user can click on that link when the value is clicked on in the graph.

Parameters:
link - A url
row - The row index of the value
column - The column index of the value

addTooltip

public void addTooltip(java.lang.String tooltip,
                       int row,
                       int column)
Add a tooltip for dataset value. The tooltip text will display when the value is moused over in the graph.

Parameters:
tooltip - A string to display when a value is moused over
row - The row index of the value
column - The column index of the value

generateLink

public java.lang.String generateLink(java.lang.Object dataset,
                                     int row,
                                     java.lang.Object columnKey)
Called by CeWolf when generating graph to get the link for a specific value in the dataset.

Specified by:
generateLink in interface de.laures.cewolf.links.CategoryItemLinkGenerator
Parameters:
dataset - This object.
row - The row index of the value
columnKey - The name of the column
Returns:
A string containing a url

generateToolTip

public java.lang.String generateToolTip(org.jfree.data.category.CategoryDataset data,
                                        int row,
                                        int column)
Text to display when a bar is moused over

Specified by:
generateToolTip in interface de.laures.cewolf.tooltips.CategoryToolTipGenerator
Parameters:
data - Jfree CategoryDataset object to add mouseover text to.
row - The row value that was moused over
column - The column value that was moused over
Returns:
Mouseover text string

getProducerId

public java.lang.String getProducerId()
Returns a unique id for this dataset

Specified by:
getProducerId in interface de.laures.cewolf.DatasetProducer

hasExpired

public boolean hasExpired(java.util.Map params,
                          java.util.Date since)
This method influences Cewolf's caching behaviour. Example of invalid data after a day (86,400 seconds): log.debug(getClass().getName() + "hasExpired()"); return (System.currentTimeMillis() - since.getTime()) > 86400000;

Specified by:
hasExpired in interface de.laures.cewolf.DatasetProducer

produceDataset

public java.lang.Object produceDataset(java.util.Map params)
                                throws de.laures.cewolf.DatasetProduceException
Return this object as the dataset

Specified by:
produceDataset in interface de.laures.cewolf.DatasetProducer
Parameters:
params - Additional params for the dataset production.
Returns:
A CategoryDataset object containing a distribution dataset
Throws:
de.laures.cewolf.DatasetProduceException

setProducerId

public void setProducerId(java.lang.String id)
Set the id for this dataset (for CeWolf)

Parameters:
id - A strin containing an id