schmitzm.jfree.feature.style
Class FeatureChartStyle.Dummy

java.lang.Object
  extended by schmitzm.jfree.chart.style.AbstractChartStyle
      extended by schmitzm.jfree.feature.style.FeatureChartStyle.Dummy
All Implemented Interfaces:
ChartStyle, FeatureChartStyle
Enclosing interface:
FeatureChartStyle

public static class FeatureChartStyle.Dummy
extends AbstractChartStyle
implements FeatureChartStyle

This class defines a dummy implementation of FeatureChartStyle just to maintain the properties of the interface FeatureChartStyle, so sub classes of FeatureChartStyle which usually are derived from a normal ChartStyle implementation must not implement the FeatureChartStyle maintenance each. Instead they can create an instance of this dummy an pipe their method implementations to the dummy!

The applyToFeatureCollection(FeatureCollection) and applyToDataset(Dataset) methods are not implemented by the dummy, but throw an exception instead!!

Author:
Martin Schmitz

Nested Class Summary
 
Nested classes/interfaces inherited from interface schmitzm.jfree.feature.style.FeatureChartStyle
FeatureChartStyle.Dummy
 
Field Summary
protected  Map<Integer,String> attrNames
          Holds the attributes needed to specify the chart data from feature collection (0 = attribute for domain axis; others assigned to the range axis as series).
protected  boolean forceCategories
          Indicates whether a CategoryDataset is forced for a numeric domain attribute.
protected  int maxAttrCount
          Holds the maximum number of attributes the style can be defined defined for (-1 = no limit).
protected  int maxAttrIdx
          Holds the number of attributes the style is defined for.
protected  Map<Integer,Boolean> normalizeAttr
          Indicates for each attribute whether the attribute data is normalized (before creating a Dataset).
protected  boolean sortDomainAxis
          Indicates whether the features are sorted according to the domain attribute (before creating a Dataset).
 
Fields inherited from class schmitzm.jfree.chart.style.AbstractChartStyle
axisStyle, bgPaint, borderVisible, descStyle, id, legend, LOGGER, maxRendererDatasetIdx, orientation, plotStyle, rendererStyle, TIPGEN_CAT, TIPGEN_XY, titleStyle, tooltips, type, URLGEN_CAT, URLGEN_XY, urls
 
Fields inherited from interface schmitzm.jfree.chart.style.ChartStyle
DOMAIN_AXIS, LOGGER, RANGE_AXIS, RANGE_AXIS2, X_AXIS, Y_AXIS, Y_AXIS_LEFT, Y_AXIS_RIGHT, Y_AXIS2
 
Constructor Summary
protected FeatureChartStyle.Dummy(String id)
          Creates a new dummy.
protected FeatureChartStyle.Dummy(String id, int maxAttrCount)
          Creates a new dummy.
 
Method Summary
 JFreeChart applyToDataset(Dataset dataset)
          Does nothing, but always throws a UnsupportedOperationException, because the dummy can not provide this functionality.
 JFreeChart applyToFeatureCollection(FeatureCollection fc)
          Does nothing, but always throws a UnsupportedOperationException, because the dummy can not provide this functionality.
 int getAttributeCount()
          Returns the number of feature attributes defined in this style.
 String getAttributeName(int idx)
          Returns the name of a feature attribute needed to create a chart for this style.
 int getMaxAttributeCount()
          Returns the maximum number of feature attributes that can be specified by this style.
 boolean isAttributeNormalized(int idx)
          Returns whether the attribute data is normalized for an attribute (before creating a Dataset).
 boolean isForceCategories()
          Returns whether a CategoryDataset is forced for a numeric domain attribute.
 boolean isSortDomainAxis()
          Returns whether the features are sorted according to the domain attribute (before creating a Dataset).
 void setAttributeName(int idx, String attrName)
          Sets the name of a feature attribute needed to create a chart for this style.
 void setAttributeNormalized(int idx, boolean normalize)
          Sets whether the attribute data is normalized for an attribute (before creating a Dataset).
 void setForceCategories(boolean forceCategories)
          Sets whether a CategoryDataset is forced for a numeric domain attribute.
 void setSortDomainAxis(boolean sortDomainAxis)
          Sets whether the features are sorted according to the domain attribute (before creating a Dataset).
 
Methods inherited from class schmitzm.jfree.chart.style.AbstractChartStyle
applyToChart, getAxisCount, getAxisStyle, getBackground, getDescStyle, getID, getOrientation, getPlotStyle, getRendererCount, getRendererStyle, getTitleStyle, getType, hasLegend, hasTooltips, hasURLs, isBorderVisible, setAxisStyle, setBackground, setBorderVisible, setDescStyle, setLegend, setOrientation, setPlotStyle, setRendererStyle, setTitleStyle, setTooltips, setType, setURLs
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface schmitzm.jfree.chart.style.ChartStyle
applyToChart, getAxisCount, getAxisStyle, getBackground, getDescStyle, getID, getOrientation, getPlotStyle, getRendererCount, getRendererStyle, getTitleStyle, getType, hasLegend, hasTooltips, hasURLs, isBorderVisible, setAxisStyle, setBackground, setBorderVisible, setDescStyle, setLegend, setOrientation, setPlotStyle, setRendererStyle, setTitleStyle, setTooltips, setURLs
 

Field Detail

sortDomainAxis

protected boolean sortDomainAxis
Indicates whether the features are sorted according to the domain attribute (before creating a Dataset).


forceCategories

protected boolean forceCategories
Indicates whether a CategoryDataset is forced for a numeric domain attribute. The default is to create XYDataset for a numeric and CategoryDataset for a non-numeric domain attribute.


attrNames

protected Map<Integer,String> attrNames
Holds the attributes needed to specify the chart data from feature collection (0 = attribute for domain axis; others assigned to the range axis as series).


normalizeAttr

protected Map<Integer,Boolean> normalizeAttr
Indicates for each attribute whether the attribute data is normalized (before creating a Dataset).


maxAttrCount

protected int maxAttrCount
Holds the maximum number of attributes the style can be defined defined for (-1 = no limit).


maxAttrIdx

protected int maxAttrIdx
Holds the number of attributes the style is defined for.

Constructor Detail

FeatureChartStyle.Dummy

protected FeatureChartStyle.Dummy(String id)
Creates a new dummy. This constructor is protected so that only derived classes can instantiate a dummy! There is no limit for the number of attributes which can be defined by the style.

Parameters:
id - a (unique) ID for the style

FeatureChartStyle.Dummy

protected FeatureChartStyle.Dummy(String id,
                                  int maxAttrCount)
Creates a new dummy. This constructor is protected so that only derived classes can instantiate a dummy!

Parameters:
id - a (unique) ID for the style
maxAttrCount - attribute count needed to specify the chart data from feature collection
Method Detail

getMaxAttributeCount

public int getMaxAttributeCount()
Returns the maximum number of feature attributes that can be specified by this style.

Specified by:
getMaxAttributeCount in interface FeatureChartStyle
Returns:
-1 if there is no limit for range attributes

getAttributeCount

public int getAttributeCount()
Returns the number of feature attributes defined in this style.

Specified by:
getAttributeCount in interface FeatureChartStyle

getAttributeName

public String getAttributeName(int idx)
Returns the name of a feature attribute needed to create a chart for this style.

Specified by:
getAttributeName in interface FeatureChartStyle
Parameters:
idx - attribute index (0=domain; 1=1st range series; 2=2nd range series; ...)

setAttributeName

public void setAttributeName(int idx,
                             String attrName)
Sets the name of a feature attribute needed to create a chart for this style.

Specified by:
setAttributeName in interface FeatureChartStyle
Parameters:
idx - attribute index (0=domain; 1=1st range series; 2=2nd range series; ...)
attrName - feature attribute name

setSortDomainAxis

public void setSortDomainAxis(boolean sortDomainAxis)
Sets whether the features are sorted according to the domain attribute (before creating a Dataset).

Specified by:
setSortDomainAxis in interface FeatureChartStyle

isSortDomainAxis

public boolean isSortDomainAxis()
Returns whether the features are sorted according to the domain attribute (before creating a Dataset).

Specified by:
isSortDomainAxis in interface FeatureChartStyle
Returns:
false as default

setForceCategories

public void setForceCategories(boolean forceCategories)
Sets whether a CategoryDataset is forced for a numeric domain attribute. The default is to create XYDataset for a numeric and CategoryDataset for a non-numeric domain attribute.

Specified by:
setForceCategories in interface FeatureChartStyle

isForceCategories

public boolean isForceCategories()
Returns whether a CategoryDataset is forced for a numeric domain attribute. The default is to create XYDataset for a numeric and CategoryDataset for a non-numeric domain attribute.

Specified by:
isForceCategories in interface FeatureChartStyle
Returns:
false as default

setAttributeNormalized

public void setAttributeNormalized(int idx,
                                   boolean normalize)
Sets whether the attribute data is normalized for an attribute (before creating a Dataset).

Specified by:
setAttributeNormalized in interface FeatureChartStyle
Parameters:
idx - attribute index (0=domain; 1=1st range series; 2=2nd range series; ...)
normalize - indicates the normalize property

isAttributeNormalized

public boolean isAttributeNormalized(int idx)
Returns whether the attribute data is normalized for an attribute (before creating a Dataset).

Specified by:
isAttributeNormalized in interface FeatureChartStyle
Parameters:
idx - attribute index (0=domain; 1=1st range series; 2=2nd range series; ...)
Returns:
false as default

applyToDataset

public JFreeChart applyToDataset(Dataset dataset)
Does nothing, but always throws a UnsupportedOperationException, because the dummy can not provide this functionality.

Specified by:
applyToDataset in interface ChartStyle
Parameters:
dataset - the data for the chart

applyToFeatureCollection

public JFreeChart applyToFeatureCollection(FeatureCollection fc)
Does nothing, but always throws a UnsupportedOperationException, because the dummy can not provide this functionality.

Specified by:
applyToFeatureCollection in interface FeatureChartStyle
Parameters:
fc - a feature collection