VK_F10()源码实例Demo

java.awt.event.KeyEvent#VK_F10()源码实例Demo

下面列出了java.awt.event.KeyEvent#VK_F10() 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: netbeans   文件: PopupMenuAction.java
public State keyPressed (Widget widget, WidgetKeyEvent event) {
        if (event.getKeyCode () == KeyEvent.VK_CONTEXT_MENU  ||  ((event.getModifiers () & InputEvent.SHIFT_MASK) == InputEvent.SHIFT_MASK  &&  event.getKeyCode () == KeyEvent.VK_F10)) {
            JPopupMenu popupMenu = provider.getPopupMenu (widget, null);
            if (popupMenu != null) {
                JComponent view = widget.getScene ().getView ();
                if (view != null) {
//                    Rectangle visibleRect = view.getVisibleRect ();
//                    popupMenu.show (view, visibleRect.x + 10, visibleRect.y + 10);
                    Rectangle bounds = widget.getBounds ();
                    Point location = new Point (bounds.x + 5, bounds.y + 5);
                    location = widget.convertLocalToScene (location);
                    location = widget.getScene ().convertSceneToView (location);
                    popupMenu.show (view, location.x, location.y);
                }
            }
            return State.CONSUMED;
        }
        return State.REJECTED;
    }
 
源代码2 项目: visualvm   文件: ExplorerComponent.java
public void keyPressed(KeyEvent e) {
    if ((e.getKeyCode() == KeyEvent.VK_CONTEXT_MENU)
                    || ((e.getKeyCode() == KeyEvent.VK_F10) && (e.getModifiers() == InputEvent.SHIFT_MASK))) {
        
        e.consume();
        
        int x;
        int y;
        TreePath path = explorerTree.getSelectionPath();
        
        if (path != null) {
            Rectangle pathRect = explorerTree.getPathBounds(path);
            x = pathRect.x;
            y = pathRect.y;
        } else {
            Point pathPoint = new Point(explorerTree.getWidth() / 3, explorerTree.getHeight() / 3);
            x = pathPoint.x;
            y = pathPoint.y;
        }
        
        displayContextMenu(x, y);
    }
}
 
源代码3 项目: visualvm   文件: ReferencesBrowserControllerUI.java
public void keyPressed(KeyEvent e) {
    if ((e.getKeyCode() == KeyEvent.VK_CONTEXT_MENU)
            || ((e.getKeyCode() == KeyEvent.VK_F10) && (e.getModifiers() == InputEvent.SHIFT_MASK))) {
        int selectedRow = fieldsListTable.getSelectedRow();

        if (selectedRow != -1) {
            showPopupMenu(selectedRow, -1, -1);
        }
    }
}
 
源代码4 项目: jdk8u_jdk   文件: XComponentPeer.java
void handleF10JavaKeyEvent(KeyEvent e) {
    if (e.getID() == KeyEvent.KEY_PRESSED && e.getKeyCode() == KeyEvent.VK_F10) {
        XWindowPeer winPeer = this.getToplevelXWindow();
        if (winPeer instanceof XFramePeer) {
            XMenuBarPeer mPeer = ((XFramePeer)winPeer).getMenubarPeer();
            if (mPeer != null) {
                mPeer.handleF10KeyPress(e);
            }
        }
    }
}
 
源代码5 项目: jdk8u-jdk   文件: XComponentPeer.java
void handleF10JavaKeyEvent(KeyEvent e) {
    if (e.getID() == KeyEvent.KEY_PRESSED && e.getKeyCode() == KeyEvent.VK_F10) {
        XWindowPeer winPeer = this.getToplevelXWindow();
        if (winPeer instanceof XFramePeer) {
            XMenuBarPeer mPeer = ((XFramePeer)winPeer).getMenubarPeer();
            if (mPeer != null) {
                mPeer.handleF10KeyPress(e);
            }
        }
    }
}
 
源代码6 项目: openjdk-jdk8u   文件: XComponentPeer.java
void handleF10JavaKeyEvent(KeyEvent e) {
    if (e.getID() == KeyEvent.KEY_PRESSED && e.getKeyCode() == KeyEvent.VK_F10) {
        XWindowPeer winPeer = this.getToplevelXWindow();
        if (winPeer instanceof XFramePeer) {
            XMenuBarPeer mPeer = ((XFramePeer)winPeer).getMenubarPeer();
            if (mPeer != null) {
                mPeer.handleF10KeyPress(e);
            }
        }
    }
}
 
源代码7 项目: netbeans   文件: ProfilingPointsWindowUI.java
public void keyPressed(KeyEvent e) {
    if ((e.getKeyCode() == KeyEvent.VK_CONTEXT_MENU)
            || ((e.getKeyCode() == KeyEvent.VK_F10) && (e.getModifiers() == InputEvent.SHIFT_MASK))) {
        int[] selectedRows = profilingPointsTable.getSelectedRows();

        if (selectedRows.length != 0) {
            Rectangle rowBounds = profilingPointsTable.getCellRect(selectedRows[0], 1, true);
            showProfilingPointsPopup(e.getComponent(), rowBounds.x + 20,
                                     rowBounds.y + (profilingPointsTable.getRowHeight() / 2));
        }
    } else if (e.getKeyCode() == KeyEvent.VK_DELETE) {
        deletePPs();
    }
}
 
源代码8 项目: netbeans   文件: FieldsBrowserControllerUI.java
public void keyPressed(KeyEvent e) {
    if ((e.getKeyCode() == KeyEvent.VK_CONTEXT_MENU)
            || ((e.getKeyCode() == KeyEvent.VK_F10) && (e.getModifiers() == InputEvent.SHIFT_MASK))) {
        int selectedRow = fieldsListTable.getSelectedRow();

        if (selectedRow != -1) {
            showPopupMenu(selectedRow, -1, -1);
        }
    }
}
 
源代码9 项目: netbeans   文件: ReferencesBrowserControllerUI.java
public void keyPressed(KeyEvent e) {
    if ((e.getKeyCode() == KeyEvent.VK_CONTEXT_MENU)
            || ((e.getKeyCode() == KeyEvent.VK_F10) && (e.getModifiers() == InputEvent.SHIFT_MASK))) {
        int selectedRow = fieldsListTable.getSelectedRow();

        if (selectedRow != -1) {
            showPopupMenu(selectedRow, -1, -1);
        }
    }
}
 
源代码10 项目: visualvm   文件: InstancesListControllerUI.java
public void keyPressed(KeyEvent e) {
    if ((e.getKeyCode() == KeyEvent.VK_CONTEXT_MENU)
            || ((e.getKeyCode() == KeyEvent.VK_F10) && (e.getModifiers() == InputEvent.SHIFT_MASK))) {
        int selectedRow = instancesListTable.getSelectedRow();

        if (selectedRow != -1) {
            Rectangle rowBounds = instancesListTable.getCellRect(selectedRow, 0, true);
            showTablePopup(instancesListTable, rowBounds.x + (rowBounds.width / 2), rowBounds.y + (rowBounds.height / 2));
        }
    } else if (KeyStroke.getAWTKeyStroke(e.getKeyCode(), e.getModifiers()).equals(COPY_ID_KEYSTROKE)) {
        copyIdToClipboard();
    }
}
 
源代码11 项目: netbeans   文件: InstancesListControllerUI.java
public void keyPressed(KeyEvent e) {
    if ((e.getKeyCode() == KeyEvent.VK_CONTEXT_MENU)
            || ((e.getKeyCode() == KeyEvent.VK_F10) && (e.getModifiers() == InputEvent.SHIFT_MASK))) {
        int selectedRow = instancesListTable.getSelectedRow();

        if (selectedRow != -1) {
            Rectangle rowBounds = instancesListTable.getCellRect(selectedRow, 0, true);
            showTablePopup(instancesListTable, rowBounds.x + (rowBounds.width / 2), rowBounds.y + (rowBounds.height / 2));
        }
    } else if (KeyStroke.getAWTKeyStroke(e.getKeyCode(), e.getModifiers()).equals(COPY_ID_KEYSTROKE)) {
        copyIdToClipboard();
    }
}
 
源代码12 项目: netbeans   文件: ProfilerTable.java
protected void processKeyEvent(KeyEvent e) {
    int code = e.getKeyCode();
    if (code == KeyEvent.VK_CONTEXT_MENU ||
       (code == KeyEvent.VK_F10 && e.getModifiers() == InputEvent.SHIFT_MASK)) {
        e.consume();
        showPopupMenu(null);
    }
    
    super.processKeyEvent(e);
}
 
源代码13 项目: netbeans   文件: HTMLTextArea.java
protected void processKeyEvent(KeyEvent e) {
    int code = e.getKeyCode();
    if (code == KeyEvent.VK_CONTEXT_MENU ||
       (code == KeyEvent.VK_F10 && e.getModifiers() == InputEvent.SHIFT_MASK)) {
        e.consume();
        showPopupMenu(null);
    }
    
    super.processKeyEvent(e);
}
 
源代码14 项目: jdk8u-dev-jdk   文件: XComponentPeer.java
void handleF10JavaKeyEvent(KeyEvent e) {
    if (e.getID() == KeyEvent.KEY_PRESSED && e.getKeyCode() == KeyEvent.VK_F10) {
        XWindowPeer winPeer = this.getToplevelXWindow();
        if (winPeer instanceof XFramePeer) {
            XMenuBarPeer mPeer = ((XFramePeer)winPeer).getMenubarPeer();
            if (mPeer != null) {
                mPeer.handleF10KeyPress(e);
            }
        }
    }
}
 
源代码15 项目: openjdk-8   文件: XComponentPeer.java
void handleF10JavaKeyEvent(KeyEvent e) {
    if (e.getID() == KeyEvent.KEY_PRESSED && e.getKeyCode() == KeyEvent.VK_F10) {
        XWindowPeer winPeer = this.getToplevelXWindow();
        if (winPeer instanceof XFramePeer) {
            XMenuBarPeer mPeer = ((XFramePeer)winPeer).getMenubarPeer();
            if (mPeer != null) {
                mPeer.handleF10KeyPress(e);
            }
        }
    }
}
 
源代码16 项目: hottub   文件: XComponentPeer.java
void handleF10JavaKeyEvent(KeyEvent e) {
    if (e.getID() == KeyEvent.KEY_PRESSED && e.getKeyCode() == KeyEvent.VK_F10) {
        XWindowPeer winPeer = this.getToplevelXWindow();
        if (winPeer instanceof XFramePeer) {
            XMenuBarPeer mPeer = ((XFramePeer)winPeer).getMenubarPeer();
            if (mPeer != null) {
                mPeer.handleF10KeyPress(e);
            }
        }
    }
}
 
源代码17 项目: openjdk-8-source   文件: XComponentPeer.java
void handleF10JavaKeyEvent(KeyEvent e) {
    if (e.getID() == KeyEvent.KEY_PRESSED && e.getKeyCode() == KeyEvent.VK_F10) {
        XWindowPeer winPeer = this.getToplevelXWindow();
        if (winPeer instanceof XFramePeer) {
            XMenuBarPeer mPeer = ((XFramePeer)winPeer).getMenubarPeer();
            if (mPeer != null) {
                mPeer.handleF10KeyPress(e);
            }
        }
    }
}
 
源代码18 项目: visualvm   文件: LinkButton.java
protected void processKeyEvent(KeyEvent e) {
    int code = e.getKeyCode();
    if (code == KeyEvent.VK_CONTEXT_MENU ||
       (code == KeyEvent.VK_F10 && e.getModifiers() == InputEvent.SHIFT_MASK)) {
        e.consume();
        showPopupMenu(null);
    }
    
    super.processKeyEvent(e);
}
 
源代码19 项目: cosmic   文件: VncClientPacketSender.java
private int mapAwtKeyToVncKey(final int key) {
    switch (key) {
        case KeyEvent.VK_BACK_SPACE:
            return 0xff08;
        case KeyEvent.VK_TAB:
            return 0xff09;
        case KeyEvent.VK_ENTER:
            return 0xff0d;
        case KeyEvent.VK_ESCAPE:
            return 0xff1b;
        case KeyEvent.VK_INSERT:
            return 0xff63;
        case KeyEvent.VK_DELETE:
            return 0xffff;
        case KeyEvent.VK_HOME:
            return 0xff50;
        case KeyEvent.VK_END:
            return 0xff57;
        case KeyEvent.VK_PAGE_UP:
            return 0xff55;
        case KeyEvent.VK_PAGE_DOWN:
            return 0xff56;
        case KeyEvent.VK_LEFT:
            return 0xff51;
        case KeyEvent.VK_UP:
            return 0xff52;
        case KeyEvent.VK_RIGHT:
            return 0xff53;
        case KeyEvent.VK_DOWN:
            return 0xff54;
        case KeyEvent.VK_F1:
            return 0xffbe;
        case KeyEvent.VK_F2:
            return 0xffbf;
        case KeyEvent.VK_F3:
            return 0xffc0;
        case KeyEvent.VK_F4:
            return 0xffc1;
        case KeyEvent.VK_F5:
            return 0xffc2;
        case KeyEvent.VK_F6:
            return 0xffc3;
        case KeyEvent.VK_F7:
            return 0xffc4;
        case KeyEvent.VK_F8:
            return 0xffc5;
        case KeyEvent.VK_F9:
            return 0xffc6;
        case KeyEvent.VK_F10:
            return 0xffc7;
        case KeyEvent.VK_F11:
            return 0xffc8;
        case KeyEvent.VK_F12:
            return 0xffc9;
        case KeyEvent.VK_SHIFT:
            return 0xffe1;
        case KeyEvent.VK_CONTROL:
            return 0xffe3;
        case KeyEvent.VK_META:
            return 0xffe7;
        case KeyEvent.VK_ALT:
            return 0xffe9;
        case KeyEvent.VK_ALT_GRAPH:
            return 0xffea;
        case KeyEvent.VK_BACK_QUOTE:
            return 0x0060;
    }

    return key;
}
 
源代码20 项目: workcraft   文件: ActionUtils.java
public static String getKeyString(int keyCode) {
    // Letters and numbers
    if (((keyCode >= KeyEvent.VK_0) && (keyCode <= KeyEvent.VK_9))
            || ((keyCode >= KeyEvent.VK_A) && (keyCode <= KeyEvent.VK_Z))) {
        return String.valueOf((char) keyCode);
    }
    switch (keyCode) {
    // Navigation keys
    case KeyEvent.VK_LEFT: return "Left";
    case KeyEvent.VK_UP: return "Up";
    case KeyEvent.VK_RIGHT: return "Right";
    case KeyEvent.VK_DOWN: return "Down";
    // Extra navigation keys
    case KeyEvent.VK_INSERT: return "Insert";
    case KeyEvent.VK_DELETE: return "Delete";
    case KeyEvent.VK_END: return "End";
    case KeyEvent.VK_HOME: return "Home";
    case KeyEvent.VK_PAGE_UP: return "PgUp";
    case KeyEvent.VK_PAGE_DOWN: return "PgDn";
    // Function keys
    case KeyEvent.VK_F1: return "F1";
    case KeyEvent.VK_F2: return "F2";
    case KeyEvent.VK_F3: return "F3";
    case KeyEvent.VK_F4: return "F4";
    case KeyEvent.VK_F5: return "F5";
    case KeyEvent.VK_F6: return "F6";
    case KeyEvent.VK_F7: return "F7";
    case KeyEvent.VK_F8: return "F8";
    case KeyEvent.VK_F9: return "F9";
    case KeyEvent.VK_F10: return "F10";
    case KeyEvent.VK_F11: return "F11";
    case KeyEvent.VK_F12: return "F12";
    // Symbols
    case KeyEvent.VK_EXCLAMATION_MARK: return "!";
    case KeyEvent.VK_QUOTEDBL: return "\"";
    case KeyEvent.VK_EURO_SIGN: return "€";
    case KeyEvent.VK_DOLLAR: return "$";
    case KeyEvent.VK_CIRCUMFLEX: return "^";
    case KeyEvent.VK_AMPERSAND: return "&";
    case KeyEvent.VK_ASTERISK: return "*";
    case KeyEvent.VK_UNDERSCORE: return "_";
    case KeyEvent.VK_MINUS: return "-";
    case KeyEvent.VK_PLUS: return "+";
    case KeyEvent.VK_EQUALS: return "=";
    case KeyEvent.VK_AT: return "@";
    case KeyEvent.VK_NUMBER_SIGN: return "#";
    case KeyEvent.VK_COLON: return ":";
    case KeyEvent.VK_SEMICOLON: return ";";
    case KeyEvent.VK_COMMA: return ",";
    case KeyEvent.VK_PERIOD: return ".";
    case KeyEvent.VK_SLASH: return "/";
    case KeyEvent.VK_BACK_SLASH: return "\\";
    case KeyEvent.VK_DEAD_TILDE: return "~";
    // Parenthesis and brackets
    case KeyEvent.VK_LEFT_PARENTHESIS: return "(";
    case KeyEvent.VK_RIGHT_PARENTHESIS: return ")";
    case KeyEvent.VK_OPEN_BRACKET: return "[";
    case KeyEvent.VK_CLOSE_BRACKET: return "]";
    case KeyEvent.VK_BRACELEFT: return "{";
    case KeyEvent.VK_BRACERIGHT: return "}";
    case KeyEvent.VK_LESS: return "<";
    case KeyEvent.VK_GREATER: return ">";
    // Formatting keys
    case KeyEvent.VK_SPACE: return "Space";
    case KeyEvent.VK_TAB: return "Tab";
    case KeyEvent.VK_ENTER: return "Enter";
    case KeyEvent.VK_BACK_SPACE: return "Backspace";
    case KeyEvent.VK_ESCAPE: return "Esc";
    }
    return "0x" + Integer.toString(keyCode, 16);
}