public abstract class DataModel
extends java.lang.Object
implements java.util.Observer
| Modifier and Type | Field and Description |
|---|---|
protected ChartModel |
chartModel
The JFreeChart representation of the series data.
|
protected ChartSettingModel |
chartSettingModel
The model for the chart settings
|
static java.awt.Color[] |
DEFAULT_COLORS
These colors will be used for newly added series.
|
static float |
DEFAULT_LINE_WIDTH
This line width will be used for newly added series.
|
protected OntologyModel |
ontologyModel
The ontology representation of the series data.
|
protected int |
seriesCount
The number of series in this data model.
|
protected TableModel |
tableModel
The JTable representation of the series data.
|
| Constructor and Description |
|---|
DataModel() |
| Modifier and Type | Method and Description |
|---|---|
void |
addOrExchangeSeries(DataSeries series,
int targetDataSeriesIndex)
Adds or exchanges a data series from the current chart.
|
void |
addSeries(DataSeries series)
Adds a new series to the data model.
|
abstract DataSeries |
createNewDataSeries(java.lang.String label)
Creates a new data series of the correct type for the precise type of chart.
|
abstract ValuePair |
createNewValuePair(java.lang.Number key,
java.lang.Number value)
Creates a new value pair for the specific type of chart.
|
abstract void |
editDataSeriesAddData(DataSeries series,
int targetDataSeriesIndex,
boolean editOntology)
Edits the data series by adding data.
|
abstract void |
editDataSeriesAddOrExchangeData(DataSeries series,
int targetDataSeriesIndex,
boolean editOntology)
Edits the data series by adding or exchanging data.
|
abstract void |
editDataSeriesExchangeData(DataSeries series,
int targetDataSeriesIndex,
boolean editOntology)
Edits the data series by exchanging data.
|
abstract void |
editDataSeriesRemoveData(DataSeries series,
int targetDataSeriesIndex,
boolean editOntology)
Edits the data series by remove data.
|
void |
exchangeSeries(DataSeries series,
int seriesIndex)
Adds or exchanges a data series from the current chart.
|
abstract java.lang.String |
getBaseStringForSeriesLabel()
Returns a string that can be used for generating default series labels
|
ChartModel |
getChartModel()
Gets the chart model.
|
ChartSettingModel |
getChartSettingModel()
Returns the chart setting model.
|
java.lang.String |
getDefaultSeriesLabel()
Builds a default series label, that can be used for new series if no label is specified.
|
OntologyModel |
getOntologyModel()
Returns the ontology model.
|
int |
getSeriesCount()
Gets the series count.
|
TableModel |
getTableModel()
Gets the table model.
|
abstract jade.util.leap.List |
getValuePairsFromSeries(DataSeries series)
Gets a list containing all value pairs from the given DataSeries.
|
abstract java.lang.Number |
getXValueFromPair(ValuePair vp)
Gets the key / x value from the given value pair.
|
abstract java.lang.Number |
getYValueFromValuePair(ValuePair vp)
Gets the (y) value from the value pair.
|
void |
removeSeries(int seriesIndex)
Removes a series from the data model.
|
void |
setChartModel(ChartModel chartModel)
Sets the chart model.
|
void |
setChartSettingModel(ChartSettingModel chartSettingModel)
Sets the chart setting model.
|
abstract void |
setKeyForPair(java.lang.Number key,
ValuePair vp)
Updates the key of the value pair.
|
abstract void |
setOntologyInstanceChart(Chart ontologyChart)
Sets the chart given by the data model of the ontology instance.
|
void |
setOntologyModel(OntologyModel ontologyModel)
Sets the ontology model.
|
void |
setTableModel(TableModel tableModel)
Sets the table model.
|
abstract void |
setValueForPair(java.lang.Number value,
ValuePair vp)
Updates the value of the key value pair.
|
void |
update(java.util.Observable o,
java.lang.Object arg) |
public static final java.awt.Color[] DEFAULT_COLORS
public static final float DEFAULT_LINE_WIDTH
protected OntologyModel ontologyModel
protected TableModel tableModel
protected ChartModel chartModel
protected ChartSettingModel chartSettingModel
protected int seriesCount
public abstract void setOntologyInstanceChart(Chart ontologyChart)
ontologyChart - the new ontology instance chartpublic abstract DataSeries createNewDataSeries(java.lang.String label)
label - The new data series labelpublic abstract ValuePair createNewValuePair(java.lang.Number key, java.lang.Number value)
key - The key / x valuevalue - The (y) valuepublic abstract java.lang.Number getXValueFromPair(ValuePair vp)
vp - The value pairpublic abstract java.lang.Number getYValueFromValuePair(ValuePair vp)
vp - The value pairpublic abstract void setKeyForPair(java.lang.Number key,
ValuePair vp)
key - The new keyvp - The value pair to be updatedpublic abstract void setValueForPair(java.lang.Number value,
ValuePair vp)
value - The new valuevp - The value pair to be updatedpublic abstract jade.util.leap.List getValuePairsFromSeries(DataSeries series)
series - The DataSeriespublic java.lang.String getDefaultSeriesLabel()
public abstract java.lang.String getBaseStringForSeriesLabel()
public OntologyModel getOntologyModel()
public void setOntologyModel(OntologyModel ontologyModel)
ontologyModel - the ontologyModel to setpublic TableModel getTableModel()
public void setTableModel(TableModel tableModel)
tableModel - the tableModel to setpublic ChartModel getChartModel()
public void setChartModel(ChartModel chartModel)
chartModel - the chartModel to setpublic ChartSettingModel getChartSettingModel()
public void setChartSettingModel(ChartSettingModel chartSettingModel)
chartSettingModel - the new chart setting modelpublic int getSeriesCount()
public void addSeries(DataSeries series)
series - The new seriespublic void addOrExchangeSeries(DataSeries series, int targetDataSeriesIndex) throws NoSuchSeriesException
series - the seriestargetDataSeriesIndex - the target data series indexNoSuchSeriesExceptionpublic void exchangeSeries(DataSeries series, int seriesIndex) throws NoSuchSeriesException
series - the seriesseriesIndex - the target data series indexNoSuchSeriesExceptionpublic void removeSeries(int seriesIndex)
throws NoSuchSeriesException
seriesIndex - The index of the series to be removedNoSuchSeriesException - Thrown if there is no series with that indexpublic abstract void editDataSeriesAddData(DataSeries series, int targetDataSeriesIndex, boolean editOntology) throws NoSuchSeriesException
series - the seriestargetDataSeriesIndex - the target data series indexeditOntology - true, if the ontology has to be editedNoSuchSeriesExceptionpublic abstract void editDataSeriesAddOrExchangeData(DataSeries series, int targetDataSeriesIndex, boolean editOntology) throws NoSuchSeriesException
series - the seriestargetDataSeriesIndex - the target data series indexeditOntology - true, if the ontology has to be editedNoSuchSeriesExceptionpublic abstract void editDataSeriesExchangeData(DataSeries series, int targetDataSeriesIndex, boolean editOntology) throws NoSuchSeriesException
series - the seriestargetDataSeriesIndex - the target data series indexeditOntology - true, if the ontology has to be editedNoSuchSeriesExceptionpublic abstract void editDataSeriesRemoveData(DataSeries series, int targetDataSeriesIndex, boolean editOntology) throws NoSuchSeriesException
series - the seriestargetDataSeriesIndex - the target data series indexeditOntology - true, if the ontology has to be editedNoSuchSeriesException - the no such series exceptionpublic void update(java.util.Observable o,
java.lang.Object arg)
update in interface java.util.Observer