public void drawOverlay(Graphics g) { overlay = true; draw(g); overlay = false; }
public void drawOverlay(Graphics g) { overlay = true; draw(g); overlay = false; }
void drawPreviousRoi(Graphics g) { if (previousRoi!=null && previousRoi!=this && previousRoi.modState!=NO_MODS) { if (type!=POINT && previousRoi.getType()==POINT && previousRoi.modState!=SUBTRACT_FROM_ROI) return; previousRoi.setImage(imp); previousRoi.draw(g); } }
void drawPreviousRoi(Graphics g) { if (previousRoi!=null && previousRoi!=this && previousRoi.modState!=NO_MODS) { if (type!=POINT && previousRoi.getType()==POINT && previousRoi.modState!=SUBTRACT_FROM_ROI) return; previousRoi.setImage(imp); previousRoi.draw(g); } }
/** Creates a new rounded rectangular ROI. */ public Roi(int x, int y, int width, int height, int cornerDiameter) { setImage(null); if (width<1) width = 1; if (height<1) height = 1; if (width>xMax) width = xMax; if (height>yMax) height = yMax; this.cornerDiameter = cornerDiameter; this.x = x; this.y = y; startX = x; startY = y; oldX = x; oldY = y; oldWidth=0; oldHeight=0; this.width = width; this.height = height; oldWidth=width; oldHeight=height; clipX = x; clipY = y; clipWidth = width; clipHeight = height; state = NORMAL; type = RECTANGLE; if (ic!=null) { Graphics g = ic.getGraphics(); draw(g); g.dispose(); } fillColor = defaultFillColor; }
/** Creates a new rounded rectangular ROI. */ public Roi(int x, int y, int width, int height, int cornerDiameter) { setImage(null); if (width<1) width = 1; if (height<1) height = 1; if (width>xMax) width = xMax; if (height>yMax) height = yMax; this.cornerDiameter = cornerDiameter; this.x = x; this.y = y; startX = x; startY = y; oldX = x; oldY = y; oldWidth=0; oldHeight=0; this.width = width; this.height = height; oldWidth=width; oldHeight=height; clipX = x; clipY = y; clipWidth = width; clipHeight = height; state = NORMAL; type = RECTANGLE; if (ic!=null) { Graphics g = ic.getGraphics(); draw(g); g.dispose(); } fillColor = defaultFillColor; }
@Override public void postRender() { final J3DGraphics2D g3d = getGraphics2D(); final Roi roi = roiImagePlus.getRoi(); if (roi != null) { roi.draw(g3d); } g3d.flush(true); } }
public void draw(Graphics g) { Graphics2D g2d = (Graphics2D)g; double mag = getMagnification(); int sx2 = screenX(x+width); int sy2 = screenY(y+height); Composite saveComposite = null; if (composite!=null) { saveComposite = g2d.getComposite(); g2d.setComposite(composite); } Image img2 = img; if (angle!=0.0) { ImageProcessor ip = new ColorProcessor(img); ip.setInterpolate(true); ip.setBackgroundValue(0.0); ip.rotate(angle); if (zeroTransparent) ip = makeZeroTransparent(ip, true); img2 = ip.createImage(); } g.drawImage(img2, screenX(x), screenY(y), sx2, sy2, 0, 0, img.getWidth(null), img.getHeight(null), null); if (composite!=null) g2d.setComposite(saveComposite); if (isActiveOverlayRoi() && !overlay) super.draw(g); }
public void draw(Graphics g) { Graphics2D g2d = (Graphics2D)g; double mag = getMagnification(); int sx2 = screenX(x+width); int sy2 = screenY(y+height); Composite saveComposite = null; if (composite!=null) { saveComposite = g2d.getComposite(); g2d.setComposite(composite); } Image img2 = img; if (angle!=0.0) { ImageProcessor ip = new ColorProcessor(img); ip.setInterpolate(true); ip.setBackgroundValue(0.0); ip.rotate(angle); if (zeroTransparent) ip = makeZeroTransparent(ip, true); img2 = ip.createImage(); } g.drawImage(img2, screenX(x), screenY(y), sx2, sy2, 0, 0, img.getWidth(null), img.getHeight(null), null); if (composite!=null) g2d.setComposite(saveComposite); if (isActiveOverlayRoi() && !overlay) super.draw(g); }
public void paint(Graphics g) { if(backBufferWidth!=getSize().width || backBufferHeight!=getSize().height || backBufferImage==null || backBufferGraphics==null) resetBackBuffer(); final Rectangle src = getSrcRect(); synchronized(this) { super.paint(backBufferGraphics); for (Overlay overlay : overlays) overlay.paint(backBufferGraphics, src.x, src.y, magnification); final Roi roi = super.imp.getRoi(); if(roi != null) roi.draw(backBufferGraphics); } g.drawImage(backBufferImage,0,0,this); }
private void drawRoi(Roi roi, Graphics g) { if (roi==currentRoi) { Color lineColor = roi.getStrokeColor(); Color fillColor = roi.getFillColor(); float lineWidth = roi.getStrokeWidth(); roi.setStrokeColor(null); roi.setFillColor(null); boolean strokeSet = roi.getStroke()!=null; if (strokeSet) roi.setStrokeWidth(1); roi.draw(g); roi.setStrokeColor(lineColor); if (strokeSet) roi.setStrokeWidth(lineWidth); roi.setFillColor(fillColor); currentRoi = null; } else roi.draw(g); }
private void drawRoi(Roi roi, Graphics g) { if (roi==currentRoi) { Color lineColor = roi.getStrokeColor(); Color fillColor = roi.getFillColor(); float lineWidth = roi.getStrokeWidth(); roi.setStrokeColor(null); roi.setFillColor(null); boolean strokeSet = roi.getStroke()!=null; if (strokeSet) roi.setStrokeWidth(1); roi.draw(g); roi.setStrokeColor(lineColor); if (strokeSet) roi.setStrokeWidth(lineWidth); roi.setFillColor(fillColor); currentRoi = null; } else roi.draw(g); }
roi.draw(g);
if (displayList != null && displayList.size() == 1) { final Roi roi = displayList.elementAt(0); if (roi.getType() == Roi.COMPOSITE) roi.draw(gr);
/** Draws the text on the screen, clipped to the ROI. */ public void draw(Graphics g) { if (IJ.debugMode) IJ.log("draw: "+theText[0]+" "+width+","+height); if (Interpreter.isBatchMode() && ic!=null && ic.getDisplayList()!=null) return; if (newFont || width==1) updateBounds(g); Color c = getStrokeColor(); setStrokeColor(getColor()); super.draw(g); // draw the rectangle setStrokeColor(c); double mag = getMagnification(); int sx = screenXD(getXBase()); int sy = screenYD(getYBase()); int swidth = (int)((bounds!=null?bounds.width:width)*mag); int sheight = (int)((bounds!=null?bounds.height:height)*mag); Rectangle r = null; if (angle!=0.0) drawText(g); else { r = g.getClipBounds(); g.setClip(sx, sy, swidth, sheight); drawText(g); if (r!=null) g.setClip(r.x, r.y, r.width, r.height); } }
/** Draws the text on the screen, clipped to the ROI. */ public void draw(Graphics g) { if (IJ.debugMode) IJ.log("draw: "+theText[0]+" "+width+","+height); if (Interpreter.isBatchMode() && ic!=null && ic.getDisplayList()!=null) return; if (newFont || width==1) updateBounds(g); Color c = getStrokeColor(); setStrokeColor(getColor()); super.draw(g); // draw the rectangle setStrokeColor(c); double mag = getMagnification(); int sx = screenXD(getXBase()); int sy = screenYD(getYBase()); int swidth = (int)((bounds!=null?bounds.width:width)*mag); int sheight = (int)((bounds!=null?bounds.height:height)*mag); Rectangle r = null; if (angle!=0.0) drawText(g); else { r = g.getClipBounds(); g.setClip(sx, sy, swidth, sheight); drawText(g); if (r!=null) g.setClip(r.x, r.y, r.width, r.height); } }