Class MainWindow

All Implemented Interfaces:
ImageObserver, MenuContainer, PropertyChangeListener, Serializable, EventListener, Accessible, RootPaneContainer, WindowConstants, ClockListener

public class MainWindow extends JFrame implements PropertyChangeListener, ClockListener
Main window of the Rachota application.
See Also:
  • Field Details

    • mbMenu

      private JMenuBar mbMenu
    • mnAbout

      private JMenuItem mnAbout
    • mnAddNote

      private JMenuItem mnAddNote
    • mnAdjustStart

      private JMenuItem mnAdjustStart
    • mnCopyTask

      private JMenuItem mnCopyTask
    • mnCorrectDuration

      private JMenuItem mnCorrectDuration
    • mnDocs

      private JMenuItem mnDocs
    • mnExit

      private JMenuItem mnExit
    • mnFAQs

      private JMenuItem mnFAQs
    • mnHelp

      private JMenu mnHelp
    • mnMoveTime

      private JMenuItem mnMoveTime
    • mnSettings

      private JMenuItem mnSettings
    • mnSwitchDate

      private JMenuItem mnSwitchDate
    • mnSystem

      private JMenu mnSystem
    • mnTask

      private JMenu mnTask
    • mnTools

      private JMenu mnTools
    • separator

      private JSeparator separator
    • tpViews

      private JTabbedPane tpViews
    • reportingActivity

      private boolean reportingActivity
      Flag to prevent multiple reporting of activity.
    • TAB_DAY_VIEW

      private static final int TAB_DAY_VIEW
      Index of day view tab.
      See Also:
    • TAB_HISTORY_VIEW

      private static final int TAB_HISTORY_VIEW
      Index of history view tab.
      See Also:
    • TAB_ANALYTICS_VIEW

      private static final int TAB_ANALYTICS_VIEW
      Index of analytics view tab.
      See Also:
  • Constructor Details

    • MainWindow

      public MainWindow() throws Exception
      Creates new application main window.
      Throws:
      Exception - Exception thrown when some I/O problems occur while loading settings or diary files.
  • Method Details

    • main

      public static void main(String[] args) throws Exception
      Main method called when application is started.
      Parameters:
      args - Command line arguments passed from operating system.
      Throws:
      Exception - Exception thrown when some I/O problems occur while loading settings or diary files.
    • getFont

      public Font getFont()
      Returns font that should be used for all widgets in this component based on the language preferences specified by user.
      Specified by:
      getFont in interface MenuContainer
      Overrides:
      getFont in class Component
      Returns:
      Font to be used in this component.
    • initComponents

      private void initComponents()
      This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor.
    • formWindowIconified

      private void formWindowIconified(WindowEvent evt)
    • mnSwitchDateActionPerformed

      private void mnSwitchDateActionPerformed(ActionEvent evt)
    • mnMoveTimeActionPerformed

      private void mnMoveTimeActionPerformed(ActionEvent evt)
      Method called when move time action is required.
      Parameters:
      evt - Event that invoked the action.
    • mnCopyTaskActionPerformed

      private void mnCopyTaskActionPerformed(ActionEvent evt)
      Method called when copy task action is required.
      Parameters:
      evt - Event that invoked the action.
    • mnSettingsActionPerformed

      private void mnSettingsActionPerformed(ActionEvent evt)
      Method called when change settings action is required.
      Parameters:
      evt - Event that invoked the action.
    • mnExitActionPerformed

      private void mnExitActionPerformed(ActionEvent evt)
      Method called when exit application action was invoked.
      Parameters:
      evt - Event that invoked the action.
    • mnAboutActionPerformed

      private void mnAboutActionPerformed(ActionEvent evt)
      Method called when information about the application should be displayed.
      Parameters:
      evt - Event that invoked the action.
    • formWindowClosing

      private void formWindowClosing(WindowEvent evt)
      Method called when application should be exited.
      Parameters:
      evt - Event that invoked the action.
    • formComponentShown

      private void formComponentShown(ComponentEvent evt)
    • mnAddNoteActionPerformed

      private void mnAddNoteActionPerformed(ActionEvent evt)
    • mnAdjustStartActionPerformed

      private void mnAdjustStartActionPerformed(ActionEvent evt)
    • formMouseEntered

      private void formMouseEntered(MouseEvent evt)
    • tpViewsMouseEntered

      private void tpViewsMouseEntered(MouseEvent evt)
    • mnCorrectDurationActionPerformed

      private void mnCorrectDurationActionPerformed(ActionEvent evt)
    • mnDocsActionPerformed

      private void mnDocsActionPerformed(ActionEvent evt)
    • mnFAQsActionPerformed

      private void mnFAQsActionPerformed(ActionEvent evt)
    • propertyChange

      public void propertyChange(PropertyChangeEvent evt)
      Method called when some property of task was changed.
      Specified by:
      propertyChange in interface PropertyChangeListener
      Parameters:
      evt - Event describing what was changed.
    • updateSystemTray

      private void updateSystemTray(DayView dayView)
    • getTrayPopupMenu

      private PopupMenu getTrayPopupMenu()
    • createSystemTray

      private void createSystemTray()
    • tick

      public void tick()
      Description copied from interface: ClockListener
      Method called when one clock tick is over.
      Specified by:
      tick in interface ClockListener
    • enableSystemTray

      private boolean enableSystemTray()
      Returns whether system tray icon should be created or not.
      Returns:
      False if Rachota enable.systemtray setting is set to false. True otherwise.
    • checkAnotherInstance

      private static void checkAnotherInstance()
      Checks whether another instance of Rachota is running or Rachota was not exited normally i.e. if this instance could be launched. If there is not a lock file in userdir, startup is approved. If there is the lock file, user is asked to confirm if he really wants to share selected userdir with another instance of Rachota. If s/he agrees, the startup goes on.
    • getMenuItem

      private JMenuItem getMenuItem(String menuName)