Package mindnotes.shared.model

Examples of mindnotes.shared.model.Node


    roundtrip(m);
  }

  public Node node(Node parent, String title, boolean expanded,
      NodeLocation nl) {
    Node n = new Node();
    n.setExpanded(expanded);
    n.setText(title);
    n.setNodeLocation(nl);
    parent.addChildNode(n);
    return n;
  }
View Full Code Here


  }

  public void testMap1() {
    MindMap m = new MindMap();
    m.setTitle("a title");
    Node n1 = node(m.getRootNode(), "n1", true, NodeLocation.LEFT);
    Node n2 = node(n1, "n2", false, NodeLocation.RIGHT);
    node(n1, "n3", false, NodeLocation.RIGHT);
    node(n2, "n3", false, NodeLocation.RIGHT);
    n2.addObject(new EmbeddedObject("yt", "dfcsdf"));
    node(m.getRootNode(), "sadas", true, NodeLocation.LEFT);
    node(m.getRootNode(), null, true, NodeLocation.LEFT);
    node(m.getRootNode(), "dsdsd", true, null);
    node(n2, "dsdsd", true, null);
    roundtrip(m);
View Full Code Here

  @Test
  public void testAddingNodes() {
    MindMap m = new MindMap();
    assertNotNull(m.getRootNode());
    m.getRootNode().addChildNode(new Node());
    m.getRootNode().addChildNode(new Node());
    Node n = new Node();
    m.getRootNode().addChildNode(n);
    m.getRootNode().addChildNode(n);

    assertEquals(3, m.getRootNode().getChildCount());
    checkNodeTreeIntegrity(m.getRootNode());
View Full Code Here

  @Test
  public void testInsertAfter() {
    MindMap m = new MindMap();
    assertNotNull(m.getRootNode());
    m.getRootNode().addChildNode(new Node());
    Node n = new Node();
    m.getRootNode().addChildNode(n);
    m.getRootNode().addChildNode(new Node());

    Node x = new Node();
    m.getRootNode().insertAfter(x, n);

    Iterator<Node> iterator = m.getRootNode().getChildren().iterator();
    for (int i = 0; iterator.hasNext(); i++) {
      Node next = iterator.next();
      if (next == n) {
        assertEquals(1, i);
        assertEquals(x, iterator.next());
      }
View Full Code Here

  @Test
  public void testInsertBefore() {
    MindMap m = new MindMap();
    assertNotNull(m.getRootNode());
    m.getRootNode().addChildNode(new Node());
    Node n = new Node();
    m.getRootNode().addChildNode(n);
    m.getRootNode().addChildNode(new Node());

    Node x = new Node();
    m.getRootNode().insertBefore(x, n);

    Iterator<Node> iterator = m.getRootNode().getChildren().iterator();
    for (int i = 0; iterator.hasNext(); i++) {
      Node next = iterator.next();
      if (next == x) {
        assertEquals(1, i);
        assertEquals(n, iterator.next());
      }
View Full Code Here

  @Test
  public void testRemovingNodes() {
    MindMap m = new MindMap();
    assertNotNull(m.getRootNode());
    m.getRootNode().addChildNode(new Node());
    m.getRootNode().addChildNode(new Node());
    Node n = new Node();
    m.getRootNode().addChildNode(n);
    m.getRootNode().addChildNode(n);

    m.getRootNode().removeChildNode(n);
View Full Code Here

TOP

Related Classes of mindnotes.shared.model.Node

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.