本文整理汇总了Java中java.awt.event.KeyEvent.VK_CONTEXT_MENU属性的典型用法代码示例。如果您正苦于以下问题:Java KeyEvent.VK_CONTEXT_MENU属性的具体用法?Java KeyEvent.VK_CONTEXT_MENU怎么用?Java KeyEvent.VK_CONTEXT_MENU使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类java.awt.event.KeyEvent
的用法示例。
在下文中一共展示了KeyEvent.VK_CONTEXT_MENU属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例2: 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();
}
}
示例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 selectedRow = fieldsListTable.getSelectedRow();
if (selectedRow != -1) {
showPopupMenu(selectedRow, -1, -1);
}
}
}
示例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 = classesListTable.getSelectedRow();
if (selectedRow != -1) {
Rectangle rowBounds = classesListTable.getCellRect(selectedRow, 0, true);
showPopupMenu(selectedRow, rowBounds.x + (rowBounds.width / 2), rowBounds.y + (rowBounds.height / 2));
}
}
}
示例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 = 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();
}
}
示例6: 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);
}