Proxy.Controller
public static interface Proxy.ControllerRO
c
- read-only.Modifier and Type | Method | Description |
---|---|---|
void |
export(Proxy.Map map,
File destinationFile,
String exportTypeDescription,
boolean overwriteExisting) |
exports map to destination file, example:
|
List<Proxy.Node> |
find(groovy.lang.Closure<Boolean> closure) |
Starting from the root node, recursively searches for nodes (in breadth-first sequence) for which
closure.call(node) returns true. |
List<Proxy.Node> |
find(org.freeplane.features.filter.condition.ICondition condition) |
Deprecated.
since 1.2 use
find(Closure) instead. |
List<Proxy.Node> |
findAll() |
Returns all nodes of the map in breadth-first order, that is, for the following map,
|
List<Proxy.Node> |
findAllDepthFirst() |
Returns all nodes of the map in depth-first order, that is, for the following map,
|
List<String> |
getExportTypeDescriptions() |
returns a list of export type descriptions that can be used to specify a specific export type
in
export(Map, File, String, boolean) . |
FreeplaneVersion |
getFreeplaneVersion() |
returns Freeplane version.
|
Proxy.Node |
getSelected() |
if multiple nodes are selected returns one (arbitrarily chosen)
selected node or the selected node for a single node selection.
|
List<Proxy.Node> |
getSelecteds() |
A read-only list of selected nodes.
|
List<Proxy.Node> |
getSortedSelection(boolean differentSubtrees) |
returns
List<Node> sorted by the node's vertical position. |
File |
getUserDirectory() |
returns the directory where user settings, logfiles, templates etc.
|
float |
getZoom() |
returns the current zoom factor.
|
boolean |
isInteractive() |
returns false if the system 'nonInteractive' is set.
|
Proxy.Node getSelected()
List<Proxy.Node> getSelecteds()
List<Proxy.Node> getSortedSelection(boolean differentSubtrees)
List<Node>
sorted by the node's vertical position.differentSubtrees
- if true
children/grandchildren/grandgrandchildren/... nodes of selected
parent nodes are excluded from the result.FreeplaneVersion getFreeplaneVersion()
import org.freeplane.core.util.FreeplaneVersion
import org.freeplane.core.ui.components.UITools
def required = FreeplaneVersion.getVersion("1.1.2");
if (c.freeplaneVersion < required)
UITools.errorMessage("Freeplane version " + c.freeplaneVersion
+ " not supported - update to at least " + required);
File getUserDirectory()
List<Proxy.Node> find(org.freeplane.features.filter.condition.ICondition condition)
find(Closure)
instead.condition.checkNode(node)
returns true.List<Proxy.Node> find(groovy.lang.Closure<Boolean> closure)
closure.call(node)
returns true.
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 it
) the search can
evaluate every node property, like attributes, icons, node text or notes.
Examples:
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 ")See
Proxy.NodeRO.find(Closure)
for searches on subtrees.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.closure.call(NodeModel)
returns true.List<Proxy.Node> findAll()
1 1.1 1.1.1 1.1.2 1.2 2[1, 1.1, 1.1.1, 1.1.2, 1.2, 2] is returned. See
Proxy.NodeRO.find(Closure)
for searches on subtrees.findAllDepthFirst()
List<Proxy.Node> findAllDepthFirst()
1 1.1 1.1.1 1.1.2 1.2 2[1.1.1, 1.1.2, 1.1, 1.2, 1, 2] is returned. See
Proxy.NodeRO.findAllDepthFirst()
for subtrees.float getZoom()
boolean isInteractive()
List<String> getExportTypeDescriptions()
export(Map, File, String, boolean)
. These descriptions are internationalized.void export(Proxy.Map map, File destinationFile, String exportTypeDescription, boolean overwriteExisting)
println c.exportTypeDescriptions.join('\n') boolean overwriteExistingFile = true c.export(node.map, new File('/tmp/t.png'), 'Portable Network Graphic (PNG) (.png)', overwriteExistingFile)
exportTypeDescription
- Use getExportTypeDescriptions()
to look up available exportTypes.
Note that the file format does not suffice to specify a specific export since there may be more than
one, as for HTML.