use of org.freeplane.plugin.script.proxy.Proxy.Node in project freeplane by freeplane.
the class ScriptApiTest method test_NodeRO_isFolded.
public void test_NodeRO_isFolded() {
createTestMap();
final Node root = map.getRoot();
final Node child = firstChild();
final Node grandchild = child.createChild("grandchild");
assertFalse("initially nothing should be folded", root.isFolded());
assertFalse("initially nothing should be folded", child.isFolded());
root.setFolded(true);
assertFalse("root isn't foldable", root.isFolded());
child.setFolded(true);
assertTrue("node should be folded now", child.isFolded());
assertFalse("folding is not recursive in terms of isFolded()", grandchild.isFolded());
child.setFolded(false);
assertFalse("node should be unfolded again", child.isFolded());
grandchild.setFolded(true);
assertFalse("a node without children is not foldable", grandchild.isFolded());
// test undo of folding - give the new node a child first to make it foldable
grandchild.createChild("grandgrandchild");
grandchild.setFolded(true);
assertTrue("node should be folded now", grandchild.isFolded());
c.undo();
assertFalse("folding should be undone now", grandchild.isFolded());
}
use of org.freeplane.plugin.script.proxy.Proxy.Node in project freeplane by freeplane.
the class ScriptApiTest method test_Node_delete.
public void test_Node_delete() {
map = c.newMap();
final Node root = map.getRoot();
final Node child1 = root.createChild("child 1");
final Node child2 = root.createChild("child 2");
assertEquals("", 2, root.getChildren().size());
child1.delete();
assertEquals("deletion failed", 1, root.getChildren().size());
assertEquals("wrong node deleted", child2, root.getChildren().get(0));
}
use of org.freeplane.plugin.script.proxy.Proxy.Node in project freeplane by freeplane.
the class ScriptApiTest method test_NodeRO_getParent.
public void test_NodeRO_getParent() {
createTestMap();
final Node root = map.getRoot();
assertEquals("root has no parent", null, root.getParent());
final Node child = firstChild(root);
assertEquals("", root, child.getParent());
}
use of org.freeplane.plugin.script.proxy.Proxy.Node in project freeplane by freeplane.
the class ScriptApiTest method test_ControllerRO_find_ICondition_condition.
@SuppressWarnings("deprecation")
public void test_ControllerRO_find_ICondition_condition() {
map = c.newMap();
@SuppressWarnings("unused") final Node firstChild = map.getRoot().createChild("child 1");
final Node secondChild = map.getRoot().createChild("child 2");
final List<Node> found = c.find(new NodeContainsCondition(TextController.FILTER_NODE, "child 2", false));
assertEquals("one matching node should be found", list(secondChild), found);
}
use of org.freeplane.plugin.script.proxy.Proxy.Node in project freeplane by freeplane.
the class ScriptApiTest method test_Node_setFolded_boolean_folded.
//
// public void test_Node_removeConnector_Connector_connectorToBeRemoved() {
//
// }
//
public void test_Node_setFolded_boolean_folded() {
createTestMap();
final Node child = firstChild();
child.createChild("grandchild");
child.setFolded(true);
assertTrue("node should be folded now", child.isFolded());
child.setFolded(false);
assertFalse("node should be unfolded again", child.isFolded());
}
Aggregations