MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / drawGrid

Method drawGrid

ij/src/main/java/ij/plugin/Grid.java:116–146  ·  view source on GitHub ↗
(Shape shape)

Source from the content-addressed store, hash-verified

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;

Callers 6

drawCirclesMethod · 0.95
drawCrossesMethod · 0.95
drawLinesMethod · 0.95
drawHorizontalLinesMethod · 0.95
showDialogMethod · 0.95
dialogItemChangedMethod · 0.95

Calls 15

sizeMethod · 0.95
removeMethod · 0.95
getColorMethod · 0.95
getMagnificationMethod · 0.95
showStatusMethod · 0.95
addMethod · 0.95
drawLinesMethod · 0.95
drawHorizontalLinesMethod · 0.95
drawCrossesMethod · 0.95
drawCirclesMethod · 0.95
getOverlayMethod · 0.45
drawMethod · 0.45

Tested by

no test coverage detected