public static interface Proxy.Controller extends Proxy.ControllerRO, Controller
Modifier and Type | Method and Description |
---|---|
void |
export(MindMap map,
java.io.File destinationFile,
java.lang.String exportTypeDescription,
boolean overwriteExisting)
exports map to destination file, example:
println c.exportTypeDescriptions.join('\n')
boolean overwriteExistingFile = true
c.export(node.map, new File('/tmp/t.png'), 'Portable Network Graphic (PNG) (.png)', overwriteExistingFile)
c.export(node.map, new File('/tmp/t.png'), 'PNG', overwriteExistingFile)
c.export(node.map, new File('/tmp/t.png'), '', overwriteExistingFile)
|
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 the root node, recursively searches for nodes (in breadth-first sequence) for which
closure.call(node) returns true. |
java.util.List<? extends Node> |
findAll()
Returns all nodes of the map in breadth-first order, that is, for the following map,
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.
|
java.util.List<? extends Node> |
findAllDepthFirst()
Returns all nodes of the map in depth-first order, that is, for the following map,
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.
|
java.util.List<java.lang.String> |
getExportTypeDescriptions()
returns a list of export type descriptions that can be used to specify a specific export type
in
ControllerRO.export(MindMap, File, String, boolean) . |
FreeplaneVersion |
getFreeplaneVersion()
returns Freeplane version.
|
Node |
getSelected()
if multiple nodes are selected returns one (arbitrarily chosen)
selected node or the selected node for a single node selection.
|
java.util.List<? extends Node> |
getSelecteds()
A read-only list of selected nodes.
|
java.util.List<? extends Node> |
getSortedSelection(boolean differentSubtrees)
returns {@code List
|
java.io.File |
getUserDirectory()
returns the directory where user settings, logfiles, templates etc. are stored.
|
float |
getZoom()
returns the current zoom factor.
|
boolean |
isInteractive()
returns false if the system 'nonInteractive' is set.
|
Proxy.Loader |
mapLoader(java.io.File file)
Returns
Loader for accessing or loading mind map from file. |
Proxy.Loader |
mapLoader(java.lang.String file)
Returns
Loader for accessing or loading mind map from file. |
Proxy.Loader |
mapLoader(java.net.URL file)
Returns
Loader for accessing or loading mind map from URL. |
find, find, find
centerOnNode, deactivateUndo, edit, editInPopup, getMainThreadExecutorService, getOpenMaps, getOpenMindMaps, load, load, load, newMap, newMap, newMapFromTemplate, newMindMap, redo, select, select, selectBranch, selectMultipleNodes, setStatusInfo, setStatusInfo, setStatusInfo, setStatusInfo, setZoom, undo
getAttributeValueSerializer, mapLoader, script, script
Node getSelected()
ControllerRO
getSelected
in interface ControllerRO
java.util.List<? extends Node> getSelecteds()
ControllerRO
getSelecteds
in interface ControllerRO
java.util.List<? extends Node> getSortedSelection(boolean differentSubtrees)
ControllerRO
List<? extends Node>
sorted by the node's vertical position.getSortedSelection
in interface ControllerRO
differentSubtrees
- if true
children/grandchildren/grandgrandchildren/... nodes of selected
parent nodes are excluded from the result.FreeplaneVersion getFreeplaneVersion()
ControllerRO
def required = FreeplaneVersion.getVersion("1.1.2");
if (c.freeplaneVersion < required)
UITools.errorMessage("Freeplane version " + c.freeplaneVersion
+ " not supported - update to at least " + required);
getFreeplaneVersion
in interface ControllerRO
java.io.File getUserDirectory()
ControllerRO
getUserDirectory
in interface ControllerRO
java.util.List<? extends Node> find(NodeCondition condition)
ControllerRO
closure.call(node)
returns true.
A find method that uses a lambda ("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
NodeRO.find(NodeCondition)
for searches on subtrees.find
in interface ControllerRO
condition
- a lambda 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.java.util.List<? extends Node> find(boolean withAncestors, boolean withDescendants, NodeCondition condition)
ControllerRO
condition.check(node)
returns true and adds their ancestor or descendant nodes if required.find
in interface ControllerRO
java.util.List<? extends Node> findAll()
ControllerRO
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
NodeRO.find(NodeCondition)
for searches on subtrees.findAll
in interface ControllerRO
ControllerRO.findAllDepthFirst()
java.util.List<? extends Node> findAllDepthFirst()
ControllerRO
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
NodeRO.findAllDepthFirst()
for subtrees.findAllDepthFirst
in interface ControllerRO
float getZoom()
ControllerRO
getZoom
in interface ControllerRO
boolean isInteractive()
ControllerRO
isInteractive
in interface ControllerRO
java.util.List<java.lang.String> getExportTypeDescriptions()
ControllerRO
ControllerRO.export(MindMap, File, String, boolean)
. These descriptions are internationalized.getExportTypeDescriptions
in interface ControllerRO
void export(MindMap map, java.io.File destinationFile, java.lang.String exportTypeDescription, boolean overwriteExisting)
ControllerRO
println c.exportTypeDescriptions.join('\n') boolean overwriteExistingFile = true c.export(node.map, new File('/tmp/t.png'), 'Portable Network Graphic (PNG) (.png)', overwriteExistingFile) c.export(node.map, new File('/tmp/t.png'), 'PNG', overwriteExistingFile) c.export(node.map, new File('/tmp/t.png'), '', overwriteExistingFile)
export
in interface ControllerRO
exportTypeDescription
- Use ControllerRO.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.
You can use a substring or an empty string instead of full description, if exported destination file extension
matches filter desription.Proxy.Loader mapLoader(java.io.File file)
Controller
Loader
for accessing or loading mind map from file.mapLoader
in interface Controller
mapLoader
in interface HeadlessMapCreator
Proxy.Loader mapLoader(java.net.URL file)
Controller
Loader
for accessing or loading mind map from URL.mapLoader
in interface Controller
mapLoader
in interface HeadlessMapCreator
Proxy.Loader mapLoader(java.lang.String file)
Controller
Loader
for accessing or loading mind map from file.mapLoader
in interface Controller
mapLoader
in interface HeadlessMapCreator