jgnash.ui
Class MainFrame

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 jgnash.ui.MainFrame
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants, MessageListener

public class MainFrame
extends javax.swing.JFrame
implements MessageListener, java.awt.event.ActionListener

The JFrame for the application.

Version:
$Id$
Author:
Craig Cavanaugh, Aleksey Trufanov
See Also:
Serialized Form

Nested Class Summary
private  class MainFrame.LogHandler
           
private  class MainFrame.ShutdownAdapter
           
private static class MainFrame.WindowAction
           
 
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.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
private  org.jdesktop.swingx.JXBusyLabel backgroundOperationLabel
           
private  javax.swing.Action editAction
           
private  java.util.concurrent.ScheduledThreadPoolExecutor executor
           
private  ExpandingAccountTablePanel expandingAccountPanel
           
private  javax.swing.Action filterAction
           
private  java.awt.Color infoColor
           
private static java.lang.String JAVASCRIPT_DIR
           
private  java.util.logging.Logger log
           
private  MainFrame.LogHandler logHandler
           
private  MainViewPanel mainView
           
private  java.util.prefs.Preferences pref
           
private  org.jdesktop.jxlayer.plaf.ext.LockableUI primaryWaitBlurUI
           
private  Resource rb
           
private static java.lang.String REGISTER_KEY
           
private static boolean registerFollowsTree
           
private  MainRegisterPanel registerTreePanel
           
private static java.lang.String REGSITER_FOLLOWS_LIST
           
private  javax.swing.JMenu reportMenu
           
private static int SCHEDULED_DELAY
           
private  javax.swing.JTextField statusField
           
private  javax.swing.Action toolAction
           
private  javax.swing.JMenu viewMenu
           
private  WaitMessagePanel waitPanel
           
private  javax.swing.JMenu windowMenu
           
 
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
MainFrame()
          Public constructor
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          
 void addRemoveCurrencies()
           
private  void addViews()
           
private  void addWindowItem(RegisterEvent e)
           
private  MainViewPanel buildMainView()
           
private  void buildUI()
           
 void closeAllWindows()
           
(package private)  void displayStatus(java.lang.String message)
           
 void displayWaitMessage(java.lang.String message)
           
private  void displayWarning(java.lang.String message)
           
(package private)  void dispose(boolean shutDown)
          Dispose the UI with an option to prevent complete program shutdown
static boolean doesRegisterFollowTree()
           
 void importOldJgnash()
           
(package private)  void loadFile(java.io.File file)
           
(package private)  void loadLast()
           
private  void mainViewAction()
           
 void messagePosted(Message event)
           
 void modifyCurrencies()
           
 void newFile()
           
 void openFile()
           
(package private)  void openRemote(java.lang.String host, int port, java.lang.String user, java.lang.String password)
           
private  void registerLogHandler(java.lang.Class<?> clazz)
           
private  void removeViews()
           
private  void removeWindowItem(RegisterEvent e)
           
 void runJavaScript()
           
 void setNetworkBusy(boolean busy)
           
private  void setOpenState(boolean state)
           
static void setRegisterFollowsTree(boolean follow)
           
 void showAboutDialog()
           
 void showAccountListFilter()
           
 void showAccountRegisterReport()
           
 void showBalanceSheetReport()
           
 void showCommodityHistoryDialog()
           
 void showCommodityHistoryImportDialog()
           
 void showCommodityModifyDialog()
           
 void showConsoleWindow()
           
 void showCurrencyExchangeDialog()
           
 void showDefaultCurrencyDialog()
           
 void showDefaultLocaleDialog()
           
 void showDesignChecksDialog()
           
 void showIncomeExpenseChart()
           
 void showMonthBalanceCSV()
           
 void showMonthlyAccountBalanceChart()
           
 void showNetWorthReport()
           
 void showOptionsDialog()
           
 void showPayeePieChart()
           
 void showPrintChecksDialog()
           
 void showProfitLossReport()
           
 void showProfitLossTXTReport()
           
 void showRecurringDialog()
           
 void showRegisterFilter()
           
 void showRunningAccountBalanceChart()
           
 void showSecurityHighLowChart()
           
 void shutDown()
           
 void startBackgroundCurrencyUpdate()
           
 void startBackgroundSecurityUpdate()
           
private  void startBackgroundUpdates()
           
 void stopWaitMessage()
           
private  void updateTitle()
           
 
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
 
Methods inherited from class java.awt.Frame
addNotify, 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, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOwnedWindows, getOwner, getOwnerlessWindows, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setVisible, 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, 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, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, 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, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, setBackground, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Field Detail

REGISTER_KEY

private static final java.lang.String REGISTER_KEY
See Also:
Constant Field Values

JAVASCRIPT_DIR

private static final java.lang.String JAVASCRIPT_DIR
See Also:
Constant Field Values

REGSITER_FOLLOWS_LIST

private static final java.lang.String REGSITER_FOLLOWS_LIST
See Also:
Constant Field Values

windowMenu

private javax.swing.JMenu windowMenu

viewMenu

private javax.swing.JMenu viewMenu

reportMenu

private javax.swing.JMenu reportMenu

mainView

private MainViewPanel mainView

pref

private final java.util.prefs.Preferences pref

rb

private final Resource rb

waitPanel

private WaitMessagePanel waitPanel

registerFollowsTree

private static boolean registerFollowsTree

registerTreePanel

private MainRegisterPanel registerTreePanel

editAction

private javax.swing.Action editAction

filterAction

private javax.swing.Action filterAction

toolAction

private javax.swing.Action toolAction

expandingAccountPanel

private ExpandingAccountTablePanel expandingAccountPanel

statusField

private javax.swing.JTextField statusField

log

private final java.util.logging.Logger log

executor

private final java.util.concurrent.ScheduledThreadPoolExecutor executor

SCHEDULED_DELAY

private static final int SCHEDULED_DELAY
See Also:
Constant Field Values

backgroundOperationLabel

private org.jdesktop.swingx.JXBusyLabel backgroundOperationLabel

logHandler

private MainFrame.LogHandler logHandler

infoColor

private java.awt.Color infoColor

primaryWaitBlurUI

private org.jdesktop.jxlayer.plaf.ext.LockableUI primaryWaitBlurUI
Constructor Detail

MainFrame

public MainFrame()
Public constructor

Method Detail

registerLogHandler

private void registerLogHandler(java.lang.Class<?> clazz)

displayWarning

private void displayWarning(java.lang.String message)

displayStatus

final void displayStatus(java.lang.String message)

displayWaitMessage

public void displayWaitMessage(java.lang.String message)

setNetworkBusy

public void setNetworkBusy(boolean busy)

stopWaitMessage

public void stopWaitMessage()

setRegisterFollowsTree

public static void setRegisterFollowsTree(boolean follow)

doesRegisterFollowTree

public static boolean doesRegisterFollowTree()

addRemoveCurrencies

public void addRemoveCurrencies()

buildMainView

private MainViewPanel buildMainView()

addViews

private void addViews()

removeViews

private void removeViews()

buildUI

private void buildUI()

loadLast

void loadLast()

loadFile

void loadFile(java.io.File file)

openRemote

void openRemote(java.lang.String host,
                int port,
                java.lang.String user,
                java.lang.String password)

startBackgroundUpdates

private void startBackgroundUpdates()

startBackgroundSecurityUpdate

public void startBackgroundSecurityUpdate()

startBackgroundCurrencyUpdate

public void startBackgroundCurrencyUpdate()

mainViewAction

private void mainViewAction()

modifyCurrencies

public void modifyCurrencies()

newFile

public void newFile()

openFile

public void openFile()

runJavaScript

public void runJavaScript()

setOpenState

private void setOpenState(boolean state)

updateTitle

private void updateTitle()

showAboutDialog

public void showAboutDialog()

showAccountListFilter

public void showAccountListFilter()

showCommodityHistoryDialog

public void showCommodityHistoryDialog()

showCommodityHistoryImportDialog

public void showCommodityHistoryImportDialog()

showCommodityModifyDialog

public void showCommodityModifyDialog()

showCurrencyExchangeDialog

public void showCurrencyExchangeDialog()

showDefaultCurrencyDialog

public void showDefaultCurrencyDialog()

showDefaultLocaleDialog

public void showDefaultLocaleDialog()

showConsoleWindow

public void showConsoleWindow()

showAccountRegisterReport

public void showAccountRegisterReport()

showBalanceSheetReport

public void showBalanceSheetReport()

showIncomeExpenseChart

public void showIncomeExpenseChart()

showPayeePieChart

public void showPayeePieChart()

showRunningAccountBalanceChart

public void showRunningAccountBalanceChart()

showMonthlyAccountBalanceChart

public void showMonthlyAccountBalanceChart()

showMonthBalanceCSV

public void showMonthBalanceCSV()

showNetWorthReport

public void showNetWorthReport()

showProfitLossReport

public void showProfitLossReport()

showProfitLossTXTReport

public void showProfitLossTXTReport()

showSecurityHighLowChart

public void showSecurityHighLowChart()

showDesignChecksDialog

public void showDesignChecksDialog()

showPrintChecksDialog

public void showPrintChecksDialog()

showOptionsDialog

public void showOptionsDialog()

showRecurringDialog

public void showRecurringDialog()

showRegisterFilter

public void showRegisterFilter()

shutDown

public void shutDown()

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)

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

addWindowItem

private void addWindowItem(RegisterEvent e)

removeWindowItem

private void removeWindowItem(RegisterEvent e)

closeAllWindows

public void closeAllWindows()

messagePosted

public void messagePosted(Message event)
Specified by:
messagePosted in interface MessageListener

importOldJgnash

public void importOldJgnash()

dispose

void dispose(boolean shutDown)
Dispose the UI with an option to prevent complete program shutdown

Parameters:
shutDown - true if UI should be shutdown when dispose is called