Font getScaledFont() { if (nonScalable) return instanceFont; else { if (instanceFont==null) instanceFont = new Font(name, style, size); double mag = getMagnification(); return instanceFont.deriveFont((float)(instanceFont.getSize()*mag)); } }
Font getScaledFont() { if (nonScalable) return instanceFont; else { if (instanceFont==null) instanceFont = new Font(name, style, size); double mag = getMagnification(); return instanceFont.deriveFont((float)(instanceFont.getSize()*mag)); } }
if (newFont || width==1) updateBounds(g); double mag = getMagnification(); int xi = (int)Math.round(getXBase()); int yi = (int)Math.round(getYBase()); int sx = nonScalable?xi:screenXD(getXBase()); int sy = nonScalable?yi:screenYD(getYBase()); int sw = nonScalable?widthi:(int)(getMagnification()*widthd); int sh = nonScalable?heighti:(int)(getMagnification()*heightd); AffineTransform at = null; if (angle!=0.0) {
if (newFont || width==1) updateBounds(g); double mag = getMagnification(); int xi = (int)Math.round(getXBase()); int yi = (int)Math.round(getYBase()); int sx = nonScalable?xi:screenXD(getXBase()); int sy = nonScalable?yi:screenYD(getYBase()); int sw = nonScalable?widthi:(int)(getMagnification()*widthd); int sh = nonScalable?heighti:(int)(getMagnification()*heightd); AffineTransform at = null; if (angle!=0.0) {
public TextRoi(int x, int y, ImagePlus imp) { super(x, y, imp); ImageCanvas ic = imp.getCanvas(); double mag = getMagnification(); if (mag>1.0) mag = 1.0; if (size<(12/mag)) size = (int)(12/mag); if (firstTime) { theText[0] = line1; theText[1] = line2; theText[2] = line3; firstTime = false; } else theText[0] = line1a; if (previousRoi!=null && (previousRoi instanceof TextRoi)) { firstMouseUp = false; previousRoi = null; } instanceFont = new Font(name, style, size); justification = globalJustification; setStrokeColor(Toolbar.getForegroundColor()); if (WindowManager.getWindow("Fonts")!=null) { setFillColor(defaultFillColor); setAngle(defaultAngle); } }
public TextRoi(int x, int y, ImagePlus imp) { super(x, y, imp); ImageCanvas ic = imp.getCanvas(); double mag = getMagnification(); if (mag>1.0) mag = 1.0; if (size<(12/mag)) size = (int)(12/mag); if (firstTime) { theText[0] = line1; theText[1] = line2; theText[2] = line3; firstTime = false; } else theText[0] = line1a; if (previousRoi!=null && (previousRoi instanceof TextRoi)) { firstMouseUp = false; previousRoi = null; } instanceFont = new Font(name, style, size); justification = globalJustification; setStrokeColor(Toolbar.getForegroundColor()); if (WindowManager.getWindow("Fonts")!=null) { setFillColor(defaultFillColor); setAngle(defaultAngle); } }
/** 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); } }