(String label)
| 2050 | } |
| 2051 | |
| 2052 | private boolean installBuiltinTool(String label) { |
| 2053 | if (IJ.debugMode) IJ.log("Toolbar.installBuiltinTool: "+label); |
| 2054 | boolean ok = true; |
| 2055 | PlugInTool tool = null; |
| 2056 | if (label.startsWith("Arrow")) { |
| 2057 | tool = new ij.plugin.tool.ArrowTool(); |
| 2058 | if (tool!=null) tool.run(""); |
| 2059 | showSource("Arrow"); |
| 2060 | } else if (label.startsWith("Overlay Brush")) { |
| 2061 | tool = new ij.plugin.tool.OverlayBrushTool(); |
| 2062 | if (tool!=null) tool.run(""); |
| 2063 | showSource("OverlayBrush"); |
| 2064 | } else if (label.startsWith("Pixel Inspect")) { |
| 2065 | tool = new ij.plugin.tool.PixelInspectionTool(); |
| 2066 | if (tool!=null) tool.run(""); |
| 2067 | showSource("PixelInspection"); |
| 2068 | } else if (label.startsWith("Brush")||label.startsWith("Paintbrush")) { |
| 2069 | tool = new ij.plugin.tool.BrushTool(); |
| 2070 | if (tool!=null) tool.run(""); |
| 2071 | showSource("Brush"); |
| 2072 | } else if (label.startsWith("Pencil")) { |
| 2073 | tool = new ij.plugin.tool.BrushTool(); |
| 2074 | if (tool!=null) tool.run("pencil"); |
| 2075 | showSource("Brush"); |
| 2076 | } else if (label.startsWith("Selection Rotator")) { |
| 2077 | tool = new ij.plugin.tool.RoiRotationTool(); |
| 2078 | if (tool!=null) tool.run(""); |
| 2079 | showSource("RoiRotation"); |
| 2080 | } else if (label.startsWith("Flood Fill")) |
| 2081 | installMacroFromJar("/macros/FloodFillTool.txt"); |
| 2082 | else if (label.startsWith("Spray Can")) |
| 2083 | installMacroFromJar("/macros/SprayCanTool.txt"); |
| 2084 | else if (label.startsWith("Developer Menu")) |
| 2085 | installMacroFromJar("/macros/DeveloperMenuTool.txt"); |
| 2086 | else if (label.startsWith("Stacks Menu")) |
| 2087 | installMacroFromJar("/macros/StacksMenuTool.txt"); |
| 2088 | else if (label.startsWith("LUT Menu")) |
| 2089 | installMacroFromJar("/macros/LUTMenuTool.txt"); |
| 2090 | else if (label.startsWith("Command Finder")) |
| 2091 | installMacroFromJar("/macros/CommandFinderTool.txt"); |
| 2092 | else if (label.startsWith("ROI")) |
| 2093 | installMacroFromJar("/macros/RoiMenuTool.txt"); |
| 2094 | else if (label.startsWith("Label")) |
| 2095 | installMacroFromJar("/macros/Label_Tool.txt"); |
| 2096 | else |
| 2097 | ok = false; |
| 2098 | return ok; |
| 2099 | } |
| 2100 | |
| 2101 | private void showSource(String name) { |
| 2102 | if (IJ.shiftKeyDown()) { |
no test coverage detected