Class MarkRelationships

java.lang.Object
PamView.paneloverlay.overlaymark.MarkRelationships
All Implemented Interfaces:
PamSettings, SettingsNameProvider

public class MarkRelationships extends Object implements PamSettings
Singleton class to handle mark relationships.
Author:
dg50
  • Method Details

    • getInstance

      public static MarkRelationships getInstance()
      Get a single instance of the class that handles ALL relationships between the markers and the marked.
      Returns:
      singleton mark relationships manager.
    • setRelationship

      public void setRelationship(OverlayMarker overlayMarker, OverlayMarkObserver markObserver, boolean linked)
      Set a link between a marker and an observer
      Parameters:
      overlayMarker - overlay marker
      markObserver - mark observer
      linked - linked true or false
    • getRelationship

      public boolean getRelationship(OverlayMarker overlayMarker, OverlayMarkObserver markObserver)
      Get a link between a marker and an observer.
      Parameters:
      markerName - Overlay Marker
      observerName - Mark Observer
      Returns:
      linked true of false
    • 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
    • subscribeAllMarkers

      public int subscribeAllMarkers()
      Subscribe all markers to all observers.
      Returns:
      number of subsribed observers
    • subscribeObservers

      public int subscribeObservers(OverlayMarker overlayMarker)
      Subscribe observers to a single marker.
      Parameters:
      overlayMarker - Overlay marker (source of marks)
      Returns:
      number of observers.
    • subcribeToMarkers

      public int subcribeToMarkers(OverlayMarkObserver markObserver)
      Subscribe an observer to all things which might mark it.
      Parameters:
      markObserver - Mark Observer
      Returns:
      number of markers marking this observer.
    • getSwingMenuItem

      public JMenuItem getSwingMenuItem(JFrame swingFrame)
      Returns:
      a Java Swing menu item or setting mark relationship options.
    • getMarkRelationshipsData

      public MarkRelationshipsData getMarkRelationshipsData()
      Returns:
      the markRelationshipsData