Class JaxoMainPanel

All Implemented Interfaces:
ActionListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, RootPaneContainer, WindowConstants, JaxoCommunicator, JaxoLocalized

public final class JaxoMainPanel extends JFrame implements JaxoCommunicator, JaxoLocalized
The main panel. Holds the menu bar, the button panel, the flag panel, the canvas panel, the tool bar and the grid bar. Responsible for the interaction between those components.
Since:
2.0
See Also:
  • Constructor Details

    • JaxoMainPanel

      public JaxoMainPanel()
      The initialisation method of the panel: sets up the menus, the button panels, the flag panel and the canvas. Start by showing one tab with an empty graph.
    • JaxoMainPanel

      public JaxoMainPanel(String[] inputFileNames)
      The initialisation method of the panel: sets up the menus, the button panels, the flag panel and the canvas. Start by showing one tab with an empty graph.
      Parameters:
      inputFileNames - inputFileNames Array of file names to be opened at startup. May be null.
      Since:
      2.1
  • Method Details

    • distributePropertyChange

      public void distributePropertyChange(String name, Object oldValue, Object newValue)
      Distributes a property change to all sub-panels.
      Specified by:
      distributePropertyChange in interface JaxoCommunicator
      Parameters:
      name - the name of the property. Not null.
      oldValue - the old value of the property.
      newValue - the new value of the property.
    • distributePropertyChange

      public void distributePropertyChange(String name, boolean oldValue, boolean newValue)
      Distributes a property change to all sub-panels.
      Specified by:
      distributePropertyChange in interface JaxoCommunicator
      Parameters:
      name - the name of the property. Not null.
      oldValue - the old value of the property.
      newValue - the new value of the property.
    • distributePropertyChange

      public void distributePropertyChange(String name, int oldValue, int newValue)
      Distributes a property change to all sub-panels.
      Specified by:
      distributePropertyChange in interface JaxoCommunicator
      Parameters:
      name - the name of the property. Not null.
      oldValue - the old value of the property.
      newValue - the new value of the property.
    • updateLanguage

      public void updateLanguage()
      Updates the component with the current language as set in the preferences (JaxoPrefs.PREF_LANGUAGE).
      Specified by:
      updateLanguage in interface JaxoLocalized
    • actionPerformed

      public void actionPerformed(ActionEvent evt)
      Performs an action in reply to an action event on either the menu bar, tool bar, grid bar, tabbed canvas panel or button panel. NOTE: This should be the central method where all input events (except drawing events on the Canvas) should be processed. The MainPanel is the only component that has direct access to all sub-components, and therefore it's easiest to trigger identical events from different input sources.

      This method throws an Exception if the source of the ActionEvent is not a Component.

      Specified by:
      actionPerformed in interface ActionListener
      Parameters:
      evt - The action event that triggers an action. The ActionCommand of the event has to be an integer, encapsulated as a String, that identifies the event according to the modes in JaxoConstants.
    • shutdown

      public void shutdown(int exitStatus)
      Dispose the main frame and call JaxoLauncher.shutdown(exitStatus).
      Specified by:
      shutdown in interface JaxoCommunicator
      Parameters:
      exitStatus - The exit status code.