Package pamScrollSystem
Class AbstractScrollManager
java.lang.Object
pamScrollSystem.AbstractScrollManager
- Direct Known Subclasses:
RealTimeScrollManager
,ViewerScrollerManager
-
Nested Class Summary
Modifier and TypeClassDescriptionclass
Holds a reference to a data block and some extra information on how that data block should be loaded. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addPamScroller
(AbstractPamScroller abstractPamScroller) Add a new scroller to the managed list.void
addToSpecialDatablock
(PamDataBlock pamDataBlock) Add a data block to the special data block list.void
addToSpecialDatablock
(PamDataBlock pamDataBlock, long timeBefore, long timeAfter) Add a data block to the special data block list.abstract void
centreDataAt
(PamDataBlock dataBlock, long menuMouseTime) Centre all data in all data blocks at the given timeabstract long
checkGapPos
(AbstractPamScroller abstractPamScroller, long oldMin, long oldMax, long newMin, long newMax, int direction) Check to see whether or not we are scrolling into a data gap.abstract long
checkMaximumTime
(long requestedTime) Check the maximum time requested by a scroll bar doesn't go beyond the end of the dataabstract long
checkMinimumTime
(long requestedTime) Check the minimum time requested by a scroll bar doesn't go below the start of the datacoupleScroller
(AbstractPamScroller abstractPamScroller, String couplingName) Couple a scroller to another scroller so that both have exactly the same behaviour, load the same data period, move their scrolls together, etc.findCoupling
(String name, boolean autoCreate) Find a scroller coupling with a given namefindScroller
(String scrollerName) Find a scroller with a given name.static AbstractScrollManager
long[]
getSpecialLoadTimes
(PamDataBlock pamDataBlock, long minimumMillis, long maximumMillis) Get the load times for a special data block based on current load times.getStandardOptionsMenu
(AbstractPamScroller pamScroller) int
isInGap
(PamDataBlock dataBlock, long timeMillis) Work out whether or not a particular time falls in the gap between points in a datamap .boolean
isInSpecialList
(PamDataBlock pamDataBlock) Check if a data block is within the special data block list.void
moveAllScrollersTo
(long minTime, long maxTime) Force all the scroller to move so that they bracket minTime -> maxTime.abstract void
moveInnerScroller
(AbstractPamScroller scroller, long newValue) Move the scroll bar component of a scroller.abstract void
moveOuterScroller
(AbstractPamScroller scroller, long newMin, long newMax) Move the data load component of a scroller.abstract void
notifyModelChanged
(int changeType) abstract void
reLoad()
Command telling manager to reload it's data.void
removeFromSpecialDatablock
(PamDataBlock pamDataBlock) Remove from special data block list.void
removePamScroller
(AbstractPamScroller abstractPamScroller) Remove a pam scroller from the managed list.final void
startDataAt
(PamDataBlock dataBlock, long menuMouseTime) abstract void
startDataAt
(PamDataBlock dataBlock, long menuMouseTime, boolean immediateLoad) Start all data in all data blocks at the given timevoid
uncoupleScroller
(AbstractPamScroller abstractPamScroller) Uncouple a scroller.
-
Method Details
-
getScrollManager
-
addPamScroller
Add a new scroller to the managed list.- Parameters:
abstractPamScroller
- scroller to add
-
removePamScroller
Remove a pam scroller from the managed list.- Parameters:
abstractPamScroller
- scroller to remove
-
moveInnerScroller
Move the scroll bar component of a scroller. This should not cause the reloading of any data, but other scroll bars should be notified of any changes.- Parameters:
scroller
- scroller that movednewValue
- new value (time in milliseconds).
-
moveOuterScroller
Move the data load component of a scroller. This should cause data to be reloaded and will need to notify all other scrollers incase they also need to shuffle along a bit.- Parameters:
scroller
- scroller that changednewMin
- new data min value in millisnewMax
- new data max value in millis
-
checkMaximumTime
public abstract long checkMaximumTime(long requestedTime) Check the maximum time requested by a scroll bar doesn't go beyond the end of the data- Parameters:
requestedTime
- requested time in millis.- Returns:
- the minimum of the requested time and the actual end time of the data
-
checkMinimumTime
public abstract long checkMinimumTime(long requestedTime) Check the minimum time requested by a scroll bar doesn't go below the start of the data- Parameters:
requestedTimerequested
- time in millis.- Returns:
- the maximum of the requested time and the actual start time of the data
-
notifyModelChanged
public abstract void notifyModelChanged(int changeType) -
centreDataAt
Centre all data in all data blocks at the given time- Parameters:
menuMouseTime
- time in milliseconds
-
startDataAt
Start all data in all data blocks at the given time- Parameters:
dataBlock
-menuMouseTime
- time in millisecondsimmediateLoad
- load data immediately in current thread. Don't re-schedule for later.
-
startDataAt
-
coupleScroller
public ScrollerCoupling coupleScroller(AbstractPamScroller abstractPamScroller, String couplingName) Couple a scroller to another scroller so that both have exactly the same behaviour, load the same data period, move their scrolls together, etc.Scollers are coupled by name so that they don't necessarily need to find references to each other in the code. These names can be anything by measures should be taken to ensure that they are going to be unique, for example by using module names as part of the coupling name.
- Parameters:
abstractPamScroller
- scroller to couplecouplingName
- coupling name- Returns:
- reference to the coupler
-
uncoupleScroller
Uncouple a scroller.- Parameters:
abstractPamScroller
- scroller to uncouple
-
findCoupling
Find a scroller coupling with a given name- Parameters:
name
- name of couplingautoCreate
- flag to automatically create a coupling if one isn't found.- Returns:
- the scroller coupling or null if none was found and the autoCreate flag was false.
-
reLoad
public abstract void reLoad()Command telling manager to reload it's data. -
moveAllScrollersTo
public void moveAllScrollersTo(long minTime, long maxTime) Force all the scroller to move so that they bracket minTime -> maxTime. This is used for modules which don't have their own scroller.- Parameters:
minTime
-maxTime
-
-
isInGap
Work out whether or not a particular time falls in the gap between points in a datamap .- Parameters:
dataBlock
- Pamguard data blocktimeMillis
- time in milliseconds- Returns:
- true if the data are in a gap.
-
checkGapPos
public abstract long checkGapPos(AbstractPamScroller abstractPamScroller, long oldMin, long oldMax, long newMin, long newMax, int direction) Check to see whether or not we are scrolling into a data gap. Rules exist for stopping / starting / jumping over gaps depending on the current state and the new position of the scroller.- Parameters:
abstractPamScroller
- PamScroller that movedoldMin
- old minimum timeoldMax
- old maximum timenewMin
- new minimum timenewMax
- new maximum timedirection
- direction of scroll +1 = forward, -1 = backward, 0 = plonked down by mouse on datamap.- Returns:
- new minimum position. Calling function must then work out the new maximum position.
-
isInSpecialList
Check if a data block is within the special data block list.- Parameters:
pamDataBlock
-- Returns:
- true if the datablock is in the list.
-
removeFromSpecialDatablock
Remove from special data block list.- Parameters:
pamDataBlock
-
-
addToSpecialDatablock
Add a data block to the special data block list. The special block list always get's loaded in viewer even if it's not displaying. this is used for any super detection datablocks, so that if their sub detections ARE displaying, then their supers are also available.- Parameters:
pamDataBlock
-
-
addToSpecialDatablock
Add a data block to the special data block list. The special block list always get's loaded in viewer even if it's not displaying. this is used for any super detection datablocks, so that if their sub detections ARE displaying, then their supers are also available.- Parameters:
pamDataBlock
-timeBefore
-timeAfter
-
-
getStandardOptionsMenu
-
getSpecialLoadTimes
public long[] getSpecialLoadTimes(PamDataBlock pamDataBlock, long minimumMillis, long maximumMillis) Get the load times for a special data block based on current load times. Unless specifically set when added to special data block list the default is Long.MIN_VALUE and Long.MAX_VALUE.- Parameters:
minimumMillis
- - the minimum time of a current scroller.maximumMillis
- - the maximum time of a current scroller- Returns:
- the load time of the special data block.
-
getPamScrollers
- Returns:
- the pamScrollers
-
findScroller
Find a scroller with a given name.- Parameters:
scrollerName
-- Returns:
-