First of all: thanks to the developers for doing all this work, and also for
the work previously put into Freemind, of which I became a heavy user, and on
which I currently depend.
I'd love to switch to Freeplane, but there's one hindrance: I need scripting
for doing my work, but I am not able to port my scripts without assistance.
Bad combination. I'd need to get text from nodes, have access to child nodes,
change fonts, change colors, check for presence and value of attributes,
programmatically center the viewport on some node, all that.
It would be absolutely terrific if someone with more ability could spend the
time to make a port of a helpful script that can be found on the Freemind
pages:
I dare asking for this because I am sure having some rudimentary scripting API
documentation would help many users.
Thanks for your interest. Due to the extensive refactoring, the API has been
in flux. The changes to the code should have settled down now we're in beta.
Hopefully we can put some documentation together soon, and I will get back to
you.
Regards,
Ryan
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Looking forward to that!
IMHO a transparent and (more or less) invariant scripting interface, and
ideally a simple way to register a script as a custom menu item would probably
be beneficial to the project. A larger crowd of users with less profound
programming skills (including me) would be enabled to contribute without the
need to understand the whole architecture of the software.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
for making the doc you requested I need some assistance from you because we
have quite different backgrounds. I almost never use scripting facilities.
I looked at the script you reference, I run it in FreeMind and I still do not understand its purpose. Couldn't you explain it to me?
Register your account at http://freeplane.sourceforge.net/wiki/index.php/Main_Page, create a new page for script doc and ask your questions, ideally in a structured form. Explain what you need and let me give you examples how to achieve it in Freeplane.
I think that there could be extra API for scripting making sure that is is compatible with undo. For this purpose we need a proxy object with the most frequently used node/map operations. I think it is not a new feature but just a new API and I could integrate it in the current release. But I need better understanding of what the scripts are good for to create such solution.
Dimitry
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'll do as you say and open that script doc page.
Here I quickly respond to your question concerning the "cheezy object
reference" script from the Freemind page. As I experienced it, it will
just take one of the preset objects "c" or "node"
(whichever line you uncomment at the bottom of the script) and create new
nodes as children of the node containing the script. These contain return
type, method name and parameter list of the methods of "c" or
"node".
I found this quite convenient, because the method names are mostly self
explanatory.
When I see a node like
public void setColor(Color)
void
class java.awt.Color
Comments
for the "node" object and
public MindMapNode getSelected()
freemind.modes.MindMapNode none
Comments
for the "c" object, then I can guess I should call
c.getSelected().setColor(Color.WHITE) to turn the currently selected node
white. In this sense I found the "cheezy" script quite useful...
Regards
Phil
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I finally found the time to think and just added an API draft to the Talk page
opened by John, which should be closer to the style imagined by Dimitry. It
hopefully can serve as a basis for discussion.
Regards
Phil
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am already working on implementing the specified API .
I have one problem There are some cases where some style property like font size is not set on the object itself but comes from the map's default. And it applies to the most style properties including properties of the edges, clouds, nodes, connectors and so on. It means that in addition to getProperty() and setProperty(property) there is a need of boolean isPropertySet() and void resetProperty(). So I have to implement four methods per property, not only the two, right?
Dimitry
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
to be honest, I see no much better solution. One alternative would be to have
a dummy property object "mapDefault" of some class "DefaultProperty" extending
Object, and to overload each setProperty(property) with
setProperty(DefaultProperty mapDefault) to do the same as resetProperty()
would do. This would save all the specialized resetProperty() methods. Is that
more elegant ? I don't know. It's up to you.
Phil
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi there,
First of all: thanks to the developers for doing all this work, and also for
the work previously put into Freemind, of which I became a heavy user, and on
which I currently depend.
I'd love to switch to Freeplane, but there's one hindrance: I need scripting
for doing my work, but I am not able to port my scripts without assistance.
Bad combination. I'd need to get text from nodes, have access to child nodes,
change fonts, change colors, check for presence and value of attributes,
programmatically center the viewport on some node, all that.
It would be absolutely terrific if someone with more ability could spend the
time to make a port of a helpful script that can be found on the Freemind
pages:
I dare asking for this because I am sure having some rudimentary scripting API
documentation would help many users.
Thanks for reading
Phil
: http://freemind.sourceforge.net/wiki/index.php/Example_scripts#Daves_massiv
ly_cheezy_Api_Generator
Hi Phil,
Thanks for your interest. Due to the extensive refactoring, the API has been
in flux. The changes to the code should have settled down now we're in beta.
Hopefully we can put some documentation together soon, and I will get back to
you.
Regards,
Ryan
Thanks, Ryan!
Looking forward to that!
IMHO a transparent and (more or less) invariant scripting interface, and
ideally a simple way to register a script as a custom menu item would probably
be beneficial to the project. A larger crowd of users with less profound
programming skills (including me) would be enabled to contribute without the
need to understand the whole architecture of the software.
Hi Phil,
for making the doc you requested I need some assistance from you because we
have quite different backgrounds. I almost never use scripting facilities.
Dimitry
Hi Dimitry,
I'll do as you say and open that script doc page.
Here I quickly respond to your question concerning the "cheezy object
reference" script from the Freemind page. As I experienced it, it will
just take one of the preset objects "c" or "node"
(whichever line you uncomment at the bottom of the script) and create new
nodes as children of the node containing the script. These contain return
type, method name and parameter list of the methods of "c" or
"node".
I found this quite convenient, because the method names are mostly self
explanatory.
When I see a node like
public void setColor(Color)
void
class java.awt.Color
Comments
for the "node" object and
public MindMapNode getSelected()
freemind.modes.MindMapNode
none
Comments
for the "c" object, then I can guess I should call
c.getSelected().setColor(Color.WHITE) to turn the currently selected node
white. In this sense I found the "cheezy" script quite useful...
Regards
Phil
Scripting API is still to be developed. It depends only on the community when
it happens. Look at http://freeplane.sourceforge.net/mediawiki-1.14.1/index.p
hp/Scripting_documentation and make your suggestions. Once we have the
specification it shall be implemented.
Dimitry
I believe this discussion needs more structure. See my suggestions on the
Scripting documentation Talk page http://freeplane.sourceforge.net/mediawiki-
1.14.1/index.php/Talk:Scripting_documentation
Your corrections and expansions of my suggestion will be appreciated.
John, your API is looks like C API, not like a object oriented one.
I do not like to think about node IDs, I prefer to deal with node objects.
Also something like
node.atributes.count()
ornode.attibutes.get(1).value = "text"
I take MS Visual Basic for Applications (MS Office) as an example.
Dimitry
Hello again,
I finally found the time to think and just added an API draft to the Talk page
opened by John, which should be closer to the style imagined by Dimitry. It
hopefully can serve as a basis for discussion.
Regards
Phil
I commented in Wiki. Dimitry
Read your comment and slightly extended the "API" draft. Guess it's time to
close this thread here and ultimately migrate it to the Wiki page
Regards, Phil
: http://freeplane.sourceforge.net/mediawiki-1.14.1/index.php/Talk:Scripting_
documentation
Hello,
Dimitry
Hello,
to be honest, I see no much better solution. One alternative would be to have
a dummy property object "mapDefault" of some class "DefaultProperty" extending
Object, and to overload each setProperty(property) with
setProperty(DefaultProperty mapDefault) to do the same as resetProperty()
would do. This would save all the specialized resetProperty() methods. Is that
more elegant ? I don't know. It's up to you.
Phil
I have implemented API and put the details in Wiki.
The new code is submitted to bazaar.
It is not tested yet.
Dimitry
Just a final note for those who find this rather old discussion while looking
for Freeplane/scripting:
You can find ported versions of nearly all FreeMind scripts from http://freem
ind.sourceforge.net/wiki/index.php/Example_scripts in the Wiki at http://freeplane.sourcef
orge.net/mediawiki-1.14.1/index.php/Scripting_examples. All are working and
tested (unlike some of their originals).
Volker