FreeMind 0.9.0: The New Features: Difference between revisions
Line 140: | Line 140: | ||
'''WARNING! 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''' | '''WARNING! 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''' | '''Prepend the modified date at the beginning of the node text''' This is an example of using some more Node methods. | ||
<nowiki>=(new java.text.SimpleDateFormat("M/d/yyyy")).format(node.getHistoryInformation().getLastModifiedAt()) + " " + node.getText()</nowiki> | <nowiki>=(new java.text.SimpleDateFormat("M/d/yyyy")).format(node.getHistoryInformation().getLastModifiedAt()) + " " + node.getText()</nowiki> | ||
'''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. | |||
<nowiki> | |||
def i = node.childrenUnfolded(); while (i.hasNext()) { d = i.next(); d.setColor(java.awt.Color.BLUE); }; c.nodeStructureChanged();</nowiki> | |||
'''Swap two CHILD nodes. This works. My goal is to get a foundation for a SORT script, to sort children by alphabet, by created date, etc. until the functionality is added to the software. WARNING WARNING WARNING this is just an example to swap the 2nd and 4th child nodes.''' | '''Swap two CHILD nodes. This works. My goal is to get a foundation for a SORT script, to sort children by alphabet, by created date, etc. until the functionality is added to the software. WARNING WARNING WARNING this is just an example to swap the 2nd and 4th child nodes.''' |
Revision as of 18:52, 15 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 notesTo Do 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 with the "script" attribute are evaluated. 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) 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); 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 |