Exemple #1
0
  @Override
  protected void drawOverlay(Graphics g) {

    /*
    int current_z = -1;

    if( plane == ThreePanes.XY_PLANE ) {
    	current_z = imp.getCurrentSlice() - 1;
    }
    */

    int current_z = imp.getCurrentSlice() - 1;

    synchronized (searchThreads) {
      for (SearchInterface st : searchThreads) st.drawProgressOnSlice(plane, current_z, this, g);
    }

    SimpleNeuriteTracer plugin = pathAndFillManager.plugin;

    boolean showOnlySelectedPaths = plugin.getShowOnlySelectedPaths();

    Color selectedColor = plugin.selectedColor;
    Color deselectedColor = plugin.deselectedColor;

    boolean drawDiametersXY = plugin.getDrawDiametersXY();

    if (pathAndFillManager != null) {
      for (int i = 0; i < pathAndFillManager.size(); ++i) {

        Path p = pathAndFillManager.getPath(i);
        if (p == null) continue;

        if (p.fittedVersionOf != null) continue;

        Path drawPath = p;

        // If the path suggests using the fitted version, draw that instead:
        if (p.useFitted) {
          drawPath = p.fitted;
        }

        Color color = deselectedColor;
        if (pathAndFillManager.isSelected(p)) {
          color = selectedColor;
        } else if (showOnlySelectedPaths) continue;

        if (just_near_slices) {
          drawPath.drawPathAsPoints(this, g, color, plane, drawDiametersXY, current_z, eitherSide);
        } else drawPath.drawPathAsPoints(this, g, color, plane, drawDiametersXY);
      }
    }

    super.drawOverlay(g);
  }
Exemple #2
0
  @Override
  public void paint(Graphics g) {

    if (backBufferWidth != getSize().width
        || backBufferHeight != getSize().height
        || backBufferImage == null
        || backBufferGraphics == null) resetBackBuffer();

    super.paint(backBufferGraphics);
    drawOverlay(backBufferGraphics);
    g.drawImage(backBufferImage, 0, 0, this);
  }