@Override public void mousePressed(MouseEvent mouseEvent) { if (SwingUtilities.isRightMouseButton(mouseEvent)) { return; } ascendingOrder = orderIndex != WorldOrder.PING || !ascendingOrder; orderBy(WorldOrder.PING); } });
@Override public void mousePressed(MouseEvent mouseEvent) { if (SwingUtilities.isRightMouseButton(mouseEvent)) { return; } ascendingOrder = orderIndex != WorldOrder.WORLD || !ascendingOrder; orderBy(WorldOrder.WORLD); } });
@Override public void mousePressed(MouseEvent mouseEvent) { if (SwingUtilities.isRightMouseButton(mouseEvent)) { return; } ascendingOrder = orderIndex != WorldOrder.ACTIVITY || !ascendingOrder; orderBy(WorldOrder.ACTIVITY); } });
@Override public void mousePressed(MouseEvent mouseEvent) { if (SwingUtilities.isRightMouseButton(mouseEvent)) { return; } ascendingOrder = orderIndex != WorldOrder.PLAYERS || !ascendingOrder; orderBy(WorldOrder.PLAYERS); } });
@Override public void mouseClicked(MouseEvent e) { if (SwingUtilities.isMiddleMouseButton(e)) { closeCodePanel(contentPanel); } else if (SwingUtilities.isRightMouseButton(e)) { JPopupMenu menu = createTabPopupMenu(contentPanel); menu.show(panel, e.getX(), e.getY()); } else { setSelectedComponent(contentPanel); } } });
public void mouseClicked(MouseEvent ev) { if (SwingUtilities.isRightMouseButton(ev) && isExtracting()) menu.show(ev.getComponent(), ev.getX(), ev.getY()); } });
@Override public void mouseClicked(MouseEvent e) { if( SwingUtilities.isRightMouseButton(e) ){ @SuppressWarnings("unchecked") JList<PathPrinter> list = (JList<PathPrinter>)e.getSource(); int row = list.locationToIndex(e.getPoint()); list.setSelectedIndex(row); popup.show(list, e.getX(), e.getY()); } }
@Override public void mouseClicked(MouseEvent e) { if (SwingUtilities.isRightMouseButton(e)) { new JPopupMenu() { { JMenuItem menuitem = new JMenuItem("Select All"); menuitem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { exception.requestFocus(); exception.selectAll(); } }); this.add(menuitem); menuitem = new JMenuItem("Copy"); menuitem.addActionListener(new DefaultEditorKit.CopyAction()); this.add(menuitem); } private static final long serialVersionUID = 562054483562666832L; }.show(e.getComponent(), e.getX(), e.getY()); } } });
else if (SwingUtilities.isRightMouseButton(e))
if (SwingUtilities.isRightMouseButton(mouseEvent))
/** Determines if the event is originated from the right mouse button * @param e the MouseEvent * @return true if the event is originated from the right mouse button, false otherwise * @deprecated Offers no advantages over the standard {@link SwingUtilities#isRightMouseButton}. */ @Deprecated public static boolean isRightMouseButton(MouseEvent e) { return SwingUtilities.isRightMouseButton(e); }
@Override public void mouseClicked(MouseEvent e) { if (SwingUtilities.isRightMouseButton(e)) { for (Sort s : sortMenuItems.keySet()) { sortMenuItems.get(s).setSelected(cardSort == s); } hideSelected.setEnabled(!dragCardList().isEmpty()); separateButton.setSelected(separateCreatures); menu.show(e.getComponent(), e.getX(), e.getY()); } } });
@Override public void mousePressed(MouseEvent e) { super.mousePressed(e); // Left button will deselect text after selectAll, so only for right click if (SwingUtilities.isRightMouseButton(e)) { JPopupComponent.this.proxy.requestFocusInWindow(); } } });
/** * Action for close button: remove tab. */ @Override public void mouseClicked(MouseEvent e) { if (SwingUtilities.isRightMouseButton(e)) { return; } int closeTabNumber = MediatorGui.tabResults().indexOfTabComponent(TabHeader.this); ActionCloseTabResult.perform(closeTabNumber); }
@Override public void mousePressed(MouseEvent e) { if (SwingUtilities.isRightMouseButton(e)) { int clickIndex = this.dndList.locationToIndex(e.getPoint()); boolean containsIndex = false; for (int currentIndex: this.dndList.getSelectedIndices()) { if (currentIndex == clickIndex) { containsIndex = true; break; } } if (!containsIndex) { this.dndList.setSelectedIndex(clickIndex); } } this.showPopup(e); }
@Override public void mousePressed(MouseEvent e) { PanelTable.this.tableValues.requestFocusInWindow(); if (SwingUtilities.isRightMouseButton(e)) { /** * Keep selection when multiple cells are selected, * move focus only */ Point p = e.getPoint(); int rowNumber = PanelTable.this.tableValues.rowAtPoint(p); int colNumber = PanelTable.this.tableValues.columnAtPoint(p); DefaultListSelectionModel modelRow = (DefaultListSelectionModel) PanelTable.this.tableValues .getSelectionModel(); DefaultListSelectionModel modelColumn = (DefaultListSelectionModel) PanelTable.this.tableValues .getColumnModel().getSelectionModel(); modelRow.moveLeadSelectionIndex(rowNumber); modelColumn.moveLeadSelectionIndex(colNumber); } } });
@Override public void mousePressed(MouseEvent e) { PanelConsoles.this.networkTable.requestFocusInWindow(); // move selected row and place cursor on focused cell if (SwingUtilities.isRightMouseButton(e)) { Point p = e.getPoint(); // get the row index that contains that coordinate int rowNumber = PanelConsoles.this.networkTable.rowAtPoint(p); int colNumber = PanelConsoles.this.networkTable.columnAtPoint(p); // Get the ListSelectionModel of the JTable DefaultListSelectionModel model = (DefaultListSelectionModel) PanelConsoles.this.networkTable.getSelectionModel(); DefaultListSelectionModel model2 = (DefaultListSelectionModel) PanelConsoles.this.networkTable.getColumnModel().getSelectionModel(); PanelConsoles.this.networkTable.setRowSelectionInterval(rowNumber, rowNumber); model.moveLeadSelectionIndex(rowNumber); model2.moveLeadSelectionIndex(colNumber); } } });
@Override public void mouseClicked(MouseEvent e) { if (SwingUtilities.isRightMouseButton(e)) { // Select if not selected if (!card.isSelected()) { selectCard(card); } // Show menu showCardRightClickMenu(card, e); } else if (SwingUtilities.isLeftMouseButton(e)) { if (e.getClickCount() == 1) { cardClicked(card, e); } else if (e.isAltDown()) { eventSource.fireEvent(card, ClientEventType.ALT_DOUBLE_CLICK); } else { eventSource.fireEvent(card, ClientEventType.DOUBLE_CLICK); } } } });
@Override public void mouseClicked(MouseEvent e) { if (SwingUtilities.isRightMouseButton(e)) { Component componentSource = (Component) e.getSource(); JPopupMenu menu = new JPopupMenu(); for (int position = 0 ; position < MediatorGui.menubar().getMenuView().getMenuComponentCount() ; position++) { // Fix #35348: SerializationException on clone() try { JMenuItem itemMenu = (JMenuItem) SerializationUtils.clone(MediatorGui.menubar().getMenuView().getMenuComponent(position)); menu.add(itemMenu); final int positionFinal = position; itemMenu.addActionListener(actionEvent -> MediatorGui.tabManagers().setSelectedIndex(positionFinal)); } catch (SerializationException ex) { LOGGER.error(ex, ex); } } menu.show(componentSource, e.getX(), e.getY()); menu.setLocation( ComponentOrientation.getOrientation(I18n.getLocaleDefault()) == ComponentOrientation.RIGHT_TO_LEFT ? e.getXOnScreen() - menu.getWidth() : e.getXOnScreen(), e.getYOnScreen() ); } }
/** * Overridden to also focus the text component on right mouse clicks. * * @param e The mouse event. */ @Override public void mousePressed(MouseEvent e) { super.mousePressed(e); if (!e.isConsumed() && SwingUtilities.isRightMouseButton(e)) { JTextComponent c = getComponent(); if (c!=null && c.isEnabled() && c.isRequestFocusEnabled()) { c.requestFocusInWindow(); } } }