Package org.tinyuml.draw

Examples of org.tinyuml.draw.Selection


 
  /**
   * Tests the selection.
   */
  public void testSelection() {
    Selection selection = connection.getSelection(operations);
    assertEquals(connection, selection.getElement());
    assertFalse(selection.isDragging());
    assertEquals(Cursor.getDefaultCursor(),
      selection.getCursorForPosition(3.0, 1.0));
    // these have no effect
    selection.startDragging(1.0, 2.0);
    selection.stopDragging(3.0, 4.0);
    selection.cancelDragging();
    selection.updateDimensions();
    selection.updatePosition(1.0, 2.0);
  }
View Full Code Here


    node.setParent(parent);
    mockParent.expects(atLeastOnce()).method("getAbsoluteX1").
      will(returnValue(0.0));
    mockParent.expects(atLeastOnce()).method("getAbsoluteY1").
      will(returnValue(0.0));
    Selection selection =
      node.getSelection((DiagramOperations) mockOperations.proxy());
    assertEquals(node, selection.getElement());
    node.setSize(3.0, 4.0); // we should in fact   
  }
View Full Code Here

   * Displays the context menu.
   * @param e the EditorMouseEvent
   */
  private void displayContextMenu(EditorMouseEvent e) {
    double mx = e.getX(), my = e.getY();
    Selection selection = getSelection(mx, my);
    if (!nothingSelected()) {
      JPopupMenu menu = menubuilder.createContextMenu(selection);
      menu.show(editor, e.getMouseEvent().getX(), e.getMouseEvent().getY());
    }
  }
View Full Code Here

    node.setParent(parent);
    mockParent.expects(atLeastOnce()).method("getAbsoluteX1").
      will(returnValue(0.0));
    mockParent.expects(atLeastOnce()).method("getAbsoluteY1").
      will(returnValue(0.0));
    Selection selection =
      node.getSelection((DiagramOperations) mockOperations.proxy());
    assertEquals(node, selection.getElement());
    node.setSize(3.0, 4.0); // we should in fact   
  }
View Full Code Here

 
  /**
   * Tests the selection.
   */
  public void testSelection() {
    Selection selection = connection.getSelection(operations);
    assertEquals(connection, selection.getElement());
  }
View Full Code Here

    node.setParent(parent);
    mockParent.expects(atLeastOnce()).method("getAbsoluteX1").
      will(returnValue(0.0));
    mockParent.expects(atLeastOnce()).method("getAbsoluteY1").
      will(returnValue(0.0));
    Selection selection =
      node.getSelection((DiagramOperations) mockOperations.proxy());
    assertEquals(node, selection.getElement());
    node.setSize(3.0, 4.0); // we should in fact   
  }
View Full Code Here

 
  /**
   * Tests the selection.
   */
  public void testSelection() {
    Selection selection = connection.getSelection(operations);
    assertEquals(connection, selection.getElement());
  }
View Full Code Here

  /**
   * Tests the methods of the NullSelection object.
   */
  public void testState() {
    double x = 1, y = 2;
    Selection selection = NullSelection.getInstance();
    assertEquals(NullElement.getInstance(), selection.getElement());
    assertEquals(0, selection.getElements().size());
    assertFalse(selection.isDragging());
    assertFalse(selection.contains(x, y));
    assertEquals(Cursor.getDefaultCursor(),
      selection.getCursorForPosition(x, y));
    // These methods have no effect, just check they don't throw
    // exceptions
    selection.startDragging(x, y);
    selection.stopDragging(x, y);
    selection.cancelDragging();
    selection.updatePosition(x, y);
    selection.draw(drawingContext);
    selection.updateDimensions();
  }
View Full Code Here

   * Displays the context menu.
   * @param e the EditorMouseEvent
   */
  private void displayContextMenu(EditorMouseEvent e) {
    double mx = e.getX(), my = e.getY();
    Selection selection = getSelection(mx, my);
    if (!nothingSelected()) {
      JPopupMenu menu = menubuilder.createContextMenu(selection);
      menu.show(editor, e.getMouseEvent().getX(), e.getMouseEvent().getY());
    }
  }
View Full Code Here

TOP

Related Classes of org.tinyuml.draw.Selection

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.