Package org.tinyuml.umldraw.structure

Examples of org.tinyuml.umldraw.structure.Association


   */
  public void testCreateAssociation() {
    ClassElement class1 = (ClassElement) factory.createNode(ElementType.CLASS);
    ClassElement class2 = (ClassElement) factory.createNode(ElementType.CLASS);

    Association conn = (Association) factory.createConnection(
      RelationType.ASSOCIATION, class1, class2);
    assertStdConnectionConditions(conn, class1, class2);
    Relation relation = (Relation) conn.getModelElement();
    assertTrue(relation.canSetElement1Navigability());
    assertTrue(relation.canSetElement2Navigability());
  }
View Full Code Here


   */
  public void testCreateComposition() {
    ClassElement class1 = (ClassElement) factory.createNode(ElementType.CLASS);
    ClassElement class2 = (ClassElement) factory.createNode(ElementType.CLASS);
   
    Association composition = (Association) factory.createConnection(
      RelationType.COMPOSITION, class1, class2);
    assertStdConnectionConditions(composition, class1, class2);
    Relation umlcomp = (Relation) composition.getModelElement();
    assertFalse(umlcomp.canSetElement1Navigability());
    assertTrue(umlcomp.canSetElement2Navigability());   
  }
View Full Code Here

   */
  public void testCreateAggregation() {
    ClassElement class1 = (ClassElement) factory.createNode(ElementType.CLASS);
    ClassElement class2 = (ClassElement) factory.createNode(ElementType.CLASS);
   
    Association composition = (Association) factory.createConnection(
      RelationType.AGGREGATION, class1, class2);
    assertStdConnectionConditions(composition, class1, class2);
    Relation umlcomp = (Relation) composition.getModelElement();
    assertFalse(umlcomp.canSetElement1Navigability());
    assertTrue(umlcomp.canSetElement2Navigability());   
  }
View Full Code Here

   */
  public void testClone() {
    prototype.setAssociationType(AssociationType.COMPOSITION);
    prototype.setShowName(true);
    prototype.setShowMultiplicities(false);
    Association cloned = (Association) prototype.clone();
   
    assertEquals(prototype.getAssociationType(), cloned.getAssociationType());
    assertEquals(parent, cloned.getMultiplicity1Label().getParent());
    assertEquals(parent, cloned.getMultiplicity2Label().getParent());
    assertEquals(parent, cloned.getNameLabel().getParent());
    assertTrue(cloned.getMultiplicity1Label() !=
      prototype.getMultiplicity1Label());
    assertTrue(cloned.getMultiplicity1Label() !=
      prototype.getMultiplicity2Label());
    assertTrue(cloned.getNameLabel() != prototype.getNameLabel());
   
    assertNotNull(cloned.getMultiplicity1Label().getSource());
    assertNotNull(cloned.getMultiplicity2Label().getSource());
    assertNotNull(cloned.getNameLabel().getSource());
   
    assertTrue(cloned.getMultiplicity1Label().getSource() !=
      prototype.getMultiplicity1Label().getSource());
    assertTrue(cloned.getMultiplicity2Label().getSource() !=
      prototype.getMultiplicity1Label().getSource());
    assertTrue(cloned.getNameLabel().getSource() == cloned.getNameLabel());
    assertTrue(cloned.showName());
    assertFalse(cloned.showMultiplicities());
  }
View Full Code Here

        umlclass.setAttributes(dialog.getAttributes());
        umlclass.setStereotypes(dialog.getStereotypes());
        redraw();
      }
    } else if (element instanceof Association) {
      Association association = (Association) element;
      EditAssociationDialog dialog = new EditAssociationDialog(frame,
        association, true);
      dialog.setLocationRelativeTo(frame);
      dialog.setVisible(true);
      redraw();
View Full Code Here

    ClassElement class2 = factory.createClass();

    mockElementFactory.expects(atLeastOnce()).method("create").
      with(eq(RelationType.DEPENDENCY)).will(returnValue(assoc));

    Association conn = (Association) factory.createAssociation(class1, class2);
    assertEquals(assoc, conn.getModelElement());
    assertEquals(class1, conn.getNode1());
    assertEquals(class2, conn.getNode2());
    assertEquals(1, class1.getConnections().size());
    assertEquals(1, class2.getConnections().size());
    assertNull(conn.getParent());   
  }
View Full Code Here

   */
  public void testCreateAssociation() {
    ClassElement class1 = (ClassElement) factory.createNode(ElementType.CLASS);
    ClassElement class2 = (ClassElement) factory.createNode(ElementType.CLASS);

    Association conn = (Association) factory.createConnection(
      RelationType.ASSOCIATION, class1, class2);
    assertStdConnectionConditions(conn, class1, class2);
    Relation relation = (Relation) conn.getModelElement();
    assertTrue(relation.canSetElement1Navigability());
    assertTrue(relation.canSetElement2Navigability());
  }
View Full Code Here

   */
  public void testCreateComposition() {
    ClassElement class1 = (ClassElement) factory.createNode(ElementType.CLASS);
    ClassElement class2 = (ClassElement) factory.createNode(ElementType.CLASS);
   
    Association composition = (Association) factory.createConnection(
      RelationType.COMPOSITION, class1, class2);
    assertStdConnectionConditions(composition, class1, class2);
    Relation umlcomp = (Relation) composition.getModelElement();
    assertFalse(umlcomp.canSetElement1Navigability());
    assertTrue(umlcomp.canSetElement2Navigability());   
  }
View Full Code Here

   */
  public void testCreateAggregation() {
    ClassElement class1 = (ClassElement) factory.createNode(ElementType.CLASS);
    ClassElement class2 = (ClassElement) factory.createNode(ElementType.CLASS);
   
    Association composition = (Association) factory.createConnection(
      RelationType.AGGREGATION, class1, class2);
    assertStdConnectionConditions(composition, class1, class2);
    Relation umlcomp = (Relation) composition.getModelElement();
    assertFalse(umlcomp.canSetElement1Navigability());
    assertTrue(umlcomp.canSetElement2Navigability());   
  }
View Full Code Here

        umlclass.setAttributes(dialog.getAttributes());
        umlclass.setStereotypes(dialog.getStereotypes());
        redraw();
      }
    } else if (element instanceof Association) {
      Association association = (Association) element;
      EditAssociationDialog dialog = new EditAssociationDialog(frame,
        association, true);
      dialog.setLocationRelativeTo(frame);
      dialog.setVisible(true);
      redraw();
View Full Code Here

TOP

Related Classes of org.tinyuml.umldraw.structure.Association

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.