Package PamView.paneloverlay.overlaymark
Class MarkRelationships
java.lang.Object
PamView.paneloverlay.overlaymark.MarkRelationships
- All Implemented Interfaces:
PamSettings
,SettingsNameProvider
Singleton class to handle mark relationships.
- Author:
- dg50
-
Method Summary
Modifier and TypeMethodDescriptionstatic MarkRelationships
Get a single instance of the class that handles ALL relationships between the markers and the marked.boolean
getRelationship
(OverlayMarker overlayMarker, OverlayMarkObserver markObserver) Get a link between a marker and an observer.long
getSwingMenuItem
(JFrame swingFrame) boolean
restoreSettings
(PamControlledUnitSettings pamControlledUnitSettings) void
setRelationship
(OverlayMarker overlayMarker, OverlayMarkObserver markObserver, boolean linked) Set a link between a marker and an observerint
subcribeToMarkers
(OverlayMarkObserver markObserver) Subscribe an observer to all things which might mark it.int
Subscribe all markers to all observers.int
subscribeObservers
(OverlayMarker overlayMarker) Subscribe observers to a single marker.
-
Method Details
-
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 markermarkObserver
- mark observerlinked
- linked true or false
-
getRelationship
Get a link between a marker and an observer.- Parameters:
markerName
- Overlay MarkerobserverName
- Mark Observer- Returns:
- linked true of false
-
getUnitName
- Specified by:
getUnitName
in interfaceSettingsNameProvider
- Returns:
- A Name specific to this instance of the particular class, e.g. Sperm whale detector, Beaked whale detector, etc.
-
getUnitType
- Specified by:
getUnitType
in interfacePamSettings
- Returns:
- A Name specific to the type, e.g. Click detector
-
getSettingsReference
- Specified by:
getSettingsReference
in interfacePamSettings
- Returns:
- The serialisable object that will be stored
-
getSettingsVersion
public long getSettingsVersion()- Specified by:
getSettingsVersion
in interfacePamSettings
- Returns:
- An integer version number for the settings
-
restoreSettings
- Specified by:
restoreSettings
in interfacePamSettings
- 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
Subscribe observers to a single marker.- Parameters:
overlayMarker
- Overlay marker (source of marks)- Returns:
- number of observers.
-
subcribeToMarkers
Subscribe an observer to all things which might mark it.- Parameters:
markObserver
- Mark Observer- Returns:
- number of markers marking this observer.
-
getSwingMenuItem
- Returns:
- a Java Swing menu item or setting mark relationship options.
-
getMarkRelationshipsData
- Returns:
- the markRelationshipsData
-