Difference between revisions of "Scripting API"

From Freeplane - free mind mapping and knowledge management software
m (Please use this page to specify the methods which should be available for objects "node" and "c")
m (Text replacement - "freeplane.sourceforge.net" to "www.freeplane.org")
 
(18 intermediate revisions by 6 users not shown)
Line 1: Line 1:
[[User:Dimitry|Dimitry]] 07:54, 3 November 2009 (UTC)
+
For the [[Scripting]] API see its [http://www.freeplane.org/doc/api/ Javadoc documentation].
== Please use this page to specify the methods which should be available for objects "node" and "c"  ==
 
  
This page was started following a suggestion of Dimitry [http://sourceforge.net/projects/freeplane/forums/forum/758437/topic/3446671?message=7744225] in reply of a post of mine.  
+
The Scripting API is in some sense extended by [[Scripting: Freeplane Utility Classes|Freeplane's utility classes]] and by the [[Scripting: Included libraries|Libraries included in Freeplane]].
  
Its first goal is to specify Freeplane Script API which is not implemented yet. Afterwards it can serve as documentation for users with little knowledge of the internals of Freeplane so that they can port their scripts when changing from Freemind.  
+
==Changes to the scripting API==
 +
The [[Scripting_API|Scripting API]] will evolve over time but Freeplane's developers will do whatever possible to keep new API versions downward compatible. On the other hand there might be changes in parts of the Freeplane code that are not part of the official API but on which some scripts might depend nevertheless. This mostly applies to the [[Scripting:_Freeplane_Utility_Classes|utility classes]].
  
This is a list of methods (and a variable) of the objects "node" and "c" passed to the scripts by Freemind which I used so far. It is not complete, and in fact I'd like to have methods at hand to access (read/write) attributes and their values, as well as icons. There might be more useful things that one could wish to do in a script.  
+
Changes to the API are indicated per method by version numbers in the [http://www.freeplane.org/doc/api/org/freeplane/plugin/script/proxy/Proxy.html JavaDoc of the Proxy class].
  
Finally the list:
+
[[Category:Script]]
 
 
Is is complete? [[User:Dimitry|Dimitry]]
 
 
 
In the sense of
 
"does it cover all methods that are available in Freemind 0.9.0": No.
 
These are just the ones I am currently using.
 
 
 
Would you rather like to have a 'wishlist', or to implement a 100% Freemind compatible API in one step? My feeling is that -- for you, and once you wrote proxy classes partially implementing the Freemind API -- it would be very easy to add one after the other, depending on user requests. I don't know which way you prefer. [[User:philshvarcz|philshvarcz]]
 
 
 
Actually neither the first nor the second. I do not want to copy FreeMind API because FreeMind does not use proxy object which is likely to make troubles with undo after script is executed. I would like to implement a new property like API which contains enough methods for changing anything you need but is easy to use and clear, although there are a lot of parameters it can get/set. So may be having only "node" is not enough, maybe we need something like
 
 
 
node.style.font.setSize(14)
 
<nowiki>node.note.setHtmlText("<html><b>text")</nowiki>
 
node.attributes.getAttributePosition(String)
 
 
 
Therefore I ask you to be creative so that we have an extendable, clear and easy to use API for scripting. Once we see what we need I can implement it in a couple of days because it is not a new functionality but just a new interface. [[User:Dimitry|Dimitry]] 10:18, 3 November 2009 (UTC)
 
 
 
=== node  ===
 
<pre>int getAttributePosition(String)</pre>
 
what is it? [[User:Dimitry|Dimitry]]
 
 
 
this will return the position of the attribute with name xyz in the list of attributes of the node. If there's no attribute with that name, it returns -1. [[User:philshvarcz|philshvarcz]]
 
 
 
<br>
 
<pre>String getPlainTextContent()
 
int getChildCount()
 
void setBackgroundColor(Color)
 
void setColor(Color)
 
void node.setFont(Font)
 
List getChildren()
 
 
 
List children</pre>
 
=== c  ===
 
<pre>void nodeStructureChanged(MindMapNode)
 
List getSelecteds()
 
MindMapNode getSelected()
 
void centerNode(MindMapNode)
 
</pre>
 
--[[User:Philshvarcz|Philshvarcz]] 21:33, 2 November 2009 (UTC)
 

Latest revision as of 19:08, 18 November 2018

For the Scripting API see its Javadoc documentation.

The Scripting API is in some sense extended by Freeplane's utility classes and by the Libraries included in Freeplane.

Changes to the scripting API

The Scripting API will evolve over time but Freeplane's developers will do whatever possible to keep new API versions downward compatible. On the other hand there might be changes in parts of the Freeplane code that are not part of the official API but on which some scripts might depend nevertheless. This mostly applies to the utility classes.

Changes to the API are indicated per method by version numbers in the JavaDoc of the Proxy class.