private void maybeShowPopup(MouseEvent e) { if (e.isPopupTrigger()) treePopup.show(e.getComponent(), e.getX(), e.getY()); }
private void showPopup(final MouseEvent e) { if("".equals(se_response.getText().trim())){ // No response body return; } if (e.isPopupTrigger()) { bpm.show(e.getComponent(), e.getX(), e.getY()); } } });
@Override public void mousePressed(MouseEvent e) { if (e.isPopupTrigger()) return; // Pan using the middle mouse button. if (e.getButton() == MouseEvent.BUTTON2) { //middle mouse pan, does same as below dragStartPoint = e.getPoint(); isPanning = true; return; } // Zoom by pressing middle mouse button, then left mouse button. if (isPanning && e.getButton() == MouseEvent.BUTTON1) { // Center point of the zoom, doesn't change. zoomStartPoint = e.getPoint(); // The distance the mouse will be dragged when zooming. zoomEndPoint = e.getPoint(); isZooming = true; return; } // If the space bar and mouse is pressed, we're getting ready to pan the view. if (isSpacePressed) { // When panning the view use the original mouse point, not the one affected by the view transform. dragStartPoint = e.getPoint(); isPanning = true; } }
public TableCellMouseEvent( MouseEvent sample ){ super(sample.getComponent(), sample.getID(), sample.getWhen(), sample.getModifiers(), sample.getX(), sample.getY(), sample.getXOnScreen(), sample.getYOnScreen(), sample.getClickCount(), sample.isPopupTrigger(), sample.getButton() ); }
@Override public void mouseReleased(MouseEvent evt) { if (evt.isPopupTrigger()) { // Fix #45348: IllegalComponentStateException on show() try { menu.show(evt.getComponent(), evt.getX(), evt.getY()); } catch (IllegalComponentStateException e) { LOGGER.error(e, e); } menu.setLocation( ComponentOrientation.getOrientation(I18n.getLocaleDefault()) == ComponentOrientation.RIGHT_TO_LEFT ? evt.getXOnScreen() - menu.getWidth() : evt.getXOnScreen(), evt.getYOnScreen() ); } } });
public void mouseDragged(MouseEvent e) { isDragging = true; JComponent c = ColorWell.this; Point pt = e.getPoint(); JFrame frame = (JFrame) SwingUtilities.getWindowAncestor(c); pt = SwingUtilities.convertPoint(c, pt, frame.getContentPane()); MouseEvent newEvent = new MouseEvent(colorPicker, e.getID(), e.getWhen(), e.getModifiers(), (int) pt.getX(), (int) pt.getY(), e.getClickCount(), e.isPopupTrigger(), e.getButton()); colorPicker.dispatchEvent(newEvent); }
/** Makes a new mouse event from MouseEvent e with the Canvas c * as source and the coordinates of Point p as X and Y.*/ private MouseEvent adaptEvent(MouseEvent e, Component c, Point p) { return new MouseEvent(c, e.getID(), e.getWhen(), e.getModifiers(), p.x, p.y, e.getClickCount(), e.isPopupTrigger()); }
private void maybeShowPopup(MouseEvent e) { if (e.isPopupTrigger()) { popup.show(e.getComponent(), e.getX(), e.getY()); } } }
public TreeTableMouseEvent(TreeTable source, MouseEvent e) { super(source, e.getID(), e.getWhen(), e.getModifiers(), e.getX(), e.getY(), e.getXOnScreen(), e.getYOnScreen(), e.getClickCount(), e.isPopupTrigger(), e.getButton()); }
private void checkMenu(MouseEvent Me, SimpleCardView card) { if (Me.isPopupTrigger()) { Me.consume(); cardEventSource.fireEvent(card, Me.getComponent(), Me.getX(), Me.getY(), ClientEventType.SHOW_POP_UP_MENU); } }
if (mouseEvent.isPopupTrigger()) { JList<ItemList> list = (JList<ItemList>) mouseEvent.getSource(); this.dndList.dropPasteFile( Arrays.asList(importFileDialog.getSelectedFiles()), this.dndList.locationToIndex(mouseEvent.getPoint()) ); popupMenuList.show( list, ComponentOrientation.getOrientation(I18n.getLocaleDefault()) == ComponentOrientation.RIGHT_TO_LEFT ? mouseEvent.getX() - popupMenuList.getWidth() : mouseEvent.getX(), mouseEvent.getY() ); } catch (IllegalComponentStateException e) {
public void mouseDragged(MouseEvent e) { isDragging = true; JComponent c = ColorWell.this; Point pt = e.getPoint(); JFrame frame = (JFrame) SwingUtilities.getWindowAncestor(c); pt = SwingUtilities.convertPoint(c, pt, frame.getContentPane()); MouseEvent newEvent = new MouseEvent(colorPicker, e.getID(), e.getWhen(), e.getModifiers(), (int) pt.getX(), (int) pt.getY(), e.getClickCount(), e.isPopupTrigger(), e.getButton()); colorPicker.dispatchEvent(newEvent); }
public void mouseReleased(MouseEvent e) { if (e.getClickCount() == 3 && e.isControlDown() && e.isShiftDown()) { reload(); } if (e.isPopupTrigger()) { showPopupMenu(e); } }
public void mousePressed(MouseEvent e) { if (e.isPopupTrigger()) { showPopup(e); } else if (isDragTrigger(e)) { } else { Point2D pt = inverseViewTransformPoint(e.getPoint());
private void maybeShowPopup(MouseEvent e) { if (e.isPopupTrigger()) { popup.show(e.getComponent(), e.getX(), e.getY()); } } }
void handleMouseMotionEvent(MouseEvent e) { MouseEvent me = new MouseEvent(this, e.getID(), e.getWhen(), e.getModifiers(), e.getX(), e.getY(), e.getXOnScreen(), e.getYOnScreen(), e.getClickCount(), e.isPopupTrigger(), e.getButton()); // IMPORTANT: See comment on the helper method! doLightweightDispatching(e); }
private void checkMenu(MouseEvent Me, SimpleCardView card) { if (Me.isPopupTrigger()) { Me.consume(); cardEventSource.fireEvent(card, Me.getComponent(), Me.getX(), Me.getY(), ClientEventType.SHOW_POP_UP_MENU); } }
private void maybeShowPopup(MouseEvent e) { if (e.isPopupTrigger()) { popup.show(e.getComponent(), e.getX(), e.getY()); } } }
void handleMouseEvent(MouseEvent e) { MouseEvent me = new MouseEvent(this, e.getID(), e.getWhen(), e.getModifiers(), e.getX(), e.getY(), e.getXOnScreen(), e.getYOnScreen(), e.getClickCount(), e.isPopupTrigger(), e.getButton()); // IMPORTANT: See comment on the helper method! doLightweightDispatching(e); }
/** * Fix compatibility issue with right click on Linux. * @param e Mouse event */ private void showPopup(MouseEvent e) { if (e.isPopupTrigger()) { JTree tree = (JTree) e.getSource(); TreePath path = tree.getPathForLocation(e.getX(), e.getY()); if (path == null) { return; } DefaultMutableTreeNode currentTableNode = (DefaultMutableTreeNode) path.getLastPathComponent(); if (currentTableNode.getUserObject() instanceof AbstractNodeModel) { AbstractNodeModel currentTableModel = (AbstractNodeModel) currentTableNode.getUserObject(); if (currentTableModel.isPopupDisplayable()) { currentTableModel.showPopup(currentTableNode, path, e); } } } }