Package java.awt.event

Examples of java.awt.event.MouseEvent


        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 testIsLeftMiddleRightMouseButton() {
        JComponent panel = new JPanel();
        panel.setPreferredSize(new Dimension(100, 100));
        MouseEvent button1DownEvent = new MouseEvent(panel, 100, 0,
                InputEvent.BUTTON1_DOWN_MASK, 50, 50, 1, false);
        MouseEvent button1PressedEvent = new MouseEvent(panel, MouseEvent.MOUSE_PRESSED, 0, 0,
                50, 50, 1, false, MouseEvent.BUTTON1);
        MouseEvent button1Released = new MouseEvent(panel, MouseEvent.MOUSE_RELEASED, 0, 0, 50,
                50, 1, false, MouseEvent.BUTTON1);
        MouseEvent button1Clicked = new MouseEvent(panel, MouseEvent.MOUSE_CLICKED, 0, 0, 50,
                50, 1, false, MouseEvent.BUTTON1);
        MouseEvent button1DraggedEvent = new MouseEvent(panel, MouseEvent.MOUSE_DRAGGED, 0, 0,
                50, 50, 1, false, MouseEvent.BUTTON1);
        MouseEvent button2DownEvent = new MouseEvent(panel, 100, 0,
                InputEvent.BUTTON2_DOWN_MASK, 50, 50, 1, false);
        MouseEvent button2PressedEvent = new MouseEvent(panel, MouseEvent.MOUSE_PRESSED, 0, 0,
                50, 50, 1, false, MouseEvent.BUTTON2);
        MouseEvent button2Released = new MouseEvent(panel, MouseEvent.MOUSE_RELEASED, 0, 0, 50,
                50, 1, false, MouseEvent.BUTTON2);
        MouseEvent button2Clicked = new MouseEvent(panel, MouseEvent.MOUSE_CLICKED, 0, 0, 50,
                50, 1, false, MouseEvent.BUTTON2);
        MouseEvent button2DraggedEvent = new MouseEvent(panel, MouseEvent.MOUSE_DRAGGED, 0, 0,
                50, 50, 1, false, MouseEvent.BUTTON2);
        MouseEvent button3DownEvent = new MouseEvent(panel, 100, 0,
                InputEvent.BUTTON3_DOWN_MASK, 50, 50, 1, false);
        MouseEvent button3PressedEvent = new MouseEvent(panel, MouseEvent.MOUSE_PRESSED, 0, 0,
                50, 50, 1, false, MouseEvent.BUTTON3);
        MouseEvent button3Released = new MouseEvent(panel, MouseEvent.MOUSE_RELEASED, 0, 0, 50,
                50, 1, false, MouseEvent.BUTTON3);
        MouseEvent button3Clicked = new MouseEvent(panel, MouseEvent.MOUSE_CLICKED, 0, 0, 50,
                50, 1, false, MouseEvent.BUTTON3);
        MouseEvent button3DraggedEvent = new MouseEvent(panel, MouseEvent.MOUSE_DRAGGED, 0, 0,
                50, 50, 1, false, MouseEvent.BUTTON3);
        assertTrue(SwingUtilities.isLeftMouseButton(button1DownEvent));
        assertFalse(SwingUtilities.isLeftMouseButton(button2DownEvent));
        assertFalse(SwingUtilities.isLeftMouseButton(button3DownEvent));
        assertTrue(SwingUtilities.isLeftMouseButton(button1PressedEvent));
View Full Code Here

   */
  public boolean isCellEditable(final EventObject anEvent)
  {
    if (anEvent instanceof MouseEvent)
    {
      final MouseEvent mouseEvent = (MouseEvent) anEvent;
      return mouseEvent.getClickCount() >= 2 && mouseEvent.getButton() == MouseEvent.BUTTON1;
    }
    return true;
  }
View Full Code Here

   */
  public boolean isCellEditable(final EventObject anEvent)
  {
    if (anEvent instanceof MouseEvent)
    {
      final MouseEvent mouseEvent = (MouseEvent) anEvent;
      return mouseEvent.getClickCount() >= 2 && mouseEvent.getButton() == MouseEvent.BUTTON1;
    }
    return true;
  }
View Full Code Here

  public boolean isCellEditable(final EventObject anEvent)
  {
    if (anEvent instanceof MouseEvent)
    {
      final MouseEvent mouseEvent = (MouseEvent) anEvent;
      return mouseEvent.getClickCount() >= 1 && mouseEvent.getButton() == MouseEvent.BUTTON1;
    }
    return true;
  }
View Full Code Here

   */
  public boolean isCellEditable(final EventObject anEvent)
  {
    if (anEvent instanceof MouseEvent)
    {
      final MouseEvent mouseEvent = (MouseEvent) anEvent;
      return mouseEvent.getClickCount() >= 2 && mouseEvent.getButton() == MouseEvent.BUTTON1;
    }
    return true;
  }
View Full Code Here

   */
  public boolean isCellEditable(final EventObject anEvent)
  {
    if (anEvent instanceof MouseEvent)
    {
      final MouseEvent mouseEvent = (MouseEvent) anEvent;
      return mouseEvent.getClickCount() >= 2 && mouseEvent.getButton() == MouseEvent.BUTTON1;
    }
    return true;
  }
View Full Code Here

            public void eventDispatched(AWTEvent e) {
                if (e instanceof MouseEvent) {
                    Component src = ((MouseEvent)e).getComponent();
                    if (src != null
                        && SwingUtilities.isDescendingFrom(src, content)) {
                        MouseEvent me = SwingUtilities.convertMouseEvent(src, (MouseEvent)e, content);
                        Component c = SwingUtilities.getDeepestComponentAt(content, me.getX(), me.getY());
                        if (c != null) {
                            setCursor(c.getCursor());
                        }
                    }
                }
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.