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

Method removeScalebar

ij/src/main/java/ij/plugin/ScaleBar.java:87–97  ·  view source on GitHub ↗

Remove the scalebar drawn by this plugin. If the scalebar was drawn without the overlay by another instance of the plugin (it is drawn into the image), then we cannot remove it. If the scalebar was drawn using the overlay by another instance of the plugin, then we can remove it. With or without t

()

Source from the content-addressed store, hash-verified

85 * drawn by this instance of the plugin.
86 */
87 void removeScalebar() {
88 // Revert with Undo, in case "Use Overlay" is not ticked
89 imp.getProcessor().reset();
90 imp.updateAndDraw();
91 // Remove overlay drawn by this plugin, in case "Use Overlay" is ticked
92 Overlay overlay = imp.getOverlay();
93 if (overlay!=null) {
94 overlay.remove(SCALE_BAR);
95 imp.draw();
96 }
97 }
98
99 /** Saves the current scale bar previously drawn as an overlay by this plugin,
100 * so it can be restored later. The scale bar overlay is deleted. */

Callers 2

runMethod · 0.95
updateScalebarMethod · 0.95

Calls 6

removeMethod · 0.95
resetMethod · 0.65
getProcessorMethod · 0.45
updateAndDrawMethod · 0.45
getOverlayMethod · 0.45
drawMethod · 0.45

Tested by

no test coverage detected