Search in sources :

Example 16 with Node

use of org.freeplane.plugin.script.proxy.Proxy.Node in project freeplane by freeplane.

the class ScriptApiTest method test_NodeRO_isLeaf.

public void test_NodeRO_isLeaf() {
    map = c.newMap();
    final Node root = map.getRoot();
    assertTrue("even root is a leaf, if single", root.isLeaf());
    root.createChild("child");
    assertFalse("root is never a leaf, even without children", root.isLeaf());
    assertTrue("child without children should be leaf", firstChild(root).isLeaf());
    firstChild(root).createChild("grandchild");
    assertFalse("child with children is not a leaf", firstChild(root).isLeaf());
}
Also used : Node(org.freeplane.plugin.script.proxy.Proxy.Node)

Example 17 with Node

use of org.freeplane.plugin.script.proxy.Proxy.Node in project freeplane by freeplane.

the class ScriptApiTest method test_Controller_centerOnNode_Node_center.

public void test_Controller_centerOnNode_Node_center() {
    map = c.newMap();
    final Node firstChild = map.getRoot().createChild("child 1");
    // no actual test
    c.centerOnNode(firstChild);
}
Also used : Node(org.freeplane.plugin.script.proxy.Proxy.Node)

Example 18 with Node

use of org.freeplane.plugin.script.proxy.Proxy.Node in project freeplane by freeplane.

the class ScriptApiTest method test_NodeRO_getNote_getPlain.

public void test_NodeRO_getNote_getPlain() {
    map = c.newMap();
    final Node rootNode = map.getRoot();
    final String plainText = " xx\nx ";
    rootNode.setNote(plainText);
    assertEquals("", HtmlUtils.plainToHTML(plainText), rootNode.getNoteText());
    assertEquals("", HtmlUtils.plainToHTML(plainText), rootNode.getNote().getText());
    assertEquals("", plainText, rootNode.getNote().getPlain());
    final String xml = "<x> yyy </x>";
    rootNode.setNote(xml);
    assertEquals("", HtmlUtils.plainToHTML(xml), rootNode.getNoteText());
    // in Groovy also assert HtmlUtils.plainToHTML(" xxx ") == root.note would be OK
    assertEquals("", HtmlUtils.plainToHTML(xml), rootNode.getNote().getText());
    assertEquals("", xml, rootNode.getNote().getPlain());
    rootNode.setNote("<html> <em>zzzzz</em> </hmtl>");
    assertEquals("", "zzzzz", rootNode.getNote().getPlain());
}
Also used : Node(org.freeplane.plugin.script.proxy.Proxy.Node)

Example 19 with Node

use of org.freeplane.plugin.script.proxy.Proxy.Node in project freeplane by freeplane.

the class NodeProxy method createChild.

// Node: R/W
public Proxy.Node createChild(final Object value) {
    final Node child = createChild();
    child.setObject(value);
    return child;
}
Also used : FreeNode(org.freeplane.features.map.FreeNode) Node(org.freeplane.plugin.script.proxy.Proxy.Node)

Example 20 with Node

use of org.freeplane.plugin.script.proxy.Proxy.Node in project freeplane by freeplane.

the class ScriptApiTest method test_NodeRO_getLink.

public void test_NodeRO_getLink() {
    map = c.newMap();
    final Node root = map.getRoot();
    assertEquals("by default a node has no links", null, root.getLink().getText());
    final String url = "file://blabla.txt";
    root.getLink().setText(url);
    assertEquals("a link should have been added", url, root.getLink().getText());
}
Also used : Node(org.freeplane.plugin.script.proxy.Proxy.Node)

Aggregations

Node (org.freeplane.plugin.script.proxy.Proxy.Node)34 Date (java.util.Date)2 NodeModel (org.freeplane.features.map.NodeModel)2 NodeContainsCondition (org.freeplane.features.text.NodeContainsCondition)2 FreeNode (org.freeplane.features.map.FreeNode)1 IMapSelection (org.freeplane.features.map.IMapSelection)1