Sets the icon of the specified macro or plugin tool. See: Help>Examples>Tool>Animated Icon Tool;
(String toolName, String icon)
| 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 | } |
no test coverage detected