public abstract class AbstractPamScroller
extends java.lang.Object
Constructor and Description |
---|
AbstractPamScroller(java.lang.String name,
int orientation,
int stepSizeMillis,
long defaultLoadTime,
boolean hasMenu) |
Modifier and Type | Method and Description |
---|---|
void |
addDataBlock(PamDataBlock dataBlock)
Add a datablock to the list for this scroller.
|
void |
addObserver(PamScrollObserver pamScrollObserver)
Ad an observer that will receive notifications when the
the scroller moves.
|
abstract void |
anotherScrollerMovedInner(long newValue)
Another managed scroller moved it's position
|
void |
anotherScrollerMovedOuter(long newMin,
long newMax)
Another managed scroller moved its outer position - will cause
new data to be loaded.
|
void |
coupledScrollerChanged(AbstractPamScroller scroller)
Called when a scroller which is coupled to this scroller changes
in any way.
|
ScrollerCoupling |
coupleScroller(java.lang.String couplingName)
Couple this scroller to another scroller so that both
have exactly the same behaviour, load the same data period,
move their scrolls together, etc.
|
void |
destroyScroller() |
long |
getDefaultLoadtime() |
long |
getMaximumMillis() |
long |
getMinimumMillis() |
int |
getNumUsedDataBlocks() |
java.util.Vector<PamScrollObserver> |
getObservers() |
int |
getPageStep() |
long |
getRangeMillis() |
ScrollerCoupling |
getScrollerCoupling() |
AbstractScrollManager |
getScrollManager() |
int |
getStepSizeMillis()
stepSizeMillis is the resolution of the scroller in milliseconds.
|
PamDataBlock |
getUsedDataBlock(int iBlock)
Get a specific data block observed by this scroller.
|
abstract long |
getValueMillis() |
boolean |
isDataBlockUsed(PamDataBlock dataBlock)
See if this scroller is using a particular data block
|
boolean |
isInSpecialList(PamDataBlock pamDataBlock)
Check if a data block is within the special data block list.
|
abstract void |
rangesChanged(long setValue)
Called when ranges have been changed and tells
scroller to go to a particular absolute value.
|
void |
reLoad()
Command passed through the the scroll manager telling it reload data.
|
void |
removeAllDataBlocks()
Remove all datablocks from the viewed list.
|
void |
removeDataBlock(PamDataBlock dataBlock)
Remove a datablock from the viewed list.
|
void |
removeObserver(PamScrollObserver pamScrollObserver)
Remove an observer which no longer requires notifications when
the scroller moves.
|
void |
setBlockIncrement(long blockIncrement) |
void |
setPageStep(int pageStep) |
void |
setRangeMillis(long minimumMillis,
long maximumMillis,
boolean notify)
Set the range of the currently loaded data and optionally notify other
scrollers.
|
void |
setScrollerCoupling(ScrollerCoupling scrollerCoupling) |
void |
setStepSizeMillis(int stepSizeMillis) |
void |
setUnitIncrement(long unitIncrement) |
void |
setValueMillis(long valueMillis) |
void |
setVisibleAmount(long visibleAmount) |
void |
uncoupleScroller()
Remove the scroller from it's coupling.
|
abstract void |
valueSetMillis(long valueMillis)
Called when a new position has been set
|
public AbstractPamScroller(java.lang.String name, int orientation, int stepSizeMillis, long defaultLoadTime, boolean hasMenu)
public void destroyScroller()
public void addObserver(PamScrollObserver pamScrollObserver)
pamScrollObserver
- public void removeObserver(PamScrollObserver pamScrollObserver)
pamScrollObserver
- public void addDataBlock(PamDataBlock dataBlock)
When the scroller is moved, data from data blocks in this list will re read from the database and binary stores. Other data will not be read.
dataBlock
- a PamDataBlockpublic void removeDataBlock(PamDataBlock dataBlock)
dataBlock
- a PamDataBlockpublic void removeAllDataBlocks()
public boolean isDataBlockUsed(PamDataBlock dataBlock)
dataBlock
- a Pamguard data blockpublic abstract void anotherScrollerMovedInner(long newValue)
newValue
- new value in millispublic void anotherScrollerMovedOuter(long newMin, long newMax)
newMin
- newMax
- public long getMinimumMillis()
public long getMaximumMillis()
public long getRangeMillis()
public void setRangeMillis(long minimumMillis, long maximumMillis, boolean notify)
minimumMillis
- minimum time in millisecondsmaximumMillis
- maximum time in millisecondsnotify
- notify the rangesChanged function.public void setVisibleAmount(long visibleAmount)
visibleAmount
- the visibleAmount to set in millispublic abstract void rangesChanged(long setValue)
setValue
- public void reLoad()
public abstract long getValueMillis()
public final void setValueMillis(long valueMillis)
valueMillis
- the valueMillis to setpublic abstract void valueSetMillis(long valueMillis)
valueMillis
- new scroll value in millisecondspublic int getStepSizeMillis()
For displays which will only ever display a short amount of data this can be one, however for longer displays this should be 1000 (a second) or more to avoid wrap around of the 32 bit integers used to control the actual scroll bar.
public void setStepSizeMillis(int stepSizeMillis)
stepSizeMillis
- the stepSizeMillis to setpublic void setBlockIncrement(long blockIncrement)
blockIncrement
- the blockIncrement to set in millispublic void setUnitIncrement(long unitIncrement)
unitIncrement
- the unitIncrement to set in millispublic java.util.Vector<PamScrollObserver> getObservers()
public int getPageStep()
public void setPageStep(int pageStep)
pageStep
- the pageStep to setpublic long getDefaultLoadtime()
public AbstractScrollManager getScrollManager()
public ScrollerCoupling coupleScroller(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.
couplingName
- name of the couplingpublic void uncoupleScroller()
public ScrollerCoupling getScrollerCoupling()
public void setScrollerCoupling(ScrollerCoupling scrollerCoupling)
public void coupledScrollerChanged(AbstractPamScroller scroller)
scroller
- coupled scroller which changes.public int getNumUsedDataBlocks()
public PamDataBlock getUsedDataBlock(int iBlock)
iBlock
- block indexpublic boolean isInSpecialList(PamDataBlock pamDataBlock)
pamDataBlock
-