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

Method setIcon

ij/src/main/java/ij/gui/Toolbar.java:2150–2166  ·  view source on GitHub ↗

Sets the icon of the specified macro or plugin tool. See: Help>Examples>Tool>Animated Icon Tool;

(String toolName, String icon)

Source from the content-addressed store, hash-verified

2148 * See: Help>Examples>Tool>Animated Icon Tool;
2149 */
2150 public static void setIcon(String toolName, String icon) {
2151 if (instance==null)
2152 return;
2153 int tool = 0;
2154 for (int i=CUSTOM1; i<instance.getNumTools(); i++) {
2155 if (instance.names[i]!=null && instance.names[i].equals(toolName)) {
2156 tool = i;
2157 break;
2158 }
2159 }
2160 if (tool>0) {
2161 instance.icons[tool] = icon;
2162 Graphics2D g = (Graphics2D)instance.getGraphics();
2163 instance.setStrokeWidth(g);
2164 instance.drawButton(g, tool);
2165 }
2166 }
2167
2168}

Callers 3

scaleMethod · 0.45
runMethod · 0.45
computeCoordinatesMethod · 0.45

Calls 5

getNumToolsMethod · 0.80
getGraphicsMethod · 0.80
drawButtonMethod · 0.80
equalsMethod · 0.45
setStrokeWidthMethod · 0.45

Tested by

no test coverage detected