Package pamScrollSystem.coupling
Class ScrollerCoupling
java.lang.Object
pamScrollSystem.coupling.ScrollerCoupling
- All Implemented Interfaces:
PamSettings
,SettingsNameProvider
A class for coupling two or more scrollers.
Coupled scrollers will move together - when one moves, the others move.
- Author:
- Doug Gillespie
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addScroller
(AbstractPamScroller aScroller) Add a new scroller to the couplingvoid
centreTime
(AbstractPamScroller hostScroller, long mouseTime) Centre other displays at this mouse time ...getName()
List<javafx.scene.control.MenuItem>
getPopupMenuItems
(AbstractPamScroller hostScroller, OverlayMark overlayMark, Long mouseTime) Get a list of menu commands that can be inserted into a popup menu when a display is clicked, which may or may not have an overlay mark on it.int
long
getSwingOptionsMenu
(Window frame) void
notifyOthers
(AbstractPamScroller scroller) Notify other scrollers in the set that a scroller has changed then pass them a reference to the changed scroller so that they can copy information from it.boolean
removeScroller
(AbstractPamScroller aScroller) Remove a scroller form a couplingboolean
restoreSettings
(PamControlledUnitSettings pamControlledUnitSettings) void
startTime
(AbstractPamScroller hostScroller, long mouseTime) Start other displays at this mouse time ...
-
Constructor Details
-
ScrollerCoupling
-
-
Method Details
-
getCouplingParams
-
getName
-
getSwingOptionsMenu
-
addScroller
Add a new scroller to the coupling- Parameters:
aScroller
-
-
notifyOthers
Notify other scrollers in the set that a scroller has changed then pass them a reference to the changed scroller so that they can copy information from it.This function holds a lock since as soon as another scroller is changed, it's likely to call back to this same function and set up an infinite loop. The lock will exit the function if set to avoid this situation.
- Parameters:
scroller
- scroller which changes.
-
removeScroller
Remove a scroller form a coupling- Parameters:
aScroller
-- Returns:
- true if the scroller wwas present.
-
getScrollerCount
public int getScrollerCount() -
getPopupMenuItems
public List<javafx.scene.control.MenuItem> getPopupMenuItems(AbstractPamScroller hostScroller, OverlayMark overlayMark, Long mouseTime) Get a list of menu commands that can be inserted into a popup menu when a display is clicked, which may or may not have an overlay mark on it. If overlayMark and mouseTime are both null, null will be returned- Parameters:
overlayMark
- Overlay mark, may be null;mouseTime
- Mouse time in milliseconds, can also be null- Returns:
- popup menu item list.
-
centreTime
Centre other displays at this mouse time ...- Parameters:
hostScroller
-mouseTime
-
-
startTime
Start other displays at this mouse time ...- Parameters:
hostScroller
-mouseTime
-
-
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
-