Package javax.swing.plaf

Examples of javax.swing.plaf.ActionMapUIResource


        return uiDefaults;
    }

    protected ActionMap getAudioActionMap() {
        ActionMapUIResource result = new ActionMapUIResource();
        Object[] actions = (Object[])getDefaults().get("AuditoryCues.cueList");
        if (actions == null) {
            return result;
        }
        for (int i = 0; i < actions.length; i++) {
            result.put(actions[i], createAudioAction(actions[i]));
        }

        return result;
    }
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

        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

    /*
     * Create a new instance of ActionMap.
     */
    private ActionMap createActionMap(final JRootPane root) {
        ActionMapUIResource actionMap = new ActionMapUIResource();

        actionMap.put("press", new DefaultButtonAction(root, true));
        actionMap.put("release", new DefaultButtonAction(root, false));
        actionMap.put("postPopup", new AbstractAction() {
            public void actionPerformed(final ActionEvent e) {
                JComponent focusOwner = getFocusOwner();
                JPopupMenu menu = focusOwner.getComponentPopupMenu();
                if (menu == null) {
                    return;
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

    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

    }

    final void installUIActionMap() {
        UIDefaults uiDefaults = UIManager.getLookAndFeelDefaults();
        String propertyName = getPropertyPrefix() + ".actionMap";
        ActionMap actionMap1 = new ActionMapUIResource();
        putActionToActionMap(focusAction, actionMap1);
        Object actionMap2 = uiDefaults.get(propertyName);
        if (actionMap2 == null) {
            ActionMapUIResource map = new ActionMapUIResource();
            Action[] actions = component.getActions();
            for (int i = 0; i < actions.length; i++) {
                putActionToActionMap(actions[i], map);
            }
            putActionToActionMap(TransferHandler.getPasteAction(), map);
View Full Code Here

    protected void uninstallDefaults() {
        LookAndFeel.uninstallBorder(menuBar);
    }

    protected void installKeyboardActions() {
        ActionMap actionMap = new ActionMapUIResource();
        actionMap.put(FocusAction.KEY, FOCUS_ACTION);
        SwingUtilities.replaceUIActionMap(menuBar, actionMap);

        SwingUtilities.replaceUIInputMap(menuBar, JComponent.WHEN_IN_FOCUSED_WINDOW,
                                         LookAndFeel.makeComponentInputMap(menuBar, (Object[])UIManager.get(PROPERTY_PREFIX + "windowBindings")));
    }
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

  /**
   * Return the mapping between JTree's input map and JGraph's actions.
   */
  ActionMap createActionMap() {
    // 1: Up, 2: Right, 3: Down, 4: Left
    ActionMap map = new ActionMapUIResource();

    map
        .put("selectPrevious", new GraphIncrementAction(1,
            "selectPrevious"));
    map.put("selectPreviousChangeLead", new GraphIncrementAction(1,
        "selectPreviousLead"));
    map.put("selectPreviousExtendSelection", new GraphIncrementAction(1,
        "selectPreviousExtendSelection"));

    map.put("selectParent", new GraphIncrementAction(4, "selectParent"));
    map.put("selectParentChangeLead", new GraphIncrementAction(4,
        "selectParentChangeLead"));

    map.put("selectNext", new GraphIncrementAction(3, "selectNext"));
    map.put("selectNextChangeLead", new GraphIncrementAction(3,
        "selectNextLead"));
    map.put("selectNextExtendSelection", new GraphIncrementAction(3,
        "selectNextExtendSelection"));

    map.put("selectChild", new GraphIncrementAction(2, "selectChild"));
    map.put("selectChildChangeLead", new GraphIncrementAction(2,
        "selectChildChangeLead"));

    map.put("cancel", new GraphCancelEditingAction("cancel"));
    map.put("startEditing", new GraphEditAction("startEditing"));
    map.put("selectAll", new GraphSelectAllAction("selectAll", true));
    map.put("clearSelection", new GraphSelectAllAction("clearSelection",
        false));
    return map;
  }
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.