FreeMind 0.9.0: The New Features: Difference between revisions
Line 123: | Line 123: | ||
--[[User:Neanderlander|Neanderlander]] 22:01, 24 Sep 2006 (PDT) | --[[User:Neanderlander|Neanderlander]] 22:01, 24 Sep 2006 (PDT) | ||
= Scripting via Groovy = | = Scripting via Groovy = |
Revision as of 05:37, 28 September 2006
A great release is to come. We have many exciting new features: WYSIWYG-Editing for nodes and notes, scripting, filter, attributes and many more. But all these new features still need a lot of testing and documentation. To start this, please have a look at the newest version here and tell us your opinions. Use this wiki page for documenting the new features. But: Don't use this version for productive maps. It is not stable enough!
AttributesQuick Attribute creation
Using Attribute Manager
Create Attribute
Create Attribute values
Every Attribute can have multiple values
Assign Attributes to nodesassigning only a few nodes
assigning many nodes
Viewing/Hiding Attributesto see an icon on nodes with attributes
show all attributes
show no attributes
show selected attributes
optimize the width of the Attribute/value table
FilterCreate filters to view and print the data more effectivelyclick on the little funnel to the left of the zoom size toggles on and off default values are useful
create filter for one Attribute
create filter for one Attribute and its value
use multiple filters at oncecreate two filter sets by the method above select the filter sets you want
press the "and" button on the right => a new set is created which combines your selected sets filter on an icon
user feedbackWrite your feedback on use of filters here.
WYSIWYG-Editing for nodes and notesYet to be documented User FeedbackLove this feature, especially the way that the notes export to javascript enabled html. Couple of observations.
--RichardForster 18:04, 19 Sep 2006 (PDT) I'd like to have the option to collapse the WYSIWYG editing area to free up more screen real-estate. --Marko 21:45, 23 Sep 2006 (PDT)
--Neanderlander 22:01, 24 Sep 2006 (PDT) Scripting via GroovyGroovy scripts may be attached to individual nodes in the map. When "evaluate" is selected via the menu or keypress (Alt-F8), all nodes in the map are searched (depth-first) for one or more attributes named "script". If such an attribute is found, the value of the attached attribute is passed to the Groovy engine to execute. Only nodes are evaluated, which attribute keys start with "script". However, there is nothing preventing a script on one node from acting on other nodes via normal operations (e.g. node.getChildren or similar) as far as I can tell from the code. Assignment vs. OperationIf the value of the script attribute starts with the equals sign ("="), then the node text will be replaced by the RESULT of the script evaluation. Be careful not to overwrite your nodes! See the example for using the "node.getText()" in an assignment script. If the value of the script attribute does not begin with the equals sign, then the script will run and may affect the map, but the expression result is not assigned to the node text. Available OperationsWhen the Groovy binding is created, two variables are set:
You will have to examine the FreeMind source code for operations on the interfaces. See the examples for a few operations such as setting the node text, node color and background color. ExamplesI have only played with the engine for five minutes, and spent about the same amount of time on the Groovy home page. The following examples work for me: Prepend the node text with an integer representing the node depth. Note that the script starts with '=' so the result is assigned back to the node text. =node.getNodeLevel() + " " + node.getText() Set the text color of a node: node.setColor(java.awt.Color.RED) Set the background color of a node: node.setBackgroundColor(java.awt.Color.BLUE) Project Manager: Don't do this; use methods of the controller c instead. If you manipulate the node model directly, you'll miss the undo and flow control capabilities of FreeMind. Please, consult methods from the interface MindMapActions only. Advanced ExamplesWARNING! I have now played with Groovy for 30 minutes and I am unsure of the side effects to FreeMind of using these examples, as they modify children of a node. - Dave Torok Prepend the modified date at the beginning of the node text This is an example of using some more Node methods. =(new java.text.SimpleDateFormat("M/d/yyyy")).format(node.getHistoryInformation().getLastModifiedAt()) + " " + node.getText() Set the color for all children This is an example of iteration over child nodes. Also, a call to c.nodeStructureChanged(node) is necessary to force a refresh to paint the new color. def i = node.childrenUnfolded(); while (i.hasNext()) { d = i.next(); d.setColor(java.awt.Color.BLUE); }; c.nodeStructureChanged();
def swap (a,b) { na = node.getChildAt(a); nb = node.getChildAt(b); node.remove(a); node.remove(b - 1); node.insert(nb,a); node.insert(na,b); c.nodeStructureChanged(node); }; swap(1,3);
=nt=node.toString(); pos=nt.indexOf(" / "); return ((pos>=0)?nt.substring(0,pos):nt) + " / " + (new java.text.SimpleDateFormat("yyyy-M-d")).format(new Date())
About GroovyFor people unfamiliar with Groovy scripting, it's home page, an introduction, a review on slashdot. How to get started
The rest new featuresTo Do |