private void setROIsAlpha(final ArrayList<Roi> rois, final int alpha) { for (final Roi roi : rois) { final Color c = roi.getStrokeColor(); roi.setStrokeColor(new Color(c.getRed(), c.getGreen(), c.getBlue(), alpha)); } }
public void setAlternateShells(final Color color1, final Color color2) { validateShells(); int i = 0; for (final Iterator<Roi> it = shells.iterator(); it.hasNext(); i++) { final Roi shell = it.next(); shell.setStrokeColor((i % 2 == 0) ? color1 : color2); } }
/** Sets the stroke color of all the ROIs in this overlay. */ public void setStrokeColor(Color color) { Roi[] rois = toArray(); for (int i=0; i<rois.length; i++) rois[i].setStrokeColor(color); }
/** Sets the stroke color of all the ROIs in this overlay. */ public void setStrokeColor(Color color) { Roi[] rois = toArray(); for (int i=0; i<rois.length; i++) rois[i].setStrokeColor(color); }
private static final void addRoiToOverlay(Overlay overlay, Roi roi, Color color) { roi.setStrokeColor(color); overlay.add(roi); }
public void setGradientShells(final Color color1, final Color color2) { double i = 0d; validateShells(); final double n = shells.size(); for (final Iterator<Roi> it = shells.iterator(); it.hasNext(); i++) { it.next().setStrokeColor(gradientColor(color1, color2, i / n)); } }
public void updateWideLine(float width) { if (isLine()) { wideLine = true; setStrokeWidth(width); if (getStrokeColor()==null) { Color c = getColor(); setStrokeColor(new Color(c.getRed(),c.getGreen(),c.getBlue(), 77)); } } }
public void updateWideLine(float width) { if (isLine()) { wideLine = true; setStrokeWidth(width); if (getStrokeColor()==null) { Color c = getColor(); setStrokeColor(new Color(c.getRed(),c.getGreen(),c.getBlue(), 77)); } } }
/** * @deprecated * replaced by ImagePlus.setOverlay(Roi, Color, int, Color) */ public void setDisplayList(Roi roi, Color color) { roi.setStrokeColor(color); Overlay list = new Overlay(); list.add(roi); setOverlay(list); }
public void setPointsColor(final Color color) { if (color == null) { removePoints(); return; } validatePoints(); final Color aColor = alphaColor(color, pointsAlpha); for (final Roi point : points) point.setStrokeColor(aColor); }
/** * @deprecated * replaced by ImagePlus.setOverlay(Roi, Color, int, Color) */ public void setDisplayList(Roi roi, Color color) { roi.setStrokeColor(color); Overlay list = new Overlay(); list.add(roi); setOverlay(list); }
public void setShellsColor(final Color color) { if (color == null) { removeShells(); return; } validateShells(); final Color aColor = alphaColor(color, shellsAlpha); for (final Roi shell : shells) shell.setStrokeColor(aColor); }
public void drawPaths(ImagePlus target, Map<Integer, GeodesicDiameter.Result> geodDiams) { Overlay overlay = new Overlay(); Calibration calib = target.getCalibration(); for (GeodesicDiameter.Result result : geodDiams.values()) { Roi roi = createPathRoi(result.path, calib); roi.setStrokeColor(Color.RED); overlay.add(roi); } target.setOverlay(overlay); }
private static void setRoiColor(Color c) { ImagePlus imp = WindowManager.getCurrentImage(); if (imp==null) return; Roi roi = imp.getRoi(); if (roi!=null && (roi.isDrawingTool())) { roi.setStrokeColor(c); imp.draw(); } }
private void assignPropertiesToRoi(final Roi roi, final Overlay overlay) { roi.setName(overlay.getName()); roi.setStrokeWidth((float) overlay.getLineWidth()); roi.setStrokeColor(AWTColors.getColor(overlay.getLineColor())); final Color fillColor = AWTColors.getColor(overlay.getFillColor()); final Color colorWithAlpha = new Color(fillColor.getRed(), fillColor.getGreen(), fillColor.getBlue(), overlay.getAlpha()); roi.setFillColor(colorWithAlpha); }
/** Creates an Overlay from the specified ROI, and assigns it to this image. * @see #setOverlay(ij.gui.Overlay) */ public void setOverlay(Roi roi, Color strokeColor, int strokeWidth, Color fillColor) { roi.setStrokeColor(strokeColor); roi.setStrokeWidth(strokeWidth); roi.setFillColor(fillColor); setOverlay(new Overlay(roi)); }
/** Creates an Overlay from the specified ROI, and assigns it to this image. * @see #setOverlay(ij.gui.Overlay) */ public void setOverlay(Roi roi, Color strokeColor, int strokeWidth, Color fillColor) { roi.setStrokeColor(strokeColor); roi.setStrokeWidth(strokeWidth); roi.setFillColor(fillColor); setOverlay(new Overlay(roi)); }
private static void transferProperties(Roi roi1, Roi roi2) { if (roi1==null || roi2==null) return; roi2.setStrokeColor(roi1.getStrokeColor()); if (roi1.getStroke()!=null) roi2.setStroke(roi1.getStroke()); roi2.setDrawOffset(roi1.getDrawOffset()); }
private static void transferProperties(Roi roi1, Roi roi2) { if (roi1==null || roi2==null) return; roi2.setStrokeColor(roi1.getStrokeColor()); if (roi1.getStroke()!=null) roi2.setStroke(roi1.getStroke()); roi2.setDrawOffset(roi1.getDrawOffset()); }
void addRoi(ImagePlus imp, Roi roi){ Overlay overlay = imp.getOverlay(); if (overlay==null || overlay.size()==0) { if (offscreenOverlay==null) offscreenOverlay = new Overlay(); overlay = offscreenOverlay; } if (defaultColor!=null) roi.setStrokeColor(defaultColor); roi.setStrokeWidth(getProcessor().getLineWidth()); overlay.add(roi); }