Package javax.swing

Examples of javax.swing.KeyStroke


            passwordFieldMap.put(pasteKeyStroke, DefaultEditorKit.pasteAction);
        }
    }

    public static void installEscapeBinding(final Window window, final JRootPane rootPane, final boolean dispose) {
        final KeyStroke stroke = KeyStroke.getKeyStroke("ESCAPE");
        final InputMap inputMap = rootPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
        inputMap.put(stroke, "ESCAPE");
        rootPane.getActionMap().put("ESCAPE", new AbstractAction() {
            private static final long serialVersionUID = 1L;
View Full Code Here


    /**
     * Install keyboard shortcuts.
     */
    public void setKeyBoardShortcut()
    {
        KeyStroke jKeyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_J, 0, false);
        KeyStroke ctrlPKeyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_P, KeyEvent.CTRL_MASK, false);
        KeyStroke altSKeyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_S, KeyEvent.ALT_MASK, false);
        KeyStroke vKeyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_V, 0, false);
        String searchID = "TAGSEARCH";
        String preferenceID = "PREFERENCES";
        String skinbrowserID = "SKINBROWSER";
        String stopplayerID = "STOPPLAYER";
        Action searchAction = new AbstractAction()
View Full Code Here

     * <tt>Action</tt>s.
     */
    protected void installKeyboardActions() {

        InputMap inputMap = getInputMap(JComponent.WHEN_FOCUSED);
        KeyStroke key;

        key = KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, 0);
        inputMap.put(key, SCROLL_RIGHT_ACTION);

        key = KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, 0);
View Full Code Here

            };
       
        javax.swing.ActionMap map = svgCanvas.getActionMap();
        map.put(FULL_SCREEN_ACTION, new FullScreenAction());
        javax.swing.InputMap imap = svgCanvas.getInputMap(JComponent.WHEN_FOCUSED);
        KeyStroke key = KeyStroke.getKeyStroke(KeyEvent.VK_F11, 0);
        imap.put(key, FULL_SCREEN_ACTION);

        svgCanvas.setDoubleBufferedRendering(true);

        listeners.put(ABOUT_ACTION, new AboutAction());
View Full Code Here

    getContentPane().setLayout(new BorderLayout());

    getTabbedPane().addChangeListener(getToolBarAndMenus());

    KeyStroke ksRight =
      KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, Event.CTRL_MASK);
    KeyStroke ksLeft =
      KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, Event.CTRL_MASK);

    getTabbedPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(
      ksRight, "MoveRight");
    getTabbedPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(
View Full Code Here

            };
       
        javax.swing.ActionMap map = svgCanvas.getActionMap();
        map.put(FULL_SCREEN_ACTION, new FullScreenAction());
        javax.swing.InputMap imap = svgCanvas.getInputMap(JComponent.WHEN_FOCUSED);
        KeyStroke key = KeyStroke.getKeyStroke(KeyEvent.VK_F11, 0);
        imap.put(key, FULL_SCREEN_ACTION);

        svgCanvas.setDoubleBufferedRendering(true);

        listeners.put(ABOUT_ACTION, new AboutAction());
View Full Code Here

          // don't get command-s or other menu key equivs on mac
          // unless it's something that's specifically bound (cmd-left or right)
          //if ((modifiers & KeyEvent.META_MASK) != 0) return;
          if ((modifiers & KeyEvent.META_MASK) != 0) {
            KeyStroke keyStroke = KeyStroke.getKeyStroke(keyCode, modifiers);
            if (currentBindings.get(keyStroke) == null) {
              return;
            }
          }

                /*
                char keyChar = evt.getKeyChar();
                System.out.println("code=" + keyCode + " char=" + keyChar +
                                   " charint=" + ((int)keyChar));
                System.out.println("other codes " + KeyEvent.VK_ALT + " " +
                                   KeyEvent.VK_META);
                */

                if((modifiers & ~KeyEvent.SHIFT_MASK) != 0
                        || evt.isActionKey()
                        || keyCode == KeyEvent.VK_BACK_SPACE
                        || keyCode == KeyEvent.VK_DELETE
                        || keyCode == KeyEvent.VK_ENTER
                        || keyCode == KeyEvent.VK_TAB
                        || keyCode == KeyEvent.VK_ESCAPE)
                {
                        if(grabAction != null)
                        {
                                handleGrabAction(evt);
                                return;
                        }

                        KeyStroke keyStroke = KeyStroke.getKeyStroke(keyCode,
                                modifiers);
                        Object o = currentBindings.get(keyStroke);
                        if(o == null)
                        {
                                // Don't beep if the user presses some
View Full Code Here

                if (c != KeyEvent.CHAR_UNDEFINED) // &&
                  //                (modifiers & KeyEvent.ALT_MASK) == 0)
                {
                  if(c >= 0x20 && c != 0x7f)
                        {
                                KeyStroke keyStroke = KeyStroke.getKeyStroke(
                                        Character.toUpperCase(c));
                                Object o = currentBindings.get(keyStroke);

                                if(o instanceof Hashtable)
                                {
View Full Code Here

                Hashtable current = bindings;

                StringTokenizer st = new StringTokenizer(keyBinding);
                while(st.hasMoreTokens())
                {
                        KeyStroke keyStroke = parseKeyStroke(st.nextToken());
                        if(keyStroke == null)
                                return;

                        if(st.hasMoreTokens())
                        {
View Full Code Here

                               pRunnableAction.getMnemonic();
                        if ( charMnemonic != null ) {
                            miTemp.setMnemonic( charMnemonic.charValue() );
                        }
                       
                        KeyStroke ksAccelerator = pRunnableAction.getAccelerator();
                        if ( ksAccelerator != null ) {
                            miTemp.setAccelerator( ksAccelerator );
                        }
                        miTemp.setName( miTemp.getText() );
                        Util.debug( this, "<init>.miTemp.name: " +
View Full Code Here

TOP

Related Classes of javax.swing.KeyStroke

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.