Difference between revisions of "Patterns"

From Freeplane - free mind mapping and knowledge management software
m (Reverted edits by Irajawapys (Talk) to last version by Boercher)
Line 1: Line 1:
----
 
<div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;">
 
----
 
=[http://ehiqikag.co.cc Under Construction! Please Visit Reserve Page. Page Will Be Available Shortly]=
 
----
 
=[http://ehiqikag.co.cc CLICK HERE]=
 
----
 
</div>
 
 
Patterns are a method to change the appearance of a mindmap node. Many attributes can be changed via patterns, like text and background colors, text properties, or icon assignments. And for scripting they provide the possibility to execute a script on a node.
 
Patterns are a method to change the appearance of a mindmap node. Many attributes can be changed via patterns, like text and background colors, text properties, or icon assignments. And for scripting they provide the possibility to execute a script on a node.
  
Line 19: Line 11:
 
When you select the '''[+]''' at ''Script'' the button on the right gets activated. Clicking on it opens a script editor.
 
When you select the '''[+]''' at ''Script'' the button on the right gets activated. Clicking on it opens a script editor.
  
* Click on &quot;Script&quot; on the left panel.
+
* Click on "Script" on the left panel.
 
* Enter a script on the right panel, e.g.
 
* Enter a script on the right panel, e.g.
&lt;groovy&gt;
+
<groovy>
=new java.text.SimpleDateFormat(&quot;yyyy-MM-dd HH:mm&quot;).format(new Date()) + &quot;: &quot; + node.text
+
=new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm").format(new Date()) + ": " + node.text
&lt;/groovy&gt;
+
</groovy>
  
 
This script will add the current timestamp to the node text when the pattern is added.
 
This script will add the current timestamp to the node text when the pattern is added.

Revision as of 18:27, 24 November 2010

Patterns are a method to change the appearance of a mindmap node. Many attributes can be changed via patterns, like text and background colors, text properties, or icon assignments. And for scripting they provide the possibility to execute a script on a node.

Edit a pattern

Patterns can be edited with a visual editor accessible via the menu under Format/Patterns/Manage Patterns.... You select the pattern to edit by clicking on the pattern name in the left pane. If you want to add a pattern select Add new Pattern.

In the pattern editor you can, for each node attribute, decide if the pattern should affect the attribute by selecting [+] (change it), [-] (remove it, e.g. all icons) or [ ] to leave it as it was before.

Add a script

When you select the [+] at Script the button on the right gets activated. Clicking on it opens a script editor.

  • Click on "Script" on the left panel.
  • Enter a script on the right panel, e.g.

<groovy> =new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm").format(new Date()) + ": " + node.text </groovy>

This script will add the current timestamp to the node text when the pattern is added.

Note that the script will be executed only once on the first assignment of a pattern to a node.

The future: Logical styles

Patterns are a concept that is about to be replaced by Logical styles in Freeplane version 1.2, see this article in the forum. The further role of scripts in Logical styles has to be discussed but chances are that scripts will not be supported by Logical styles.