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, setTableModelpublic 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)
DataModelsetOntologyInstanceChart in class DataModelontologyChart - 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)
DataModelcreateNewDataSeries in class DataModellabel - The new data series labelpublic ValuePair createNewValuePair(java.lang.Number key, java.lang.Number value)
DataModelcreateNewValuePair in class DataModelkey - The key / x valuevalue - The (y) valuepublic java.lang.Number getXValueFromPair(ValuePair vp)
DataModelgetXValueFromPair in class DataModelvp - The value pairpublic java.lang.Number getYValueFromValuePair(ValuePair vp)
DataModelgetYValueFromValuePair in class DataModelvp - The value pairpublic jade.util.leap.List getValuePairsFromSeries(DataSeries series)
DataModelgetValuePairsFromSeries in class DataModelseries - The DataSeriespublic void setKeyForPair(java.lang.Number key,
ValuePair vp)
DataModelsetKeyForPair in class DataModelkey - The new keyvp - The value pair to be updatedpublic void setValueForPair(java.lang.Number value,
ValuePair vp)
DataModelsetValueForPair in class DataModelvalue - The new valuevp - The value pair to be updatedpublic void removeValuePairsFromAllSeries(java.lang.Number key)
key - The time stamppublic java.lang.String getDefaultSeriesLabel()
DataModelgetDefaultSeriesLabel in class DataModelpublic void editDataSeriesAddData(DataSeries series, int targetDataSeriesIndex, boolean editOntology) throws NoSuchSeriesException
DataModeleditDataSeriesAddData in class DataModelseries - the seriestargetDataSeriesIndex - the target data series indexeditOntology - true, if the ontology has to be editedNoSuchSeriesExceptionpublic void editDataSeriesAddOrExchangeData(DataSeries series, int targetDataSeriesIndex, boolean editOntology) throws NoSuchSeriesException
DataModeleditDataSeriesAddOrExchangeData in class DataModelseries - the seriestargetDataSeriesIndex - the target data series indexeditOntology - true, if the ontology has to be editedNoSuchSeriesExceptionpublic void editDataSeriesExchangeData(DataSeries series, int targetDataSeriesIndex, boolean editOntology) throws NoSuchSeriesException
DataModeleditDataSeriesExchangeData in class DataModelseries - the seriestargetDataSeriesIndex - the target data series indexeditOntology - true, if the ontology has to be editedNoSuchSeriesExceptionpublic void editDataSeriesRemoveData(DataSeries series, int targetDataSeriesIndex, boolean editOntology) throws NoSuchSeriesException
DataModeleditDataSeriesRemoveData in class DataModelseries - 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()
DataModelgetBaseStringForSeriesLabel in class DataModelpublic 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