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());
}
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);
}
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());
}
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;
}
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());
}
Aggregations