Package PamView.panel

Class SplitPanePositioner

java.lang.Object
PamView.panel.SplitPanePositioner
All Implemented Interfaces:
PamSettings, SettingsNameProvider

public class SplitPanePositioner extends Object implements PamSettings
Class that will remember and reset the position of a split pane. Any split pane. Just call this constructor with a unique name and the splitPane and a default between 0 and 1 and it will register itself automatically with PamSettings.
Author:
dg50
  • Constructor Details

    • SplitPanePositioner

      public SplitPanePositioner(String unitName, JSplitPane splitPane, double proportionalDefault)
      Constructor for split pane positioner. Just call this constructor for each split pane, then forget about it. This will have been registered with PamSettings and will handle everything, restoring the split pane position when PAMGuard is restarted.
      Parameters:
      unitName - A unique name for the split pane.
      splitPane - reference to an existing split pane.
      proportionalDefault - default position (0 invalid input: '<' position invalid input: '<' 1).
  • Method Details

    • getUnitName

      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

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

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

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

      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