|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectschmitzm.jfree.feature.style.FeatureChartUtil
public class FeatureChartUtil
This class contains static utility methods related to chart styles based on
FeatureCollection
.
Field Summary | |
---|---|
static FeatureChartStyleXMLFactory |
FEATURE_CHART_STYLE_FACTORY
Instance of ChartStyleXMLFactory . |
Constructor Summary | |
---|---|
FeatureChartUtil()
|
Method Summary | |
---|---|
static HashMap<String,StaticBin1D> |
calcStatisticsForNormalization(
Calculates statistics needed to normalize data. |
static boolean |
correctAttributeNames(FeatureChartStyle featureChartStyle,
SimpleFeatureType schema)
After loading from XML, a FeatureChartStyle contains whatever is
written in the XML. |
static DefaultCategoryDataset |
createCategoryDataset(
Creates a XYDataset for 2 (or more) attributes of a
FeatureCollection . |
static Dataset |
createDataset(
Creates a Dataset for 1 or more attributes of a
FeatureCollection . |
static XYSeriesCollection |
createXYDataset(
Creates a XYDataset for 2 (or more) attributes of a
FeatureCollection . |
static List<FeatureDatasetSelectionModel<?,?,?>> |
getFeatureDatasetSelectionModelFor(JFreeChart chart)
Returns all DatasetSelectionModels that can
be reached via the renderers of a chart. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final FeatureChartStyleXMLFactory FEATURE_CHART_STYLE_FACTORY
ChartStyleXMLFactory
.
Constructor Detail |
---|
public FeatureChartUtil()
Method Detail |
---|
public static List<FeatureDatasetSelectionModel<?,?,?>> getFeatureDatasetSelectionModelFor(JFreeChart chart)
DatasetSelectionModels
that can
be reached via the renderers of a chart.
chart
- a chartpublic static Dataset createDataset(fc, FeatureChartStyle style)
Dataset
for 1 or more attributes of a
FeatureCollection
. According to the feature attribute type the
method decides whether a XYDataset
or a CategoryDataset
is created:CategoryDataset
is
created always. Otherwise the default is to create a XYDataset
.
The flag forceCat
can be used to create CategoryDataset
for numeric X attributes.
fc
- a FeatureCollection
forceCat
- forces a CategoryDataset
also for numeric X attributessort
- sorts the features according to xAttr
before creating
the datasetxAttr
- feature attribute used for the X-valueyAttr
- feature attribute(s) used for the Y-value (at least one; for
each a series is created in the dataset)public static XYSeriesCollection createXYDataset(fc, FeatureChartStyle chartStyle)
XYDataset
for 2 (or more) attributes of a
FeatureCollection
. XYDateset can only be created for
numeric attributes.
fc
- a FeatureCollection
style
- defines the attributes used to create the dataset from, as
well as the sorting and normalization properties
IllegalArgumentException
- if less then 2 attributes are specified
UnsupportedOperationException
- if attributes are not numericpublic static HashMap<String,StaticBin1D> calcStatisticsForNormalization(fc, FeatureChartStyle chartStyle)
fc
- FeatureCollection
where the data comes fromchartStyle
- ChartStyle
to determine which attributes shall be
normalized.public static DefaultCategoryDataset createCategoryDataset(fc, FeatureChartStyle chartStyle)
XYDataset
for 2 (or more) attributes of a
FeatureCollection
. XYDateset can only be created for
numeric attributes.
fc
- a FeatureCollection
style
- defines the attributes used to create the dataset from, as
well as the sorting and normalization properties
IllegalArgumentException
- if less then 2 attributes are specified
UnsupportedOperationException
- if attributes are not numericpublic static boolean correctAttributeNames(FeatureChartStyle featureChartStyle, SimpleFeatureType schema)
FeatureChartStyle
contains whatever is
written in the XML. But the DBF Schema can change quickly by accident!
This method checks an FeatureChartStyle
against a schema and
corrects upperCase/lowerCase problems where possible.
Returns false
if attributes had to be removed from the
FeatureChartStyle
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |