int fontHeight = metrics.getHeight(); if (script) code += "ip.setColor(new Color("+getColorArgs(getStrokeColor())+"));\n"; else code += "setColor(\""+Colors.colorToString(getStrokeColor())+"\");\n"; if (addSelection) { code += "Overlay.drawString(\""+text()+"\", "+x+", "+(y+fontHeight)+", "+getAngle()+");\n";
int fontHeight = metrics.getHeight(); if (script) code += "ip.setColor(new Color("+getColorArgs(getStrokeColor())+"));\n"; else code += "setColor(\""+Colors.colorToString(getStrokeColor())+"\");\n"; if (addSelection) { code += "Overlay.drawString(\""+text()+"\", "+x+", "+(y+fontHeight)+", "+getAngle()+");\n";
private String getAddSelectionScript(String code) { code += "roi = new TextRoi("+x+", "+y+", \""+text()+"\", font);\n"; code += "roi.setStrokeColor(new Color("+getColorArgs(getStrokeColor())+"));\n"; if (getFillColor()!=null) code += "roi.setFillColor(new Color("+getColorArgs(getFillColor())+"));\n"; if (getAngle()!=0.0) code += "roi.setAngle("+getAngle()+");\n"; code += "overlay.add(roi);\n"; return code; }
private String getAddSelectionScript(String code) { code += "roi = new TextRoi("+x+", "+y+", \""+text()+"\", font);\n"; code += "roi.setStrokeColor(new Color("+getColorArgs(getStrokeColor())+"));\n"; if (getFillColor()!=null) code += "roi.setFillColor(new Color("+getColorArgs(getFillColor())+"));\n"; if (getAngle()!=0.0) code += "roi.setAngle("+getAngle()+");\n"; code += "overlay.add(roi);\n"; return code; }
UNITS.PIXEL), roiNum, shape); if (roi.getStrokeColor() != null) { store.setLabelStrokeColor(toOMExmlColor(roi.getStrokeColor()) , roiNum, shape);
UNITS.PIXEL), roiNum, shape); if (roi.getStrokeColor() != null) { store.setLabelStrokeColor(toOMExmlColor(roi.getStrokeColor()) , roiNum, shape);
style = font.getStyle(); justification = textRoi.getJustification(); Color c = textRoi.getStrokeColor(); if (c!=null) color=c; fillc = Colors.colorToString2(textRoi.getFillColor());
style = font.getStyle(); justification = textRoi.getJustification(); Color c = textRoi.getStrokeColor(); if (c!=null) color=c; fillc = Colors.colorToString2(textRoi.getFillColor());
/** 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); } }