LiveGraph
data visualisation and analysis framework

org.LiveGraph
Class LiveGraph

java.lang.Object
  extended by org.LiveGraph.LiveGraph

public class LiveGraph
extends java.lang.Object

This is the main executable class of the LiveGraph plotter application. An instance of this class represents the application itself. The tasks of this class is to interpret the command line parameters, to set-up and to start-up the GUI and the back-end of the application, and to provide some functions which are used by different modules of the application to communicate with each other and to access global data, such as settings.

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: LiveGraph.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:
"2.0.beta01"
Author:
Greg Paperin (http://www.paperin.org)

Nested Class Summary
private  class LiveGraph.TidyUpAfterEventManagerShutDown
           
private  class LiveGraph.UncaughtExceptionHandler
           
 
Field Summary
private static LiveGraph app
          Singleton application instance.
private  java.lang.Thread.UncaughtExceptionHandler commonDefaultUncaughtExceptionHandler
           
private  DataCache dataCache
           
private  DataFileSettings dataFileSettings
          Holds the data file settings for the application.
private  EventManager eventManager
           
private  GraphExporter graphExporter
          Holds the graph exporter.
private  GraphSettings graphSettings
          Holds the graph settings for the application.
private  GUIManager guiManager
           
private  boolean initialised
           
private  DataSeriesSettings seriesSettings
          Holds the data series settings for the application.
private  boolean standAlone
           
private  UpdateInvoker updateInvoker
          Application's data update invoker.
private  UpgradeManager upgradeManager
           
static java.lang.String version
          LiveGraph software version.
 
Constructor Summary
LiveGraph()
           
 
Method Summary
static LiveGraph application()
          Singleton application access method.
 void disposeGUIAndExit()
          This method is called by the main window when it is closed.
 EventManager eventManager()
          Gets the applications' global event manager.
 void execEngine()
           
 void execStandalone()
           
 void execStandalone(CommandLineProcessor cmdLn)
           
 void execStandalone(java.lang.String[] args)
          Main program method.
 DataFileSettings getDataFileSettings()
          Gets the application's global data file settings.
 DataSeriesSettings getDataSeriesSettings()
          Gets the application's global data series settings.
 GraphExporter getGraphExporter()
          Get the exporter that can be used to create image representations of LiveGraph plots.
 GraphSettings getGraphSettings()
          Gets the application's global graph settings.
 java.lang.String getJavaSpecificationVersion()
          Determines the current Java specification version.
 GUIManager guiManager()
          Gets the applications' global gui manager.
 boolean initialised()
           
private  void installUncaughtExceptionHandler()
          Installs an uncaught exception handler that logs errors to the message window as well as to the colsole.
static void main(java.lang.String[] args)
          Program entry point.
 boolean runsCorrectJavaVersion()
          Determines whether the currect Java version is appropriate.
private  void shutDown()
           
 boolean standalone()
           
 UpdateInvoker updateInvoker()
           
 UpgradeManager upgradeManager()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

version

public static final java.lang.String version
LiveGraph software version.

See Also:
Constant Field Values

app

private static LiveGraph app
Singleton application instance.


eventManager

private EventManager eventManager

guiManager

private GUIManager guiManager

dataCache

private DataCache dataCache

upgradeManager

private UpgradeManager upgradeManager

initialised

private boolean initialised

standAlone

private boolean standAlone

commonDefaultUncaughtExceptionHandler

private java.lang.Thread.UncaughtExceptionHandler commonDefaultUncaughtExceptionHandler

updateInvoker

private UpdateInvoker updateInvoker
Application's data update invoker.


dataFileSettings

private DataFileSettings dataFileSettings
Holds the data file settings for the application.


graphSettings

private GraphSettings graphSettings
Holds the graph settings for the application.


seriesSettings

private DataSeriesSettings seriesSettings
Holds the data series settings for the application.


graphExporter

private GraphExporter graphExporter
Holds the graph exporter.

Constructor Detail

LiveGraph

public LiveGraph()
Method Detail

application

public static LiveGraph application()
Singleton application access method.

Returns:
The singleton application object.

main

public static void main(java.lang.String[] args)
Program entry point. Creates an application instance and calls the execStandalone(String[]) method.

Parameters:
args - Command line parameters.

execStandalone

public void execStandalone()

execStandalone

public void execStandalone(java.lang.String[] args)
Main program method. It parses the command line parameters, sets up the GUI and the back-end components of the application and configures the their communication. It then loads the default settings and passes the execution control to the main Swing GUI loop.

Parameters:
args - Command line arguments.

execStandalone

public void execStandalone(CommandLineProcessor cmdLn)

execEngine

public void execEngine()

getJavaSpecificationVersion

public java.lang.String getJavaSpecificationVersion()
Determines the current Java specification version.

Returns:
The current Java specification version or "unknown" if it could not be obtained.

runsCorrectJavaVersion

public boolean runsCorrectJavaVersion()
Determines whether the currect Java version is appropriate. This is done based on the system property java.specification.version. Java version 1.6 or higher is considered ok.

Returns:
Whether the currect Java version is appropriate.

disposeGUIAndExit

public void disposeGUIAndExit()
This method is called by the main window when it is closed. This method initiates the disposing of all windows and the data update invocation thread in order to correctly close the application and save all settings to default files. API users should call ths method in order to shut down LiveGraph.


shutDown

private void shutDown()

eventManager

public EventManager eventManager()
Gets the applications' global event manager.

Returns:
Global event manager.

guiManager

public GUIManager guiManager()
Gets the applications' global gui manager.

Returns:
Global event manager.

updateInvoker

public UpdateInvoker updateInvoker()

upgradeManager

public UpgradeManager upgradeManager()

standalone

public boolean standalone()

initialised

public boolean initialised()

getDataFileSettings

public DataFileSettings getDataFileSettings()
Gets the application's global data file settings.

Returns:
Global data file settings.

getGraphSettings

public GraphSettings getGraphSettings()
Gets the application's global graph settings.

Returns:
Global graph settings.

getDataSeriesSettings

public DataSeriesSettings getDataSeriesSettings()
Gets the application's global data series settings.

Returns:
Global data series settings.

getGraphExporter

public GraphExporter getGraphExporter()
Get the exporter that can be used to create image representations of LiveGraph plots.

Returns:
An exporter that can be used to create image representations of LiveGraph plots.

installUncaughtExceptionHandler

private void installUncaughtExceptionHandler()
Installs an uncaught exception handler that logs errors to the message window as well as to the colsole.


LiveGraph
data visualisation and analysis framework
LiveGraph is a member of SourceForge.net Donate to LiveGraph