|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectpamScrollSystem.AbstractPamScroller
public abstract class AbstractPamScroller
| Nested Class Summary | |
|---|---|
private class |
AbstractPamScroller.MenuButtonMouse
|
(package private) class |
AbstractPamScroller.MouseWheel
|
(package private) class |
AbstractPamScroller.PageBackAction
|
(package private) class |
AbstractPamScroller.PageForwardAction
|
(package private) class |
AbstractPamScroller.ShowMenuButtonPress
|
| Field Summary | |
|---|---|
private javax.swing.JPanel |
buttonPanel
|
static int |
HORIZONTAL
|
(package private) java.awt.Color |
iconFill
|
(package private) java.awt.Color |
iconLine
|
private boolean |
needsNotify
|
protected java.util.Vector<PamScrollObserver> |
observers
|
private javax.swing.JButton |
pageBack
|
private javax.swing.JButton |
pageForward
|
private ScrollerCoupling |
scrollerCoupling
|
protected PamScrollerData |
scrollerData
|
private AbstractScrollManager |
scrollManager
reference to the global scroll manager. |
private static long |
serialVersionUID
|
private javax.swing.JButton |
showMenu
|
protected java.util.Vector<PamDataBlock> |
usedDataBlocks
|
static int |
VERTICAL
|
| Constructor Summary | |
|---|---|
AbstractPamScroller(java.lang.String name,
int orientation,
int stepSizeMillis,
long defaultLoadTime,
boolean hasMenu)
|
|
| Method Summary | |
|---|---|
void |
addDataBlock(PamDataBlock dataBlock)
Add a datablock to the list for this scroller. |
void |
addMouseWheelSource(java.awt.Component component)
Add a component to the scrollers mouse wheel listener. |
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()
|
(package private) abstract void |
doMouseWheelAction(java.awt.event.MouseWheelEvent mouseWheelEvent)
|
protected javax.swing.JPanel |
getButtonPanel()
|
abstract javax.swing.JComponent |
getComponent()
|
protected 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 |
protected void |
menuButtonPress()
|
private void |
notifyCoupledScrollers()
Tell other scrollers coupled to this one that there has been a change |
protected void |
notifyRangeChange()
Send a notification to all observers of this scroller to say that the range of data loaded has changed. |
protected void |
notifyValueChange()
Send notification to all observers of this scroll bar to say that the value set by the slider in the scroll bar has changed. |
protected void |
pageBack()
|
protected void |
pageForward()
|
abstract void |
rangesChanged(long setValue)
Called when ranges have been changed and tells scroller to go to a particular absolute value. |
private void |
rangesChangedF(long setValue)
called when the set range is changed with a flag to send out a notification. |
void |
reLoad()
Command passed through the the scroll manager telling it reload data. |
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)
|
protected void |
setDefaultLoadtime(long defaultLoadtime)
|
void |
setPageStep(int pageStep)
|
void |
setRangeMillis(long minimumMillis,
long maximumMillis,
boolean notify)
Set the range of the currently loaded data and optionally noitify other scrollers. |
void |
setScrollerCoupling(ScrollerCoupling scrollerCoupling)
|
void |
setStepSizeMillis(int stepSizeMillis)
|
void |
setUnitIncrement(long unitIncrement)
|
void |
setValueMillis(long valueMillis)
|
void |
setVisible(boolean b)
Set the visibility of the scroll bar component. |
void |
setVisibleAmount(long visibleAmount)
|
(package private) void |
showMenuButtonPopup(java.awt.event.MouseEvent me)
Show standard menu for mouse right click on the middle options button. |
void |
uncoupleScroller()
Remove the scroller from it's coupling. |
abstract void |
valueSetMillis(long valueMillis)
Called when a new position has been set |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final long serialVersionUID
public static final int HORIZONTAL
public static final int VERTICAL
protected transient java.util.Vector<PamScrollObserver> observers
protected transient java.util.Vector<PamDataBlock> usedDataBlocks
protected PamScrollerData scrollerData
private AbstractScrollManager scrollManager
private javax.swing.JButton pageForward
private javax.swing.JButton pageBack
private javax.swing.JButton showMenu
private javax.swing.JPanel buttonPanel
private boolean needsNotify
private ScrollerCoupling scrollerCoupling
java.awt.Color iconLine
java.awt.Color iconFill
| Constructor Detail |
|---|
public AbstractPamScroller(java.lang.String name,
int orientation,
int stepSizeMillis,
long defaultLoadTime,
boolean hasMenu)
| Method Detail |
|---|
public abstract javax.swing.JComponent getComponent()
public void addMouseWheelSource(java.awt.Component component)
component - componentabstract void doMouseWheelAction(java.awt.event.MouseWheelEvent mouseWheelEvent)
protected javax.swing.JPanel getButtonPanel()
void showMenuButtonPopup(java.awt.event.MouseEvent me)
Concrete instances of the scroller can either override this or add to the standard menu
me - Mouse eventprotected void pageForward()
protected void pageBack()
protected void menuButtonPress()
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 boolean isDataBlockUsed(PamDataBlock dataBlock)
dataBlock - a Pamguard data block
public abstract void anotherScrollerMovedInner(long newValue)
newValue - new value in millis
public void anotherScrollerMovedOuter(long newMin,
long newMax)
newMin - newMax - protected void notifyValueChange()
protected void notifyRangeChange()
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.private final void rangesChangedF(long setValue)
setValue - scroller position in milliseconds.public 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 void setVisibleAmount(long visibleAmount)
visibleAmount - the visibleAmount to set in millispublic java.util.Vector<PamScrollObserver> getObservers()
public int getPageStep()
public void setPageStep(int pageStep)
pageStep - the pageStep to setprotected long getDefaultLoadtime()
protected void setDefaultLoadtime(long defaultLoadtime)
public AbstractScrollManager getScrollManager()
public void setVisible(boolean b)
b - 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 coupling
public void uncoupleScroller()
public ScrollerCoupling getScrollerCoupling()
public void setScrollerCoupling(ScrollerCoupling scrollerCoupling)
public void coupledScrollerChanged(AbstractPamScroller scroller)
scroller - coupled scroller which changes.private void notifyCoupledScrollers()
public int getNumUsedDataBlocks()
public PamDataBlock getUsedDataBlock(int iBlock)
iBlock - block index
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||