当前位置: 首页>>代码示例>>Java>>正文


Java KeyEvent.VK_F10属性代码示例

本文整理汇总了Java中java.awt.event.KeyEvent.VK_F10属性的典型用法代码示例。如果您正苦于以下问题:Java KeyEvent.VK_F10属性的具体用法?Java KeyEvent.VK_F10怎么用?Java KeyEvent.VK_F10使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在java.awt.event.KeyEvent的用法示例。


在下文中一共展示了KeyEvent.VK_F10属性的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: keyPressed

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;
    }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:19,代码来源:PopupMenuAction.java

示例2: commandKeyPressed

private void commandKeyPressed(java.awt.event.KeyEvent evt) {
    if (evt.getKeyCode()==KeyEvent.VK_DOWN) {
        displayer.selectNext();
        evt.consume();
    } else if (evt.getKeyCode() == KeyEvent.VK_UP) {
        displayer.selectPrev();
        evt.consume();
    } else if (evt.getKeyCode() == KeyEvent.VK_ENTER) {
        evt.consume();
        invokeSelectedItem();
    } else if ((evt.getKeyCode()) == KeyEvent.VK_ESCAPE) {
        returnFocus(true);
        displayer.clearModel();
    } else if (evt.getKeyCode() == KeyEvent.VK_F10 &&
            evt.isShiftDown()) {
        evt.consume();
        maybeShowPopup(null);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:19,代码来源:AbstractQuickSearchComboBar.java

示例3: keyPressed

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();
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:14,代码来源:ProfilingPointsWindowUI.java

示例4: keyPressed

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);
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:10,代码来源:FieldsBrowserControllerUI.java

示例5: keyPressed

public void keyPressed(KeyEvent e) {
    if ((e.getKeyCode() == KeyEvent.VK_CONTEXT_MENU)
            || ((e.getKeyCode() == KeyEvent.VK_F10) && (e.getModifiers() == InputEvent.SHIFT_MASK))) {
        int selectedRow = classesListTable.getSelectedRow();

        if (selectedRow != -1) {
            Rectangle rowBounds = classesListTable.getCellRect(selectedRow, 0, true);
            showPopupMenu(selectedRow, rowBounds.x + (rowBounds.width / 2), rowBounds.y + (rowBounds.height / 2));
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:11,代码来源:ClassesListControllerUI.java

示例6: keyPressed

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();
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:InstancesListControllerUI.java

示例7: processKeyEvent

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);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:10,代码来源:ProfilerTable.java

示例8: handleF10JavaKeyEvent

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);
            }
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:11,代码来源:XComponentPeer.java


注:本文中的java.awt.event.KeyEvent.VK_F10属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。