Package java.awt.event

Examples of java.awt.event.MouseEvent


  }

  @Override
  public boolean isCellEditable(final EventObject event) {
    if (!(event instanceof MouseEvent)) return false;
    final MouseEvent mouseEvent = (MouseEvent) event;

    final TreePath path =
      theTree.getPathForLocation(mouseEvent.getX(), mouseEvent.getY());
    if (path == null) return false;

    final Object node = path.getLastPathComponent();
    if (!(node instanceof DefaultMutableTreeNode)) return false;
    final DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode) node;
View Full Code Here


        public void handleEvent(Event evt){
            setToolTipText(toolTip);

            if (toolTip != null) {
                MouseEvent e = new MouseEvent(JSVGCanvas.this,
                                              MouseEvent.MOUSE_ENTERED,
                                              System.currentTimeMillis(),
                                              0,
                                              locationListener.getLastX(),
                                              locationListener.getLastY(),
View Full Code Here

                    while (it.hasNext()) {
                        Object next = it.next();
                        if (next instanceof MouseDraggedRunnable) {
                            MouseDraggedRunnable mdr;
                            mdr = (MouseDraggedRunnable)next;
                            MouseEvent mev = mdr.event;
                            if (mev.getModifiers() == e.getModifiers()) {
                                mdr.event = e;
                            }
                            return;
                        }
                    }
View Full Code Here

                    while (it.hasNext()) {
                        Object next = it.next();
                        if (next instanceof MouseMovedRunnable) {
                            MouseMovedRunnable mmr;
                            mmr = (MouseMovedRunnable)next;
                            MouseEvent mev = mmr.event;
                            if (mev.getModifiers() == e.getModifiers()) {
                                mmr.event = e;
                            }
                            return;
                        }
                        i++;
View Full Code Here

        public void handleEvent(Event evt){
            setToolTipText(toolTip);

            if (toolTip != null) {
                MouseEvent e = new MouseEvent(JSVGCanvas.this,
                                              MouseEvent.MOUSE_ENTERED,
                                              System.currentTimeMillis(),
                                              0,
                                              locationListener.getLastX(),
                                              locationListener.getLastY(),
View Full Code Here

                    while (it.hasNext()) {
                        Object next = it.next();
                        if (next instanceof MouseDraggedRunnable) {
                            MouseDraggedRunnable mdr;
                            mdr = (MouseDraggedRunnable)next;
                            MouseEvent mev = mdr.event;
                            if (mev.getModifiers() == e.getModifiers()) {
                                mdr.event = e;
                            }
                            return;
                        }
                    }
View Full Code Here

                    while (it.hasNext()) {
                        Object next = it.next();
                        if (next instanceof MouseMovedRunnable) {
                            MouseMovedRunnable mmr;
                            mmr = (MouseMovedRunnable)next;
                            MouseEvent mev = mmr.event;
                            if (mev.getModifiers() == e.getModifiers()) {
                                mmr.event = e;
                            }
                            return;
                        }
                        i++;
View Full Code Here

  public boolean isCellEditable(EventObject e) {
      if (e instanceof MouseEvent) {
    for (int counter = getColumnCount() - 1; counter >= 0;
         counter--) {
        if (getColumnClass(counter) == TreeTableModel.class) {
      MouseEvent me = (MouseEvent)e;
      MouseEvent newME = new MouseEvent(tree, me.getID(),
           me.getWhen(), me.getModifiers(),
           me.getX() - getCellRect(0, counter, true).x,
           me.getY(), me.getClickCount(),
                                   me.isPopupTrigger());
      tree.dispatchEvent(newME);
View Full Code Here

    assertEquals(c, rec.getFieldComponent());
    assertEquals(l, rec.getFieldDragGestureListener());
    assertEquals(DnDConstants.ACTION_MOVE, rec.getFieldSourceActions());

    ArrayList ev = rec.getFieldEvents();
    ev.add(new MouseEvent(c, MouseEvent.MOUSE_DRAGGED,
                          System.currentTimeMillis(), MouseEvent.ALT_DOWN_MASK,
                          10, 20, 1, false));
    ev.add(new MouseEvent(c, MouseEvent.MOUSE_DRAGGED,
                          System.currentTimeMillis(), MouseEvent.ALT_DOWN_MASK,
                          10, 20, 1, false));
    assertEquals(2, ev.size());
    rec.resetRecognizer();
    assertSame(ev, rec.getFieldEvents());
View Full Code Here

  }

 
  public Object invoke(Object proxy, Method method, Object[] args)
      throws Throwable {
    MouseEvent e = (MouseEvent) args[0];
    if (!e.isConsumed()) {
      Point point = e.getPoint();
      Component hovered = designer.componentAt(point, WidgetAdapter.ADHERE_PAD);
      if (hovered != null) {
        WidgetAdapter adapter = WidgetAdapter.getWidgetAdapter(hovered);
        if (adapter != null) {
          do {
            MouseEvent mEvent = SwingUtilities.convertMouseEvent(designer, e, adapter.getContentPane());
            Object l = adapter.getAdapter(MouseInputListener.class);
            if (l != null) {
              method.invoke(l, new Object[] { mEvent });
              if (mEvent.isConsumed()) {
                e.consume();
                return null;
              } else if (mEvent.getSource() == null) {
                return null;
              }
            }
            adapter = adapter.getParentAdapter();
          } while (adapter != null);
View Full Code Here

TOP

Related Classes of java.awt.event.MouseEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.