Package org.tinyuml.draw

Examples of org.tinyuml.draw.CompositeNode


    MyCompositeNode node = new MyCompositeNode();
    node.setParent(parent);
    node.setOrigin(0, 0);
    node.setSize(100, 100);
    // test parent assignment
    CompositeNode child = new MyCompositeNode();
    child.setOrigin(5, 5);
    child.setSize(80, 80);
    node.addChild(child);

    Node childchild = new MyCompositeNode();
    childchild.setOrigin(5, 5);
    childchild.setSize(70, 70);
    child.addChild(childchild);
   
    // retrieve childchild
    assertEquals(childchild, node.getChildAt(15, 20));
    assertEquals(node, child.getParent());
    assertEquals(child, childchild.getParent());
   
    assertTrue(childchild.isAncestor(child));
    assertTrue(childchild.isAncestor(parent));
    assertTrue(child.isAncestor(parent));
    assertFalse(parent.isAncestor(child));
    assertFalse(child.isAncestor(childchild));
  }
View Full Code Here


    MyCompositeNode node = new MyCompositeNode();
    node.setParent(parent);
    node.setOrigin(0, 0);
    node.setSize(100, 100);
    // test parent assignment
    CompositeNode child = new MyCompositeNode();
    child.setOrigin(5, 5);
    child.setSize(80, 80);
    node.addChild(child);

    Node childchild = new MyCompositeNode();
    childchild.setOrigin(5, 5);
    childchild.setSize(70, 70);
    child.addChild(childchild);
   
    // retrieve childchild
    assertEquals(childchild, node.getChildAt(15, 20));
    assertEquals(node, child.getParent());
    assertEquals(child, childchild.getParent());
   
    assertTrue(childchild.isAncestor(child));
    assertTrue(childchild.isAncestor(parent));
    assertTrue(child.isAncestor(parent));
    assertFalse(parent.isAncestor(child));
    assertFalse(child.isAncestor(childchild));
  }
View Full Code Here

  /**
   * {@inheritDoc}
   */
  public void mousePressed(EditorMouseEvent event) {
    CompositeNode parent = editor.getDiagram();
    DiagramElement possibleParent = editor.getDiagram().getChildAt(
      tmpPos.getX(), tmpPos.getY());
    if (isNestingCondition(possibleParent)) {
      parent = (CompositeNode) possibleParent;
    }
View Full Code Here

TOP

Related Classes of org.tinyuml.draw.CompositeNode

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.