Class SeedOverlayBigViewerHandler

java.lang.Object
sc.fiji.snt.seed.SeedOverlayBigViewerHandler

public final class SeedOverlayBigViewerHandler extends Object
Bdv/Bvv counterpart of SeedOverlayCanvasHandler.

Mirrors a SeedOverlay into an AbstractBigViewer's AbstractBigViewer.AnnotationOverlay, which already provides viewer-agnostic marker rendering and hit-testing for both Bdv and Bvv (see BookmarkManager for the same pattern applied to bookmarks). No new rendering code is added here; coloring reuses SeedOverlayRenderer.colorForSeed(net.imglib2.display.ColorTable, java.awt.Color, sc.fiji.snt.seed.SeedOverlay.ColorMode, sc.fiji.snt.seed.SeedPoint, double, double, double, java.util.Map<sc.fiji.snt.seed.SeedPoint, java.lang.Integer>, java.util.Map<java.lang.String, java.lang.Integer>) so seeds look identical across the classic canvas and the big-viewer overlay.

Alt+Click on a rendered seed (while the SNT UI is idle - see SNTUI#isReady() - or when no SNT instance is attached) opens the same SeedPointEditDialog used by the canvas handler.

Alt is also AbstractBigViewer.AbstractTracer's fork-a-path modifier: whenever the viewer's own Start/Stop Tracing toggle is on, AbstractTracer reacts to every click - Alt or not - in mouseReleased, which AWT always dispatches before this handler's mouseClicked. So by the time onAltClick(java.awt.event.MouseEvent) would run, a fork/trace attempt from the very same click may already have fired (at best a spurious "No Fork Point Found" dialog; at worst a real node inserted into a path, or a segment traced) - e.consume() here cannot undo that. onAltClick(java.awt.event.MouseEvent) therefore additionally requires AbstractBigViewer.isTracingEnabled() to be false for that viewer, so seed-editing via Alt+Click and fork-via-Alt+Click never both act on one click; toggle tracing off in that viewer to edit a seed by Alt+Click. onPlainClick(java.awt.event.MouseEvent) shares the same underlying hazard - a plain click also drives AbstractTracer in mouseReleased (starting/extending a path), fork or not - so it requires AbstractBigViewer.isTracingEnabled() to be false too, unlike BookmarkManager's plain-click-to-select, which does not gate on it.

Author:
Tiago Ferreira
See Also:
  • Method Details

    • install

      public static SeedOverlayBigViewerHandler install(AbstractBigViewer viewer, SeedOverlay overlay)
      Attaches a handler to viewer, bridging overlay into its annotation overlay. No-op (beyond bookkeeping) if the viewer has no annotation support.
      Parameters:
      viewer - the big-viewer instance (Bdv or Bvv)
      overlay - the seed store to mirror
      Returns:
      the handler, retained only if the caller needs to dispose() it
    • dispose

      public void dispose()
      Detaches from overlay and clears the viewer's annotations