/** Handles CheckboxMenuItem state changes. */ public void itemStateChanged(ItemEvent e) { MenuItem item = (MenuItem) e.getSource(); MenuComponent parent = (MenuComponent) item.getParent(); String cmd = e.getItem().toString(); if ((Menu) parent == Menus.window) WindowManager.activateWindow(cmd, item); else doCommand(cmd); }
// GL public synchronized void itemStateChanged(ItemEvent e) { if (e.getSource() == hsb) isRGB = false; if (e.getSource() == rgb) isRGB = true; if (e.getSource() == hsb || e.getSource() == rgb) { flag = true; originalB.setEnabled(false); filteredB.setEnabled(false); minHue = minSat = minBri = 0; maxHue = maxSat = maxBri = 255; bandPassH.setState(true); bandPassS.setState(true); bandPassB.setState(true); } reset(imp, ip); ip = setup(imp); apply(imp, ip); updateNames(); notify(); }