()
| 153 | } |
| 154 | |
| 155 | public void update() { |
| 156 | CompositeImage ci = getImage(); |
| 157 | if (ci==null || checkbox==null) |
| 158 | return; |
| 159 | int n = checkbox.length; |
| 160 | int nChannels = ci.getNChannels(); |
| 161 | if (nChannels!=n && nChannels<=CompositeImage.MAX_CHANNELS) { |
| 162 | instance = null; |
| 163 | location = getLocation(); |
| 164 | close(); |
| 165 | new Channels(); |
| 166 | return; |
| 167 | } |
| 168 | boolean[] active = ci.getActiveChannels(); |
| 169 | for (int i=0; i<checkbox.length; i++) |
| 170 | checkbox[i].setState(active[i]); |
| 171 | int index = 0; |
| 172 | |
| 173 | String cmode = ci.getProp("CompositeProjection"); |
| 174 | int cindex = COMP; |
| 175 | if (cmode!=null) { |
| 176 | if (cmode.contains("Max")||cmode.contains("max")) cindex=MAX; |
| 177 | if (cmode.contains("Min")||cmode.contains("min")) cindex=MIN; |
| 178 | if (cmode.contains("Invert")||cmode.contains("invert")) cindex=INVERT; |
| 179 | } |
| 180 | switch (ci.getMode()) { |
| 181 | case IJ.COMPOSITE: index=cindex; break; |
| 182 | case IJ.COLOR: index=COLOR; break; |
| 183 | case IJ.GRAYSCALE: index=GRAY; break; |
| 184 | } |
| 185 | choice.select(index); |
| 186 | } |
| 187 | |
| 188 | public static void updateChannels() { |
| 189 | if (instance!=null) |
no test coverage detected