|
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.GraphSettings
public class GraphSettings
Encapsulates settings concerned with the data graphs and the plot canvas.
This product includes software developed by the
LiveGraph project and its contributors.
(http://www.live-graph.org)
Copyright (c) 2007-2008 G. Paperin.
All rights reserved.
File: GraphSettings.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 | |
---|---|
static class |
GraphSettings.HGridType
Possible types for the horizontal grid. |
static class |
GraphSettings.VGridType
Possible types for the vertical grid. |
static class |
GraphSettings.XAxisType
Possible types for the x-axis. |
Field Summary | |
---|---|
private java.awt.Color |
hGridColour
Color of the horisontal grid. |
private double |
hGridSize
Spacing of the horisontal grid in data coordinates. |
private GraphSettings.HGridType |
hGridType
Type of the horisontal grid. |
private boolean |
highlightDataPoints
Whether to highlight data points as mouse is moved over the graph. |
private double |
maxX
Right edge of the visible data area. |
private double |
maxY
Top edge of the visible data area. |
private double |
minX
Left edge of the visible data area. |
private double |
minY
Bottom edge of the visible data area. |
static java.lang.String |
preferredFileExtension
Standard file extension. |
private java.awt.Color |
vGridColour
Color of the vertical grid. |
private double |
vGridSize
Spacing of the vertical grid in data coordinates. |
private GraphSettings.VGridType |
vGridType
Type of the vertical grid. |
private double |
xAxisParamValue
Parameter for transformation of x-values. |
private int |
xAxisSeriesIndex
Against which data series to plot (index). |
private GraphSettings.XAxisType |
xAxisType
Against what to plot the values. |
Constructor Summary | |
---|---|
GraphSettings()
Creates a new graph settings object with the default settings. |
|
GraphSettings(java.lang.String fileName)
Creates a new graph settings object and loads the settings from the specified file. |
Method Summary | |
---|---|
private void |
checkDisableHighlightingForOldJava()
If the Java version is too old, data point highlighting is disabled. |
private double |
ensureGoodXAxisParameter(GraphSettings.XAxisType xAxisType,
double parameter)
Ensure that the transformation parameter has a legal value for the given x-axis type. |
java.awt.Color |
getHGridColour()
Gets the colour for drawing the horizontal grid bars. |
double |
getHGridSize()
Gets the interval between the horizontal grib bars. |
GraphSettings.HGridType |
getHGridType()
Gets the horizontal grid type. |
boolean |
getHighlightDataPoints()
Gets whether the data points in the vicinity of the mouse cursor should be highlighted. |
double |
getMaxX()
Gets the maximum X value for the plot viewport. |
double |
getMaxY()
Gets the maximum Y value for the plot viewport. |
double |
getMinX()
Gets the minimum X value for the plot viewport. |
double |
getMinY()
Gets the minimum Y value for the plot viewport. |
java.awt.Color |
getVGridColour()
Gets the colour to use for drawing the vertical grid bars. |
double |
getVGridSize()
Gets the interval between the vertical grid bars. |
GraphSettings.VGridType |
getVGridType()
Sets the vertical grid type. |
double |
getXAxisParamValue()
Gets the x-axis transformation parameter. |
int |
getXAxisSeriesIndex()
Gets the index of the data series to use as the x-axis. |
GraphSettings.XAxisType |
getXAxisType()
Gets the type for the x-axis. |
boolean |
load(java.lang.String fileName)
Loads the settings from the specified file. |
boolean |
save(java.lang.String fileName)
Saves the settings to a specified file. |
void |
setHGridColour(java.awt.Color c)
Sets the colour for drawing the horizontal grid bars. |
void |
setHGridSize(double val)
Sets the interval between the horizontal grib bars. |
void |
setHGridType(GraphSettings.HGridType v)
Sets the horizontal grid type. |
void |
setHighlightDataPoints(boolean v)
Gets whether the data points in the vicinity of the mouse cursor should be highlighted. |
void |
setMaxX(double v)
Sets the maximum X value for the plot viewport. |
void |
setMaxY(double v)
Sets the maximum Y value for the plot viewport. |
void |
setMinX(double v)
Sets the minimum X value for the plot viewport. |
void |
setMinY(double v)
Sets the minimum Y value for the plot viewport. |
void |
setVGridColour(java.awt.Color c)
Sets the colour to use for drawing the vertical grid bars. |
void |
setVGridSize(double val)
Sets the interval between the vertical grid bars. |
void |
setVGridType(GraphSettings.VGridType v)
Gets the vertical grid type. |
void |
setXAxisParamValue(double val)
Sets x-axis transformation parameter. |
void |
setXAxisSeriesIndex(int val)
Sets the index of the data series to use as the x-axis. |
void |
setXAxisType(GraphSettings.XAxisType v)
Sets the type for the x-axis. |
Methods inherited from class org.LiveGraph.settings.ObservableSettings |
---|
checkObservers, checkObservers, checkObservers, checkObservers, checkObservers, eventProcessingException, eventProcessingFinished, notifyObservers |
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 double minY
Double.NaN
(Auto
).
private double maxY
Double.NaN
(Auto
).
private double minX
Double.NaN
(Auto
).
private double maxX
Double.NaN
(Auto
).
private GraphSettings.VGridType vGridType
VGridType.VGrid_None
.
private double vGridSize
50
.
private java.awt.Color vGridColour
#C0C0C0
.
private GraphSettings.HGridType hGridType
HGridType.HGrid_None
.
private double hGridSize
50
.
private java.awt.Color hGridColour
#C0C0C0
.
private GraphSettings.XAxisType xAxisType
XAxisType.XAxis_DSNum
.
private int xAxisSeriesIndex
0
.
private double xAxisParamValue
1
.
private boolean highlightDataPoints
true
.
Constructor Detail |
---|
public GraphSettings()
public GraphSettings(java.lang.String fileName)
fileName
- File to load the settigs from.Method Detail |
---|
public boolean load(java.lang.String fileName)
fileName
- File to load the settigs 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 double getMinY()
java.lang.Double.NaN
if the current global minimum of all data series
should be used instead.public void setMinY(double v)
v
- The minimum value along the Y axis for the graph view
or java.lang.Double.NaN
if the global minimum of all data series
should be used at all times.public double getMaxY()
java.lang.Double.NaN
if the current global maximum of all data series
should be used instead.public void setMaxY(double v)
v
- The maximum value along the Y axis for the graph view
or java.lang.Double.NaN
if the global maximum of all data series
should be used at all times.public double getMinX()
java.lang.Double.NaN
if the currently smallest X value of all data series
should be used instead.public void setMinX(double v)
v
- The minimum value along the X axis for the graph view
or java.lang.Double.NaN
if the smallest X value of all data series
should be used at all times.public double getMaxX()
java.lang.Double.NaN
if the currently largest X value of all data series
should be used instead.public void setMaxX(double v)
v
- The maximum value along the X axis for the graph view
or java.lang.Double.NaN
if the largest X value of all data series
should be used at all times.public GraphSettings.VGridType getVGridType()
public void setVGridType(GraphSettings.VGridType v)
v
- The vertical grid type.public double getVGridSize()
public void setVGridSize(double val)
val
- The interval between the vertical grid bars.public java.awt.Color getVGridColour()
public void setVGridColour(java.awt.Color c)
c
- The colour to use for drawing the vertical grid bars.public GraphSettings.HGridType getHGridType()
public void setHGridType(GraphSettings.HGridType v)
v
- The horizontal grid type.public double getHGridSize()
public void setHGridSize(double val)
val
- The interval between the horizontal grib bars.public java.awt.Color getHGridColour()
public void setHGridColour(java.awt.Color c)
c
- The colour for drawing the horizontal grid bars.public GraphSettings.XAxisType getXAxisType()
public void setXAxisType(GraphSettings.XAxisType v)
v
- The type for the x-axis.public int getXAxisSeriesIndex()
public void setXAxisSeriesIndex(int val)
val
- The index of the data series to use as the x-axis.public double getXAxisParamValue()
public void setXAxisParamValue(double val)
val
- x-axis transformation parameter.public boolean getHighlightDataPoints()
true
if the data points in the vicinity of the mouse cursor should be highlighted,
false
otherwise.public void setHighlightDataPoints(boolean v)
v
- true
if the data points in the vicinity of the mouse cursor are to be highlighted,
false
otherwise.private void checkDisableHighlightingForOldJava()
private double ensureGoodXAxisParameter(GraphSettings.XAxisType xAxisType, double parameter)
XAxis_DataValLogToSetBase
, it must be
non-negative and not 1.
xAxisType
- The x-axis type for which to verify the parameter.parameter
- The transfom parameter to check.
|
LiveGraph data visualisation and analysis framework |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |