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();
       }
     }
   }
 }
Beispiel #2
0
    @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 mousePressed(MouseEvent e) {
   if (mouseEnabled || e instanceof BotEvent) {
     for (MouseListener l : defaultMouseListeners) {
       l.mousePressed(e);
     }
     mouseOnCanvas = true;
   }
 }
Beispiel #4
0
 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);
     }
   }
 }
Beispiel #5
0
 @Override
 public void mousePressed(MouseEvent e) {
   MouseEvent te = transformMouseEvent(e);
   MouseListener[] mouseListenersBuf =
       _mouseListeners.toArray(new MouseListener[_mouseListeners.size()]);
   for (MouseListener mouseListener : mouseListenersBuf) {
     mouseListener.mousePressed(te);
   }
 }
 /**
  * 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;
   }
 }
Beispiel #7
0
 public void mousePressed(LayerEvent e) {
   if (_filter.accept(e)) {
     _ml.mousePressed(e);
   }
 }
Beispiel #8
0
  public void mousePressed(MouseEvent e) {

    for (MouseListener ml : mouseListeners) {
      ml.mousePressed(translate(e));
    }
  }
 /**
  * Handles the mousePressed event by invoking the mousePressed methods on listener-a and
  * listener-b.
  *
  * @param e the mouse event
  */
 public void mousePressed(MouseEvent e) {
   ((MouseListener) a).mousePressed(e);
   ((MouseListener) b).mousePressed(e);
 }