Package javax.swing.plaf

Examples of javax.swing.plaf.ActionMapUIResource


                grabFocus();
                setState(getNextState(getState()));
            }
        });
        // Reset the keyboard action map
        ActionMap map = new ActionMapUIResource();
        map.put("pressed", new AbstractAction() {
            private static final long serialVersionUID = 7121802319351334948L;

            public void actionPerformed(ActionEvent e) {
                grabFocus();
                setState(getNextState(getState()));
            }
        });
        map.put("released", null);
        SwingUtilities.replaceUIActionMap(this, map);
        // set the model to the adapted model
        model = new TristateDecorator(getModel());
        setModel(model);
        setState(initial);
View Full Code Here


    ActionMap map1 = SwingUtilities.getUIActionMap(t);
    map1.setParent(new ActionMap());

    harness.check(howManyMaps(t) == 3);

    ActionMapUIResource map2 = new ActionMapUIResource();
    SwingUtilities.replaceUIActionMap(t, map2);

    harness.check(howManyMaps(t) == 2);
  }
View Full Code Here

    protected void installKeyboardActions() {
        createInternalFrameListener();
        frame.addInternalFrameListener(internalFrameListener);

        ActionMapUIResource actionMap = new ActionMapUIResource();
        actionMap.put("showSystemMenu", new AbstractAction() {
            public void actionPerformed(final ActionEvent e) {
                if (titlePane != null) {
                    titlePane.showSystemMenu();
                }
            }
        });

        actionMap.setParent(((BasicLookAndFeel)UIManager.getLookAndFeel())
                            .getAudioActionMap());
        SwingUtilities.replaceUIActionMap(frame, actionMap);
    }
View Full Code Here

    private ActionMap getUIActionMap() {
        if (actionMap != null) {
            return actionMap;
        }

        actionMap = new ActionMapUIResource();
        final AbstractAction navigateEastAction = new NavigateAction(EAST);
        actionMap.put("navigateRight", navigateEastAction);
        final AbstractAction navigateWestAction = new NavigateAction(WEST);
        actionMap.put("navigateLeft", navigateWestAction);
        actionMap.put("navigateUp", new NavigateAction(NORTH));
View Full Code Here

        menuKeyListener = null;
        mouseInputListener = null;
    }

    protected void installKeyboardActions() {
        ActionMap actionMap = new ActionMapUIResource();
        actionMap.put(StringConstants.MNEMONIC_ACTION, MNEMONIC_ACTION);
        actionMap.setParent(((BasicLookAndFeel)UIManager.getLookAndFeel()).getAudioActionMap());
        SwingUtilities.replaceUIActionMap(menuItem, actionMap);
    }
View Full Code Here

    public void uninstallKeyboardActions(final JComponent c) {
        SwingUtilities.replaceUIActionMap(c, null);
    }

    public void installKeyboardActions(final JComponent c) {
        ActionMap actionMap = new ActionMapUIResource();
        actionMap.put(StringConstants.BUTTON_PRESSED_ACTION, PRESS_ACTION);
        actionMap.put(StringConstants.BUTTON_RELEASED_ACTION, RELEASE_ACTION);
        actionMap.put(StringConstants.MNEMONIC_ACTION, MNEMONIC_ACTION);
        SwingUtilities.replaceUIActionMap(c, actionMap);
    }
View Full Code Here

        super.installDefaults();
        LookAndFeel.installProperty(menuItem, "opaque", Boolean.FALSE);
    }

    protected void installKeyboardActions() {
        ActionMap actionMap = new ActionMapUIResource();
        actionMap.put(StringConstants.MNEMONIC_ACTION, MNEMONIC_ACTION);
        actionMap.setParent(((BasicLookAndFeel)UIManager.getLookAndFeel()).getAudioActionMap());
        SwingUtilities.replaceUIActionMap(menuItem, actionMap);
    }
View Full Code Here

    protected void installKeyboardActions() {
        SwingUtilities.replaceUIInputMap(optionPane, JComponent.WHEN_IN_FOCUSED_WINDOW,
                       LookAndFeel.makeComponentInputMap(optionPane, (Object[])UIManager.get(PROPERTY_PREFIX + "windowBindings")));

        ActionMap actionMap = new ActionMapUIResource();
        actionMap.put(StringConstants.CLOSE_ACTION, closeAction);
        actionMap.setParent(((BasicLookAndFeel)UIManager.getLookAndFeel())
                            .getAudioActionMap());
        SwingUtilities.replaceUIActionMap(optionPane, actionMap);
    }
View Full Code Here

    protected ActionMap getActionMap() {
        return createActionMap();
    }

    protected ActionMap createActionMap() {
        ActionMap result = new ActionMapUIResource();
        result.put("approveSelection", getApproveSelectionAction());
        result.put("cancelSelection", getCancelSelectionAction());
        result.put("Go Up", getChangeToParentDirectoryAction());

        return result;
    }
View Full Code Here

        model.nextState();
        fireActionPerformed(new ActionEvent(e.getSource(), ActionEvent.ACTION_PERFORMED, model.getState().toString()));
      }
    });
    // Reset the keyboard action map
    ActionMap map = new ActionMapUIResource();
    map.put("pressed", new AbstractAction() {
      public void actionPerformed(ActionEvent e) {
        grabFocus();
        model.nextState();
      }
    });
    map.put("released", null);
    SwingUtilities.replaceUIActionMap(this, map);
    // set the model to the adapted model
    model = new TristateDecorator(getModel());
    setModel(model);
    setState(initial);
View Full Code Here

TOP

Related Classes of javax.swing.plaf.ActionMapUIResource

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.