Package org.tinyuml.ui.diagram

Examples of org.tinyuml.ui.diagram.EditorMouseEvent


    int x = 5, y = 5;
    Component comp = new JLabel();
    boolean popupTrigger = true;
    MouseEvent mouseEvent = new MouseEvent(comp, 12345, now, modifiers, x, y,
      clickCount, popupTrigger, MouseEvent.BUTTON2);
    EditorMouseEvent event = new EditorMouseEvent();
    event.setMouseEvent(mouseEvent, Scaling.SCALING_100);
    mockEditor.expects(once()).method("redraw");
    handler.mouseMoved(event);
   
    // expectations
    Mock mockNester = mock(CompositeNode.class);
View Full Code Here


    MouseEvent event1 = new MouseEvent(comp, 12345, now, modifiers, x, y,
      clickCount, popupTrigger, MouseEvent.BUTTON2);
    MouseEvent event2 = new MouseEvent(comp, 12345, now, modifiers, x, y,
      1, !popupTrigger, MouseEvent.BUTTON1);
   
    EditorMouseEvent evt = new EditorMouseEvent();
    evt.setMouseEvent(event1, scaling);
   
    // Check assertions
    assertTrue(Math.abs(evt.getX() - (x * 2)) < EPS);
    assertTrue(Math.abs(evt.getY() - (y * 2)) < EPS);
    assertTrue(evt.isPopupTrigger());
    assertEquals(2, evt.getClickCount());
    assertFalse(evt.isMainButton());
    assertEquals(event1, evt.getMouseEvent());

    evt.setMouseEvent(event2, scaling);
   
    // Check assertions
    assertFalse(evt.isPopupTrigger());
    assertEquals(1, evt.getClickCount());
    assertTrue(evt.isMainButton());
    assertEquals(event2, evt.getMouseEvent());
  }
View Full Code Here

    boolean popupTrigger = true;
    Scaling scaling = Scaling.SCALING_50;   
    MouseEvent event = new MouseEvent(comp, 12345, now, modifiers, x, y,
      clickCount, popupTrigger);
   
    EditorMouseEvent evt = new EditorMouseEvent();
    evt.setMouseEvent(event, scaling);
   
    // Check assertions
    assertTrue(Math.abs(evt.getX() - (x * 2)) < EPS);
    assertTrue(Math.abs(evt.getY() - (y * 2)) < EPS);
    assertTrue(evt.isPopupTrigger());
    assertEquals(2, evt.getClickCount());
  }
View Full Code Here

    MouseEvent event1 = new MouseEvent(comp, 12345, now, modifiers, x, y,
      clickCount, popupTrigger, MouseEvent.BUTTON2);
    MouseEvent event2 = new MouseEvent(comp, 12345, now, modifiers, x, y,
      1, !popupTrigger, MouseEvent.BUTTON1);
   
    EditorMouseEvent evt = new EditorMouseEvent();
    evt.setMouseEvent(event1, scaling);
   
    // Check assertions
    assertTrue(Math.abs(evt.getX() - (x * 2)) < EPS);
    assertTrue(Math.abs(evt.getY() - (y * 2)) < EPS);
    assertTrue(evt.isPopupTrigger());
    assertEquals(2, evt.getClickCount());
    assertFalse(evt.isMainButton());
    assertEquals(event1, evt.getMouseEvent());

    evt.setMouseEvent(event2, scaling);
   
    // Check assertions
    assertFalse(evt.isPopupTrigger());
    assertEquals(1, evt.getClickCount());
    assertTrue(evt.isMainButton());
    assertEquals(event2, evt.getMouseEvent());
  }
View Full Code Here

    int x = 5, y = 5;
    Component comp = new JLabel();
    boolean popupTrigger = true;
    MouseEvent mouseEvent = new MouseEvent(comp, 12345, now, modifiers, x, y,
      clickCount, popupTrigger, MouseEvent.BUTTON2);
    EditorMouseEvent event = new EditorMouseEvent();
    event.setMouseEvent(mouseEvent, Scaling.SCALING_100);
    mockEditor.expects(once()).method("redraw");
    handler.mouseMoved(event);
   
    // expectations
    Mock mockNester = mock(CompositeNode.class);
View Full Code Here

    boolean popupTrigger = true;
    Scaling scaling = Scaling.SCALING_50;   
    MouseEvent event = new MouseEvent(comp, 12345, now, modifiers, x, y,
      clickCount, popupTrigger);
   
    EditorMouseEvent evt = new EditorMouseEvent();
    evt.setMouseEvent(event, scaling);
   
    // Check assertions
    assertTrue(Math.abs(evt.getX() - (x * 2)) < EPS);
    assertTrue(Math.abs(evt.getY() - (y * 2)) < EPS);
    assertTrue(evt.isPopupTrigger());
    assertEquals(2, evt.getClickCount());
  }
View Full Code Here

TOP

Related Classes of org.tinyuml.ui.diagram.EditorMouseEvent

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.