Class OverlayMarker

java.lang.Object
PamView.paneloverlay.overlaymark.ExtMouseAdapter
PamView.paneloverlay.overlaymark.OverlayMarker
All Implemented Interfaces:
MarkManager
Direct Known Subclasses:
BTOverlayMarker, ClipDisplayMarker, SpectrogramMarker, StandardOverlayMarker

public abstract class OverlayMarker extends ExtMouseAdapter implements MarkManager
Receive mouse actions made on the map, turn them into regions displayed as an overlay on the map and send the region information off to any observers who might be interested in those data.

In some ways this class behaves in a very similar manner to the spectrogram mark observer system.

Author:
Doug Gillespie
  • Constructor Details Link icon

  • Method Details Link icon

    • getProjector Link icon

      public GeneralProjector<PamCoordinate> getProjector()
      Returns:
      the projector
    • getMarkerName Link icon

      public abstract String getMarkerName()
    • isCanMark Link icon

      public boolean isCanMark(javafx.scene.input.MouseEvent e)
    • mousePressed Link icon

      public boolean mousePressed(javafx.scene.input.MouseEvent e)
      Overrides:
      mousePressed in class ExtMouseAdapter
    • findExtraInfo Link icon

      protected MarkExtraInfo findExtraInfo(Object mouseSource)
      See if the display making the mark has any extra information.
      Parameters:
      mouseSource -
      Returns:
    • mouseReleased Link icon

      public boolean mouseReleased(javafx.scene.input.MouseEvent e)
      Overrides:
      mouseReleased in class ExtMouseAdapter
    • showNoObserverPopup Link icon

      public boolean showNoObserverPopup(javafx.scene.input.MouseEvent e)
      An optional additional popup that can occur even if there were no observers of the popup This get's used on displays that are starting to label data units using generic annotations, thereby avoiding the need for more advanced marks and groupers.
      Parameters:
      e - Mouse event (needed for popup coordinates)
      Returns:
      true if a menu was shown.
    • createJPopMenu Link icon

      public JPopupMenu createJPopMenu(javafx.scene.input.MouseEvent e)
      Create the JPopupMenu. this is a composite menu made up from all observers of a particular marker.
      Returns:
      the jpop up menu with overlay options.
    • getPopupMenuItems Link icon

      public List<javafx.scene.control.MenuItem> getPopupMenuItems(javafx.scene.input.MouseEvent e)
      Overrides:
      getPopupMenuItems in class ExtMouseAdapter
    • showObserverPopups Link icon

      public boolean showObserverPopups(javafx.scene.input.MouseEvent e)
      Show any popup menus form the mark observers in response to the mouse going down with a right click.

      If a mark has been made, and is in existence, then

      Parameters:
      e - Mouse event
      Returns:
      true if a menu was shown.
    • findClosestData Link icon

      public ClosestDataInfo findClosestData(javafx.scene.input.MouseEvent e, double maxDistance)
      Find the closest data unit to the mouse point.
      Parameters:
      e - Mouse informatoin
      maxDistance - Maximum distance to consider.
      Returns:
    • destroyCurrentMark Link icon

      public void destroyCurrentMark(javafx.scene.input.MouseEvent e)
      Destroy the current mark.
    • mouseClicked Link icon

      public boolean mouseClicked(javafx.scene.input.MouseEvent e)
      Overrides:
      mouseClicked in class ExtMouseAdapter
    • needPaused Link icon

      public boolean needPaused()
      Returns:
      true if whatever is going on makes it desirable to pause display scrolling.
    • canDestroyMark Link icon

      public boolean canDestroyMark(javafx.scene.input.MouseEvent e)
      Check whether a current mark can be destroyed.
      Parameters:
      e - - the mouse event
      Returns:
      true if mark can be destroyed. False otherwise.
    • updateObservers Link icon

      protected void updateObservers(int markStatus, javafx.scene.input.MouseEvent mouseEvent, OverlayMark overlayMark)
    • addObserver Link icon

      public void addObserver(OverlayMarkObserver observer)
    • removeObserver Link icon

      public void removeObserver(OverlayMarkObserver observer)
    • getObserverCount Link icon

      public int getObserverCount()
      Get the number of observers.
      Returns:
      The number of things observing this marker.
    • getObservers Link icon

      public ArrayList<OverlayMarkObserver> getObservers()
      Get the list of observers.
      Returns:
      the observers
    • notifyObservers Link icon

      public boolean notifyObservers(int markStatus, javafx.scene.input.MouseEvent mouseEvent, OverlayMarker overlayMarker, OverlayMark overlayMark)
    • mouseMoved Link icon

      public boolean mouseMoved(javafx.scene.input.MouseEvent e)
      Overrides:
      mouseMoved in class ExtMouseAdapter
    • isMarkComplete Link icon

      public boolean isMarkComplete()
    • completeMark Link icon

      protected boolean completeMark(javafx.scene.input.MouseEvent e)
      Complete the mark.
      Parameters:
      e - - mouse event
    • mouseDragged Link icon

      public boolean mouseDragged(javafx.scene.input.MouseEvent e)
      Overrides:
      mouseDragged in class ExtMouseAdapter
    • getCurrentMark Link icon

      public OverlayMark getCurrentMark()
      Specified by:
      getCurrentMark in interface MarkManager
    • getSelectedMarkedDataUnits Link icon

      public List<PamDataUnit> getSelectedMarkedDataUnits(OverlayMark overlayMark, MarkDataSelector markDataSelector)
      Get a list of marked and selected data units. For now, work off the hover data within the projector, but feel free to override or use a totally different system of working out what's in the mark - that's the responsibility of whatever display has the mark. The MarkDataSelector comes from the Mark Observer, i.e. the thing that uses the data.
      Parameters:
      overlayMark -
      markDataSelector -
      Returns:
    • getSelectedMarkedDataUnits Link icon

      public List<PamDataUnit> getSelectedMarkedDataUnits(OverlayMark overlayMark, MarkDataSelector markDataSelector, int minOverlap)
    • getCoordinate Link icon

      protected PamCoordinate getCoordinate(javafx.scene.input.MouseEvent e)
      Get an x,y coordinate as a lat long.
      Parameters:
      e - Mouse event
      Returns:
      coordinate.
    • canMark Link icon

      public boolean canMark(OverlayMarkObserver markObserver)
      Parameters:
      markObserver -
      Returns:
      true if this marker can send marks to this observer.
    • isAllowRectangles Link icon

      protected boolean isAllowRectangles()
      Returns:
      the allowRectangles
    • setAllowRectangles Link icon

      protected void setAllowRectangles(boolean allowRectangles)
      Parameters:
      allowRectangles - the allowRectangles to set
    • isAllowPolygons Link icon

      protected boolean isAllowPolygons()
      Returns:
      the allowPolygons
    • setAllowPolygons Link icon

      protected void setAllowPolygons(boolean allowPolygons)
      Parameters:
      allowPolygons - the allowPolygons to set
    • getMarkSource Link icon

      protected Object getMarkSource()
      Returns:
      the markSource
    • setMarkSource Link icon

      protected void setMarkSource(Object markSource)
      Parameters:
      markSource - the markSource to set
    • getMarkChannels Link icon

      protected int getMarkChannels()
      Returns:
      the markChannels
    • setMarkChannels Link icon

      protected void setMarkChannels(int markChannels)
      Parameters:
      markChannels - the markChannels to set
    • isNowMarking Link icon

      public boolean isNowMarking()
      Now marking
      Returns:
      true if now marking.
    • setProjector Link icon

      public void setProjector(GeneralProjector<PamCoordinate> projector)
      Parameters:
      projector - the projector to set
    • updateMarkedDisplay Link icon

      public void updateMarkedDisplay()
      Update the marked display. This can be called after the mark has been used to repaint the owner display. Forcing a repaint will generally make the mark disappear and may also recolour any changed dataunits.
    • isMouseContained Link icon

      public boolean isMouseContained(javafx.scene.input.MouseEvent e)
      Check whether a mouse event is contained within the current mark shape
      Parameters:
      e - - the mouse event
      Returns:
      true if the mouse event is cointained within the shape.
    • setNowMarking Link icon

      public void setNowMarking(boolean nowMarking)
      Set if marking
    • setCurrentMark Link icon

      public void setCurrentMark(OverlayMark currentMark)
      Set the current mark.
      Parameters:
      currentMark - - set the current mark
    • setMarkSTartXY Link icon

      protected void setMarkSTartXY(javafx.geometry.Point3D point3d)
    • getMarkWarning Link icon

      public PamWarning getMarkWarning()
      Get the current mark warning. Can be null.
      Returns:
      the current mark warning.