public void drawOverlay(Graphics g) { drawText(g); }
public void drawOverlay(Graphics g) { drawText(g); }
void drawRoi(Graphics g, Roi roi, int index) { ImagePlus imp2 = roi.getImage(); roi.setImage(imp); Color saveColor = roi.getStrokeColor(); if (saveColor==null) roi.setStrokeColor(defaultColor); if (roi.getStroke()==null) ((Graphics2D)g).setStroke(Roi.onePixelWide); if (roi instanceof TextRoi) ((TextRoi)roi).drawText(g); else roi.drawOverlay(g); roi.setStrokeColor(saveColor); if (index>=0) { if (roi==currentRoi) g.setColor(Roi.getColor()); else g.setColor(defaultColor); drawRoiLabel(g, index, roi); } if (imp2!=null) roi.setImage(imp2); else roi.setImage(null); }
void drawRoi(Graphics g, Roi roi, int index) { ImagePlus imp2 = roi.getImage(); roi.setImage(imp); Color saveColor = roi.getStrokeColor(); if (saveColor==null) roi.setStrokeColor(defaultColor); if (roi.getStroke()==null) ((Graphics2D)g).setStroke(Roi.onePixelWide); if (roi instanceof TextRoi) ((TextRoi)roi).drawText(g); else roi.drawOverlay(g); roi.setStrokeColor(saveColor); if (index>=0) { if (roi==currentRoi) g.setColor(Roi.getColor()); else g.setColor(defaultColor); drawRoiLabel(g, index, roi); } if (imp2!=null) roi.setImage(imp2); else roi.setImage(null); }
/** 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); } }