Index: branches/GP.Grammar.Editor/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views-3.4.csproj
===================================================================
--- branches/GP.Grammar.Editor/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views-3.4.csproj	(revision 6387)
+++ branches/GP.Grammar.Editor/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views-3.4.csproj	(revision 6403)
@@ -149,4 +149,5 @@
     </Compile>
     <Compile Include="VisualSymbolicExpressionTreeNode.cs" />
+    <Compile Include="VisualSymbolicExpressionTreeNodeConnection.cs" />
   </ItemGroup>
   <ItemGroup>
Index: branches/GP.Grammar.Editor/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolView.Designer.cs
===================================================================
--- branches/GP.Grammar.Editor/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolView.Designer.cs	(revision 6387)
+++ branches/GP.Grammar.Editor/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolView.Designer.cs	(revision 6403)
@@ -47,5 +47,9 @@
       this.initialFrequencyLabel = new System.Windows.Forms.Label();
       this.initialFrequencyTextBox = new System.Windows.Forms.TextBox();
-      this.checkBoxEnabled = new System.Windows.Forms.CheckBox();
+      this.enabledCheckBox = new System.Windows.Forms.CheckBox();
+      this.minimumArityLabel = new System.Windows.Forms.Label();
+      this.maximumArityLabel = new System.Windows.Forms.Label();
+      this.minimumArityTextBox = new System.Windows.Forms.TextBox();
+      this.maximumArityTextBox = new System.Windows.Forms.TextBox();
       ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
       this.SuspendLayout();
@@ -85,14 +89,56 @@
       this.initialFrequencyTextBox.Validated += new System.EventHandler(this.initialFrequencyTextBox_Validated);
       // 
-      // checkBoxEnabled
+      // enabledCheckBox
       // 
-      this.checkBoxEnabled.AutoSize = true;
-      this.checkBoxEnabled.Location = new System.Drawing.Point(93, 52);
-      this.checkBoxEnabled.Name = "checkBoxEnabled";
-      this.checkBoxEnabled.Size = new System.Drawing.Size(65, 17);
-      this.checkBoxEnabled.TabIndex = 5;
-      this.checkBoxEnabled.Text = "Enabled";
-      this.checkBoxEnabled.UseVisualStyleBackColor = true;
-      this.checkBoxEnabled.CheckedChanged += new System.EventHandler(this.checkBoxEnabled_CheckedChanged);
+      this.enabledCheckBox.AutoSize = true;
+      this.enabledCheckBox.Location = new System.Drawing.Point(93, 104);
+      this.enabledCheckBox.Name = "enabledCheckBox";
+      this.enabledCheckBox.Size = new System.Drawing.Size(65, 17);
+      this.enabledCheckBox.TabIndex = 5;
+      this.enabledCheckBox.Text = "Enabled";
+      this.enabledCheckBox.UseVisualStyleBackColor = true;
+      this.enabledCheckBox.CheckedChanged += new System.EventHandler(this.checkBoxEnabled_CheckedChanged);
+      // 
+      // minimumArityLabel
+      // 
+      this.minimumArityLabel.AutoSize = true;
+      this.minimumArityLabel.Location = new System.Drawing.Point(3, 55);
+      this.minimumArityLabel.Name = "minimumArityLabel";
+      this.minimumArityLabel.Size = new System.Drawing.Size(74, 13);
+      this.minimumArityLabel.TabIndex = 8;
+      this.minimumArityLabel.Text = "Minimum Arity:";
+      this.toolTip.SetToolTip(this.minimumArityLabel, "Relative frequency of the symbol in randomly created trees");
+      // 
+      // maximumArityLabel
+      // 
+      this.maximumArityLabel.AutoSize = true;
+      this.maximumArityLabel.Location = new System.Drawing.Point(3, 81);
+      this.maximumArityLabel.Name = "maximumArityLabel";
+      this.maximumArityLabel.Size = new System.Drawing.Size(74, 13);
+      this.maximumArityLabel.TabIndex = 6;
+      this.maximumArityLabel.Text = "Maximum Arity";
+      this.toolTip.SetToolTip(this.maximumArityLabel, "Relative frequency of the symbol in randomly created trees");
+      // 
+      // minimumArityTextBox
+      // 
+      this.minimumArityTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+      this.errorProvider.SetIconAlignment(this.minimumArityTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
+      this.minimumArityTextBox.Location = new System.Drawing.Point(93, 52);
+      this.minimumArityTextBox.Name = "minimumArityTextBox";
+      this.minimumArityTextBox.ReadOnly = true;
+      this.minimumArityTextBox.Size = new System.Drawing.Size(227, 20);
+      this.minimumArityTextBox.TabIndex = 9;
+      // 
+      // maximumArityTextBox
+      // 
+      this.maximumArityTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+      this.errorProvider.SetIconAlignment(this.maximumArityTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
+      this.maximumArityTextBox.Location = new System.Drawing.Point(93, 78);
+      this.maximumArityTextBox.Name = "maximumArityTextBox";
+      this.maximumArityTextBox.ReadOnly = true;
+      this.maximumArityTextBox.Size = new System.Drawing.Size(227, 20);
+      this.maximumArityTextBox.TabIndex = 7;
       // 
       // SymbolView
@@ -100,12 +146,20 @@
       this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
       this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+      this.Controls.Add(this.minimumArityTextBox);
+      this.Controls.Add(this.minimumArityLabel);
+      this.Controls.Add(this.maximumArityTextBox);
+      this.Controls.Add(this.maximumArityLabel);
       this.Controls.Add(this.initialFrequencyTextBox);
       this.Controls.Add(this.initialFrequencyLabel);
-      this.Controls.Add(this.checkBoxEnabled);
+      this.Controls.Add(this.enabledCheckBox);
       this.Name = "SymbolView";
-      this.Size = new System.Drawing.Size(320, 75);
-      this.Controls.SetChildIndex(this.checkBoxEnabled, 0);
+      this.Size = new System.Drawing.Size(320, 123);
+      this.Controls.SetChildIndex(this.enabledCheckBox, 0);
       this.Controls.SetChildIndex(this.initialFrequencyLabel, 0);
       this.Controls.SetChildIndex(this.initialFrequencyTextBox, 0);
+      this.Controls.SetChildIndex(this.maximumArityLabel, 0);
+      this.Controls.SetChildIndex(this.maximumArityTextBox, 0);
+      this.Controls.SetChildIndex(this.minimumArityLabel, 0);
+      this.Controls.SetChildIndex(this.minimumArityTextBox, 0);
       this.Controls.SetChildIndex(this.infoLabel, 0);
       this.Controls.SetChildIndex(this.nameLabel, 0);
@@ -121,5 +175,9 @@
     protected System.Windows.Forms.Label initialFrequencyLabel;
     protected System.Windows.Forms.TextBox initialFrequencyTextBox;
-    private System.Windows.Forms.CheckBox checkBoxEnabled;
+    private System.Windows.Forms.CheckBox enabledCheckBox;
+    protected System.Windows.Forms.Label minimumArityLabel;
+    protected System.Windows.Forms.Label maximumArityLabel;
+    protected System.Windows.Forms.TextBox minimumArityTextBox;
+    protected System.Windows.Forms.TextBox maximumArityTextBox;
 
   }
Index: branches/GP.Grammar.Editor/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolView.cs
===================================================================
--- branches/GP.Grammar.Editor/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolView.cs	(revision 6387)
+++ branches/GP.Grammar.Editor/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolView.cs	(revision 6403)
@@ -59,5 +59,5 @@
       initialFrequencyTextBox.Enabled = Content != null || Locked;
       initialFrequencyTextBox.ReadOnly = ReadOnly;
-      checkBoxEnabled.Enabled = Content != null || Locked || ReadOnly;
+      enabledCheckBox.Enabled = Content != null || Locked || ReadOnly;
     }
 
@@ -97,5 +97,5 @@
     private void checkBoxEnabled_CheckedChanged(object sender, EventArgs e) {
       if (Content != null)
-        Content.Enabled = checkBoxEnabled.Checked;
+        Content.Enabled = enabledCheckBox.Checked;
     }
     #endregion
@@ -105,8 +105,12 @@
       if (Content == null) {
         initialFrequencyTextBox.Text = string.Empty;
-        checkBoxEnabled.Checked = false;
+        minimumArityTextBox.Text = string.Empty;
+        maximumArityTextBox.Text = string.Empty;
+        enabledCheckBox.Checked = false;
       } else {
         initialFrequencyTextBox.Text = Content.InitialFrequency.ToString();
-        checkBoxEnabled.Checked = Content.Enabled;
+        minimumArityTextBox.Text = Content.MinimumArity.ToString();
+        maximumArityTextBox.Text = Content.MaximumArity.ToString();
+        enabledCheckBox.Checked = Content.Enabled;
       }
       SetEnabledStateOfControls();
Index: branches/GP.Grammar.Editor/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarEditorView.Designer.cs
===================================================================
--- branches/GP.Grammar.Editor/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarEditorView.Designer.cs	(revision 6387)
+++ branches/GP.Grammar.Editor/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarEditorView.Designer.cs	(revision 6403)
@@ -28,12 +28,12 @@
       this.grpSymbols = new System.Windows.Forms.GroupBox();
       this.splitContainer1 = new System.Windows.Forms.SplitContainer();
+      this.showDetailsCheckBox = new System.Windows.Forms.CheckBox();
+      this.removeButton = new System.Windows.Forms.Button();
+      this.addButton = new System.Windows.Forms.Button();
       this.symbolsTreeView = new System.Windows.Forms.TreeView();
       this.imageList = new System.Windows.Forms.ImageList(this.components);
       this.splitContainer2 = new System.Windows.Forms.SplitContainer();
+      this.allowedChildSymbolsControl = new HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views.SymbolicExpressionTreeChart();
       this.symbolDetailsViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
-      this.showDetailsCheckBox = new System.Windows.Forms.CheckBox();
-      this.removeButton = new System.Windows.Forms.Button();
-      this.addButton = new System.Windows.Forms.Button();
-      this.allowedChildSymbolsControl = new HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views.SymbolicExpressionTreeChart();
       ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
       this.grpSymbols.SuspendLayout();
@@ -90,4 +90,41 @@
       this.splitContainer1.SplitterDistance = 191;
       this.splitContainer1.TabIndex = 0;
+      // 
+      // showDetailsCheckBox
+      // 
+      this.showDetailsCheckBox.Appearance = System.Windows.Forms.Appearance.Button;
+      this.showDetailsCheckBox.Checked = true;
+      this.showDetailsCheckBox.CheckState = System.Windows.Forms.CheckState.Checked;
+      this.showDetailsCheckBox.Image = HeuristicLab.Common.Resources.VSImageLibrary.Properties;
+      this.showDetailsCheckBox.Location = new System.Drawing.Point(63, 3);
+      this.showDetailsCheckBox.Name = "showDetailsCheckBox";
+      this.showDetailsCheckBox.Size = new System.Drawing.Size(24, 24);
+      this.showDetailsCheckBox.TabIndex = 7;
+      this.toolTip.SetToolTip(this.showDetailsCheckBox, "Show/Hide Details");
+      this.showDetailsCheckBox.UseVisualStyleBackColor = true;
+      this.showDetailsCheckBox.CheckedChanged += new System.EventHandler(this.showDetailsCheckBox_CheckedChanged);
+      // 
+      // removeButton
+      // 
+      this.removeButton.Enabled = false;
+      this.removeButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Remove;
+      this.removeButton.Location = new System.Drawing.Point(33, 3);
+      this.removeButton.Name = "removeButton";
+      this.removeButton.Size = new System.Drawing.Size(24, 24);
+      this.removeButton.TabIndex = 6;
+      this.toolTip.SetToolTip(this.removeButton, "Remove");
+      this.removeButton.UseVisualStyleBackColor = true;
+      this.removeButton.Click += new System.EventHandler(this.removeButton_Click);
+      // 
+      // addButton
+      // 
+      this.addButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Add;
+      this.addButton.Location = new System.Drawing.Point(3, 3);
+      this.addButton.Name = "addButton";
+      this.addButton.Size = new System.Drawing.Size(24, 24);
+      this.addButton.TabIndex = 5;
+      this.toolTip.SetToolTip(this.addButton, "Add");
+      this.addButton.UseVisualStyleBackColor = true;
+      this.addButton.Click += new System.EventHandler(this.addButton_Click);
       // 
       // symbolsTreeView
@@ -132,56 +169,5 @@
       this.splitContainer2.TabIndex = 0;
       // 
-      // symbolViewHost
-      // 
-      this.symbolDetailsViewHost.Caption = "View";
-      this.symbolDetailsViewHost.Content = null;
-      this.symbolDetailsViewHost.Dock = System.Windows.Forms.DockStyle.Fill;
-      this.symbolDetailsViewHost.Enabled = false;
-      this.symbolDetailsViewHost.Location = new System.Drawing.Point(0, 0);
-      this.symbolDetailsViewHost.Name = "symbolViewHost";
-      this.symbolDetailsViewHost.ReadOnly = false;
-      this.symbolDetailsViewHost.Size = new System.Drawing.Size(568, 190);
-      this.symbolDetailsViewHost.TabIndex = 0;
-      this.symbolDetailsViewHost.ViewsLabelVisible = true;
-      this.symbolDetailsViewHost.ViewType = null;
-      // 
-      // showDetailsCheckBox
-      // 
-      this.showDetailsCheckBox.Appearance = System.Windows.Forms.Appearance.Button;
-      this.showDetailsCheckBox.Checked = true;
-      this.showDetailsCheckBox.CheckState = System.Windows.Forms.CheckState.Checked;
-      this.showDetailsCheckBox.Image = HeuristicLab.Common.Resources.VSImageLibrary.Properties;
-      this.showDetailsCheckBox.Location = new System.Drawing.Point(63, 3);
-      this.showDetailsCheckBox.Name = "showDetailsCheckBox";
-      this.showDetailsCheckBox.Size = new System.Drawing.Size(24, 24);
-      this.showDetailsCheckBox.TabIndex = 7;
-      this.toolTip.SetToolTip(this.showDetailsCheckBox, "Show/Hide Details");
-      this.showDetailsCheckBox.UseVisualStyleBackColor = true;
-      this.showDetailsCheckBox.CheckedChanged += new System.EventHandler(this.showDetailsCheckBox_CheckedChanged);
-      // 
-      // removeButton
-      // 
-      this.removeButton.Enabled = false;
-      this.removeButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Remove;
-      this.removeButton.Location = new System.Drawing.Point(33, 3);
-      this.removeButton.Name = "removeButton";
-      this.removeButton.Size = new System.Drawing.Size(24, 24);
-      this.removeButton.TabIndex = 6;
-      this.toolTip.SetToolTip(this.removeButton, "Remove");
-      this.removeButton.UseVisualStyleBackColor = true;
-      this.removeButton.Click += new System.EventHandler(this.removeButton_Click);
-      // 
-      // addButton
-      // 
-      this.addButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Add;
-      this.addButton.Location = new System.Drawing.Point(3, 3);
-      this.addButton.Name = "addButton";
-      this.addButton.Size = new System.Drawing.Size(24, 24);
-      this.addButton.TabIndex = 5;
-      this.toolTip.SetToolTip(this.addButton, "Add");
-      this.addButton.UseVisualStyleBackColor = true;
-      this.addButton.Click += new System.EventHandler(this.addButton_Click);
-      // 
-      // symbolicExpressionTreeChart
+      // allowedChildSymbolsControl
       // 
       this.allowedChildSymbolsControl.AllowDrop = true;
@@ -190,5 +176,5 @@
       this.allowedChildSymbolsControl.LineColor = System.Drawing.Color.Black;
       this.allowedChildSymbolsControl.Location = new System.Drawing.Point(0, 0);
-      this.allowedChildSymbolsControl.Name = "symbolicExpressionTreeChart";
+      this.allowedChildSymbolsControl.Name = "allowedChildSymbolsControl";
       this.allowedChildSymbolsControl.Size = new System.Drawing.Size(568, 165);
       this.allowedChildSymbolsControl.Spacing = 5;
@@ -200,5 +186,21 @@
       this.allowedChildSymbolsControl.DragEnter += new System.Windows.Forms.DragEventHandler(this.symbolicExpressionTreeChart_DragEnter);
       this.allowedChildSymbolsControl.DragOver += new System.Windows.Forms.DragEventHandler(this.symbolicExpressionTreeChart_DragOver);
+      this.allowedChildSymbolsControl.Paint += new System.Windows.Forms.PaintEventHandler(this.allowedChildSymbolsControl_Paint);
       this.allowedChildSymbolsControl.KeyDown += new System.Windows.Forms.KeyEventHandler(this.symbolicExpressionTreeChart_KeyDown);
+      this.allowedChildSymbolsControl.MouseDown += new System.Windows.Forms.MouseEventHandler(this.allowedChildSymbolsControl_MouseDown);
+      // 
+      // symbolDetailsViewHost
+      // 
+      this.symbolDetailsViewHost.Caption = "View";
+      this.symbolDetailsViewHost.Content = null;
+      this.symbolDetailsViewHost.Dock = System.Windows.Forms.DockStyle.Fill;
+      this.symbolDetailsViewHost.Enabled = false;
+      this.symbolDetailsViewHost.Location = new System.Drawing.Point(0, 0);
+      this.symbolDetailsViewHost.Name = "symbolDetailsViewHost";
+      this.symbolDetailsViewHost.ReadOnly = false;
+      this.symbolDetailsViewHost.Size = new System.Drawing.Size(568, 190);
+      this.symbolDetailsViewHost.TabIndex = 0;
+      this.symbolDetailsViewHost.ViewsLabelVisible = true;
+      this.symbolDetailsViewHost.ViewType = null;
       // 
       // SymbolicExpressionGrammarEditorView
Index: branches/GP.Grammar.Editor/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarEditorView.cs
===================================================================
--- branches/GP.Grammar.Editor/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarEditorView.cs	(revision 6387)
+++ branches/GP.Grammar.Editor/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarEditorView.cs	(revision 6403)
@@ -159,4 +159,5 @@
       var tree = new SymbolicExpressionTree(new SymbolicExpressionTreeNode(symbol));
 
+      allowedChildSymbolsControl.SuspendRepaint = true;
       if (Content.GetMaximumSubtreeCount(symbol) > 0) {
         for (int i = 0; i < Content.GetMaximumSubtreeCount(symbol); i++) {
@@ -169,4 +170,33 @@
       }
       allowedChildSymbolsControl.Tree = tree;
+
+      foreach (var subtreeNode in tree.Root.Subtrees) {
+        foreach (var allowedChildNode in subtreeNode.Subtrees) {
+          var visualLine = allowedChildSymbolsControl.GetVisualSymbolicExpressionTreeNodeConnection(subtreeNode, allowedChildNode);
+          visualLine.DashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
+        }
+      }
+
+      for (int i = Content.GetMinimumSubtreeCount(symbol); i < Content.GetMaximumSubtreeCount(symbol); i++) {
+        var subtreeNode = tree.Root.GetSubtree(i);
+        var visualTreeNode = allowedChildSymbolsControl.GetVisualSymbolicExpressionTreeNode(subtreeNode);
+        visualTreeNode.TextColor = Color.Gray;
+        visualTreeNode.LineColor = Color.LightGray;
+
+        var visualLine = allowedChildSymbolsControl.GetVisualSymbolicExpressionTreeNodeConnection(tree.Root, subtreeNode);
+        visualLine.LineColor = Color.LightGray;
+
+        foreach (var allowedChildNode in subtreeNode.Subtrees) {
+          visualTreeNode = allowedChildSymbolsControl.GetVisualSymbolicExpressionTreeNode(allowedChildNode);
+          visualTreeNode.TextColor = Color.Gray;
+          visualTreeNode.LineColor = Color.LightGray;
+
+          visualLine = allowedChildSymbolsControl.GetVisualSymbolicExpressionTreeNodeConnection(subtreeNode, allowedChildNode);
+          visualLine.LineColor = Color.LightGray;
+        }
+      }
+
+      allowedChildSymbolsControl.SuspendRepaint = false;
+      allowedChildSymbolsControl.Repaint();
       UpdateSelectedSymbolicExpressionTreeNodes();
     }
@@ -216,5 +246,5 @@
       var symbol = data as ISymbol;
       var symbols = data as IEnumerable<ISymbol>;
-      if (symbol != null && !(symbol is IReadOnlySymbol) && !Content.ContainsSymbol(symbol)) validDragOperation = true;
+      if (symbol != null && !(symbol is IReadOnlySymbol) && Content.ContainsSymbol(symbol)) validDragOperation = true;
       else if (symbols != null && symbols.All(s => !(symbol is IReadOnlySymbol) && Content.ContainsSymbol(s))) validDragOperation = true;
     }
@@ -263,13 +293,65 @@
       foreach (var node in allowedChildSymbolsControl.Tree.IterateNodesPrefix()) {
         var visualNode = allowedChildSymbolsControl.GetVisualSymbolicExpressionTreeNode(node);
-        if (!selectedSymbolicExpressionTreeNodes.Contains(node)) {
-          visualNode.FillColor = Color.White;
-          visualNode.LineColor = Color.Black;
-        } else {
-          visualNode.FillColor = Color.WhiteSmoke;
-          visualNode.LineColor = Color.DarkOrange;
-        }
+        if (!selectedSymbolicExpressionTreeNodes.Contains(node)) visualNode.FillColor = Color.White;
+        else visualNode.FillColor = Color.LightSteelBlue;
+
       }
       allowedChildSymbolsControl.Repaint();
+    }
+
+    private RectangleF increaseMinimumSubtreeCountRectangle;
+    private RectangleF decreaseMinimumSubtreeCountRectangle;
+    private RectangleF increaseMaximumSubtreeCountRectangle;
+    private RectangleF decreaseMaximumSubtreeCountRectangle;
+    private void allowedChildSymbolsControl_Paint(object sender, PaintEventArgs e) {
+      increaseMinimumSubtreeCountRectangle = RectangleF.Empty;
+      decreaseMinimumSubtreeCountRectangle = RectangleF.Empty;
+      increaseMaximumSubtreeCountRectangle = RectangleF.Empty;
+      decreaseMaximumSubtreeCountRectangle = RectangleF.Empty;
+
+      if (Content == null) return;
+      if (allowedChildSymbolsControl.Tree == null) return;
+
+      var rootNode = allowedChildSymbolsControl.Tree.Root;
+      var visualRootNode = allowedChildSymbolsControl.GetVisualSymbolicExpressionTreeNode(rootNode);
+      var graphics = e.Graphics;
+
+      if (rootNode.Symbol is IReadOnlySymbol) return;
+      if (rootNode.Symbol.MinimumArity == rootNode.Symbol.MaximumArity) return;
+
+      using (Pen pen = new Pen(Color.Black)) {
+        using (Font font = new Font("Times New Roman", 8)) {
+          var stringFormat = new StringFormat();
+          stringFormat.Alignment = StringAlignment.Center;
+          stringFormat.LineAlignment = StringAlignment.Center;
+          int spacing = 5;
+          int size = (visualRootNode.Height - spacing * 3) / 2;
+
+          increaseMinimumSubtreeCountRectangle = new RectangleF(visualRootNode.X - spacing - size, visualRootNode.Y + spacing, size, size);
+          decreaseMinimumSubtreeCountRectangle = new RectangleF(visualRootNode.X - spacing - size, visualRootNode.Y + size + 2 * spacing, size, size);
+          increaseMaximumSubtreeCountRectangle = new RectangleF(visualRootNode.X + visualRootNode.Width + spacing, visualRootNode.Y + spacing, size, size);
+          decreaseMaximumSubtreeCountRectangle = new RectangleF(visualRootNode.X + visualRootNode.Width + spacing, visualRootNode.Y + size + 2 * spacing, size, size);
+
+          pen.Color = Content.GetMaximumSubtreeCount(rootNode.Symbol) == Content.GetMinimumSubtreeCount(rootNode.Symbol) ? Color.LightGray : Color.Black;
+          graphics.DrawString("+", font, pen.Brush, increaseMinimumSubtreeCountRectangle, stringFormat);
+          graphics.DrawRectangle(pen, Rectangle.Round(increaseMinimumSubtreeCountRectangle));
+          if (pen.Color == Color.LightGray) increaseMinimumSubtreeCountRectangle = RectangleF.Empty;
+
+          pen.Color = Content.GetMinimumSubtreeCount(rootNode.Symbol) == rootNode.Symbol.MinimumArity ? Color.LightGray : Color.Black;
+          graphics.DrawString("-", font, pen.Brush, decreaseMinimumSubtreeCountRectangle, stringFormat);
+          graphics.DrawRectangle(pen, Rectangle.Round(decreaseMinimumSubtreeCountRectangle));
+          if (pen.Color == Color.LightGray) decreaseMinimumSubtreeCountRectangle = RectangleF.Empty;
+
+          pen.Color = Content.GetMaximumSubtreeCount(rootNode.Symbol) == rootNode.Symbol.MaximumArity ? Color.LightGray : Color.Black;
+          graphics.DrawRectangle(pen, Rectangle.Round(increaseMaximumSubtreeCountRectangle));
+          graphics.DrawString("+", font, pen.Brush, increaseMaximumSubtreeCountRectangle, stringFormat);
+          if (pen.Color == Color.LightGray) increaseMaximumSubtreeCountRectangle = RectangleF.Empty;
+
+          pen.Color = Content.GetMaximumSubtreeCount(rootNode.Symbol) == Content.GetMinimumSubtreeCount(rootNode.Symbol) ? Color.LightGray : Color.Black;
+          graphics.DrawRectangle(pen, Rectangle.Round(decreaseMaximumSubtreeCountRectangle));
+          graphics.DrawString("-", font, pen.Brush, decreaseMaximumSubtreeCountRectangle, stringFormat);
+          if (pen.Color == Color.LightGray) decreaseMaximumSubtreeCountRectangle = RectangleF.Empty;
+        }
+      }
     }
 
@@ -297,4 +379,5 @@
             groupSymbol = selectedNode.Tag as GroupSymbol;
             if (groupSymbol != null && Content.ContainsSymbol(groupSymbol)) break;
+            selectedNode = selectedNode.Parent;
           }
 
@@ -345,4 +428,30 @@
     }
     #endregion
+
+    private void allowedChildSymbolsControl_MouseDown(object sender, MouseEventArgs e) {
+      if (Content == null) return;
+      if (allowedChildSymbolsControl.Tree == null) return;
+
+      var pointF = new PointF(e.X, e.Y);
+      var rootSymbol = allowedChildSymbolsControl.Tree.Root.Symbol;
+      int minimumSubtreeCount = Content.GetMinimumSubtreeCount(rootSymbol);
+      int maximumSubtreecount = Content.GetMaximumSubtreeCount(rootSymbol);
+
+      bool changed = true;
+      DeregisterContentEvents();
+      if (increaseMinimumSubtreeCountRectangle.Contains(pointF))
+        Content.SetSubtreeCount(rootSymbol, minimumSubtreeCount + 1, maximumSubtreecount);
+      else if (decreaseMinimumSubtreeCountRectangle.Contains(pointF))
+        Content.SetSubtreeCount(rootSymbol, minimumSubtreeCount - 1, maximumSubtreecount);
+      else if (increaseMaximumSubtreeCountRectangle.Contains(pointF))
+        Content.SetSubtreeCount(rootSymbol, minimumSubtreeCount, maximumSubtreecount + 1);
+      else if (decreaseMaximumSubtreeCountRectangle.Contains(pointF))
+        Content.SetSubtreeCount(rootSymbol, minimumSubtreeCount, maximumSubtreecount - 1);
+      else
+        changed = false;
+
+      if (changed) BuildAllowedChildSymbolsTree(rootSymbol);
+      RegisterContentEvents();
+    }
   }
 
Index: branches/GP.Grammar.Editor/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionTreeChart.cs
===================================================================
--- branches/GP.Grammar.Editor/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionTreeChart.cs	(revision 6387)
+++ branches/GP.Grammar.Editor/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionTreeChart.cs	(revision 6403)
@@ -31,4 +31,5 @@
     private StringFormat stringFormat;
     private Dictionary<ISymbolicExpressionTreeNode, VisualSymbolicExpressionTreeNode> visualTreeNodes;
+    private Dictionary<Tuple<ISymbolicExpressionTreeNode, ISymbolicExpressionTreeNode>, VisualSymbolicExpressionTreeNodeConnection> visualLines;
 
     public SymbolicExpressionTreeChart() {
@@ -91,7 +92,10 @@
         tree = value;
         visualTreeNodes = new Dictionary<ISymbolicExpressionTreeNode, VisualSymbolicExpressionTreeNode>();
+        visualLines = new Dictionary<Tuple<ISymbolicExpressionTreeNode, ISymbolicExpressionTreeNode>, VisualSymbolicExpressionTreeNodeConnection>();
         if (tree != null) {
-          foreach (SymbolicExpressionTreeNode node in tree.IterateNodesPrefix())
+          foreach (ISymbolicExpressionTreeNode node in tree.IterateNodesPrefix()) {
             visualTreeNodes[node] = new VisualSymbolicExpressionTreeNode(node);
+            if (node.Parent != null) visualLines[Tuple.Create(node.Parent, node)] = new VisualSymbolicExpressionTreeNodeConnection();
+          }
         }
         Repaint();
@@ -99,7 +103,13 @@
     }
 
+    private bool suspendRepaint;
+    public bool SuspendRepaint {
+      get { return suspendRepaint; }
+      set { suspendRepaint = value; }
+    }
+
     protected override void OnPaint(PaintEventArgs e) {
+      e.Graphics.DrawImage(image, 0, 0);
       base.OnPaint(e);
-      e.Graphics.DrawImage(image, 0, 0);
     }
     protected override void OnResize(EventArgs e) {
@@ -113,6 +123,8 @@
 
     public void Repaint() {
-      this.GenerateImage();
-      this.Refresh();
+      if (!suspendRepaint) {
+        this.GenerateImage();
+        this.Refresh();
+      }
     }
 
@@ -133,4 +145,12 @@
         return visualTreeNodes[symbolicExpressionTreeNode];
       return null;
+    }
+
+    public VisualSymbolicExpressionTreeNodeConnection GetVisualSymbolicExpressionTreeNodeConnection(ISymbolicExpressionTreeNode parent, ISymbolicExpressionTreeNode child) {
+      if (child.Parent != parent) throw new ArgumentException();
+      var key = Tuple.Create(parent, child);
+      VisualSymbolicExpressionTreeNodeConnection connection = null;
+      visualLines.TryGetValue(key, out connection);
+      return connection;
     }
 
@@ -228,5 +248,4 @@
 
       SolidBrush textBrush = new SolidBrush(visualTreeNode.TextColor);
-      Pen linePen = new Pen(this.lineColor);
       Pen nodeLinePen = new Pen(visualTreeNode.LineColor);
       SolidBrush nodeFillBrush = new SolidBrush(visualTreeNode.FillColor);
@@ -275,6 +294,11 @@
 
       //draw connection line to parent node
-      if (!connectionPoint.IsEmpty)
-        graphics.DrawLine(linePen, connectionPoint, new Point(visualTreeNode.X + visualTreeNode.Width / 2, visualTreeNode.Y));
+      if (!connectionPoint.IsEmpty && node.Parent != null) {
+        var visualLine = GetVisualSymbolicExpressionTreeNodeConnection(node.Parent, node);
+        using (Pen linePen = new Pen(visualLine.LineColor)) {
+          linePen.DashStyle = visualLine.DashStyle;
+          graphics.DrawLine(linePen, connectionPoint, new Point(visualTreeNode.X + visualTreeNode.Width / 2, visualTreeNode.Y));
+        }
+      }
 
       //calculate areas for the subtrees according to their tree size and call drawFunctionTree
Index: branches/GP.Grammar.Editor/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/VisualSymbolicExpressionTreeNode.cs
===================================================================
--- branches/GP.Grammar.Editor/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/VisualSymbolicExpressionTreeNode.cs	(revision 6387)
+++ branches/GP.Grammar.Editor/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/VisualSymbolicExpressionTreeNode.cs	(revision 6403)
@@ -23,5 +23,5 @@
 
 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views {
-  public class VisualSymbolicExpressionTreeNode {
+  public class VisualSymbolicExpressionTreeNode : object {
     private static readonly Color defaultLineColor = Color.Black;
     private static readonly Color defaultTextColor = Color.Black;
Index: branches/GP.Grammar.Editor/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/VisualSymbolicExpressionTreeNodeConnection.cs
===================================================================
--- branches/GP.Grammar.Editor/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/VisualSymbolicExpressionTreeNodeConnection.cs	(revision 6403)
+++ branches/GP.Grammar.Editor/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/VisualSymbolicExpressionTreeNodeConnection.cs	(revision 6403)
@@ -0,0 +1,48 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System.Drawing;
+using System.Drawing.Drawing2D;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views {
+  public class VisualSymbolicExpressionTreeNodeConnection : object {
+    private static readonly Color defaultLineColor = Color.Black;
+    private static readonly DashStyle defaultDashStyle = DashStyle.Solid;
+
+    private Color lineColor;
+    public Color LineColor {
+      get { return lineColor; }
+      set { lineColor = value; }
+    }
+
+    private DashStyle dashStyle;
+    public DashStyle DashStyle {
+      get { return dashStyle; }
+      set { dashStyle = value; }
+    }
+
+    public VisualSymbolicExpressionTreeNodeConnection()
+      : base() {
+      lineColor = defaultLineColor;
+      dashStyle = defaultDashStyle;
+    }
+  }
+}
