Class AbstractScrollManager

java.lang.Object
pamScrollSystem.AbstractScrollManager
Direct Known Subclasses:
RealTimeScrollManager, ViewerScrollerManager

public abstract class AbstractScrollManager extends Object
  • Field Details Link icon

  • Constructor Details Link icon

    • AbstractScrollManager Link icon

      protected AbstractScrollManager()
  • Method Details Link icon

    • getScrollManager Link icon

      public static AbstractScrollManager getScrollManager()
    • addPamScroller Link icon

      public void addPamScroller(AbstractPamScroller abstractPamScroller)
      Add a new scroller to the managed list.
      Parameters:
      abstractPamScroller - scroller to add
    • removePamScroller Link icon

      public void removePamScroller(AbstractPamScroller abstractPamScroller)
      Remove a pam scroller from the managed list.
      Parameters:
      abstractPamScroller - scroller to remove
    • moveInnerScroller Link icon

      public abstract void moveInnerScroller(AbstractPamScroller scroller, long newValue)
      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 moved
      newValue - new value (time in milliseconds).
    • moveOuterScroller Link icon

      public abstract void moveOuterScroller(AbstractPamScroller scroller, long newMin, long newMax)
      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 changed
      newMin - new data min value in millis
      newMax - new data max value in millis
    • checkMaximumTime Link icon

      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 Link icon

      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 Link icon

      public abstract void notifyModelChanged(int changeType)
    • centreDataAt Link icon

      public abstract void centreDataAt(PamDataBlock dataBlock, long menuMouseTime)
      Centre all data in all data blocks at the given time
      Parameters:
      menuMouseTime - time in milliseconds
    • scrollToTime Link icon

      public abstract void scrollToTime(PamDataBlock dataBlock, long menuMouseTime)
      Move scroll to given time. Don't move the outer scroller unless necessary.
      Parameters:
      dataBlock -
      menuMouseTime -
    • startDataAt Link icon

      public abstract void startDataAt(PamDataBlock dataBlock, long menuMouseTime, boolean immediateLoad)
      Start all data in all data blocks at the given time
      Parameters:
      dataBlock -
      menuMouseTime - time in milliseconds
      immediateLoad - load data immediately in current thread. Don't re-schedule for later.
    • startDataAt Link icon

      public final void startDataAt(PamDataBlock dataBlock, long menuMouseTime)
    • coupleScroller Link icon

      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 couple
      couplingName - coupling name
      Returns:
      reference to the coupler
    • uncoupleScroller Link icon

      public void uncoupleScroller(AbstractPamScroller abstractPamScroller)
      Uncouple a scroller.
      Parameters:
      abstractPamScroller - scroller to uncouple
    • findCoupling Link icon

      public ScrollerCoupling findCoupling(String name, boolean autoCreate)
      Find a scroller coupling with a given name
      Parameters:
      name - name of coupling
      autoCreate - 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 Link icon

      public abstract void reLoad()
      Command telling manager to reload it's data.
    • moveAllScrollersTo Link icon

      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 Link icon

      public int isInGap(PamDataBlock dataBlock, long timeMillis)
      Work out whether or not a particular time falls in the gap between points in a datamap .
      Parameters:
      dataBlock - Pamguard data block
      timeMillis - time in milliseconds
      Returns:
      true if the data are in a gap.
    • checkGapPos Link icon

      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 moved
      oldMin - old minimum time
      oldMax - old maximum time
      newMin - new minimum time
      newMax - new maximum time
      direction - 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 Link icon

      public boolean isInSpecialList(PamDataBlock pamDataBlock)
      Check if a data block is within the special data block list.
      Parameters:
      pamDataBlock -
      Returns:
      true if the datablock is in the list.
    • removeFromSpecialDatablock Link icon

      public void removeFromSpecialDatablock(PamDataBlock pamDataBlock)
      Remove from special data block list.
      Parameters:
      pamDataBlock -
    • addToSpecialDatablock Link icon

      public void addToSpecialDatablock(PamDataBlock pamDataBlock)
      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 Link icon

      public void addToSpecialDatablock(PamDataBlock pamDataBlock, long timeBefore, long timeAfter)
      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 Link icon

      public JPopupMenu getStandardOptionsMenu(AbstractPamScroller pamScroller)
    • getSpecialLoadTimes Link icon

      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 Link icon

      public Vector<AbstractPamScroller> getPamScrollers()
      Returns:
      the pamScrollers
    • findScroller Link icon

      public AbstractPamScroller findScroller(String scrollerName)
      Find a scroller with a given name.
      Parameters:
      scrollerName -
      Returns: