|
LiveGraph data visualisation and analysis framework |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.LiveGraph.settings.ObservableSettings
org.LiveGraph.settings.DataSeriesSettings
public class DataSeriesSettings
Ecapsulates the settings concerned with plotting each of the data series.
This product includes software developed by the
LiveGraph project and its contributors.
(http://www.live-graph.org)
Copyright (c) 2007 G. Paperin.
All rights reserved.
File: DataSeriesSettings.java
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following terms and conditions are met:
1. Redistributions of source code must retain the above
acknowledgement of the LiveGraph project and its web-site, the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above acknowledgement of the
LiveGraph project and its web-site, the above copyright notice, this list of conditions
and the following disclaimer in the documentation and/or other materials provided with
the distribution.
3. All advertising materials mentioning features or use of this software or any derived
software must display the following acknowledgement:
This product includes software developed by the LiveGraph project and its
contributors.
(http://www.live-graph.org)
4. All advertising materials distributed in form of HTML pages or any other technology
permitting active hyper-links that mention features or use of this software or any
derived software must display the acknowledgment specified in condition 3 of this
agreement, and in addition, include a visible and working hyper-link to the LiveGraph
homepage (http://www.live-graph.org).
THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS, CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Nested Class Summary | |
---|---|
class |
DataSeriesSettings.SeriesParameters
This struct-class is used to group the settings for one data series in a single data structure. |
static class |
DataSeriesSettings.TransformMode
The transformation mode to the series values. |
Field Summary | |
---|---|
private java.util.List<java.awt.Color> |
defaultColours
Holds the default colours. |
static java.lang.String |
preferredFileExtension
The default file extension. |
private java.util.List<DataSeriesSettings.SeriesParameters> |
settings
Holds the current settigs. |
Constructor Summary | |
---|---|
DataSeriesSettings()
Creates a new data series settings object and initialises it with default values. |
|
DataSeriesSettings(java.lang.String fileName)
Creates a new data series settings object and loads the settigs from the specified file. |
Method Summary | |
---|---|
private void |
createDefaultColours()
Creates a set of "nice" default colours for the plot. |
private void |
ensureLength(int maxSeriesIndex)
Ensures that this settings container contains at least the settings for the data series with the specified index and all indices before that. |
java.awt.Color |
getColour(int seriesIndex)
Gets the colour for the plot of the data series with the specified index. |
private java.awt.Color |
getDefaultColour(int serInd)
|
private double |
getDefaultScaleFactor(int serInd)
|
private boolean |
getDefaultShow(int serInd)
|
private DataSeriesSettings.TransformMode |
getDefaultTransformMode(int serInd)
|
double |
getScaleFactor(int seriesIndex)
Gets the parameter for the transformation of the plotted values of the data series with the specified index; this parameter is currently required only for the mode Transform_SetVal . |
boolean |
getShow(int seriesIndex)
Setts whether the data series with the specified index should be included in tthe plot. |
DataSeriesSettings.TransformMode |
getTransformMode(int seriesIndex)
Gets the transformation mode for the plotted values of the data series with the specified index. |
boolean |
load(java.lang.String fileName)
Loads the settings from a specified file. |
boolean |
save(java.lang.String fileName)
Saves the settings to a specified file. |
void |
setColour(int seriesIndex,
java.awt.Color colour)
Sets the colour for the plot of the data series with the specified index. |
void |
setScaleFactor(int seriesIndex,
double parameter)
Sets the parameter for the transformation of the plotted values of the data series with the specified index; this parameter is currently required only for the mode Transform_SetVal ; |
private void |
setSeriesMarkedAsXAxis(int seriesIndex)
Getts called when this settings container was registered as an observer to a graph settings container and some data series was set as being used as the x-axis in the observed graph settings container. |
void |
setShow(int seriesIndex,
boolean show)
Sets whether the data series with the specified index should be included in tthe plot. |
void |
setShowAll(int from,
int to,
boolean show)
Sets whether the data series between the specified indices should be included in the plot. |
void |
setShowToggleAll(int from,
int to)
Toggles whether the data series between the specified indices should be included in the plot. |
void |
settingHasChanged(ObservableSettings settings,
java.lang.Object info)
Data seties settings objects may listen to other settings objects in order to react to changed in other settings; currently data series settings react when a data series is set to be used as the x-axis. |
void |
setTransformMode(int seriesIndex,
DataSeriesSettings.TransformMode transformMode)
Sets the transformation mode for the plotted values of the data series with the specified index. |
Methods inherited from class org.LiveGraph.settings.ObservableSettings |
---|
addObserver, countObservers, hasObserver, notifyObservers, notifyObservers, removeObserver |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String preferredFileExtension
private java.util.List<DataSeriesSettings.SeriesParameters> settings
private java.util.List<java.awt.Color> defaultColours
Constructor Detail |
---|
public DataSeriesSettings()
public DataSeriesSettings(java.lang.String fileName)
fileName
- The file name to use.Method Detail |
---|
private void createDefaultColours()
private boolean getDefaultShow(int serInd)
private java.awt.Color getDefaultColour(int serInd)
private DataSeriesSettings.TransformMode getDefaultTransformMode(int serInd)
private double getDefaultScaleFactor(int serInd)
private void ensureLength(int maxSeriesIndex)
maxSeriesIndex
- It will be ensured that this container contains settings for
at least all data series up to this index.public boolean load(java.lang.String fileName)
fileName
- The file to load the settings from.
true
if the settings were loaded, false
if an exception occured.public boolean save(java.lang.String fileName)
fileName
- The file to save the settings to.
true
if the settings were saved, false
if an exception occured.public void setShow(int seriesIndex, boolean show)
seriesIndex
- A data series index (corresponds to the column index in the data file).show
- true
if the data series with the specified index is to be included in the plot,
false
otherwise.public void setShowAll(int from, int to, boolean show)
from
- Starting data series index (inclusive).to
- Finishing data series index (inclusive).show
- true
if the data series with the specified index is to be included in tthe plot,
false
otherwise.public void setShowToggleAll(int from, int to)
from
- Starting data series index (inclusive).to
- Finishing data series index (inclusive).public void setColour(int seriesIndex, java.awt.Color colour)
seriesIndex
- A data series index (corresponds to the column index in the data file).colour
- The colour for the plot of the data series with the specified index.public void setTransformMode(int seriesIndex, DataSeriesSettings.TransformMode transformMode)
seriesIndex
- A data series index (corresponds to the column index in the data file).transformMode
- The transformation mode for the plotted values of the data series with the specified index.public void setScaleFactor(int seriesIndex, double parameter)
Transform_SetVal
;
seriesIndex
- A data series index (corresponds to the column index in the data file).parameter
- The parameter for the transformation of the plotted values of the data series with
the specified index.public boolean getShow(int seriesIndex)
getDefaultShow(int)
.
seriesIndex
- A data series index (corresponds to the column index in the data file).
true
if the data series with the specified index is to be included in tthe plot,
false
otherwise.getDefaultShow(int)
public java.awt.Color getColour(int seriesIndex)
getDefaultColour(int)
.
seriesIndex
- A data series index (corresponds to the column index in the data file).
getDefaultColour(int)
public DataSeriesSettings.TransformMode getTransformMode(int seriesIndex)
getDefaultTransformMode(int)
.
seriesIndex
- A data series index (corresponds to the column index in the data file).
getDefaultTransformMode(int)
public double getScaleFactor(int seriesIndex)
Transform_SetVal
.
If no setting value has been defined for the specified series, a defalut value will be
returned as specified by getDefaultScaleFactor(int)
.
seriesIndex
- A data series index (corresponds to the column index in the data file).
getDefaultScaleFactor(int)
public void settingHasChanged(ObservableSettings settings, java.lang.Object info)
setSeriesMarkedAsXAxis(int)
to process this event.
settingHasChanged
in interface SettingsObserver
settings
- The settings object that was changed.info
- Is used to further specify the change. Usually this is a
String
containing the name of the changed setting.setSeriesMarkedAsXAxis(int)
private void setSeriesMarkedAsXAxis(int seriesIndex)
seriesIndex
- The index of the data series to be set to invisible
(corresponds to the column index in the data file).settingHasChanged(ObservableSettings, Object)
|
LiveGraph data visualisation and analysis framework |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |