MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / draw

Method draw

ij/src/main/java/ij/gui/TextRoi.java:252–275  ·  view source on GitHub ↗

Draws the text on the screen, clipped to the ROI.

(Graphics g)

Source from the content-addressed store, hash-verified

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);

Callers 3

addCharMethod · 0.45
setJustificationMethod · 0.45
updateTextMethod · 0.45

Calls 12

logMethod · 0.95
isBatchModeMethod · 0.95
drawTextMethod · 0.95
getDisplayListMethod · 0.80
getStrokeColorMethod · 0.80
getXBaseMethod · 0.80
getYBaseMethod · 0.80
getColorMethod · 0.65
setStrokeColorMethod · 0.45
getMagnificationMethod · 0.45
screenXDMethod · 0.45
screenYDMethod · 0.45

Tested by

no test coverage detected