LiveGraph
data visualisation and analysis framework

org.LiveGraph.settings
Class DataFileSettings

java.lang.Object
  extended by org.LiveGraph.settings.ObservableSettings
      extended by org.LiveGraph.settings.DataFileSettings

public class DataFileSettings
extends ObservableSettings

Encapsulates the settings concerned with reading the data file, the update frequency and the caching method.

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: DataFileSettings.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.

Version:
"1.1.1"
Author:
Greg Paperin (http://www.paperin.org)

Field Summary
private static java.util.Properties defaultValues
          Default settings.
static java.lang.String preferredFileExtension
          Standard file extension.
private  java.util.Properties values
          Holds the current settings.
 
Constructor Summary
DataFileSettings()
          Creates a new data file settings object with the default settings values.
DataFileSettings(java.lang.String fileName)
          Creates a new data file settings object and loads the settings values from the specified file.
 
Method Summary
 java.lang.String getDataFile()
          Gets the data file.
 boolean getDoNotCacheData()
          Gets whether the data stream should not be cached in memory.
 boolean getShowOnlyTailData()
          Gets whether to plot only tail data.
 long getUpdateFrequency()
          Gets the interval between automatic graph updates.
 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 setDataFile(java.lang.String fn)
          Sets the data file.
 void setDoNotCacheData(boolean v)
          Sets whether the data stream should not be cached in memory.
 void setShowOnlyTailData(boolean v)
          Setts whether to plot only tail data.
 void setUpdateFrequency(long f)
          Sets the interval between automatic graph updates.
 
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

preferredFileExtension

public static final java.lang.String preferredFileExtension
Standard file extension.

See Also:
Constant Field Values

defaultValues

private static final java.util.Properties defaultValues
Default settings.


values

private java.util.Properties values
Holds the current settings.

Constructor Detail

DataFileSettings

public DataFileSettings()
Creates a new data file settings object with the default settings values.


DataFileSettings

public DataFileSettings(java.lang.String fileName)
Creates a new data file settings object and loads the settings values from the specified file.

Parameters:
fileName - File to load the settings from.
Method Detail

load

public boolean load(java.lang.String fileName)
Loads the settings from a specified file.

Parameters:
fileName - The file to load the settings from.
Returns:
true if the settings were loaded, false if an exception occured.

save

public boolean save(java.lang.String fileName)
Saves the settings to a specified file.

Parameters:
fileName - The file to save the settings to.
Returns:
true if the settings were saved, false if an exception occured.

getDataFile

public java.lang.String getDataFile()
Gets the data file.

Returns:
Name of the data stream to plot.

setDataFile

public void setDataFile(java.lang.String fn)
Sets the data file.

Parameters:
fn - Name of the data stream to plot.

getShowOnlyTailData

public boolean getShowOnlyTailData()
Gets whether to plot only tail data.

Returns:
true if only the datasets at the end of the data setream should be plotted, false if data sets should be sampled from the complete data stream.

setShowOnlyTailData

public void setShowOnlyTailData(boolean v)
Setts whether to plot only tail data.

Parameters:
v - true if only the datasets at the end of the data setream should be plotted, false if data sets should be sampled from the complete data stream.

getDoNotCacheData

public boolean getDoNotCacheData()
Gets whether the data stream should not be cached in memory.

Returns:
true if the data stream should be read from the start each time the graph is updated, false if data should be cached in memory and only the new data sets should be read on each update.

setDoNotCacheData

public void setDoNotCacheData(boolean v)
Sets whether the data stream should not be cached in memory.

Parameters:
v - true if the data stream should be read from the start each time the graph is updated, false if data should be cached in memory and only the new data sets should be read on each update.

getUpdateFrequency

public long getUpdateFrequency()
Gets the interval between automatic graph updates.

Returns:
The number of milliseconds to wait between trying to read from the data stream next time. If this values is < 1 no automatic update should be initiated.

setUpdateFrequency

public void setUpdateFrequency(long f)
Sets the interval between automatic graph updates.

Parameters:
f - The number of milliseconds to wait between trying to read from the data stream next time. Pass a value f < 1 to indicate that no automatic update should be initiated.

LiveGraph
data visualisation and analysis framework