FreeMind 0.9.0: The New Features: Difference between revisions
(→Advanced Examples: Groovy Highlighting enabled) |
(→Examples: Groovy Highlighting enabled) |
||
Line 214: | Line 214: | ||
'''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. | '''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. | ||
<groovy>=node.getNodeLevel() + " " + node.getText()</groovy> | |||
< | |||
'''Set the text color of a node:''' | '''Set the text color of a node:''' | ||
<groovy>node.setColor(java.awt.Color.RED)</groovy> | |||
< | |||
'''Set the background color of a node:''' | '''Set the background color of a node:''' | ||
<groovy>node.setBackgroundColor(java.awt.Color.BLUE)</groovy> | |||
< | |||
'''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. | '''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. |
Revision as of 21:53, 13 March 2007
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
Working with Attributes
Create Attribute
Delete Attribute
Rename Attribute
Working with Attribute values
Create Attribute values
Every Attribute can have multiple values
Delete Attribute values
Rename Attribute values
Assign Attributes to nodesassigning only a few 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
User feedbackReport on potential bugs. With FreeMind 0.9.0 beta 8,
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)
--pedron 1:02pm, 10 October 2006 (EST)
--Cichutki75 8:09pm, 19 October 2006 (GMT)
--Belebele 4:15pm, 25 February 2007 (GMT)
--VincentD 02:30, 9 Nov 2006 (PST)
I usually write short nodes but very long notes in order to have a "clear" map. 2 special comments on notes :
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. <groovy>=node.getNodeLevel() + " " + node.getText()</groovy> Set the text color of a node: <groovy>node.setColor(java.awt.Color.RED)</groovy> Set the background color of a node: <groovy>node.setBackgroundColor(java.awt.Color.BLUE)</groovy> 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 ExamplesA node with the current time If you need a node that shows the last saving time, just add the following script and start it once each time, you are opening the map for editing. <groovy> import freemind.modes.MindMapNode; import freemind.modes.mindmapmode.MindMapController; import java.util.Timer; class DateTimer extends java.util.TimerTask { MindMapNode mNode; MindMapController mC; DateTimer(node, c) { mNode = node; mC = c; } void run() { mNode.setText("Save Time: " + new java.util.Date()); mC.nodeRefresh(mNode); } } t = new Timer(); t.schedule(new DateTimer(node, c),2000,2000); </groovy> 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 This is an example of using some more Node methods. <groovy>=(new java.text.SimpleDateFormat("M/d/yyyy")).format(node.getHistoryInformation().getLastModifiedAt()) + " " + node.getText()</groovy> Add up all subnodes and set them into the first row, second column. Copy the script into subnodes if you want go more than one level. As far as I can tell you can't grab the values by attribute name, just by row / column, but I didn't spend forever looking over the source.. (Maybe someone could push some javadoc?)
The above code has a problem that it will let leaf node and its parent nodes with the script to yield 0 value. The following code would work recursively. <groovy> if (!node.isLeaf()) {def i = node.childrenUnfolded(); def total=0; while (i.hasNext()) { d = i.next(); def val=d.getAttributes().getValueAt(0,1); if (val!=null) total=total+java.lang.Integer.parseInt(val); }; node.getAttributes().setValueAt(total, 0,1);};</groovy> --yushen 15:35, 15 Jan 2007 (PST)
<groovy> def i = node.childrenUnfolded(); while (i.hasNext()) { d = i.next(); d.setColor(java.awt.Color.BLUE); }; c.nodeStructureChanged();</groovy>
<groovy>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);</groovy>
<groovy> =nt=node.toString(); pos=nt.indexOf(" / "); return ((pos>=0)?nt.substring(0,pos):nt) + " / " + (new java.text.SimpleDateFormat("yyyy-M-d")).format(new Date()) </groovy> About GroovyFor people unfamiliar with Groovy scripting, it's home page, an introduction, a review on slashdot. How to get started
Wish for Groovy script editing
--yushen 15:41, 15 Jan 2007 (PST) Tips of editing script
--yushen 15:41, 15 Jan 2007 (PST) TaskJuggler IntegrationTaskJuggler is a opensource project management tool for linux. It covers the complete spectrum of project management tasks from the first idea to the completion of the project. It assists you during project scoping, resource assignment, cost and revenue planing, risk and communication management. IdeaThe idea is to have special task and resource nodes on the mindmap. These node's attributes contain information needed for generating taskjuggler include files through xslt transformation. You can find more info about these attribs in TaskJuggler documentation Tasks are defined as subnodes of TASKS node, similarly resources are defined as subnodes of RESOURCES node. Project file (TJP)We generate only includes with FreeMind, so we must write simple TaskJuggler main project file: project simple "Simple Project" "1.0" 2005-06-06 2005-06-26 taskreport "Gantt" { columns start {title "Start"},name, end {title "End"}, duration, chart #loadunit days #hideresource 1 } include "example.resources.tji" include "example.tasks.tji" taskreport "My Tasks" Include Files (TJI)Mindmap with defined TASKS and RESOURCES nodes can look like this: We can export include files which we have defined in our project file directly from FreeMind mindmap: example.resources.tji - from RESOURCES node (File->Export->Resources from RESOURCES node to TJI file..) example.tasks.tji - from TASKS node (File->Export->Task from TASKS node to TJI file..) In TaskJuggler our project will look like this: DownloadHere you can download full example. Freemind version infoYou have to compile FreeMind from CVS to use this functionality (FreeMind ver. 0.9.0 beta 9, CVS tag: fm_060405_integration) The rest new featuresLinking to nodes in another mm-fileYou may create a link to a node in another map by appending #node_name to the map path User feedback: Bug: This very useful feature seems to work for the current instance of the target map only. Once the target map is closed and reopened the link points to the root node in the target map, even though the link text is still correct. Closing the source map and reopening it works fine. - Tested based on FM 0.8.0 maps with the Windows version of FM.--Uli 02:51, 13 Feb 2007 (PST)
To Do
|