Difference between revisions of "Scripting API"

From Freeplane - free mind mapping and knowledge management software
(Please use this page to specify the methods which should be available for objects "node" and "c")
(Please use this page to specify the methods which should be available for objects "node" and "c")
Line 1: Line 1:
 
[[User:Dimitry|Dimitry]] 07:54, 3 November 2009 (UTC)
 
[[User:Dimitry|Dimitry]] 07:54, 3 November 2009 (UTC)
==Please use this page to specify the methods which should be available for objects "node" and "c"==
+
== 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.  
 
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.  
Line 6: Line 6:
 
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.  
 
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.  
  
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.
+
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.  
 +
 
 +
Finally the list:
  
Finally the list:
 
 
  Is is complete? [[User:Dimitry|Dimitry]]
 
  Is is complete? [[User:Dimitry|Dimitry]]
  
===node===
+
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]]
 +
 
 +
=== node ===
 
<pre>int getAttributePosition(String)</pre>  
 
<pre>int getAttributePosition(String)</pre>  
what is it? [[User:Dimitry|Dimitry]]
+
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()
 
<pre>String getPlainTextContent()
 
int getChildCount()
 
int getChildCount()
Line 22: Line 33:
  
 
List children</pre>  
 
List children</pre>  
===c ===
+
=== c ===
 
<pre>void nodeStructureChanged(MindMapNode)
 
<pre>void nodeStructureChanged(MindMapNode)
 
List getSelecteds()
 
List getSelecteds()
 
MindMapNode getSelected()
 
MindMapNode getSelected()
 
void centerNode(MindMapNode)
 
void centerNode(MindMapNode)
</pre>
+
</pre>  
 
 
 
--[[User:Philshvarcz|Philshvarcz]] 21:33, 2 November 2009 (UTC)
 
--[[User:Philshvarcz|Philshvarcz]] 21:33, 2 November 2009 (UTC)

Revision as of 09:14, 3 November 2009

Dimitry 07:54, 3 November 2009 (UTC)

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 [1] in reply of a post of mine.

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.

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.

Finally the list:

Is is complete? 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. philshvarcz

node

int getAttributePosition(String)

what is it? 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. philshvarcz


String getPlainTextContent()
int getChildCount()
void setBackgroundColor(Color)
void setColor(Color)
void node.setFont(Font)
List getChildren()

List children

c

void nodeStructureChanged(MindMapNode)
List getSelecteds()
MindMapNode getSelected()
void centerNode(MindMapNode)

--Philshvarcz 21:33, 2 November 2009 (UTC)