(Shape shape)
| 114 | } |
| 115 | |
| 116 | void drawGrid(Shape shape) { |
| 117 | if (shape==null) { |
| 118 | Overlay overlay = imp.getOverlay(); |
| 119 | if (overlay!=null) { |
| 120 | if (overlay.size()>1) { |
| 121 | overlay.remove(GRID); |
| 122 | imp.draw(); |
| 123 | } else |
| 124 | imp.setOverlay(null); |
| 125 | } |
| 126 | } else { |
| 127 | Roi roi = new ShapeRoi(shape); |
| 128 | roi.setStrokeColor(Colors.getColor(color,Color.cyan)); |
| 129 | if (bold && linesV*linesH<5000) { |
| 130 | ImageCanvas ic = imp.getCanvas(); |
| 131 | double mag = ic!=null?ic.getMagnification():1.0; |
| 132 | double width = 2.0; |
| 133 | if (mag<1.0) |
| 134 | width = width/mag; |
| 135 | roi.setStrokeWidth(width); |
| 136 | } |
| 137 | IJ.showStatus(linesV*linesH+" nodes"); |
| 138 | Overlay overlay = imp.getOverlay(); |
| 139 | if (overlay!=null) |
| 140 | overlay.remove(GRID); |
| 141 | else |
| 142 | overlay = new Overlay(); |
| 143 | overlay.add(roi, GRID); |
| 144 | imp.setOverlay(overlay); |
| 145 | } |
| 146 | } |
| 147 | |
| 148 | private boolean showDialog() { |
| 149 | isMacro = Macro.getOptions()!=null; |
no test coverage detected