Package org.tinyuml.draw

Examples of org.tinyuml.draw.Connection


 
  /**
   * 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

  /**
   * {@inheritDoc}
   */
  public Connection createDependency(UmlNode sourceNode, UmlNode targetNode) {
    Connection connection = new Dependency(createAssociationModel(sourceNode,
      targetNode));
    bindConnection(connection, sourceNode, targetNode);
    return connection;
  }
View Full Code Here

  /**
   * {@inheritDoc}
   */
  public Connection createNoteConnection(UmlNode sourceNode,
    UmlNode targetNode) {
    Connection connection = new NoteConnection();
    bindConnection(connection, sourceNode, targetNode);
    return connection;
  }
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

  public void testAddRemoveConnection() {
    UmlAssociation assoc = (UmlAssociation)
      UmlAssociation.getInstance().clone();
    Line2D line = new Line2D.Double();
    line.setLine(5.0, 5.0, 10.0, 5.0);
    Connection conn = new BaseConnection(assoc, line);
    diagram.addChild(conn);
    assertEquals(diagram, conn.getParent());
    assertEquals(conn, diagram.getChildAt(6.0, 5.0));
    diagram.removeChild(conn);
    assertNull(conn.getParent());
  }
View Full Code Here

  public void testAddRemoveConnection() {
    UmlAssociation assoc = (UmlAssociation)
      UmlAssociation.getInstance().clone();
    Line2D line = new Line2D.Double();
    line.setLine(5.0, 5.0, 10.0, 5.0);
    Connection conn = new BaseConnection(assoc, line);
    diagram.addChild(conn);
    assertEquals(diagram, conn.getParent());
    assertEquals(conn, diagram.getChildAt(6.0, 5.0));
    diagram.removeChild(conn);
    assertNull(conn.getParent());
  }
View Full Code Here

  /**
   * Tests creation of a Connection with an existing UmlAssociation object.
   */
  public void testCreateConnection() {
    Connection conn = factory.createConnection(assoc);
    assertNotNull(conn);
    assertNull(conn.getParent());
  }
View Full Code Here

  /**
   * Tests creation of a Connection with an existing UmlAssociation object.
   */
  public void testCreateConnection() {
    Connection conn = factory.createConnection(assoc);
    assertNotNull(conn);
    assertNull(conn.getParent());
  }
View Full Code Here

TOP

Related Classes of org.tinyuml.draw.Connection

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.