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
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionvoidaddScroller(AbstractPamScroller aScroller) Add a new scroller to the couplingvoidcentreTime(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.intlonggetSwingOptionsMenu(Window frame) voidnotifyOthers(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.booleanremoveScroller(AbstractPamScroller aScroller) Remove a scroller form a couplingbooleanrestoreSettings(PamControlledUnitSettings pamControlledUnitSettings) voidstartTime(AbstractPamScroller hostScroller, long mouseTime) Start other displays at this mouse time ...protected voidzoomToRange(AbstractPamScroller hostScroller, double[] markRange)  
- 
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.
 
 - 
zoomToRange
 - 
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:
 getUnitNamein interfaceSettingsNameProvider- Returns:
 - A Name specific to this instance of the particular class, e.g. Sperm whale detector, Beaked whale detector, etc.
 
 - 
getUnitType
- Specified by:
 getUnitTypein interfacePamSettings- Returns:
 - A Name specific to the type, e.g. Click detector
 
 - 
getSettingsReference
- Specified by:
 getSettingsReferencein interfacePamSettings- Returns:
 - The serialisable object that will be stored
 
 - 
getSettingsVersion
public long getSettingsVersion()- Specified by:
 getSettingsVersionin interfacePamSettings- Returns:
 - An integer version number for the settings
 
 - 
restoreSettings
- Specified by:
 restoreSettingsin interfacePamSettings- Parameters:
 pamControlledUnitSettings-- 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
 
 
 -