edu.iris.dmc.pdcc.gui
Class PdccMain

java.lang.Object
  extended byedu.iris.dmc.pdcc.gui.PdccMain
All Implemented Interfaces:
java.util.EventListener, java.awt.event.WindowListener

public class PdccMain
extends java.lang.Object
implements java.awt.event.WindowListener

The main launching class for PDCC. This sets up the primary display window and establishes all general GUI functions. This class is instantiated via a singleton mechanism.
Copyright (C) 2006 Incorporated Research Institutions for Seismology

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

For more information, please contact the principle author shown here.

Version:
6/29/2006
Author:
Robert Casey, IRIS DMC (rob@iris.washington.edu)
Linus Kamb, IRIS DMC (ISIS Foundation Classes)
Chris Laughbon, IRIS DMC

Field Summary
static java.lang.String datalessExportBuilderType
          Dataless export builder type (lower case).
static java.lang.String miniSeedExportBuilderType
          miniSEED export builder type (lower case).
static java.lang.String sacExportBuilderType
          SAC export builder type (lower case).
static java.lang.String seedExportBuilderType
          SEED export builder type (lower case).
 
Method Summary
 void checkDbExportBuilder()
          Check to see that there is a single instance of the db export builder.
 void checkTableContainer()
          Check to see that there is a single instance of a table container.
 void exitPDCC()
           
static javax.swing.JFrame getAppFrame()
          Get application frame instance.
static edu.iris.dmc.isis.AppModel getAppModel()
          Get app model instance.
 java.lang.String getConfigFileName()
          return the currently-assigned config file name of this instance
static PdccConfigUtil getConfigUtil()
          Return the currently-assigned confuration utility for this instance
static PdccDbExportBuilder getDbExportBuilder()
          Get DB export builder instance.
 PdccDbImportDirector getDbImportDirector()
          Get DB import director instance.
static java.lang.String getExportBuilderTypeDescription(java.lang.String exportBuilderType)
          Gets the description for the specified export builder type.
static java.lang.String getInstallDirectory(java.lang.Object instance)
          Get our installation directory using a local object instance.
static PdccMain getInstance()
          Return a Singleton instance of PdccMain.
static PdccMain getInstance(java.lang.String configFile, java.lang.String sessionName)
          Return a Singleton instance of PdccMain.
static PdccMainPanel getMainPanel()
          Get main panel instance.
protected  javax.swing.Action getNewAbbreviationAction(int type, java.lang.String name)
           
 java.lang.String getNewCachePathName(java.lang.String dataFileName)
          Generate a full cache pathname based on the indicated source file name.
static PdccTableContainer getTableContainer()
          Get DB table container instance.
static void main(java.lang.String[] args)
          Main launcher method for PDCC.
 void notifyConfigReload(PdccConfigFrame configFrame)
          Receive notification from a configuration frame that the configuration has been changed, which precipitates a reloading of the configuration.
static void popupError(java.lang.String errTitle, java.lang.String errMsg)
          Pop up a dialog box with an error message.
static void resetInstance()
          Delete the singleton instance of this class.
static java.lang.String toHexString(byte[] b)
          Fast-convert a byte array to a hex string with possible leading zero.
 void windowActivated(java.awt.event.WindowEvent e)
          WindowListener interface implementation.
 void windowClosed(java.awt.event.WindowEvent e)
          WindowListener interface implementation.
 void windowClosing(java.awt.event.WindowEvent e)
          WindowListener interface implementation.
 void windowDeactivated(java.awt.event.WindowEvent e)
          WindowListener interface implementation.
 void windowDeiconified(java.awt.event.WindowEvent e)
          WindowListener interface implementation.
 void windowIconified(java.awt.event.WindowEvent e)
          WindowListener interface implementation.
 void windowOpened(java.awt.event.WindowEvent e)
          WindowListener interface implementation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

datalessExportBuilderType

public static java.lang.String datalessExportBuilderType
Dataless export builder type (lower case).


seedExportBuilderType

public static java.lang.String seedExportBuilderType
SEED export builder type (lower case).


miniSeedExportBuilderType

public static java.lang.String miniSeedExportBuilderType
miniSEED export builder type (lower case).


sacExportBuilderType

public static java.lang.String sacExportBuilderType
SAC export builder type (lower case).

Method Detail

getExportBuilderTypeDescription

public static java.lang.String getExportBuilderTypeDescription(java.lang.String exportBuilderType)
Gets the description for the specified export builder type.

Parameters:
exportBuilderType - String
Returns:
the description text.

getInstance

public static PdccMain getInstance()
Return a Singleton instance of PdccMain. Use default values.


getInstance

public static PdccMain getInstance(java.lang.String configFile,
                                   java.lang.String sessionName)
Return a Singleton instance of PdccMain. Use the indicated configuration file and session name to start the session.


resetInstance

public static void resetInstance()
Delete the singleton instance of this class. Use with care!

Returns:
void

getMainPanel

public static PdccMainPanel getMainPanel()
Get main panel instance.


getAppFrame

public static javax.swing.JFrame getAppFrame()
Get application frame instance.


getAppModel

public static edu.iris.dmc.isis.AppModel getAppModel()
Get app model instance.


getTableContainer

public static PdccTableContainer getTableContainer()
Get DB table container instance.


getDbExportBuilder

public static PdccDbExportBuilder getDbExportBuilder()
                                              throws java.lang.Exception
Get DB export builder instance.

Throws:
java.lang.Exception

getConfigUtil

public static PdccConfigUtil getConfigUtil()
Return the currently-assigned confuration utility for this instance


popupError

public static void popupError(java.lang.String errTitle,
                              java.lang.String errMsg)
Pop up a dialog box with an error message. Attaches to the PDCC main panel.


getInstallDirectory

public static java.lang.String getInstallDirectory(java.lang.Object instance)
Get our installation directory using a local object instance. Credit for the idea of this one-liner goes to Mike Clarke of Clarkeware.com for his JWhich utility (mike@clarkeware.com), which is licensed for free use and modification under BSD license guidelines: Copyright (C) 2001 Clarkware Consulting, Inc. All Rights Reserved.


getDbImportDirector

public PdccDbImportDirector getDbImportDirector()
Get DB import director instance.


checkTableContainer

public void checkTableContainer()
Check to see that there is a single instance of a table container.


checkDbExportBuilder

public void checkDbExportBuilder()
Check to see that there is a single instance of the db export builder.


windowClosing

public void windowClosing(java.awt.event.WindowEvent e)
WindowListener interface implementation. This one triggers an exit routine that asks user for confirmation, performs cleanup, closes the window, and exits PDCC.

Specified by:
windowClosing in interface java.awt.event.WindowListener

windowActivated

public void windowActivated(java.awt.event.WindowEvent e)
WindowListener interface implementation.

Specified by:
windowActivated in interface java.awt.event.WindowListener

windowClosed

public void windowClosed(java.awt.event.WindowEvent e)
WindowListener interface implementation.

Specified by:
windowClosed in interface java.awt.event.WindowListener

windowDeactivated

public void windowDeactivated(java.awt.event.WindowEvent e)
WindowListener interface implementation.

Specified by:
windowDeactivated in interface java.awt.event.WindowListener

windowDeiconified

public void windowDeiconified(java.awt.event.WindowEvent e)
WindowListener interface implementation.

Specified by:
windowDeiconified in interface java.awt.event.WindowListener

windowIconified

public void windowIconified(java.awt.event.WindowEvent e)
WindowListener interface implementation.

Specified by:
windowIconified in interface java.awt.event.WindowListener

windowOpened

public void windowOpened(java.awt.event.WindowEvent e)
WindowListener interface implementation.

Specified by:
windowOpened in interface java.awt.event.WindowListener

getNewCachePathName

public java.lang.String getNewCachePathName(java.lang.String dataFileName)
Generate a full cache pathname based on the indicated source file name. If the default cache pathname is already active, alternate names will be generated to prevent a destructive collision and the new pathname will be returned. Creates the cache directory if it does not exist.


notifyConfigReload

public void notifyConfigReload(PdccConfigFrame configFrame)
Receive notification from a configuration frame that the configuration has been changed, which precipitates a reloading of the configuration.


getConfigFileName

public java.lang.String getConfigFileName()
return the currently-assigned config file name of this instance


main

public static void main(java.lang.String[] args)
Main launcher method for PDCC.

Parameters:
args - arg0=config file path, arg1=session config name

toHexString

public static java.lang.String toHexString(byte[] b)
Fast-convert a byte array to a hex string with possible leading zero. Code courtesy of mindprod.com.


getNewAbbreviationAction

protected javax.swing.Action getNewAbbreviationAction(int type,
                                                      java.lang.String name)

exitPDCC

public void exitPDCC()


brought to you by Incorporated Research Institutions for Seismology
June 29 2006