Draws the text on the screen, clipped to the ROI.
(Graphics g)
| 250 | |
| 251 | /** Draws the text on the screen, clipped to the ROI. */ |
| 252 | public void draw(Graphics g) { |
| 253 | if (IJ.debugMode) IJ.log("draw: "+theText[0]+" "+this.width+","+this.height); |
| 254 | if (Interpreter.isBatchMode() && ic!=null && ic.getDisplayList()!=null) |
| 255 | return; |
| 256 | Color c = getStrokeColor(); |
| 257 | setStrokeColor(getColor()); |
| 258 | super.draw(g); // draw the rectangle |
| 259 | setStrokeColor(c); |
| 260 | double mag = getMagnification(); |
| 261 | int sx = screenXD(getXBase()); |
| 262 | int sy = screenYD(getYBase()); |
| 263 | int swidth = (int)((bounds!=null?bounds.width:this.width)*mag); |
| 264 | int sheight = (int)((bounds!=null?bounds.height:this.height)*mag); |
| 265 | Rectangle r = null; |
| 266 | if (angle!=0.0) |
| 267 | drawText(g); |
| 268 | else { |
| 269 | r = g.getClipBounds(); |
| 270 | g.setClip(sx, sy, swidth, sheight); |
| 271 | drawText(g); |
| 272 | if (r!=null) |
| 273 | g.setClip(r.x, r.y, r.width, r.height); |
| 274 | } |
| 275 | } |
| 276 | |
| 277 | public void drawOverlay(Graphics g) { |
| 278 | drawText(g); |
no test coverage detected