Пример #1
0
 @Override
 public void setDisplaySettings(String key, Object value) {
   super.setDisplaySettings(key, value);
   // If we modified the feature coloring, then we recompute NOW the colors.
   if (key == TrackMateModelView.KEY_SPOT_COLOR_FEATURE) {
     spotOverlay.computeSpotColors();
   }
   if (key == TrackMateModelView.KEY_TRACK_COLOR_FEATURE) {
     trackOverlay.computeTrackColors();
   }
 }
Пример #2
0
  @Override
  public void modelChanged(TrackMateModelChangeEvent event) {
    if (DEBUG)
      System.out.println(
          "[HyperStackDisplayer] Received model changed event ID: "
              + event.getEventID()
              + " from "
              + event.getSource());
    boolean redoOverlay = false;

    switch (event.getEventID()) {
      case TrackMateModelChangeEvent.MODEL_MODIFIED:
        // Rebuild track overlay only if edges were added or removed, or if at least one spot was
        // removed.
        final List<DefaultWeightedEdge> edges = event.getEdges();
        if (edges != null && edges.size() > 0) {
          trackOverlay.computeTrackColors();
          redoOverlay = true;
        } else {
          final List<Spot> spots = event.getSpots();
          if (spots != null && spots.size() > 0) {
            for (Spot spot : event.getSpots()) {
              if (event.getSpotFlag(spot) == TrackMateModelChangeEvent.FLAG_SPOT_REMOVED) {
                trackOverlay.computeTrackColors();
                redoOverlay = true;
                break;
              }
            }
          }
        }
        break;

      case TrackMateModelChangeEvent.SPOTS_COMPUTED:
        spotOverlay.computeSpotColors();
        redoOverlay = true;
        break;

      case TrackMateModelChangeEvent.TRACKS_VISIBILITY_CHANGED:
      case TrackMateModelChangeEvent.TRACKS_COMPUTED:
        trackOverlay.computeTrackColors();
        redoOverlay = true;
        break;
    }

    if (redoOverlay) refresh();
  }
Пример #3
0
 @Override
 public void highlightSpots(Collection<Spot> spots) {
   spotOverlay.setSpotSelection(spots);
   imp.updateAndDraw();
 }