|
|
|
@ -50,50 +50,4 @@ public class DarkButtonListener extends BasicButtonListener {
|
|
|
|
|
model.setRollover(false); |
|
|
|
|
model.setArmed(false); |
|
|
|
|
} |
|
|
|
|
//A possible fix for shadow buttons being focusable.
|
|
|
|
|
//
|
|
|
|
|
// public static void loadActionMap(final LazyActionMap map) {
|
|
|
|
|
// map.put(new Actions(Actions.PRESS));
|
|
|
|
|
// map.put(new Actions(Actions.RELEASE));
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
// /**
|
|
|
|
|
// * Actions for Buttons. Two types of action are supported:
|
|
|
|
|
// * pressed: Moves the button to a pressed state
|
|
|
|
|
// * released: Disarms the button.
|
|
|
|
|
// */
|
|
|
|
|
// protected static class Actions extends UIAction {
|
|
|
|
|
// private static final String PRESS = "pressed";
|
|
|
|
|
// private static final String RELEASE = "released";
|
|
|
|
|
//
|
|
|
|
|
// protected Actions(final String name) {
|
|
|
|
|
// super(name);
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// public void actionPerformed(final ActionEvent e) {
|
|
|
|
|
// AbstractButton b = (AbstractButton)e.getSource();
|
|
|
|
|
// if (DarkButtonUI.doConvertToShadow(b) || DarkButtonUI.isShadowVariant(b)) return;
|
|
|
|
|
// String key = getName();
|
|
|
|
|
// if (PRESS.equals(key)) {
|
|
|
|
|
// ButtonModel model = b.getModel();
|
|
|
|
|
// model.setArmed(true);
|
|
|
|
|
// model.setPressed(true);
|
|
|
|
|
// if(!b.hasFocus()) {
|
|
|
|
|
// b.requestFocus();
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// else if (RELEASE.equals(key)) {
|
|
|
|
|
// ButtonModel model = b.getModel();
|
|
|
|
|
// model.setPressed(false);
|
|
|
|
|
// model.setArmed(false);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// @Override
|
|
|
|
|
// public boolean accept(final Object sender) {
|
|
|
|
|
// return !((sender instanceof AbstractButton) &&
|
|
|
|
|
// !((AbstractButton)sender).getModel().isEnabled());
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
} |
|
|
|
|