public abstract class AbstractScrollManager
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
void |
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.
|
abstract void |
centreDataAt(PamDataBlock dataBlock,
long menuMouseTime)
Centre all data in all data blocks at the given time
|
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.
|
abstract long |
checkMaximumTime(long requestedTime)
Check the maximum time requested by a scroll bar doesn't go beyond the end of the data
|
abstract long |
checkMinimumTime(long requestedTime)
Check the minimum time requested by a scroll bar doesn't go below the start of the data
|
ScrollerCoupling |
coupleScroller(AbstractPamScroller abstractPamScroller,
java.lang.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.
|
static AbstractScrollManager |
getScrollManager() |
javax.swing.JPopupMenu |
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.
|
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 time
|
void |
uncoupleScroller(AbstractPamScroller abstractPamScroller)
Uncouple a scroller.
|
public static AbstractScrollManager getScrollManager()
public void addPamScroller(AbstractPamScroller abstractPamScroller)
abstractPamScroller
- scroller to addpublic void removePamScroller(AbstractPamScroller abstractPamScroller)
abstractPamScroller
- scroller to removepublic abstract void moveInnerScroller(AbstractPamScroller scroller, long newValue)
scroller
- scroller that movednewValue
- new value (time in milliseconds).public abstract void moveOuterScroller(AbstractPamScroller scroller, long newMin, long newMax)
scroller
- scroller that changednewMin
- new data min value in millisnewMax
- new data max value in millispublic abstract long checkMaximumTime(long requestedTime)
requestedTime
- requested time in millis.public abstract long checkMinimumTime(long requestedTime)
requestedTimerequested
- time in millis.public abstract void notifyModelChanged(int changeType)
public abstract void centreDataAt(PamDataBlock dataBlock, long menuMouseTime)
menuMouseTime
- time in millisecondspublic abstract void startDataAt(PamDataBlock dataBlock, long menuMouseTime, boolean immediateLoad)
dataBlock
- menuMouseTime
- time in millisecondsimmediateLoad
- load data immediately in current thread. Don't re-schedule for later.public final void startDataAt(PamDataBlock dataBlock, long menuMouseTime)
public ScrollerCoupling coupleScroller(AbstractPamScroller abstractPamScroller, java.lang.String couplingName)
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.
abstractPamScroller
- scroller to couplecouplingName
- coupling namepublic void uncoupleScroller(AbstractPamScroller abstractPamScroller)
abstractPamScroller
- scroller to uncouplepublic abstract void reLoad()
public void moveAllScrollersTo(long minTime, long maxTime)
minTime
- maxTime
- public int isInGap(PamDataBlock dataBlock, long timeMillis)
dataBlock
- Pamguard data blocktimeMillis
- time in millisecondspublic abstract long checkGapPos(AbstractPamScroller abstractPamScroller, long oldMin, long oldMax, long newMin, long newMax, int direction)
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.public boolean isInSpecialList(PamDataBlock pamDataBlock)
pamDataBlock
- public void removeFromSpecialDatablock(PamDataBlock pamDataBlock)
pamDataBlock
- public void addToSpecialDatablock(PamDataBlock pamDataBlock)
pamDataBlock
- public javax.swing.JPopupMenu getStandardOptionsMenu(AbstractPamScroller pamScroller)