edu.iastate.metnet.ui
Class MainWindow2

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Frame
                  extended by javax.swing.JFrame
                      extended by edu.iastate.metnet.ui.MainWindow2
All Implemented Interfaces:
java.awt.event.ContainerListener, java.awt.event.KeyListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants
Direct Known Subclasses:
MetNetGUI

public class MainWindow2
extends javax.swing.JFrame
implements java.awt.event.ContainerListener, java.awt.event.KeyListener

MainWindow2.java Standalone main window lauched by ShowTable, which is embedded in brower window. This is the entry point of the metnetdb program

Author:
Jie Li
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JFrame
javax.swing.JFrame.AccessibleJFrame
 
Nested classes/interfaces inherited from class java.awt.Frame
java.awt.Frame.AccessibleAWTFrame
 
Nested classes/interfaces inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
static AddEntityForm addEntityForm
          entitywithlocation editor window instance
static AddInteractionForm addInteractionForm
          interaction editor window instance
(package private) static javax.swing.plaf.metal.MetalTheme defaultTheme
          default look and feel theme
static WebDBService formDBLink
          external database link editor window instance
static AbbreviationRules formEditAbbreviationRule
          abbreivation rule editor window instance
static AddPathwayForm formEditPathway
          pathway basic property editor window instance
static SynonymCandidate formGenerateSynonym
          synonym candidate approval editor window instance
static RefService formReference
          reference and comment editor window instance
static NameService formSynonym
          synonym and abbreviation editor window instance
static HelpWindow helpWindow
          help information window instance
(package private) static boolean inPlatform
          if current running in MetNet platform
(package private) static org.apache.log4j.Logger logger
          log4j facility
(package private) static MainWindow2 myself
          this main window instance
static PathwayEditor pathwayEditor
          pathway editor window instance
static java.util.Properties resource
          external user prefenrece, will be overriden by preference xml file
static java.util.Collection sessionOrganism
          organism that the curator can edit
static int sessionUserLevel
          user level: 0 - guest, browse only, 1 - normal, browse only, 2 - expert user, can edit all data, 3 - administrator, can edit all data.
static java.lang.String sessionUsername
          user name to login
static Splash splash
          splash window instance
static java.sql.Statement statement
          SQL statement instance
static java.util.Stack windowList
          store the visited window history list
 
Fields inherited from class javax.swing.JFrame
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
MainWindow2()
          Creates new form MainWindow2
MainWindow2(java.lang.String guest)
          automatically login
 
Method Summary
 void componentAdded(java.awt.event.ContainerEvent e)
          perform the component add event
 void componentRemoved(java.awt.event.ContainerEvent e)
          perform the component remove event
static boolean connectMySQL()
          compose the password for the database accession
 void enableMenu()
          change the enable / diable status of the menu based on the level of the user
 AddEntityForm getAddEntityForm()
          the window instance of Edit Entity window
 MyPanel getDesktop()
          the desktop instance
 WebDBService getFormDBLink()
          the window instance of web database source window
 AddPathwayForm getFormEditPathway()
          the window instance of edit pathway window
 AddInteractionForm getFormInteraction()
          the window instance of Edit Interaction window
 RefService getFormReference()
          the window instance of reference service window
 NameService getFormSynonym()
          the window instance of name service window
static MainWindow2 getMainWindow2()
          get the current main window instance
static PathwayEditor getPathwayEditor()
           
static java.sql.Statement getStatement()
           
static boolean isInPlatform()
           
 void keyPressed(java.awt.event.KeyEvent e)
          perform the press event
 void keyReleased(java.awt.event.KeyEvent e)
          perform the release event
 void keyTyped(java.awt.event.KeyEvent e)
           
static void main(java.lang.String[] args)
          main function of the whole program
static void obtainWriteLock()
          obtain the write lock
 void openSelectedTabs()
          the EXPERT USER request that when the program start up, all useful windows should be opened already
static void releaseWriteLock()
          release the write lock
static void setInPlatform(boolean inPlatform)
           
 
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update
 
Methods inherited from class java.awt.Frame
addNotify, finalize, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setAlwaysOnTop, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationByPlatform, setLocationRelativeTo, show, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Field Detail

logger

static org.apache.log4j.Logger logger
log4j facility


splash

public static Splash splash
splash window instance


pathwayEditor

public static PathwayEditor pathwayEditor
pathway editor window instance


addInteractionForm

public static AddInteractionForm addInteractionForm
interaction editor window instance


addEntityForm

public static AddEntityForm addEntityForm
entitywithlocation editor window instance


formEditPathway

public static AddPathwayForm formEditPathway
pathway basic property editor window instance


formSynonym

public static NameService formSynonym
synonym and abbreviation editor window instance


formDBLink

public static WebDBService formDBLink
external database link editor window instance


formReference

public static RefService formReference
reference and comment editor window instance


helpWindow

public static HelpWindow helpWindow
help information window instance


formEditAbbreviationRule

public static AbbreviationRules formEditAbbreviationRule
abbreivation rule editor window instance


formGenerateSynonym

public static SynonymCandidate formGenerateSynonym
synonym candidate approval editor window instance


statement

public static java.sql.Statement statement
SQL statement instance


myself

static MainWindow2 myself
this main window instance


inPlatform

static boolean inPlatform
if current running in MetNet platform


resource

public static java.util.Properties resource
external user prefenrece, will be overriden by preference xml file


sessionUsername

public static java.lang.String sessionUsername
user name to login


sessionOrganism

public static java.util.Collection sessionOrganism
organism that the curator can edit


sessionUserLevel

public static int sessionUserLevel
user level: 0 - guest, browse only, 1 - normal, browse only, 2 - expert user, can edit all data, 3 - administrator, can edit all data.


windowList

public static java.util.Stack windowList
store the visited window history list


defaultTheme

static javax.swing.plaf.metal.MetalTheme defaultTheme
default look and feel theme

Constructor Detail

MainWindow2

public MainWindow2()
Creates new form MainWindow2


MainWindow2

public MainWindow2(java.lang.String guest)
automatically login

Parameters:
guest - not used
Method Detail

componentAdded

public void componentAdded(java.awt.event.ContainerEvent e)
perform the component add event

Specified by:
componentAdded in interface java.awt.event.ContainerListener

componentRemoved

public void componentRemoved(java.awt.event.ContainerEvent e)
perform the component remove event

Specified by:
componentRemoved in interface java.awt.event.ContainerListener

keyPressed

public void keyPressed(java.awt.event.KeyEvent e)
perform the press event

Specified by:
keyPressed in interface java.awt.event.KeyListener

keyReleased

public void keyReleased(java.awt.event.KeyEvent e)
perform the release event

Specified by:
keyReleased in interface java.awt.event.KeyListener

keyTyped

public void keyTyped(java.awt.event.KeyEvent e)
Specified by:
keyTyped in interface java.awt.event.KeyListener

getMainWindow2

public static MainWindow2 getMainWindow2()
get the current main window instance

Returns:
the instance of the main window

getDesktop

public MyPanel getDesktop()
the desktop instance

Returns:
the desktop instance

getAddEntityForm

public AddEntityForm getAddEntityForm()
the window instance of Edit Entity window

Returns:
append another row data from another result set

getPathwayEditor

public static PathwayEditor getPathwayEditor()

getFormInteraction

public AddInteractionForm getFormInteraction()
the window instance of Edit Interaction window

Returns:
the window instance of Edit Interaction window

enableMenu

public void enableMenu()
change the enable / diable status of the menu based on the level of the user


getFormReference

public RefService getFormReference()
the window instance of reference service window

Returns:
the window instance of reference service window

getFormEditPathway

public AddPathwayForm getFormEditPathway()
the window instance of edit pathway window

Returns:
the window instance of edit pathway window

getFormDBLink

public WebDBService getFormDBLink()
the window instance of web database source window

Returns:
the window instance of web database source window

getFormSynonym

public NameService getFormSynonym()
the window instance of name service window

Returns:
the window instance of name service window

openSelectedTabs

public void openSelectedTabs()
the EXPERT USER request that when the program start up, all useful windows should be opened already


main

public static void main(java.lang.String[] args)
main function of the whole program

Parameters:
args - the command line arguments

connectMySQL

public static boolean connectMySQL()
compose the password for the database accession

Returns:
true if successfully connected to the database, false if not

getStatement

public static java.sql.Statement getStatement()
Returns:
the statement

obtainWriteLock

public static void obtainWriteLock()
                            throws java.sql.SQLException
obtain the write lock

Throws:
java.sql.SQLException - any SQL exception

releaseWriteLock

public static void releaseWriteLock()
                             throws java.sql.SQLException
release the write lock

Throws:
java.sql.SQLException - any SQL exception

isInPlatform

public static boolean isInPlatform()
Returns:
the isInPlatform

setInPlatform

public static void setInPlatform(boolean inPlatform)
Parameters:
inPlatform - the isInPlatform to set