public interface NodeRO
node
- read-only.Modifier and Type | Method and Description |
---|---|
java.util.List<? extends Node> |
allAt(java.lang.String path)
Returns a list of all nodes matching given path.
|
Node |
at(java.lang.String path)
Returns a single node located by path given as a string argument.
|
java.util.List<? extends Node> |
find(boolean withAncestors,
boolean withDescendants,
NodeCondition condition)
Starting from this node, recursively searches for nodes for which
condition.check(node)
returns true and adds their ancestor or descendant nodes if required. |
java.util.List<? extends Node> |
find(NodeCondition condition)
Starting from this node, recursively searches for nodes for which
closure.call(node)
returns true. |
java.util.List<? extends Node> |
findAll()
Returns all nodes of the branch that starts with this node in breadth-first order.
|
java.util.List<? extends Node> |
findAllDepthFirst()
Returns all nodes of the branch that starts with this node in depth-first order.
|
java.lang.String |
getAlias()
Alias of the node
|
Convertible |
getAt(java.lang.String attributeName)
allows to access attribute values like array elements.
|
Attributes |
getAttributes() |
byte[] |
getBinary()
Returns a BASE64 encoded node text
(see
Node.setBinary(byte[]) ) as a binary object. |
int |
getChildPosition(Node childNode)
returns the index (0..) of this node in the (by Y coordinate sorted)
list of this node's children.
|
java.util.List<? extends Node> |
getChildren()
returns the children of this node ordered by Y coordinate.
|
Cloud |
getCloud()
a reference to an accessor object for cloud properties of this node.
|
java.util.Collection<? extends Connector> |
getConnectorsIn() |
java.util.Collection<? extends Connector> |
getConnectorsOut() |
int |
getCountNodesSharingContent()
The count of node sharing their content with this node.
|
int |
getCountNodesSharingContentAndSubtree()
The count of nodes sharing their content and subtree with this node.
|
java.util.Date |
getCreatedAt() |
DependencyLookup |
getDependents() |
Convertible |
getDetails()
returns the text of the details as a Convertible like
getNote() for notes:
node.details.to.plain plain text of the node, possibly after formula evaluation
node.details.plain the same. |
java.lang.String |
getDetailsText()
returns the raw HTML text of the details if there is any or null otherwise.
|
java.lang.String |
getDisplayedText()
Plain or HTML text of this node after possible transformation (formula evaluation, formatting, ...)
|
ExternalObject |
getExternalObject() |
java.lang.String |
getFormat()
returns the format string of the formatter if available and null otherwise.
|
NodeGeometryRO |
getGeometry() |
boolean |
getHideDetails()
returns true if node details are hidden.
|
default int |
getHorizontalShift() |
Quantity<LengthUnit> |
getHorizontalShiftAsLength() |
default int |
getHorizontalShiftInScreenPixels() |
java.lang.String |
getHtmlText()
The node text as HTML markup.
|
Icons |
getIcons()
a reference to an accessor object for icons of this node.
|
java.lang.String |
getId() |
boolean |
getIsGlobal()
True if the node can be accessed using global accessor, see
at(String) |
java.util.Date |
getLastModifiedAt() |
Link |
getLink()
a reference to an accessor object for link properties of this node.
|
default Map |
getMap()
Deprecated.
since 1.7.10 - use
getMindMap() |
MindMap |
getMindMap()
The mind map this node belongs to.
|
default int |
getMinimalDistanceBetweenChildren() |
Quantity<LengthUnit> |
getMinimalDistanceBetweenChildrenAsLength() |
default int |
getMinimalDistanceBetweenChildrenInScreenPixels() |
Node |
getNext()
returns the next node with respect to this node in depth-first order.
|
java.lang.String |
getNodeID()
Deprecated.
since 1.2 - use Node.getId() instead.
|
int |
getNodeLevel(boolean countHidden)
if countHidden is false then only nodes that are matched by the
current filter are counted.
|
java.util.List<? extends Node> |
getNodesSharingContent()
The count of nodes sharing their content with this node.
|
java.util.List<? extends Node> |
getNodesSharingContentAndSubtree()
The nodes sharing their content and subtree with this node.
|
Convertible |
getNote()
returns the text of the details as a Convertible.
|
java.lang.String |
getNoteText()
Returns the HTML text of the node.
|
java.lang.Object |
getObject()
The object that's displayed as the node text - normally the raw text of this node (then this method is
equivalent to
getText() ). |
Node |
getParent() |
Node |
getParentNode()
Deprecated.
since 1.2 - use
getParent() instead. |
java.util.List<? extends Node> |
getPathToRoot()
a list of all nodes starting from this node upto (and including) the root node.
|
java.lang.String |
getPlainText()
Plain text after removal of possible HTML markup.
|
java.lang.String |
getPlainTextContent()
Deprecated.
since 1.2 - use getPlainText() or getTo().getPlain() instead.
|
DependencyLookup |
getPrecedents() |
Node |
getPrevious()
returns the previous node with respect to this node in depth-first order.
|
Reminder |
getReminder()
use it to create and inspect
Reminder s. |
java.lang.String |
getShortText()
Plain text of this node after possible transformation and forced text shortening.
|
NodeStyle |
getStyle()
The style attributes of a node can either be changed by assigning a named style like this:
node.style.name = 'style.ok'
or by changing attributes for this node individually like this:
node.style.textColorCode = '#FF0000'
Conditional styles of a node can only be investigated by
hasStyle(String) . |
java.lang.String |
getText()
Raw text of this node which might be plain or HTML text.
|
Convertible |
getTo()
returns an object that performs conversions (method name is choosen to give descriptive code):
node.to.num Long or Double, see
Convertible.getDate() . |
java.lang.String |
getTransformedText()
Plain or HTML text of this node after possible transformation (formula evaluation, formatting, ...).
|
Convertible |
getValue()
an alias for
getTo() . |
default int |
getVerticalShift() |
Quantity<LengthUnit> |
getVerticalShiftAsLength() |
default int |
getVerticalShiftInScreenPixels() |
boolean |
hasStyle(java.lang.String styleName)
returns true if the node has the style of this name - either manually set or as a conditional style or it is
"default" which all nodes have.
|
boolean |
isDescendantOf(Node p)
returns true if p is a parent, or grandparent, ... of this node, or if it is equal
to this node; returns false otherwise.
|
boolean |
isFolded()
if this node is folded.
|
boolean |
isFree()
returns true if this node is freely positionable.
|
boolean |
isLeaf() |
boolean |
isLeft() |
boolean |
isMinimized()
if this node's text is shortened for display.
|
boolean |
isRoot() |
boolean |
isVisible()
if this node is visible or not (due to filtering).
|
Node at(java.lang.String path)
If no node or more than one node is available at the specified position,
NodeNotFoundException
is thrown.
The path is a concatenation of path elements described below.
node.at(":'house'/'kitchen'/~chairs/~2") - take global node with text 'house', - in its subtree node find with text 'kitchen' - find its child node with alias 'chairs' - return the second child node of the chairs node.at(".. 'house'/**/~dog") -- return node with alias 'dog' within subtree of ancestor node with text 'house'Following path elements are defined:
'node text' or /"node text" : child node with text 'node text' 'node...' : child node containing text starting with 'node' * or '...' : any child node ~1 : child node at position 1 ( any number starting with 1 is allowed) ~nodeAlias : child node with alias 'nodeAlias', node alias can not be a number because numbers are reserved for the previous selector.
/**/
..
..'node text' or "node text" : the closest ancestor node with text 'node text' ..'node...' : the closest ancestor node containing text starting with 'node' ..~2 : second ancestor node also the parent node of the parent node (any positive number is allowed) ..~nodeAlias : the closest ancestor node with alias 'nodeAlias', node alias can not be a number
/
as the first path character means the path starts from the root node.
/'node text' or /"node text" : child node of the root with text 'node text' /'node...' : child node of the root containing text starting with 'node' /~nodeAlias : child node of the root with alias 'nodeAlias', node alias can not be a number
:'node text' or :"node text" : global node with text 'node text' :'node...' : global node containing text starting with 'node' :~nodeAlias : global node with alias 'nodeAlias', node alias can not be a number
java.util.List<? extends Node> allAt(java.lang.String path)
at
method.Attributes getAttributes()
Convertible getAt(java.lang.String attributeName)
Convertible
, not a String. Nevertheless it behaves like a String in almost all respects,
that is, in Groovy scripts it understands all String methods like lenght(), matches() etc.
// standard way node.attributes.set("attribute name", "12") // implicitely use getAt() def val = node["attribute name"] // use all conversions that Convertible provides (num, date, string, ...) assert val.num == new Long(12) // or use it just like a string assert val.startsWith("1") // check for availability of an attribute this way: if (node["unknown attribute"]) // surprise: the node has an attribute with key "unknown attribute"
org.freeplane.plugin.script.ExecuteScriptException
Cloud getCloud()
int getChildPosition(Node childNode)
java.util.List<? extends Node> getChildren()
java.util.Collection<? extends Connector> getConnectorsIn()
java.util.Collection<? extends Connector> getConnectorsOut()
java.lang.String getDetailsText()
Convertible getDetails()
getNote()
for notes:
boolean getHideDetails()
ExternalObject getExternalObject()
Icons getIcons()
Link getLink()
Reminder getReminder()
Reminder
s. This property is never null.MindMap getMindMap()
@Deprecated default Map getMap()
getMindMap()
@Deprecated java.lang.String getNodeID()
java.lang.String getId()
int getNodeLevel(boolean countHidden)
Convertible getNote()
getNoteText()
to get the HTML text.org.freeplane.plugin.script.ExecuteScriptException
java.lang.String getNoteText()
org.freeplane.plugin.script.ExecuteScriptException
Node getParent()
@Deprecated Node getParentNode()
getParent()
instead.java.lang.String getAlias()
boolean getIsGlobal()
at(String)
java.util.List<? extends Node> getPathToRoot()
def path = pathToRoot.collect{ it.plainText }.join('.')
Node getNext()
Node getPrevious()
NodeStyle getStyle()
node.style.name = 'style.ok'or by changing attributes for this node individually like this:
node.style.textColorCode = '#FF0000'Conditional styles of a node can only be investigated by
hasStyle(String)
. Here a script that
creates an index of all nodes having the style 'todo':
def todos = node.map.root.createChild('To Do') c.find{ it.hasStyle('todo') }.each { def child = todos.createChild(it.text) child.link.node = it }
boolean hasStyle(java.lang.String styleName)
java.lang.String getText()
See
getPlainText()
for plain text or use HtmlUtils.htmlToPlain(String)
.
getHtmlText()
for HTML text or use HtmlUtils.plainToHTML(String)
.
getTransformedText()
or getValue()
for text after formula evaluation.
getObject()
for possible typed content.
getTo()
for text/object conversions.
java.lang.String getPlainText()
@Deprecated java.lang.String getPlainTextContent()
java.lang.String getHtmlText()
getText()
if the node text
already is HTML or converts the plain text to HTML otherwise.java.lang.String getTransformedText()
java.lang.String getDisplayedText()
isMinimized()
for node shortening.java.lang.String getShortText()
java.lang.Object getObject()
getText()
).
But in case of typed content (for numbers, dates and calendars) getObject()
returns
a proper IFormattedObject
. Use getPlainText()
to remove HTML.
See Node.setObject(Object)
for details.java.lang.String getFormat()
Convertible getTo()
Convertible.getDate()
.
Convertible.getDate()
.
Convertible.getString()
.
Convertible.getText()
.
Convertible.getObject()
.
org.freeplane.plugin.script.ExecuteScriptException
- on formula evaluation errorsConvertible getValue()
getTo()
.org.freeplane.plugin.script.ExecuteScriptException
- on formula evaluation errorsbyte[] getBinary()
Node.setBinary(byte[])
) as a binary object. Errors are signaled by a null return value.
Whitespace characters are ignored.boolean isDescendantOf(Node p)
boolean isFolded()
boolean isFree()
boolean isLeaf()
boolean isLeft()
boolean isRoot()
boolean isVisible()
isFolded()
for folding state.boolean isMinimized()
int getCountNodesSharingContent()
if (node.countNodesSharingContent() > 0)
to check if a node has any clones.
getCountNodesSharingContent()
≥ getCountNodesSharingContentAndSubtree()
.getNodesSharingContent()
,
Node#appendAsCloneWithSubtree(Proxy.NodeRO)
,
Node#appendAsCloneWithoutSubtree(Proxy.NodeRO)
int getCountNodesSharingContentAndSubtree()
getCountNodesSharingContent()
≥ getCountNodesSharingContentAndSubtree()
.getNodesSharingContentAndSubtree()
,
Node#appendAsCloneWithSubtree(Proxy.NodeRO)
,
Node#appendAsCloneWithoutSubtree(Proxy.NodeRO)
java.util.List<? extends Node> getNodesSharingContent()
getCountNodesSharingContent()
≥ getCountNodesSharingContentAndSubtree()
.getCountNodesSharingContent()
,
Node#appendAsCloneWithSubtree(Proxy.NodeRO)
,
Node#appendAsCloneWithoutSubtree(Proxy.NodeRO)
java.util.List<? extends Node> getNodesSharingContentAndSubtree()
getCountNodesSharingContentAndSubtree()
,
Node#appendAsCloneWithSubtree(Proxy.NodeRO)
,
Node#appendAsCloneWithoutSubtree(Proxy.NodeRO)
java.util.List<? extends Node> find(NodeCondition condition)
closure.call(node)
returns true. See ControllerRO.find(NodeCondition)
for details.java.util.List<? extends Node> find(boolean withAncestors, boolean withDescendants, NodeCondition condition)
condition.check(node)
returns true and adds their ancestor or descendant nodes if required.ControllerRO.find(NodeCondition)
for details.java.util.List<? extends Node> findAll()
ControllerRO.findAll()
for map-global searches.java.util.List<? extends Node> findAllDepthFirst()
ControllerRO.findAllDepthFirst()
for map-global searches.java.util.Date getLastModifiedAt()
java.util.Date getCreatedAt()
default int getHorizontalShift()
default int getVerticalShift()
default int getMinimalDistanceBetweenChildren()
default int getHorizontalShiftInScreenPixels()
default int getVerticalShiftInScreenPixels()
default int getMinimalDistanceBetweenChildrenInScreenPixels()
Quantity<LengthUnit> getVerticalShiftAsLength()
Quantity<LengthUnit> getMinimalDistanceBetweenChildrenAsLength()
Quantity<LengthUnit> getHorizontalShiftAsLength()
NodeGeometryRO getGeometry()
DependencyLookup getPrecedents()
DependencyLookup getDependents()