Package java.awt

Examples of java.awt.KeyboardFocusManager$HeavyweightFocusRequest


             * component in the form rather than move within the table.
             */
            protected void processKeyEvent( KeyEvent ke ) {
                if (ke.getKeyChar() == KeyEvent.VK_TAB) {
                    if (ke.getID() == KeyEvent.KEY_TYPED) {
                        KeyboardFocusManager focusManager = KeyboardFocusManager.getCurrentKeyboardFocusManager();
                        if (ke.isShiftDown()) {
                            focusManager.focusPreviousComponent();
                        } else {
                            focusManager.focusNextComponent();
                        }
                    }
                    ke.consume();
                } else {
                    super.processKeyEvent(ke);
View Full Code Here


                if (ke.getKeyChar() == KeyEvent.VK_TAB) {//TAB key ?
                    if (getModel().getRowCount() == (getSelectedRow() + 1)) {//last row ?
                        if (getSelectedColumn() == (getColumnCount() - 1)) {//last column ?
                            if (ke.getID() == KeyEvent.KEY_TYPED) {//shift-TAB ?
                                KeyboardFocusManager focusManager = KeyboardFocusManager
                                .getCurrentKeyboardFocusManager();
                                if (ke.isShiftDown()) {
                                    focusManager.focusPreviousComponent();
                                } else {
                                    //int selRow = getSelectedRow();
                                    clearSelection();
                                    focusManager.focusNextComponent();
                                }
                            }
                        } else {
                            setColumnSelectionInterval(getColumnCount() - 1, getColumnCount() - 1);
                        }
                    } else {
                        if (ke.isShiftDown()) {
                            KeyboardFocusManager focusManager = KeyboardFocusManager
                            .getCurrentKeyboardFocusManager();
                            if (getSelectedRow() == 0) {
                                if (getSelectedColumn() == 0) {
                                    clearSelection();
                                    focusManager.focusPreviousComponent();
                                } else {
                                    setColumnSelectionInterval(
                                            getColumnCount() - 1,
                                            getColumnCount() - 1);
                                    super.processKeyEvent(ke);
View Full Code Here

        }
    }
    protected void processKeyEvent(KeyEvent ke) {
        if (ke.getKeyChar() == KeyEvent.VK_TAB) {
            if (ke.getID() == KeyEvent.KEY_TYPED) {
                KeyboardFocusManager focusManager = KeyboardFocusManager.getCurrentKeyboardFocusManager();
                if (ke.isShiftDown()) {
                    focusManager.focusPreviousComponent();
                } else {
                    focusManager.focusNextComponent();
                }
            }
            ke.consume();
        } else {
            super.processKeyEvent(ke);
View Full Code Here

     */
    @Override
    protected void processKeyEvent( KeyEvent ke ) {
        if (ke.getKeyChar() == KeyEvent.VK_TAB) {
            if (ke.getID() == KeyEvent.KEY_TYPED) {
                KeyboardFocusManager focusManager = KeyboardFocusManager.getCurrentKeyboardFocusManager();
                if (ke.isShiftDown()) {
                    focusManager.focusPreviousComponent();
                } else {
                    focusManager.focusNextComponent();
                }
            }
            ke.consume();
        } else if (ke.getKeyCode() == KeyEvent.VK_DOWN
                || ke.getKeyCode() == KeyEvent.VK_UP
View Full Code Here

       
        if(!isCellEditable(index))
            return false;
       
        if(editorRemover == null) {
            KeyboardFocusManager fm = KeyboardFocusManager.getCurrentKeyboardFocusManager();
            editorRemover = new CellEditorRemover(fm);
            fm.addPropertyChangeListener("permanentFocusOwner", editorRemover);
        }
       
        if(editor != null && editor.isCellEditable(e)) {
            editorComp = prepareEditor(index);
            if(editorComp == null) {
View Full Code Here

    private JComponent focusOwner; // = null;

    //This code based on Java DnD tutorial
    public TransferActionListener() {
      KeyboardFocusManager manager = KeyboardFocusManager.
      getCurrentKeyboardFocusManager();
      manager.addPropertyChangeListener("permanentFocusOwner", this);
    }
View Full Code Here

                doReturn();
            }
        }

        private void doReturn() {
            KeyboardFocusManager fmgr =
                KeyboardFocusManager.getCurrentKeyboardFocusManager();
            Component focusOwner = fmgr.getFocusOwner();
            if(focusOwner != null && !(focusOwner instanceof JRootPane)) {
                return;
            }

            MenuSelectionManager msm = MenuSelectionManager.defaultManager();
View Full Code Here

  private class exitTimerAction implements ActionListener {
    public void actionPerformed(ActionEvent e) {
      if(tip == null || insideComponent == null){
        return;
      }
            final KeyboardFocusManager currentKeyboardFocusManager = KeyboardFocusManager.getCurrentKeyboardFocusManager();
            final Window activeWindow = currentKeyboardFocusManager.getActiveWindow();
            if(activeWindow instanceof JDialog && ((JDialog) activeWindow).isModal()
                && ! SwingUtilities.isDescendingFrom(Controller.getCurrentController().getMapViewManager().getMapViewComponent(), activeWindow)){
                hideTipWindow();
                return;
            }

      if(isMouseOverTip() || isMouseOverComponent()){
        exitTimer.restart();
        return;
      }
            final Component focusOwner = currentKeyboardFocusManager.getFocusOwner();
      if(focusOwner != null){
        if(SwingUtilities.isDescendingFrom(focusOwner, tip)){
          exitTimer.restart();
          return;
        }
View Full Code Here

    EventQueue.invokeLater(new Runnable() {
      public void run() {
        if (!oldTable) {
          return;
        }
        final KeyboardFocusManager focusManager = java.awt.KeyboardFocusManager
            .getCurrentKeyboardFocusManager();
        final Component focusOwner = SwingUtilities.getAncestorOfClass(AttributeTable.class, focusManager
            .getFocusOwner());
        if (table != focusOwner && focusOwner instanceof JComponent) {
          table.requestFocus(true);
          ((JComponent) focusOwner).requestFocusInWindow();
        }
View Full Code Here

        EventQueue.invokeLater(new Runnable() {
            public void run() {
                DockbarTracker tracker = new DockbarTracker();
                // register a propertyChangeListener to update the 'currrent'
                // DockbarManager each time the focused window changes
                KeyboardFocusManager focusManager = KeyboardFocusManager.getCurrentKeyboardFocusManager();
                focusManager.addPropertyChangeListener(tracker);

                // register an AWTEventListener to handle low-level mouse events
                long evtType = AWTEvent.MOUSE_MOTION_EVENT_MASK | AWTEvent.MOUSE_EVENT_MASK;
                Toolkit.getDefaultToolkit().addAWTEventListener(tracker, evtType);
            }
View Full Code Here

TOP

Related Classes of java.awt.KeyboardFocusManager$HeavyweightFocusRequest

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.