@Override public void mousePressed(MouseEvent me) { // // check if this happened in the gutter area // if (me.getX() < Editor.LEFT_GUTTER) { // if (me.getButton() == MouseEvent.BUTTON1) { // && me.getClickCount() == 2) { // //int line = me.getY() / painter.getFontMetrics().getHeight() + firstLine; // int offset = xyToOffset(me.getX(), me.getY()); // if (offset >= 0) { // int lineIndex = getLineOfOffset(offset); // editor.toggleBreakpoint(lineIndex); // } //// if (line >= 0 && line < getLineCount()) { //// //editor.gutterDblClicked(line); //// editor.toggleBreakpoint(line); //// } // } // return; // } if (me.getButton() == MouseEvent.BUTTON3) { if (!editor.hasJavaTabs()) { // tooltips, etc disabled for java tabs fetchPhrase(me); } } // forward to standard listeners for (MouseListener ml : mouseListeners) { ml.mousePressed(me); } }
@Override public void mouseExited(MouseEvent me) { // forward to standard listeners for (MouseListener ml : mouseListeners) { ml.mouseExited(me); } }
public boolean dispatchKeyEvent(KeyEvent e) { if (e.getID() == KeyEvent.KEY_PRESSED) { pressed.add(e.getKeyCode()); MouseListener mlis; if ((mlis = mListeners.get(e.getKeyCode())) != null) { mlis.mouseClicked(null); } if (buttons.containsKey(e.getKeyCode())) { ArrayList<JButton> list = buttons.get(e.getKeyCode()); if (bid.containsKey(e.getKeyCode())) { for (int i = 0; i < list.size(); ++i) { int k = isPressed(KeyEvent.VK_SHIFT) ? -1 : 1; int a = (bid.get(e.getKeyCode()) + k + list.size()) % list.size(); bid.put(e.getKeyCode(), a); if (list.get(a).isVisible()) { list.get(a).doClick(); break; } } } else { for (JButton button : buttons.get(e.getKeyCode())) { if (button != null && button.isVisible()) { button.doClick(); break; } } } } } if (e.getID() == KeyEvent.KEY_RELEASED) { pressed.remove(e.getKeyCode()); } return false; }
@Override public void mouseExited(MouseEvent e) { MouseEvent te = transformMouseEvent(e); MouseListener[] mouseListenersBuf = _mouseListeners.toArray(new MouseListener[_mouseListeners.size()]); for (MouseListener mouseListener : mouseListenersBuf) { mouseListener.mouseExited(te); } }
@Override public void mouseReleased(MouseEvent e) { if (mouseEnabled || e instanceof BotEvent) { for (MouseListener l : defaultMouseListeners) { l.mouseReleased(e); } mouseOnCanvas = true; } }
private void fireMouseEvent(MouseEvent e) { for (MouseListener l : mMouseListeners) { if (e.getID() == MouseEvent.MOUSE_PRESSED) { l.mousePressed(e); } else if (e.getID() == MouseEvent.MOUSE_RELEASED) { l.mouseReleased(e); } } }
@Override public void mouseEntered(MouseEvent e) { if (mouseEnabled || e instanceof BotEvent) { for (MouseListener l : defaultMouseListeners) { l.mouseEntered(e); } mousePoint = e.getPoint(); mouseOnCanvas = true; } }
@Override public void mouseExited(MouseEvent e) { if (mouseEnabled || e instanceof BotEvent) { for (MouseListener l : defaultMouseListeners) { l.mouseExited(e); } mousePoint = new Point(-1, -1); mouseOnCanvas = false; } }
@Override public void mouseEntered(MouseEvent me) { // forward to standard listeners for (MouseListener ml : mouseListeners) { // investigating an NPE that keeps showing up here [fry] // if (ml == null || me == null) { // System.out.println(ml + " " + me); // } ml.mouseEntered(me); } }
protected void installMouseHook() { MouseListener[] listeners = header.getMouseListeners(); for (int i = 0; i < listeners.length; i++) { MouseListener l = listeners[i]; if (l.getClass().getName().contains("TableHeaderUI")) { this.mouseDelegate = l; listeners[i] = this; } header.removeMouseListener(l); } for (MouseListener l : listeners) { header.addMouseListener(l); } }
/** * If the user double clicks on any part of this FigNode, pass it down to one of the internal * Figs. This allows the user to initiate direct text editing. * * <p>{@inheritDoc} */ @Override public void mouseClicked(MouseEvent me) { if (!readyToEdit) { Object owner = getOwner(); if (Model.getFacade().isAModelElement(owner) && !Model.getModelManagementHelper().isReadOnly(owner)) { readyToEdit = true; } else { return; } } if (me.isConsumed()) { return; } if (me.getClickCount() >= 2 && !(me.isPopupTrigger() || me.getModifiers() == InputEvent.BUTTON3_MASK)) { if (getOwner() == null) { return; } Fig f = hitFig(new Rectangle(me.getX() - 2, me.getY() - 2, 4, 4)); if (f instanceof MouseListener) { ((MouseListener) f).mouseClicked(me); } } me.consume(); }
/** * If the user double clicks on anu part of this FigNode, pass it down to one of the internal * Figs. This allows the user to initiate direct text editing. * * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent) */ public void mouseClicked(MouseEvent me) { if (me.isConsumed()) return; if (me.getClickCount() >= 2) { Fig f = hitFig(new Rectangle(me.getX() - 2, me.getY() - 2, 4, 4)); if (f instanceof MouseListener && canEdit(f)) ((MouseListener) f).mouseClicked(me); } me.consume(); }
private void dispatchMouseEvent(MouseEvent event) { MouseListener[] mouseListeners = event.getComponent().getMouseListeners(); for (MouseListener listener : mouseListeners) { // skip all ToolTipManager's related listeners if (!listener.getClass().getName().startsWith("javax.swing.ToolTipManager")) { switch (event.getID()) { case MouseEvent.MOUSE_PRESSED: listener.mousePressed(event); break; case MouseEvent.MOUSE_RELEASED: listener.mouseReleased(event); break; case MouseEvent.MOUSE_CLICKED: listener.mouseClicked(event); break; case MouseEvent.MOUSE_EXITED: listener.mouseExited(event); break; case MouseEvent.MOUSE_ENTERED: listener.mouseEntered(event); break; default: throw new AssertionError(); } } } }
public void mouseClicked(MouseEvent e) { MouseEvent transfer = new MouseEvent( this, e.getID(), e.getWhen(), e.getModifiers(), e.getX(), e.getY(), e.getXOnScreen(), e.getYOnScreen(), e.getClickCount(), e.isPopupTrigger(), e.getButton()); for (MouseListener l : getMouseListeners()) { l.mouseClicked(transfer); } }
/** * Implemented to do some tweaks/bookkeeping before/after passing the event to the original * * <p>- temporarily disallow reordering if hit on first column - calculate the max mouseX that's * allowable in dragging to the left */ @Override public void mousePressed(MouseEvent e) { int index = header.columnAtPoint(e.getPoint()); boolean reorderingAllowed = header.getReorderingAllowed(); if (index == 0) { // temporarily disable re-ordering header.setReorderingAllowed(false); } mouseDelegate.mousePressed(e); header.setReorderingAllowed(reorderingAllowed); if (header.getDraggedColumn() != null) { Rectangle r = header.getHeaderRect(index); maxX = header.getColumnModel().getColumn(0).getWidth() + e.getX() - r.x - 1; } }
public void mouseReleased(MouseListener listener, MouseEvent e) { Point p = e.getPoint(); boolean generateClick = false; if (!m_clickConsumed) { if (!m_pressedLocation.equals(p)) { Component c = e.getComponent(); if (c == null || c.getBounds().contains(p)) { if (c instanceof JTree || c instanceof JTable) { // only allow 8 pixel in order not to interfere with drag and drop if (Math.max(Math.abs(m_pressedLocation.x - p.x), Math.abs(m_pressedLocation.y - p.y)) <= 8) { generateClick = true; } } else { generateClick = true; } } } } if (generateClick) { listener.mouseClicked(e); } }
/** * Handles the mouseExited event by invoking the mouseExited methods on listener-a and listener-b. * * @param e the mouse event */ public void mouseExited(MouseEvent e) { ((MouseListener) a).mouseExited(e); ((MouseListener) b).mouseExited(e); }
@Override public void mouseExited(MouseEvent e) { mouseDelegate.mouseExited(e); }
/** * Handles the mouseReleased event by invoking the mouseReleased methods on listener-a and * listener-b. * * @param e the mouse event */ public void mouseReleased(MouseEvent e) { ((MouseListener) a).mouseReleased(e); ((MouseListener) b).mouseReleased(e); }
public void mouseReleased(MouseEvent e) { for (MouseListener ml : mouseListeners) { ml.mouseReleased(translate(e)); } }
public void mouseReleased(LayerEvent e) { if (_filter.accept(e)) { _ml.mouseReleased(e); } }
public void mouseDragged(MouseEvent e) { mouseListener.mouseClicked(e); mouseMoved(e); }