edu.iastate.metnet.metaomgraph
Class MetaOmGraph

java.lang.Object
  extended by edu.iastate.metnet.metaomgraph.MetaOmGraph
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener

public class MetaOmGraph
extends java.lang.Object
implements java.awt.event.ActionListener

The main class of the MetaOmGraph. Handles all non-project-specific functions.

Author:
Nick Ransom

Nested Class Summary
static class MetaOmGraph.NewProjectWorker
          Worker that constructs a new project.
 
Field Summary
static java.lang.String ABOUT_COMMAND
           
static java.lang.String CLOSE_PROJECT_COMMAND
           
static java.lang.String LOAD_INFO_COMMAND
           
static java.lang.String NEW_PROJECT_DELIMITED_COMMAND
           
static java.lang.String NEW_PROJECT_SOFT_COMMAND
           
static java.lang.String OPEN_COMMAND
           
static java.lang.String PROPERTIES_COMMAND
           
static java.lang.String QUIT_COMMAND
           
static java.lang.String RECENT_PROJECT_COMMAND
           
static java.lang.String SAVE_AS_COMMAND
           
static java.lang.String SAVE_COMMAND
           
static java.lang.String SHOW_TIPS_COMMAND
           
 
Constructor Summary
MetaOmGraph()
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          ActionListener for the MetaOmGraph window's menu items.
static void addRecentProject(java.io.File projectFile)
           
static boolean closeProject()
          Closes the active project.
static MetaOmProject getActiveProject()
          Fetches the active MetaOmProject.
static MetaOmTablePanel getActiveTable()
          Fetches the MetaOmTablePanel for the active project.
static javax.swing.JDesktopPane getDesktop()
          Fetches the desktop used in the main JFrame.
static int[] getFilteredColumns(java.lang.String[] columnHeaders)
           
static MetaOmHelpListener getHelpListener()
          Fetches the ActionListener used to display a Help frame.
static java.awt.Image getIconImage()
          Fetches the MetaOmGraph icon as an Image.
static javax.swing.JFrame getMainWindow()
          Fetches the main JFrame used by this program
static SimpleModalMaker getModalMaker()
          Fetches the WindowListener used to make a frame/dialog modal, but still be able to access the Help frame.
static void init()
           
static void main(java.lang.String[] args)
           
static boolean openProject(MetaOmProject myProject)
           
static boolean promptToSave()
          Prompts the user to save the active project.
static void refreshCharts()
           
static void tableToFront()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NEW_PROJECT_DELIMITED_COMMAND

public static final java.lang.String NEW_PROJECT_DELIMITED_COMMAND
See Also:
Constant Field Values

NEW_PROJECT_SOFT_COMMAND

public static final java.lang.String NEW_PROJECT_SOFT_COMMAND
See Also:
Constant Field Values

OPEN_COMMAND

public static final java.lang.String OPEN_COMMAND
See Also:
Constant Field Values

SAVE_COMMAND

public static final java.lang.String SAVE_COMMAND
See Also:
Constant Field Values

SAVE_AS_COMMAND

public static final java.lang.String SAVE_AS_COMMAND
See Also:
Constant Field Values

QUIT_COMMAND

public static final java.lang.String QUIT_COMMAND
See Also:
Constant Field Values

CLOSE_PROJECT_COMMAND

public static final java.lang.String CLOSE_PROJECT_COMMAND
See Also:
Constant Field Values

LOAD_INFO_COMMAND

public static final java.lang.String LOAD_INFO_COMMAND
See Also:
Constant Field Values

PROPERTIES_COMMAND

public static final java.lang.String PROPERTIES_COMMAND
See Also:
Constant Field Values

ABOUT_COMMAND

public static final java.lang.String ABOUT_COMMAND
See Also:
Constant Field Values

RECENT_PROJECT_COMMAND

public static final java.lang.String RECENT_PROJECT_COMMAND
See Also:
Constant Field Values

SHOW_TIPS_COMMAND

public static final java.lang.String SHOW_TIPS_COMMAND
See Also:
Constant Field Values
Constructor Detail

MetaOmGraph

public MetaOmGraph()
Method Detail

getActiveProject

public static MetaOmProject getActiveProject()
Fetches the active MetaOmProject.

Returns:
The open MetaOmProject, or null if there is no open project.

init

public static void init()

main

public static void main(java.lang.String[] args)

getMainWindow

public static javax.swing.JFrame getMainWindow()
Fetches the main JFrame used by this program

Returns:
the program's main JFrame

getDesktop

public static javax.swing.JDesktopPane getDesktop()
Fetches the desktop used in the main JFrame.

Returns:
The main desktop

promptToSave

public static boolean promptToSave()
Prompts the user to save the active project. Doesn't check to see if there IS an active project or not, though. If the user hasn't yet saved the project and elects to do so here, a Save As dialog will appear.

Returns:
false if the user closes or cancels the dialog, true otherwise.

addRecentProject

public static void addRecentProject(java.io.File projectFile)

openProject

public static boolean openProject(MetaOmProject myProject)

closeProject

public static boolean closeProject()
Closes the active project. If there are unsaved changes to the active project, the user is prompted to save them. If the user cancels the save prompt, this returns false and does nothing. Otherwise, it closes the project, removes any open JInternalFrames, and disables the appropriate menu items.

Returns:
false if the user canceled the save prompt, true otherwise

getIconImage

public static java.awt.Image getIconImage()
Fetches the MetaOmGraph icon as an Image.

Returns:
an Image of the MetaOmGraph icon

getHelpListener

public static MetaOmHelpListener getHelpListener()
Fetches the ActionListener used to display a Help frame.

Returns:
the ActionListener used to dispaly a Help frame

getModalMaker

public static SimpleModalMaker getModalMaker()
Fetches the WindowListener used to make a frame/dialog modal, but still be able to access the Help frame. Normally, when a dialog is modal, it completely blocks the current process, thus disabling access to all frames/dialogs besides the modal dialog and its children. By applying this listener to a frame or dialog, when that frame/dialog is visible, it will disable only the main MetaOmGraph window, thus allowing the user to still access other frames.

Returns:
a WindowListener that, when applied to a frame or dialog, will disable the main MetaOmGraph window when the frame/dialog is visible

getActiveTable

public static MetaOmTablePanel getActiveTable()
Fetches the MetaOmTablePanel for the active project.

Returns:
the MetaOmTablePanel for the active project

tableToFront

public static void tableToFront()

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
ActionListener for the MetaOmGraph window's menu items.

Specified by:
actionPerformed in interface java.awt.event.ActionListener

getFilteredColumns

public static int[] getFilteredColumns(java.lang.String[] columnHeaders)

refreshCharts

public static void refreshCharts()