Search in sources :

Example 31 with Node

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

the class ScriptApiTest method test_NodeRO_getMap.

public void test_NodeRO_getMap() {
    map = c.newMap();
    final Node root = map.getRoot();
    assertEquals("???", map, root.getMap());
}
Also used : Node(org.freeplane.plugin.script.proxy.Proxy.Node)

Example 32 with Node

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

the class ScriptApiTest method test_Node_moveTo_Node_parentNode_int_position.

public void test_Node_moveTo_Node_parentNode_int_position() {
    map = c.newMap();
    final Node root = map.getRoot();
    final Node child1 = root.createChild("child 1");
    final Node child2 = root.createChild("child 2");
    final Node grandchild = child1.createChild("grandchild");
    assertEquals("wrong count of children", 2, root.getChildren().size());
    grandchild.moveTo(root, 1);
    assertEquals("wrong position", child1, root.getChildren().get(0));
    assertEquals("wrong position", grandchild, root.getChildren().get(1));
    assertEquals("wrong position", child2, root.getChildren().get(2));
}
Also used : Node(org.freeplane.plugin.script.proxy.Proxy.Node)

Example 33 with Node

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

the class ScriptApiTest method test_NodeRO_find_ICondition_condition.

/**
 * copy of {@link #test_ControllerRO_find_ICondition_condition()}.
 */
@SuppressWarnings("deprecation")
public void test_NodeRO_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);
}
Also used : NodeContainsCondition(org.freeplane.features.text.NodeContainsCondition) Node(org.freeplane.plugin.script.proxy.Proxy.Node)

Example 34 with Node

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

the class ControllerProxy method selectMultipleNodes.

public void selectMultipleNodes(final Collection<Node> toSelect) {
    final IMapSelection selection = Controller.getCurrentController().getSelection();
    final Iterator<Node> it = toSelect.iterator();
    if (!it.hasNext()) {
        return;
    }
    selection.selectAsTheOnlyOneSelected(((NodeProxy) it.next()).getDelegate());
    while (it.hasNext()) {
        final NodeModel nodeModel = ((NodeProxy) it.next()).getDelegate();
        Controller.getCurrentController().getSelection().toggleSelected(nodeModel);
    }
}
Also used : NodeModel(org.freeplane.features.map.NodeModel) IMapSelection(org.freeplane.features.map.IMapSelection) 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