if (roi.subPixelResolution()) { Rectangle2D fb = roi.getFloatBounds(); roi2 = new TextRoi(fb.getX(), fb.getY(), fb.getWidth(), fb.getHeight(), new String(text), font); } else roi2 = new TextRoi(r.x, r.y, r.width, r.height, new String(text), font); roi2.setStrokeColor(roi.getStrokeColor()); roi2.setFillColor(roi.getFillColor());
if (roi.subPixelResolution()) { Rectangle2D fb = roi.getFloatBounds(); roi2 = new TextRoi(fb.getX(), fb.getY(), fb.getWidth(), fb.getHeight(), new String(text), font); } else roi2 = new TextRoi(r.x, r.y, r.width, r.height, new String(text), font); roi2.setStrokeColor(roi.getStrokeColor()); roi2.setFillColor(roi.getFillColor());
roi = new TextRoi((int) xi, (int) yi, Integer.toString(label)); roi.setStrokeColor(Color.BLUE); overlay.add(roi);
void makeText() { String text = getFirstString(); int x = (int)getNextArg(); int y = (int)getLastArg(); ImagePlus imp = getImage(); Font font = this.font; boolean nullFont = font==null; if (nullFont) font = imp.getProcessor().getFont(); TextRoi roi = new TextRoi(x, y, text, font); if (!nullFont) roi.setAntialiased(antialiasedText); imp.setRoi(roi); }
void makeText() { String text = getFirstString(); int x = (int)getNextArg(); int y = (int)getLastArg(); ImagePlus imp = getImage(); Font font = this.font; boolean nullFont = font==null; if (nullFont) font = imp.getProcessor().getFont(); TextRoi roi = new TextRoi(x, y, text, font); if (!nullFont) roi.setAntialiased(antialiasedText); imp.setRoi(roi); }
TextRoi label = new TextRoi(todisplay, x + 5, yLabel + fontHeight/2, font); label.setStrokeColor(c); overlay.add(label, CALIBRATION_BAR);
TextRoi label = new TextRoi(todisplay, x + 5, yLabel + fontHeight/2, font); label.setStrokeColor(c); overlay.add(label, CALIBRATION_BAR);
protected void handleMouseUp(int screenX, int screenY) { super.handleMouseUp(screenX, screenY); if (width<5 && height<5 && imp!=null && previousRoi==null) { int ox = ic!=null?ic.offScreenX(screenX):screenX; int oy = ic!=null?ic.offScreenY(screenY):screenY; TextRoi roi = new TextRoi(ox, oy, line1a); roi.setStrokeColor(Toolbar.getForegroundColor()); roi.firstChar = true; imp.setRoi(roi); return; } else if (firstMouseUp) { updateBounds(null); updateText(); firstMouseUp = false; } if (width<5 || height<5) imp.deleteRoi(); }
protected void handleMouseUp(int screenX, int screenY) { super.handleMouseUp(screenX, screenY); if (width<5 && height<5 && imp!=null && previousRoi==null) { int ox = ic!=null?ic.offScreenX(screenX):screenX; int oy = ic!=null?ic.offScreenY(screenY):screenY; TextRoi roi = new TextRoi(ox, oy, line1a); roi.setStrokeColor(Toolbar.getForegroundColor()); roi.firstChar = true; imp.setRoi(roi); return; } else if (firstMouseUp) { updateBounds(null); updateText(); firstMouseUp = false; } if (width<5 || height<5) imp.deleteRoi(); }
private Roi createTextRoi(TextOverlay overlay) { RectangleRegionOfInterest region = overlay.getRegionOfInterest(); double x = region.getOrigin(0); double y = region.getOrigin(1); TextRoi roi = new TextRoi(x, y, overlay.getText()); switch (overlay.getJustification()) { case LEFT: roi.setJustification(TextRoi.LEFT); break; case CENTER: roi.setJustification(TextRoi.CENTER); break; case RIGHT: roi.setJustification(TextRoi.RIGHT); break; default: break; } assignPropertiesToRoi(roi, overlay); return roi; }
double overlayDrawString(ImagePlus imp) { addDrawingToOverlay(imp); String text = getFirstString(); int x = (int)getNextArg(); int y = (int)getNextArg(); double angle = 0.0; if (interp.nextToken()==',') angle = getLastArg(); else interp.getRightParen(); Font font = this.font; boolean nullFont = font==null; if (nullFont) font = imp.getProcessor().getFont(); TextRoi roi = new TextRoi(text, x, y, font); // use drawString() compatible constructor if (!nullFont && !antialiasedText) roi.setAntialiased(false); roi.setAngle(angle); roi.setJustification(justification); addRoi(imp, roi); return Double.NaN; }
double overlayDrawString(ImagePlus imp) { addDrawingToOverlay(imp); String text = getFirstString(); int x = (int)getNextArg(); int y = (int)getNextArg(); double angle = 0.0; if (interp.nextToken()==',') angle = getLastArg(); else interp.getRightParen(); Font font = this.font; boolean nullFont = font==null; if (nullFont) font = imp.getProcessor().getFont(); TextRoi roi = new TextRoi(text, x, y, font); // use drawString() compatible constructor if (!nullFont && !antialiasedText) roi.setAntialiased(false); roi.setAngle(angle); roi.setJustification(justification); addRoi(imp, roi); return Double.NaN; }
overlay.add(bar, SCALE_BAR); if (!hideText) { TextRoi text = new TextRoi(x+xoffset, y+barHeightInPixels, label, font); text.setStrokeColor(color); overlay.add(text, SCALE_BAR);
overlay.add(bar, SCALE_BAR); if (!hideText) { TextRoi text = new TextRoi(x+xoffset, y+barHeightInPixels, label, font); text.setStrokeColor(color); overlay.add(text, SCALE_BAR);
if (!hyperstack) text = IJ.pad(i,4); TextRoi roi = new TextRoi(5, yloc-28, text, font); roi.setStrokeColor(Color.white); if (hyperstack || c>1) "and to enable/disable channels.\n"; font = new Font("SansSerif", Font.PLAIN, imp.getWidth()>399?14:12); roi = new TextRoi(25, yloc, msg, font); roi.setStrokeColor(Color.white); roi.setPosition(0, 1, 1);
Roi roi = new TextRoi(xloc, y-yoffset, s, font); roi.setStrokeColor(color); roi.setNonScalable(true);
Roi roi = new TextRoi(xloc, y-yoffset, s, font); roi.setStrokeColor(color); roi.setNonScalable(true);
break; case Toolbar.TEXT: roi = new TextRoi(sx, sy, this); ((TextRoi)roi).setPreviousRoi(previousRoi); break;