Package org.tinyuml.draw

Examples of org.tinyuml.draw.SimpleConnection


 
  /**
   * Tests adding Connections.
   */
  public void testAddRemoveConnection() {
    Connection conn = new SimpleConnection() {
      public boolean contains(double mx, double my) { return true; }
    };
    diagram.addChild(conn);
    assertEquals(diagram, conn.getParent());
    assertEquals(conn, diagram.getChildAt(6.0, 5.0));
    diagram.removeChild(conn);
    assertEquals(NullElement.getInstance(), diagram.getChildAt(6.0, 5.0));
  }
View Full Code Here


  /**
   * Tests the overridden getChildren() method, which contains both connections
   * and nodes.
   */
  public void testOverriddenGetChildren() {
    Connection conn = new SimpleConnection();
    Mock mockNode = mock(Node.class);
    mockNode.expects(atLeastOnce()).method("getAbsoluteX2")
      .will(returnValue(2.0));
    mockNode.expects(atLeastOnce()).method("getAbsoluteY2")
      .will(returnValue(2.0));
View Full Code Here

  /**
   * Tests the clone() method.
   */
  public void testClone() {
    MyBaseConnection conn = new MyBaseConnection();
    SimpleConnection simpleconn = new SimpleConnection();
    Relation relation = new UmlRelation();
    conn.setConnection(simpleconn);
    conn.setRelation(relation);
    MyBaseConnection cloned = (MyBaseConnection) conn.clone();
    assertTrue(cloned.getConnection() != conn.getConnection());
View Full Code Here

  public void rectilinearToDirect() {
    if (getSelectedElements().size() > 0 &&
        getSelectedElements().get(0) instanceof UmlConnection) {
      UmlConnection conn = (UmlConnection) getSelectedElements().get(0);
      execute(new ConvertConnectionTypeCommand(this, conn,
        new SimpleConnection()));
       // we can only tell the selection handler to forget about the selection
      selectionHandler.deselectAll();
    }
  }
View Full Code Here

  /**
   * Constructor.
   */
  private Dependency() {
    setConnection(new SimpleConnection());
    setIsDashed(true);
  }
View Full Code Here

 
  /**
   * Tests the clone() method.
   */
  public void testClone() {
    SimpleConnection cloned = (SimpleConnection) connection.clone();
    assertEquals(cloned.getPoints(), connection.getPoints());
    assertTrue(cloned.getPoints() != connection.getPoints());
    for (int i = 0; i < cloned.getPoints().size(); i++) {
      assertTrue(connection.getPoints().get(i) != cloned.getPoints().get(i));
    }
  }
View Full Code Here

  /**
   * Constructor.
   * @param anAssociation the UmlAssociation object
   */
  public Dependency(UmlAssociation anAssociation) {
    super(anAssociation, new SimpleConnection());
    setIsDashed(true);
  }
View Full Code Here

  /**
   * Tests the clone() method.
   */
  public void testClone() {
    MyBaseConnection conn = new MyBaseConnection();
    SimpleConnection simpleconn = new SimpleConnection();
    Relation relation = new UmlRelation();
    conn.setConnection(simpleconn);
    conn.setRelation(relation);
    MyBaseConnection cloned = (MyBaseConnection) conn.clone();
    assertTrue(cloned.getConnection() != conn.getConnection());
View Full Code Here

 
  /**
   * Tests adding Connections.
   */
  public void testAddRemoveConnection() {
    Connection conn = new SimpleConnection() {
      public boolean contains(double mx, double my) { return true; }
    };
    diagram.addChild(conn);
    assertEquals(diagram, conn.getParent());
    assertEquals(conn, diagram.getChildAt(6.0, 5.0));
    diagram.removeChild(conn);
    assertEquals(NullElement.getInstance(), diagram.getChildAt(6.0, 5.0));
  }
View Full Code Here

  /**
   * Tests the overridden getChildren() method, which contains both connections
   * and nodes.
   */
  public void testOverriddenGetChildren() {
    Connection conn = new SimpleConnection();
    Mock mockNode = mock(Node.class);
    mockNode.expects(atLeastOnce()).method("getAbsoluteX2")
      .will(returnValue(2.0));
    mockNode.expects(atLeastOnce()).method("getAbsoluteY2")
      .will(returnValue(2.0));
View Full Code Here

TOP

Related Classes of org.tinyuml.draw.SimpleConnection

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.