Package PamView

Class PamGui

All Implemented Interfaces:
WindowListener, EventListener, PamSettings, SettingsNameProvider, PamViewInterface

public class PamGui extends PamView implements WindowListener, PamSettings
Author:
Doug Gillespie

Simple PamGui implementing a tab control.

  • Constructor Details Link icon

    • PamGui Link icon

      public PamGui(PamController pamControllerInterface, PamModel pamModelInterface, int frameNumber)
  • Method Details Link icon

    • isSomethingShowing Link icon

      public static boolean isSomethingShowing()
      Static flag to say that at least one GUI has opened.
      Returns:
      true when one or more GUI frames are visible.
    • addControlledUnit Link icon

      public void addControlledUnit(PamControlledUnit unit)
      Description copied from interface: PamViewInterface
      Called whenever a pamcontrolled unit is added ot the model.
      Specified by:
      addControlledUnit in interface PamViewInterface
      Parameters:
      unit - - the added controlled unit.
    • setTitle Link icon

      public void setTitle(String title)
      Specified by:
      setTitle in interface PamViewInterface
    • removeControlledUnit Link icon

      public void removeControlledUnit(PamControlledUnit unit)
      Description copied from interface: PamViewInterface
      Called whenever a controlled unit is removed.
      Specified by:
      removeControlledUnit in interface PamViewInterface
    • renameControlledUnit Link icon

      public void renameControlledUnit(PamControlledUnit unit)
      Specified by:
      renameControlledUnit in class PamView
    • findControlledUnit Link icon

      public PamControlledUnit findControlledUnit(int tabNo)
    • ShowTabSpecificSettings Link icon

      public void ShowTabSpecificSettings()
      Set up specific settings for the tab - get's called quite a lot, including whenever modules are added or removed in order to make sure that menus contain the correct options for existing modules.
    • makeGuiMenu Link icon

      public JMenuBar makeGuiMenu()
    • openURL Link icon

      public static void openURL(String urlString)
    • pamEnded Link icon

      public void pamEnded()
      Specified by:
      pamEnded in interface PamViewInterface
    • pamStarted Link icon

      public void pamStarted()
      Specified by:
      pamStarted in interface PamViewInterface
    • modelChanged Link icon

      public void modelChanged(int changeType)
      Specified by:
      modelChanged in interface PamViewInterface
    • setTabsSize Link icon

      public int setTabsSize(Dimension dimension)
      Set all tab sizes to a new dimension
      Parameters:
      dimension - - the new tab size to set.
      font - - the tab font to set.
    • setTabFont Link icon

      public void setTabFont(Font font)
      Set font for the main tab panel.
      Parameters:
      font - - the font to set.
    • windowActivated Link icon

      public void windowActivated(WindowEvent e)
      Implementation of WindowListener
      Specified by:
      windowActivated in interface WindowListener
    • windowClosing Link icon

      public void windowClosing(WindowEvent e)
      Specified by:
      windowClosing in interface WindowListener
    • windowOpened Link icon

      public void windowOpened(WindowEvent e)
      Specified by:
      windowOpened in interface WindowListener
    • windowIconified Link icon

      public void windowIconified(WindowEvent e)
      Specified by:
      windowIconified in interface WindowListener
    • windowDeiconified Link icon

      public void windowDeiconified(WindowEvent e)
      Specified by:
      windowDeiconified in interface WindowListener
    • windowDeactivated Link icon

      public void windowDeactivated(WindowEvent e)
      Specified by:
      windowDeactivated in interface WindowListener
    • windowClosed Link icon

      public void windowClosed(WindowEvent e)
      Specified by:
      windowClosed in interface WindowListener
    • showDialog Link icon

      public void showDialog(String s1, String s2, int dialogType)
    • showControlledUnit Link icon

      public void showControlledUnit(PamControlledUnit pamControlledUnit)
      Description copied from class: PamView
      tells the view to show the main display panel of a pamControlledUnit
      Specified by:
      showControlledUnit in interface PamViewInterface
      Specified by:
      showControlledUnit in class PamView
      Parameters:
      pamControlledUnit - -the controlled unit to show.
    • getViewName Link icon

      public String getViewName()
      Specified by:
      getViewName in class PamView
    • getSettingsReference Link icon

      public Serializable getSettingsReference()
      Specified by:
      getSettingsReference in interface PamSettings
      Returns:
      The serialisable object that will be stored
    • getSettingsVersion Link icon

      public long getSettingsVersion()
      Specified by:
      getSettingsVersion in interface PamSettings
      Returns:
      An integer version number for the settings
    • getUnitName Link icon

      public String getUnitName()
      Specified by:
      getUnitName in interface SettingsNameProvider
      Returns:
      A Name specific to this instance of the particular class, e.g. Sperm whale detector, Beaked whale detector, etc.
    • getUnitType Link icon

      public String getUnitType()
      Specified by:
      getUnitType in interface PamSettings
      Returns:
      A Name specific to the type, e.g. Click detector
    • restoreSettings Link icon

      public boolean restoreSettings(PamControlledUnitSettings pamControlledUnitSettings)
      Specified by:
      restoreSettings in interface PamSettings
      Returns:
      true if successful The object performs final checks (if needed) and then casts the settings data pamcontrolledunitSettings.settings into the correct type and uses as required
    • getMainTab Link icon

      public PamTabbedPane getMainTab()
    • enableGUIControl Link icon

      public void enableGUIControl(boolean enable)
      Description copied from interface: PamViewInterface
      Enable and disable the entire GUI.
      Specified by:
      enableGUIControl in interface PamViewInterface
      Parameters:
      enable - - true to enable the GUI/
    • packFrame Link icon

      public static void packFrame(JComponent component)
      find the frame owning the given component and pack it.
      Parameters:
      component -
    • toggleFullScreen Link icon

      public void toggleFullScreen()
      Toggle between full screen and not full screen.
    • setToolBarVisible Link icon

      public void setToolBarVisible(boolean useToolBar)
      Set whether the top toolbar (with the record/viewer play buttons) is visible or not
      Parameters:
      useToolBar - - true to have it visible (default)
    • getMainPanel Link icon

      public JPanel getMainPanel()
      Get the main panel, this contains all components within the frame.
      Returns:
      the main panel.
    • getSidePanel Link icon

      public HidingSidePanel getSidePanel()
      Get the side panel. This holds all the side pane.s
      Returns:
      the side panel.
    • getTabbedPane Link icon

      public PamTabbedPane getTabbedPane()
      Get the main tab pane.
      Returns:
      the tab pane.
    • findComponentWindow Link icon

      public static Window findComponentWindow(JComponent component)
      find a parent window for a JComponent. This can be useful in finding windows to open child dialogs when the object holding the component may not have a direct reference back to it's dialog.
      Parameters:
      component - any Swing component
      Returns:
      parent Window (or frame) if it can be found