public class TimeSeriesDataModel extends DataModel
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_CHART_TITLE
This title will be used for the chart if none is specified
|
static java.lang.String |
DEFAULT_SERIES_LABEL
This label with appended seriesCount+1 will be used for newly added series
|
static java.lang.String |
DEFAULT_X_AXIS_LABEL
This x axis label will be used for the chart if none is specified
|
static java.lang.String |
DEFAULT_Y_AXIS_LABEL
This y axis label will be used for the chart if none is specified
|
chartModel, chartSettingModel, DEFAULT_COLORS, DEFAULT_LINE_WIDTH, ontologyModel, seriesCount, tableModel
Constructor and Description |
---|
TimeSeriesDataModel()
Instantiates a new TimeSeriesDataModel.
|
Modifier and Type | Method and Description |
---|---|
void |
addValuePairToSeries(long timeStamp,
float value,
int seriesIndex,
boolean editOntology)
Edits the series by adding a value pair.
|
TimeSeries |
createNewDataSeries(java.lang.String label)
Creates a new data series of the correct type for the precise type of chart.
|
ValuePair |
createNewValuePair(java.lang.Number key,
java.lang.Number value)
Creates a new value pair for the specific type of chart.
|
void |
editDataSeriesAddData(DataSeries series,
int targetDataSeriesIndex,
boolean editOntology)
Edits the data series by adding data.
|
void |
editDataSeriesAddOrExchangeData(DataSeries series,
int targetDataSeriesIndex,
boolean editOntology)
Edits the data series by adding or exchanging data.
|
void |
editDataSeriesExchangeData(DataSeries series,
int targetDataSeriesIndex,
boolean editOntology)
Edits the data series by exchanging data.
|
void |
editDataSeriesRemoveData(DataSeries series,
int targetDataSeriesIndex,
boolean editOntology)
Edits the data series by remove data.
|
java.lang.String |
getBaseStringForSeriesLabel()
Returns a string that can be used for generating default series labels
|
java.lang.String |
getDefaultSeriesLabel()
Builds a default series label, that can be used for new series if no label is specified.
|
java.lang.String |
getDefaultTimeFormat()
Returns the default time format.
|
TimeSeriesLengthRestriction |
getLengthRestriction()
Gets the length restriction.
|
java.lang.String |
getTimeFormat() |
TimeSeriesChartModel |
getTimeSeriesChartModel()
Returns the current time series chart model.
|
TimeSeriesOntologyModel |
getTimeSeriesOntologyModel()
Returns the current time series ontology model.
|
TimeSeriesTableModel |
getTimeSeriesTableModel()
Returns the current time series table model.
|
jade.util.leap.List |
getValuePairsFromSeries(DataSeries series)
Gets a list containing all value pairs from the given DataSeries.
|
java.lang.Number |
getXValueFromPair(ValuePair vp)
Gets the key / x value from the given value pair.
|
java.lang.Number |
getYValueFromValuePair(ValuePair vp)
Gets the (y) value from the value pair.
|
boolean |
isRealTime()
Checks if this is a real time series.
|
void |
removeValuePairsFromAllSeries(java.lang.Number key)
Removes the value pair with the given time stamp from every series that contains one.
|
void |
setDefaultTimeFormat(java.lang.String defaultTimeFormat)
Sets the default time format.
|
void |
setKeyForPair(java.lang.Number key,
ValuePair vp)
Updates the key of the value pair.
|
void |
setOntologyInstanceChart(Chart ontologyChart)
Sets the chart given by the data model of the ontology instance.
|
void |
setRealTime(boolean realTime)
Configures if this is a real time series.
|
void |
setTimeFormat(java.lang.String timeFormat) |
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) |
addOrExchangeSeries, addSeries, exchangeSeries, getChartModel, getChartSettingModel, getOntologyModel, getSeriesCount, getTableModel, removeSeries, setChartModel, setChartSettingModel, setOntologyModel, setTableModel
public static final java.lang.String DEFAULT_SERIES_LABEL
public static final java.lang.String DEFAULT_CHART_TITLE
public static final java.lang.String DEFAULT_X_AXIS_LABEL
public static final java.lang.String DEFAULT_Y_AXIS_LABEL
public TimeSeriesDataModel()
public void setOntologyInstanceChart(Chart ontologyChart)
DataModel
setOntologyInstanceChart
in class DataModel
ontologyChart
- the new ontology instance chartpublic TimeSeriesOntologyModel getTimeSeriesOntologyModel()
public TimeSeriesChartModel getTimeSeriesChartModel()
public TimeSeriesTableModel getTimeSeriesTableModel()
public void setDefaultTimeFormat(java.lang.String defaultTimeFormat)
defaultTimeFormat
- the new default time formatpublic java.lang.String getDefaultTimeFormat()
public java.lang.String getTimeFormat()
public void setTimeFormat(java.lang.String timeFormat)
timeFormat
- the timeFormat to setpublic boolean isRealTime()
public void setRealTime(boolean realTime)
realTime
- the new real time seriespublic TimeSeriesLengthRestriction getLengthRestriction()
public TimeSeries createNewDataSeries(java.lang.String label)
DataModel
createNewDataSeries
in class DataModel
label
- The new data series labelpublic ValuePair createNewValuePair(java.lang.Number key, java.lang.Number value)
DataModel
createNewValuePair
in class DataModel
key
- The key / x valuevalue
- The (y) valuepublic java.lang.Number getXValueFromPair(ValuePair vp)
DataModel
getXValueFromPair
in class DataModel
vp
- The value pairpublic java.lang.Number getYValueFromValuePair(ValuePair vp)
DataModel
getYValueFromValuePair
in class DataModel
vp
- The value pairpublic jade.util.leap.List getValuePairsFromSeries(DataSeries series)
DataModel
getValuePairsFromSeries
in class DataModel
series
- The DataSeriespublic void setKeyForPair(java.lang.Number key, ValuePair vp)
DataModel
setKeyForPair
in class DataModel
key
- The new keyvp
- The value pair to be updatedpublic void setValueForPair(java.lang.Number value, ValuePair vp)
DataModel
setValueForPair
in class DataModel
value
- The new valuevp
- The value pair to be updatedpublic void removeValuePairsFromAllSeries(java.lang.Number key)
key
- The time stamppublic java.lang.String getDefaultSeriesLabel()
DataModel
getDefaultSeriesLabel
in class DataModel
public void editDataSeriesAddData(DataSeries series, int targetDataSeriesIndex, boolean editOntology) throws NoSuchSeriesException
DataModel
editDataSeriesAddData
in class DataModel
series
- the seriestargetDataSeriesIndex
- the target data series indexeditOntology
- true, if the ontology has to be editedNoSuchSeriesException
public void editDataSeriesAddOrExchangeData(DataSeries series, int targetDataSeriesIndex, boolean editOntology) throws NoSuchSeriesException
DataModel
editDataSeriesAddOrExchangeData
in class DataModel
series
- the seriestargetDataSeriesIndex
- the target data series indexeditOntology
- true, if the ontology has to be editedNoSuchSeriesException
public void editDataSeriesExchangeData(DataSeries series, int targetDataSeriesIndex, boolean editOntology) throws NoSuchSeriesException
DataModel
editDataSeriesExchangeData
in class DataModel
series
- the seriestargetDataSeriesIndex
- the target data series indexeditOntology
- true, if the ontology has to be editedNoSuchSeriesException
public void editDataSeriesRemoveData(DataSeries series, int targetDataSeriesIndex, boolean editOntology) throws NoSuchSeriesException
DataModel
editDataSeriesRemoveData
in class DataModel
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)
public java.lang.String getBaseStringForSeriesLabel()
DataModel
getBaseStringForSeriesLabel
in class DataModel
public void addValuePairToSeries(long timeStamp, float value, int seriesIndex, boolean editOntology) throws NoSuchSeriesException
timeStamp
- the time stampvalue
- the valueseriesIndex
- the series indexeditOntology
- if false, only chart and table model will be modifiedNoSuchSeriesException
- the no such series exception