Interface Controller

All Superinterfaces:
ControllerRO, HeadlessMapCreator
All Known Subinterfaces:
Proxy.Controller

public interface Controller extends ControllerRO, HeadlessMapCreator
Access to global state: in scripts, this is available as global variable c - read-write.
  • Method Details

    • centerOnNode

      void centerOnNode(Node center)
    • edit

      void edit(Node node)
      Starts editing node, normally in the inline editor. Does not block until edit has finished.
      Since:
      1.2.2
    • editInPopup

      void editInPopup(Node node)
      opens the appropriate popup text editor. Does not block until edit has finished.
      Since:
      1.2.2
    • select

      void select(Node toSelect)
    • select

      void select(Collection<? extends Node> toSelect)
      selects multiple Nodes.
      Since:
      1.4
    • selectBranch

      void selectBranch(Node branchRoot)
      selects branchRoot and all children
    • selectMultipleNodes

      void selectMultipleNodes(Collection<? extends Node> toSelect)
    • deactivateUndo

      void deactivateUndo()
      reset undo / redo lists and deactivate Undo for current script
    • undo

      void undo()
      invokes undo once - for testing purposes mainly.
      Since:
      1.2
    • redo

      void redo()
      invokes redo once - for testing purposes mainly.
      Since:
      1.2
    • setStatusInfo

      void setStatusInfo(String info)
      The main info for the status line with key="standard", use null to remove. Removes icon if there is one.
    • setStatusInfo

      void setStatusInfo(String infoPanelKey, String info)
      Info for status line, null to remove. Removes icon if there is one.
      See Also:
    • setStatusInfo

      void setStatusInfo(String infoPanelKey, String info, String iconKey)
      Info for status line - text and icon - null stands for "remove" (text or icon)
      Parameters:
      infoPanelKey - "standard" is the left most standard info panel. If a panel with this name doesn't exist it will be created.
      info - Info text
      iconKey - key as those that are used for nodes (see Icons.addIcon(String)).
         println("all available icon keys: " + FreeplaneIconUtils.listStandardIconKeys())
         c.setStatusInfo("standard", "hi there!", "button_ok");
       
      Since:
      1.2
      See Also:
      • FreeplaneIconFactory
    • setStatusInfo

      @Deprecated void setStatusInfo(String infoPanelKey, Icon icon)
      Deprecated.
    • load

      @Deprecated Loader load(File file)
      Deprecated.
      since 1.7.5 - use mapLoader(File)
      Specified by:
      load in interface HeadlessMapCreator
    • load

      @Deprecated Loader load(URL url)
      Deprecated.
      since 1.7.5 - use mapLoader(URL)
      Specified by:
      load in interface HeadlessMapCreator
    • load

      @Deprecated Loader load(String input)
      Deprecated.
      since 1.7.5 - use mapLoader(String)
      Specified by:
      load in interface HeadlessMapCreator
    • mapLoader

      Loader mapLoader(File file)
      Returns Loader for accessing or loading mind map from file.
      Specified by:
      mapLoader in interface HeadlessMapCreator
      Since:
      1.7.5
    • mapLoader

      Loader mapLoader(URL file)
      Returns Loader for accessing or loading mind map from URL.
      Specified by:
      mapLoader in interface HeadlessMapCreator
      Since:
      1.7.5
    • mapLoader

      Loader mapLoader(String file)
      Returns Loader for accessing or loading mind map from file.
      Specified by:
      mapLoader in interface HeadlessMapCreator
      Since:
      1.7.5
    • newMap

      default Map newMap()
      Deprecated.
      since 1.7.10 - use newMindMap()
      opens a new map with a default name in the foreground.
      Since:
      1.2
    • newMap

      @Deprecated default Map newMap(URL url)
      Deprecated.
      since 1.6.16 - use mapLoader(URL)
      Since:
      1.2
    • newMapFromTemplate

      default Map newMapFromTemplate(File templateFile)
      Since:
      1.5
    • newMindMap

      MindMap newMindMap()
      opens a new map with a default name in the foreground.
      Since:
      1.7.10
    • setZoom

      void setZoom(float ratio)
      a value of 1 means 100%.
      Since:
      1.2
    • getOpenMaps

      @Deprecated default List<? extends Map> getOpenMaps()
      Deprecated.
      since 1.7.10 - use getOpenMindMaps()
      a list of all opened maps.
      Since:
      1.5
    • getOpenMindMaps

      List<? extends MindMap> getOpenMindMaps()
      a list of all opened maps.
      Since:
      1.5
    • getMainThreadExecutorService

      ExecutorService getMainThreadExecutorService()
      Since:
      1.7.10
    • moveNodes

      void moveNodes(List<Node> nodes, Node parent, int position)
      Parameters:
      nodes - the nodes to move
      parent - the new parent node
      position - the new position within the parent
      Since:
      1.13.3 Moves a group of nodes together.
      Useful, e.g., when moving a summary-node group (FirstGroupNode .. SummaryNode).
    • askAi

      AiRequestHandle askAi(String prompt, AiRequestOptions options, AiRequestCallback callback)
      Starts an asynchronous AI request for raw prompt text and delivers the terminal result through the callback.

      The supplied options must include a positive timeout and a non-null AiRequestMode. See AiRequestOptions.Builder.systemMessage(String) and AiRequestOptions.Builder.exactSystemMessage(String) for the difference between a base system-message override and an exact system instruction.

      May throw AiRequestRejectedException for same-thread pre-acceptance rejection. In Groovy scripts, implementations may also support the natural trailing-closure form, for example c.askAi("Prompt", AiRequestOptions.builder().timeout(Duration.ofSeconds(30)).mode(org.freeplane.api.ai.AiRequestMode.HIDDEN).build()) { result -> println(result.status) }.

      Since:
      1.13.3
    • runAiPrompt

      AiRequestHandle runAiPrompt(String promptName, Duration timeout, AiRequestCallback callback)
      Starts an asynchronous AI request from a saved AI prompt name using the supplied timeout and the saved prompt's stored execution defaults.
      Since:
      1.13.3
    • runAiPrompt

      AiRequestHandle runAiPrompt(String promptName, AiRequestOptions options, AiRequestCallback callback)
      Starts an asynchronous AI request from a saved AI prompt name using the supplied options to override saved-prompt execution defaults.

      Unset option fields inherit from the saved prompt where applicable. Explicit values in AiRequestOptions override saved-prompt values; unset fields inside AiModelConfiguration inherit independently.

      Since:
      1.13.3