(String code)
| 614 | } |
| 615 | |
| 616 | private String getAddSelectionScript(String code) { |
| 617 | code += "roi = new TextRoi("+this.x+", "+this.y+", \""+text()+"\", font);\n"; |
| 618 | code += "roi.setStrokeColor(new Color("+getColorArgs(getStrokeColor())+"));\n"; |
| 619 | if (getFillColor()!=null) |
| 620 | code += "roi.setFillColor(new Color("+getColorArgs(getFillColor())+"));\n"; |
| 621 | int just = getJustification(); |
| 622 | if (just>LEFT) { |
| 623 | if (just==CENTER) |
| 624 | code += "roi.setJustification(TextRoi.CENTER);\n"; |
| 625 | else if (just==RIGHT) |
| 626 | code += "roi.setJustification(TextRoi.RIGHT);\n"; |
| 627 | } |
| 628 | if (getAngle()!=0.0) |
| 629 | code += "roi.setAngle("+getAngle()+");\n"; |
| 630 | code += "overlay.add(roi);\n"; |
| 631 | return code; |
| 632 | } |
| 633 | |
| 634 | private String getColorArgs(Color c) { |
| 635 | return IJ.d2s(c.getRed()/255.0,2)+", "+IJ.d2s(c.getGreen()/255.0,2)+", "+IJ.d2s(c.getBlue()/255.0,2); |
no test coverage detected