FreeMind 0.9.0: The New Features: Difference between revisions
Line 208: | Line 208: | ||
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);</nowiki> | 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);</nowiki> | ||
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. | |||
<nowiki> | |||
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);};</nowiki> | |||
--[[User:Yubrshen|yushen]] 15:35, 15 Jan 2007 (PST) | |||
---- | ---- | ||
Revision as of 23:35, 15 January 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
Create Attribute
Create Attribute values
Every Attribute can have multiple 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)
--VincentD 02:30, 9 Nov 2006 (PST)
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()
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. 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);}; --yushen 15:35, 15 Jan 2007 (PST)
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
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 featuresTo Do
|