Examples of KeyStroke


Examples of javax.swing.KeyStroke

    /* (non-Javadoc)
     * @see simtools.diagram.DiagramComponent#registerActions()
     */
    protected void registerActions() {
      super.registerActions();
      KeyStroke ks;
      ks=KeyStroke.getKeyStroke(KeyEvent.VK_S,KeyEvent.CTRL_MASK);
      getInputMap().remove(ks);// don't use ctrlS to select connectors
      ks=KeyStroke.getKeyStroke(KeyEvent.VK_N,KeyEvent.CTRL_MASK);
      getInputMap().remove(ks);// don't use ctrlN to create component
      ks=KeyStroke.getKeyStroke(KeyEvent.VK_SPACE ,KeyEvent.CTRL_MASK);
View Full Code Here

Examples of javax.swing.KeyStroke

    }
    else{
      res.setMnemonic(iname.charAt(0));
    }

    KeyStroke k = getKeyStroke(name+"Shortcut");
    if (k != null) res.setAccelerator(k);

    if(listener!=null){
      res.addActionListener(listener);
    }
View Full Code Here

Examples of javax.swing.KeyStroke

      res.setMnemonic(mname.charAt(0));
    } else {
      res.setMnemonic(iname.charAt(0));
    }

    KeyStroke k = getKeyStroke(name+"Shortcut");
    if (k != null) res.setAccelerator(k);

    if (listener != null) {
      res.addActionListener(listener);
    }
View Full Code Here

Examples of javax.swing.KeyStroke

        }

        jmWindows = desktopCardPanel.createMenu(null);

        JMenuItem item = jmWindows.add(aZoomIn);
        KeyStroke  k = resources.getKeyStroke("zoomInShortcut");
        if (k != null) {
            item.setAccelerator(k);
        }
        item = jmWindows.add(aZoomOut);
        k = resources.getKeyStroke("zoomOutShortcut");
View Full Code Here

Examples of javax.swing.KeyStroke

     * Add an edit menu to a menu bar1999
     */
    public void addEditMenu(Object mb) {
        jmEdit = resources.getMenu("edit");
        JMenuItem item;
        KeyStroke k;
        jmEdit.add(miUndo = resources.getItem("undo", this));
        k = resources.getKeyStroke("undoShortcut");
        miUndo.setIcon(resources.getIcon("undoImage"));
        if (k != null) {
            miUndo.setAccelerator(k);
View Full Code Here

Examples of javax.swing.KeyStroke

        _rootNode.refresh();
        setTransferHandler(new ShapeTransferHandler());
        setDragEnabled(true);

        // register keyboard actions
        KeyStroke ks;
        ks=KeyStroke.getKeyStroke(KeyEvent.VK_Z,
                KeyEvent.CTRL_MASK);
        registerKeyboardAction(this, "z",
                ks, WHEN_FOCUSED);
        ks=KeyStroke.getKeyStroke(KeyEvent.VK_Y,
View Full Code Here

Examples of javax.swing.KeyStroke

                    + "Action"));
            ImageIcon i = sharedResources.getIcon(_resourceKey + "Image");
            if (i != null) {
                putValue(Action.SMALL_ICON, i);
            }
            KeyStroke k = sharedResources.getKeyStroke(_resourceKey + "Shortcut");
            if (k != null) {
                putValue(Action.ACCELERATOR_KEY, k);
            }
            String tip = sharedResources.getStringValue(_resourceKey + "Tip");
            putValue(Action.SHORT_DESCRIPTION, tip);
View Full Code Here

Examples of javax.swing.KeyStroke

                + "Text"));
        ImageIcon i = Tree.resources.getIcon(_resourceKey + "Image");
        if (i != null) {
            putValue(Action.SMALL_ICON, i);
        }
        KeyStroke k = Tree.resources.getKeyStroke(_resourceKey + "Shortcut");
        if (k != null) {
            putValue(Action.ACCELERATOR_KEY, k);
        }
        String tip = Tree.resources.getStringValue(_resourceKey + "Tip");
        putValue(Action.SHORT_DESCRIPTION, tip);
View Full Code Here

Examples of javax.swing.KeyStroke

         {
            setVisible(false);
            dispose();
         }
      };
      KeyStroke escapeStroke = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0);
      getRootPane().getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(escapeStroke, "CloseAction");
      getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(escapeStroke, "CloseAction");
      getRootPane().getInputMap(JComponent.WHEN_FOCUSED).put(escapeStroke, "CloseAction");
      getRootPane().getActionMap().put("CloseAction", closeAction);
View Full Code Here

Examples of javax.swing.KeyStroke

         public void actionPerformed(ActionEvent actionEvent) {
            setVisible(false);
            dispose();
         }
      };
      KeyStroke escapeStroke = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0);
      getRootPane().getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT)
                   .put(escapeStroke, "CloseAction");
      getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW)
                   .put(escapeStroke, "CloseAction");
      getRootPane().getInputMap(JComponent.WHEN_FOCUSED).put(escapeStroke,
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.