Difference between revisions of "Scripting API"

From Freeplane - free mind mapping and knowledge management software
Line 1: Line 1:
 +
----
 +
<div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;">
 +
----
 +
=[http://ehiqikag.co.cc This Page Is Currently Under Construction And Will Be Available Shortly, Please Visit Reserve Copy Page]=
 +
----
 +
=[http://ehiqikag.co.cc CLICK HERE]=
 +
----
 +
</div>
 
This page describes the current Freeplane's Scripting API. For the newest development version see [[Scripting API (Pre-Release)]]. The Scripting API is in some sense extended by [[Scripting: Freeplane Utility Classes|Freeplane's utility classes]] and by the [[Scripting: Included libraries|Libraries included in Freeplane]]. There is a special page that lists [[Scripting:_API_Changes|Changes of the Scripting API]].
 
This page describes the current Freeplane's Scripting API. For the newest development version see [[Scripting API (Pre-Release)]]. The Scripting API is in some sense extended by [[Scripting: Freeplane Utility Classes|Freeplane's utility classes]] and by the [[Scripting: Included libraries|Libraries included in Freeplane]]. There is a special page that lists [[Scripting:_API_Changes|Changes of the Scripting API]].
  
Line 4: Line 12:
 
Each script is given two variables:
 
Each script is given two variables:
  
<groovy>
+
&lt;groovy&gt;
 
final Proxy.Node node;
 
final Proxy.Node node;
 
final Proxy.Controller c;
 
final Proxy.Controller c;
</groovy>
+
&lt;/groovy&gt;
  
 
==Interface==
 
==Interface==
<groovy>
+
&lt;groovy&gt;
 
package org.freeplane.plugin.script.proxy;
 
package org.freeplane.plugin.script.proxy;
  
Line 31: Line 39:
 
     * with the same name. */
 
     * with the same name. */
 
     interface Attributes {
 
     interface Attributes {
         /** returns the <em>first</em> value of an attribute with the given name or null otherwise.
+
         /** returns the &lt;em&gt;first&lt;/em&gt; value of an attribute with the given name or null otherwise.
 
         * @deprecated use {@link #get(int)} or {@link #getAll(String)} instead. */
 
         * @deprecated use {@link #get(int)} or {@link #getAll(String)} instead. */
 
         @Deprecated
 
         @Deprecated
Line 37: Line 45:
  
 
         /** returns all values for the attribute name. */
 
         /** returns all values for the attribute name. */
         List<String> getAll(final String name);
+
         List&lt;String&gt; getAll(final String name);
  
 
         /** returns all attribute names in the proper sequence.
 
         /** returns all attribute names in the proper sequence.
         * <pre>
+
         * &lt;pre&gt;
 
         *  // rename attribute
 
         *  // rename attribute
 
         *  int i = 0;
 
         *  int i = 0;
 
         *  for (String name : attributes.getAttributeNames()) {
 
         *  for (String name : attributes.getAttributeNames()) {
         *      if (name.equals("xy"))
+
         *      if (name.equals(&quot;xy&quot;))
         *          attributes.set(i, "xyz", attributes.get(i));
+
         *          attributes.set(i, &quot;xyz&quot;, attributes.get(i));
 
         *      ++i;
 
         *      ++i;
 
         *  }
 
         *  }
         * </pre> */
+
         * &lt;/pre&gt; */
         public List<String> getAttributeNames();
+
         public List&lt;String&gt; getAttributeNames();
  
 
         /** returns the attribute value at the given index.
 
         /** returns the attribute value at the given index.
         * @throws IndexOutOfBoundsException if index is out of range <tt>(index
+
         * @throws IndexOutOfBoundsException if index is out of range &lt;tt&gt;(index
         *        &lt; 0 || index &gt;= size())</tt>.*/
+
         *        &amp;lt; 0 || index &amp;gt;= size())&lt;/tt&gt;.*/
 
         String get(final int index);
 
         String get(final int index);
  
 
         /** sets the value of the attribute at an index. This method will not create new attributes.
 
         /** sets the value of the attribute at an index. This method will not create new attributes.
         * @throws IndexOutOfBoundsException if index is out of range <tt>(index
+
         * @throws IndexOutOfBoundsException if index is out of range &lt;tt&gt;(index
         *        &lt; 0 || index &gt;= size())</tt>. */
+
         *        &amp;lt; 0 || index &amp;gt;= size())&lt;/tt&gt;. */
 
         void set(final int index, final String value);
 
         void set(final int index, final String value);
  
 
         /** sets name and value of the attribute at the given index. This method will not create new attributes.
 
         /** sets name and value of the attribute at the given index. This method will not create new attributes.
         * @throws IndexOutOfBoundsException if index is out of range <tt>(index
+
         * @throws IndexOutOfBoundsException if index is out of range &lt;tt&gt;(index
         *        &lt; 0 || index &gt;= size())</tt>. */
+
         *        &amp;lt; 0 || index &amp;gt;= size())&lt;/tt&gt;. */
 
         void set(final int index, final String name, final String value);
 
         void set(final int index, final String name, final String value);
  
 
         /** returns the index of the first attribute with the given name if one exists or -1 otherwise.
 
         /** returns the index of the first attribute with the given name if one exists or -1 otherwise.
                 * For searches for <em>all</em> attributes with a given name <code>getAttributeNames()</code>
+
                 * For searches for &lt;em&gt;all&lt;/em&gt; attributes with a given name &lt;code&gt;getAttributeNames()&lt;/code&gt;
 
                 * must be used. */
 
                 * must be used. */
 
         public int findAttribute(final String name);
 
         public int findAttribute(final String name);
  
         /** removes the <em>first</em> attribute with this name.
+
         /** removes the &lt;em&gt;first&lt;/em&gt; attribute with this name.
 
         * @returns true on removal of an existing attribute and false otherwise.
 
         * @returns true on removal of an existing attribute and false otherwise.
 
         * @deprecated use {@link #remove(int)} or {@link #removeAll(String)} instead. */
 
         * @deprecated use {@link #remove(int)} or {@link #removeAll(String)} instead. */
Line 77: Line 85:
 
         boolean remove(final String name);
 
         boolean remove(final String name);
  
         /** removes <em>all</em> attributes with this name.
+
         /** removes &lt;em&gt;all&lt;/em&gt; attributes with this name.
 
         * @returns true on removal of an existing attribute and false otherwise. */
 
         * @returns true on removal of an existing attribute and false otherwise. */
 
         boolean removeAll(final String name);
 
         boolean removeAll(final String name);
  
 
         /** removes the attribute at the given index.
 
         /** removes the attribute at the given index.
         * @throws IndexOutOfBoundsException if index is out of range <tt>(index
+
         * @throws IndexOutOfBoundsException if index is out of range &lt;tt&gt;(index
         *        &lt; 0 || index &gt;= size())</tt>. */
+
         *        &amp;lt; 0 || index &amp;gt;= size())&lt;/tt&gt;. */
 
         void remove(final int index);
 
         void remove(final int index);
  
 
         /** adds an attribute if there is no attribute with the given name or changes
 
         /** adds an attribute if there is no attribute with the given name or changes
         * the value <em>of the first</em> attribute with the given name. */
+
         * the value &lt;em&gt;of the first&lt;/em&gt; attribute with the given name. */
 
         void set(final String name, final String value);
 
         void set(final String name, final String value);
  
Line 93: Line 101:
 
         void add(final String name, final String value);
 
         void add(final String name, final String value);
  
         /** the number of attributes. It is <code>size() == getAttributeNames().size()</code>. */
+
         /** the number of attributes. It is &lt;code&gt;size() == getAttributeNames().size()&lt;/code&gt;. */
 
         int size();
 
         int size();
 
     }
 
     }
Line 138: Line 146:
 
         Node getSelected();
 
         Node getSelected();
  
         List<Node> getSelecteds();
+
         List&lt;Node&gt; getSelecteds();
  
         /** returns List<Node> of Node objects sorted on Y
+
         /** returns List&lt;Node&gt; of Node objects sorted on Y
 
         *
 
         *
 
         * @param differentSubtrees if true
 
         * @param differentSubtrees if true
 
         *  children/grandchildren/grandgrandchildren/... nodes of selected
 
         *  children/grandchildren/grandgrandchildren/... nodes of selected
 
         *  parent nodes are excluded from the result. */
 
         *  parent nodes are excluded from the result. */
         List<Node> getSortedSelection(boolean differentSubtrees);
+
         List&lt;Node&gt; getSortedSelection(boolean differentSubtrees);
  
 
         void select(Node toSelect);
 
         void select(Node toSelect);
Line 152: Line 160:
 
         void selectBranch(Node branchRoot);
 
         void selectBranch(Node branchRoot);
  
         /** toSelect is a List<Node> of Node objects */
+
         /** toSelect is a List&lt;Node&gt; of Node objects */
         void selectMultipleNodes(List<Node> toSelect);
+
         void selectMultipleNodes(List&lt;Node&gt; toSelect);
  
 
         /** reset undo / redo lists and deactivate Undo for current script */
 
         /** reset undo / redo lists and deactivate Undo for current script */
Line 168: Line 176:
  
 
         /** Starting from the root node, recursively searches for nodes for which
 
         /** Starting from the root node, recursively searches for nodes for which
         * <code>condition.checkNode(node)</code> returns true.
+
         * &lt;code&gt;condition.checkNode(node)&lt;/code&gt; returns true.
 
         * @see Node.find(ICondition) for searches on subtrees */
 
         * @see Node.find(ICondition) for searches on subtrees */
         public List<Node> find(ICondition condition);
+
         public List&lt;Node&gt; find(ICondition condition);
  
 
         /**
 
         /**
         * Starting from the root node, recursively searches for nodes for which <code>closure.call(node)</code>
+
         * Starting from the root node, recursively searches for nodes for which &lt;code&gt;closure.call(node)&lt;/code&gt;
 
         * returns true.
 
         * returns true.
         * <p>
+
         * &lt;p&gt;
         * A find method that uses a Groovy closure ("block") for simple custom searches. As this closure
+
         * A find method that uses a Groovy closure (&quot;block&quot;) for simple custom searches. As this closure
         * will be called with a node as an argument (to be referenced by <code>it</code>) the search can
+
         * will be called with a node as an argument (to be referenced by &lt;code&gt;it&lt;/code&gt;) the search can
 
         * evaluate every node property, like attributes, icons, node text or notes.
 
         * evaluate every node property, like attributes, icons, node text or notes.
         * <p>
+
         * &lt;p&gt;
 
         * Examples:
 
         * Examples:
         * <pre>
+
         * &lt;pre&gt;
 
         *    def nodesWithNotes = c.find{ it.noteText != null }
 
         *    def nodesWithNotes = c.find{ it.noteText != null }
 
         *     
 
         *     
         *    def matchingNodes = c.find{ it.text.matches(".*\\d.*") }
+
         *    def matchingNodes = c.find{ it.text.matches(&quot;.*\\d.*&quot;) }
 
         *    def texts = matchingNodes.collect{ it.text }
 
         *    def texts = matchingNodes.collect{ it.text }
         *    print "node texts containing numbers:\n " + texts.join("\n ")
+
         *    print &quot;node texts containing numbers:\n &quot; + texts.join(&quot;\n &quot;)
         * </pre>
+
         * &lt;/pre&gt;
 
         * @param closure a Groovy closure that returns a boolean value. The closure will receive
 
         * @param closure a Groovy closure that returns a boolean value. The closure will receive
 
         *        a NodeModel as an argument which can be tested for a match.
 
         *        a NodeModel as an argument which can be tested for a match.
         * @return all nodes for which <code>closure.call(NodeModel)</code> returns true.
+
         * @return all nodes for which &lt;code&gt;closure.call(NodeModel)&lt;/code&gt; returns true.
 
         * @see Node.find(Closure) for searches on subtrees
 
         * @see Node.find(Closure) for searches on subtrees
 
         */
 
         */
         public List<Node> find(Closure closure);
+
         public List&lt;Node&gt; find(Closure closure);
 
     }
 
     }
  
Line 207: Line 215:
 
         void setType(EdgeStyle type);
 
         void setType(EdgeStyle type);
  
         /** can be -1 for default, 0 for thin, >0 */
+
         /** can be -1 for default, 0 for thin, &gt;0 */
 
         void setWidth(int width);
 
         void setWidth(int width);
 
     }
 
     }
Line 260: Line 268:
 
         void addIcon(String name);
 
         void addIcon(String name);
  
         /** returns List<Node> of Strings (corresponding to iconID above);
+
         /** returns List&lt;Node&gt; of Strings (corresponding to iconID above);
         * iconID is one of "Idea","Question","Important", etc. */
+
         * iconID is one of &quot;Idea&quot;,&quot;Question&quot;,&quot;Important&quot;, etc. */
         List<String> getIcons();
+
         List&lt;String&gt; getIcons();
  
 
         /** deletes first occurence of icon with name iconID, returns true if
 
         /** deletes first occurence of icon with name iconID, returns true if
Line 274: Line 282:
 
         /** target is a URI.
 
         /** target is a URI.
 
         * An empty String will remove the link.
 
         * An empty String will remove the link.
         * To get a local link (i.e. to another node) target should be: "#" + nodeID */
+
         * To get a local link (i.e. to another node) target should be: &quot;#&quot; + nodeID */
 
         boolean set(String target);
 
         boolean set(String target);
 
     }
 
     }
Line 291: Line 299:
 
         Connector addConnectorTo(Node target);
 
         Connector addConnectorTo(Node target);
  
         /** adds a new Connector object to List<Node> connectors and returns
+
         /** adds a new Connector object to List&lt;Node&gt; connectors and returns
 
         * reference for optional further editing (style); also enlists the
 
         * reference for optional further editing (style); also enlists the
 
         * Connector on the target Node object. */
 
         * Connector on the target Node object. */
Line 314: Line 322:
  
 
         /** returns the children of this node ordered by Y coordinate. */
 
         /** returns the children of this node ordered by Y coordinate. */
         List<Node> getChildren();
+
         List&lt;Node&gt; getChildren();
  
         Collection<Connector> getConnectorsIn();
+
         Collection&lt;Connector&gt; getConnectorsIn();
  
         Collection<Connector> getConnectorsOut();
+
         Collection&lt;Connector&gt; getConnectorsOut();
  
 
         ExternalObject getExternalObject();
 
         ExternalObject getExternalObject();
Line 358: Line 366:
 
         boolean isVisible();
 
         boolean isVisible();
  
         /** removes connector from List<Node> connectors; does the corresponding
+
         /** removes connector from List&lt;Node&gt; connectors; does the corresponding
 
         * on the target Node object referenced by connectorToBeRemoved */
 
         * on the target Node object referenced by connectorToBeRemoved */
 
         void moveTo(Node parentNode);
 
         void moveTo(Node parentNode);
Line 374: Line 382:
  
 
         /** Starting from this node, recursively searches for nodes for which
 
         /** Starting from this node, recursively searches for nodes for which
         * <code>condition.checkNode(node)</code> returns true. */
+
         * &lt;code&gt;condition.checkNode(node)&lt;/code&gt; returns true. */
         List<Node> find(ICondition condition);
+
         List&lt;Node&gt; find(ICondition condition);
  
         /** Starting from this node, recursively searches for nodes for which <code>closure.call(node)</code>
+
         /** Starting from this node, recursively searches for nodes for which &lt;code&gt;closure.call(node)&lt;/code&gt;
 
         * returns true. See {@link Controller#find(Closure)} for details. */
 
         * returns true. See {@link Controller#find(Closure)} for details. */
         List<Node> find(Closure closure);
+
         List&lt;Node&gt; find(Closure closure);
  
 
         Date getLastModifiedAt();
 
         Date getLastModifiedAt();
Line 406: Line 414:
 
     }
 
     }
 
}
 
}
</groovy>
+
&lt;/groovy&gt;
  
 
[[Category:Scripting]]
 
[[Category:Scripting]]

Revision as of 03:54, 24 November 2010


This page describes the current Freeplane's Scripting API. For the newest development version see Scripting API (Pre-Release). The Scripting API is in some sense extended by Freeplane's utility classes and by the Libraries included in Freeplane. There is a special page that lists Changes of the Scripting API.

Entry Points

Each script is given two variables:

<groovy> final Proxy.Node node; final Proxy.Controller c; </groovy>

Interface

<groovy> package org.freeplane.plugin.script.proxy;

import groovy.lang.Closure;

import java.awt.Color; import java.io.File; import java.util.Collection; import java.util.Date; import java.util.List;

import javax.swing.Icon;

import org.freeplane.core.filter.condition.ICondition; import org.freeplane.features.common.edge.EdgeStyle; import org.freeplane.features.common.link.ArrowType;

public interface Proxy {

   /** Attributes are name - value pairs assigned to a node. A node may have multiple attributes
    * with the same name. */
   interface Attributes {
       /** returns the <em>first</em> value of an attribute with the given name or null otherwise.
        * @deprecated use {@link #get(int)} or {@link #getAll(String)} instead. */
       @Deprecated
       String get(final String name);
       /** returns all values for the attribute name. */
       List<String> getAll(final String name);
       /** returns all attribute names in the proper sequence.
        * <pre>
        *   // rename attribute
        *   int i = 0;
        *   for (String name : attributes.getAttributeNames()) {
        *       if (name.equals("xy"))
        *           attributes.set(i, "xyz", attributes.get(i));
        *       ++i;
        *   }
        * </pre> */
       public List<String> getAttributeNames();
       /** returns the attribute value at the given index.
        * @throws IndexOutOfBoundsException if index is out of range <tt>(index
        *         &lt; 0 || index &gt;= size())</tt>.*/
       String get(final int index);
       /** sets the value of the attribute at an index. This method will not create new attributes.
        * @throws IndexOutOfBoundsException if index is out of range <tt>(index
        *         &lt; 0 || index &gt;= size())</tt>. */
       void set(final int index, final String value);
       /** sets name and value of the attribute at the given index. This method will not create new attributes.
        * @throws IndexOutOfBoundsException if index is out of range <tt>(index
        *         &lt; 0 || index &gt;= size())</tt>. */
       void set(final int index, final String name, final String value);
       /** returns the index of the first attribute with the given name if one exists or -1 otherwise.
                * For searches for <em>all</em> attributes with a given name <code>getAttributeNames()</code>
                * must be used. */
       public int findAttribute(final String name);
       /** removes the <em>first</em> attribute with this name.
        * @returns true on removal of an existing attribute and false otherwise.
        * @deprecated use {@link #remove(int)} or {@link #removeAll(String)} instead. */
       @Deprecated
       boolean remove(final String name);
       /** removes <em>all</em> attributes with this name.
        * @returns true on removal of an existing attribute and false otherwise. */
       boolean removeAll(final String name);
       /** removes the attribute at the given index.
        * @throws IndexOutOfBoundsException if index is out of range <tt>(index
        *         &lt; 0 || index &gt;= size())</tt>. */
       void remove(final int index);
       /** adds an attribute if there is no attribute with the given name or changes
        * the value <em>of the first</em> attribute with the given name. */
       void set(final String name, final String value);
       /** adds an attribute no matter if an attribute with the given name already exists. */
       void add(final String name, final String value);
       /** the number of attributes. It is <code>size() == getAttributeNames().size()</code>. */
       int size();
   }
   interface Connector {
       Color getColor();
       ArrowType getEndArrow();
       String getMiddleLabel();
       Node getSource();
       String getSourceLabel();
       ArrowType getStartArrow();
       Node getTarget();
       String getTargetLabel();
       void setColor(Color color);
       void setEndArrow(ArrowType arrowType);
       void setMiddleLabel(String label);
       void setSimulatesEdge(boolean simulatesEdge);
       void setSourceLabel(String label);
       void setStartArrow(ArrowType arrowType);
       void setTargetLabel(String label);
       boolean simulatesEdge();
   }
   interface Controller {
       void centerOnNode(Node center);
       /** if multiple nodes are selected returns one (arbitrarily chosen)
        * selected node or the selected node for a single node selection. */
       Node getSelected();
       List<Node> getSelecteds();
       /** returns List<Node> of Node objects sorted on Y
        *
        * @param differentSubtrees if true
        *   children/grandchildren/grandgrandchildren/... nodes of selected
        *   parent nodes are excluded from the result. */
       List<Node> getSortedSelection(boolean differentSubtrees);
       void select(Node toSelect);
       /** selects branchRoot and all children */
       void selectBranch(Node branchRoot);
       /** toSelect is a List<Node> of Node objects */
       void selectMultipleNodes(List<Node> toSelect);
       /** reset undo / redo lists and deactivate Undo for current script */
       void deactivateUndo();
       /** The main info for the status line, null to remove*/
       public void setStatusInfo(String info);
       /** Info for status line, null to remove*/
       public void setStatusInfo(String key, String info);
       /** Info for status line, null to remove*/
       public void setStatusInfo(String key, Icon icon);
       /** Starting from the root node, recursively searches for nodes for which
        * <code>condition.checkNode(node)</code> returns true.
        * @see Node.find(ICondition) for searches on subtrees */
       public List<Node> find(ICondition condition);
       /**
        * Starting from the root node, recursively searches for nodes for which <code>closure.call(node)</code>
        * returns true.
        * <p>
        * A find method that uses a Groovy closure ("block") for simple custom searches. As this closure
        * will be called with a node as an argument (to be referenced by <code>it</code>) the search can
        * evaluate every node property, like attributes, icons, node text or notes.
        * <p>
        * Examples:
        * <pre>
        *    def nodesWithNotes = c.find{ it.noteText != null }
        *    
        *    def matchingNodes = c.find{ it.text.matches(".*\\d.*") }
        *    def texts = matchingNodes.collect{ it.text }
        *    print "node texts containing numbers:\n " + texts.join("\n ")
        * </pre>
        * @param closure a Groovy closure that returns a boolean value. The closure will receive
        *        a NodeModel as an argument which can be tested for a match.
        * @return all nodes for which <code>closure.call(NodeModel)</code> returns true.
        * @see Node.find(Closure) for searches on subtrees
        */
       public List<Node> find(Closure closure);
   }
   interface Edge {
       Color getColor();
       EdgeStyle getType();
       int getWidth();
       void setColor(Color color);
       void setType(EdgeStyle type);
       /** can be -1 for default, 0 for thin, >0 */
       void setWidth(int width);
   }
   interface ExternalObject {
       /** empty string means that there's no external object */
       String getURI();
       float getZoom();
       /** setting empty String uri means remove external object (as for Links); */
       void setURI(String uri);
       void setZoom(float zoom);
   }
   interface Font {
       String getName();
       int getSize();
       boolean isBold();
       boolean isBoldSet();
       boolean isItalic();
       boolean isItalicSet();
       boolean isNameSet();
       boolean isSizeSet();
       void resetBold();
       void resetItalic();
       void resetName();
       void resetSize();
       void setBold(boolean bold);
       void setItalic(boolean italic);
       void setName(String name);
       void setSize(int size);
   }
   interface Icons {
       void addIcon(String name);
       /** returns List<Node> of Strings (corresponding to iconID above);
        * iconID is one of "Idea","Question","Important", etc. */
       List<String> getIcons();
       /** deletes first occurence of icon with name iconID, returns true if
        * success (icon existed); */
       boolean removeIcon(String iconID);
   }
   interface Link {
       String get();
       /** target is a URI.
        * An empty String will remove the link.
        * To get a local link (i.e. to another node) target should be: "#" + nodeID */
       boolean set(String target);
   }
   interface Map {
       Node getRootNode();
       /** returns the node if the map contains it or null otherwise. */
       Node node(String id);
       /** returns the physical location of the map if available or null otherwise. */
       File getFile();
   }
   interface Node {
       Connector addConnectorTo(Node target);
       /** adds a new Connector object to List<Node> connectors and returns
        * reference for optional further editing (style); also enlists the
        * Connector on the target Node object. */
       Connector addConnectorTo(String targetNodeID);
       /** inserts *new* node as child, takes care of all construction work and
        * internal stuff inserts as last child. */
       Node createChild();
       /** inserts *new* node as child, takes care of all construction work and
        * internal stuff */
       Node createChild(int position);
       void delete();
       Attributes getAttributes();
       /** returns the index (0..) of this node in the (by Y coordinate sorted)
        * list of this node's children. Returns -1 if childNode is not a child
        * of this node. */
       int getChildPosition(Node childNode);
       /** returns the children of this node ordered by Y coordinate. */
       List<Node> getChildren();
       Collection<Connector> getConnectorsIn();
       Collection<Connector> getConnectorsOut();
       ExternalObject getExternalObject();
       Icons getIcons();
       Link getLink();
       /** the map this node belongs to. */
       Map getMap();
       String getNodeID();
       /** if countHidden is false then only nodes that are matched by the
        * current filter are counted. */
       int getNodeLevel(boolean countHidden);
       String getNoteText();
       Node getParentNode();
       /** use this method to remove all tags from an HTML node. */
       String getPlainTextContent();
       NodeStyle getStyle();
       String getText();
       boolean isDescendantOf(Node p);
       boolean isFolded();
       boolean isLeaf();
       boolean isLeft();
       boolean isRoot();
       boolean isVisible();
       /** removes connector from List<Node> connectors; does the corresponding
        * on the target Node object referenced by connectorToBeRemoved */
       void moveTo(Node parentNode);
       void moveTo(Node parentNode, int position);
       /** as above, using String nodeID instead of Node object to establish the connector*/
       void removeConnector(Connector connectorToBeRemoved);
       void setFolded(boolean folded);
       void setNoteText(String text);
       void setText(String text);
       /** Starting from this node, recursively searches for nodes for which
        * <code>condition.checkNode(node)</code> returns true. */
       List<Node> find(ICondition condition);
       /** Starting from this node, recursively searches for nodes for which <code>closure.call(node)</code>
        * returns true. See {@link Controller#find(Closure)} for details. */
       List<Node> find(Closure closure);
       Date getLastModifiedAt();
       void setLastModifiedAt(Date date);
       Date getCreatedAt();
       void setCreatedAt(Date date);
   }
   interface NodeStyle {
       void applyPattern(String patternName);
       Color getBackgroundColor();
       Edge getEdge();
       Font getFont();
       Color getNodeTextColor();
       void setBackgroundColor(Color color);
       void setNodeTextColor(Color color);
   }

} </groovy>