Interface Proxy.Controller
-
- All Superinterfaces:
Controller
,ControllerRO
,HeadlessMapCreator
,Proxy.ControllerRO
- Enclosing interface:
- Proxy
public static interface Proxy.Controller extends Proxy.ControllerRO, Controller
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
export(Map map, File destinationFile, String exportTypeDescription, boolean overwriteExisting)
exports map to destination file, example:List<? extends Node>
find(boolean withAncestors, boolean withDescendants, NodeCondition condition)
Starting from this node, recursively searches for nodes for whichcondition.check(node)
returns true and adds their ancestor or descendant nodes if required.List<? extends Node>
find(NodeCondition condition)
Starting from the root node, recursively searches for nodes (in breadth-first sequence) for whichclosure.call(node)
returns true.List<? extends Node>
findAll()
Returns all nodes of the map in breadth-first order, that is, for the following map,List<? extends 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 inControllerRO.export(Map, 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.List<? extends Node>
getSelecteds()
A read-only list of selected nodes.List<? extends Node>
getSortedSelection(boolean differentSubtrees)
returnsList<? extends 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.Loader
mapLoader(File file)
ReturnsLoader
for accessing or loading mind map from file.Proxy.Loader
mapLoader(String file)
ReturnsLoader
for accessing or loading mind map from file.Proxy.Loader
mapLoader(URL file)
ReturnsLoader
for accessing or loading mind map from URL.-
Methods inherited from interface org.freeplane.api.Controller
centerOnNode, deactivateUndo, edit, editInPopup, getOpenMaps, load, load, load, newMap, newMap, newMapFromTemplate, redo, select, select, selectBranch, selectMultipleNodes, setStatusInfo, setStatusInfo, setStatusInfo, setStatusInfo, setZoom, undo
-
Methods inherited from interface org.freeplane.api.HeadlessMapCreator
script, script
-
Methods inherited from interface org.freeplane.plugin.script.proxy.Proxy.ControllerRO
find, find, find
-
-
-
-
Method Detail
-
getSelected
Node getSelected()
Description copied from interface:ControllerRO
if multiple nodes are selected returns one (arbitrarily chosen) selected node or the selected node for a single node selection.- Specified by:
getSelected
in interfaceControllerRO
-
getSelecteds
List<? extends Node> getSelecteds()
Description copied from interface:ControllerRO
A read-only list of selected nodes. That is you cannot select a node by adding it to the returned list.- Specified by:
getSelecteds
in interfaceControllerRO
-
getSortedSelection
List<? extends Node> getSortedSelection(boolean differentSubtrees)
Description copied from interface:ControllerRO
returnsList<? extends Node>
sorted by the node's vertical position.- Specified by:
getSortedSelection
in interfaceControllerRO
- Parameters:
differentSubtrees
- if true children/grandchildren/grandgrandchildren/... nodes of selected parent nodes are excluded from the result.
-
getFreeplaneVersion
FreeplaneVersion getFreeplaneVersion()
Description copied from interface:ControllerRO
returns Freeplane version. Use it like this:def required = FreeplaneVersion.getVersion("1.1.2"); if (c.freeplaneVersion < required) UITools.errorMessage("Freeplane version " + c.freeplaneVersion + " not supported - update to at least " + required);
- Specified by:
getFreeplaneVersion
in interfaceControllerRO
-
getUserDirectory
File getUserDirectory()
Description copied from interface:ControllerRO
returns the directory where user settings, logfiles, templates etc. are stored.- Specified by:
getUserDirectory
in interfaceControllerRO
-
find
List<? extends Node> find(NodeCondition condition)
Description copied from interface:ControllerRO
Starting from the root node, recursively searches for nodes (in breadth-first sequence) for whichclosure.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 ")
SeeNodeRO.find(NodeCondition)
for searches on subtrees.- Specified by:
find
in interfaceControllerRO
- Parameters:
condition
- a lambda that returns a boolean value. The closure will receive a NodeModel as an argument which can be tested for a match.- Returns:
- all nodes for which
closure.call(NodeModel)
returns true.
-
find
List<? extends Node> find(boolean withAncestors, boolean withDescendants, NodeCondition condition)
Description copied from interface:ControllerRO
Starting from this node, recursively searches for nodes for whichcondition.check(node)
returns true and adds their ancestor or descendant nodes if required.- Specified by:
find
in interfaceControllerRO
-
findAll
List<? extends Node> findAll()
Description copied from interface:ControllerRO
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. SeeNodeRO.find(NodeCondition)
for searches on subtrees.- Specified by:
findAll
in interfaceControllerRO
- See Also:
ControllerRO.findAllDepthFirst()
-
findAllDepthFirst
List<? extends Node> findAllDepthFirst()
Description copied from interface:ControllerRO
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. SeeNodeRO.findAllDepthFirst()
for subtrees.- Specified by:
findAllDepthFirst
in interfaceControllerRO
-
getZoom
float getZoom()
Description copied from interface:ControllerRO
returns the current zoom factor. A value of 1 means 100%.- Specified by:
getZoom
in interfaceControllerRO
-
isInteractive
boolean isInteractive()
Description copied from interface:ControllerRO
returns false if the system 'nonInteractive' is set. This can be used in actions to not open dialogs etc.- Specified by:
isInteractive
in interfaceControllerRO
-
getExportTypeDescriptions
List<String> getExportTypeDescriptions()
Description copied from interface:ControllerRO
returns a list of export type descriptions that can be used to specify a specific export type inControllerRO.export(Map, File, String, boolean)
. These descriptions are internationalized.- Specified by:
getExportTypeDescriptions
in interfaceControllerRO
-
export
void export(Map map, File destinationFile, String exportTypeDescription, boolean overwriteExisting)
Description copied from interface:ControllerRO
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)
- Specified by:
export
in interfaceControllerRO
exportTypeDescription
- UseControllerRO.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.
-
mapLoader
Proxy.Loader mapLoader(File file)
Description copied from interface:Controller
ReturnsLoader
for accessing or loading mind map from file.- Specified by:
mapLoader
in interfaceController
- Specified by:
mapLoader
in interfaceHeadlessMapCreator
-
mapLoader
Proxy.Loader mapLoader(URL file)
Description copied from interface:Controller
ReturnsLoader
for accessing or loading mind map from URL.- Specified by:
mapLoader
in interfaceController
- Specified by:
mapLoader
in interfaceHeadlessMapCreator
-
mapLoader
Proxy.Loader mapLoader(String file)
Description copied from interface:Controller
ReturnsLoader
for accessing or loading mind map from file.- Specified by:
mapLoader
in interfaceController
- Specified by:
mapLoader
in interfaceHeadlessMapCreator
-
-