Index: /branches/HeuristicLab.TreeLayout/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/GraphicalSymbolicExpressionTreeView.Designer.cs
===================================================================
--- /branches/HeuristicLab.TreeLayout/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/GraphicalSymbolicExpressionTreeView.Designer.cs	(revision 9650)
+++ /branches/HeuristicLab.TreeLayout/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/GraphicalSymbolicExpressionTreeView.Designer.cs	(revision 9650)
@@ -0,0 +1,79 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2013 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
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views {
+  partial class GraphicalSymbolicExpressionTreeView {
+    /// <summary> 
+    /// Required designer variable.
+    /// </summary>
+    private System.ComponentModel.IContainer components = null;
+
+    /// <summary> 
+    /// Clean up any resources being used.
+    /// </summary>
+    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+    protected override void Dispose(bool disposing) {
+      if (disposing && (components != null)) {
+        components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
+    #region Component Designer generated code
+
+    /// <summary> 
+    /// Required method for Designer support - do not modify 
+    /// the contents of this method with the code editor.
+    /// </summary>
+    private void InitializeComponent() {
+      this.symbolicExpressionTreeChart = new HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views.SymbolicExpressionTreeChart();
+      this.SuspendLayout();
+      // 
+      // functionTreeChart
+      // 
+      this.symbolicExpressionTreeChart.BackgroundColor = System.Drawing.Color.White;
+      this.symbolicExpressionTreeChart.Dock = System.Windows.Forms.DockStyle.Fill;
+      this.symbolicExpressionTreeChart.Tree = null;
+      this.symbolicExpressionTreeChart.LineColor = System.Drawing.Color.Black;
+      this.symbolicExpressionTreeChart.Location = new System.Drawing.Point(0, 0);
+      this.symbolicExpressionTreeChart.Name = "functionTreeChart";
+      this.symbolicExpressionTreeChart.Size = new System.Drawing.Size(407, 367);
+      this.symbolicExpressionTreeChart.Spacing = 5;
+      this.symbolicExpressionTreeChart.TabIndex = 0;
+      this.symbolicExpressionTreeChart.TextFont = new System.Drawing.Font("Times New Roman", 6F);
+      // 
+      // FunctionTreeView
+      // 
+      this.AllowDrop = true;
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
+      this.Controls.Add(this.symbolicExpressionTreeChart);
+      this.Name = "FunctionTreeView";
+      this.Size = new System.Drawing.Size(407, 367);
+      this.ResumeLayout(false);
+
+    }
+
+    #endregion
+
+    private SymbolicExpressionTreeChart symbolicExpressionTreeChart;
+  }
+}
Index: /branches/HeuristicLab.TreeLayout/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/GraphicalSymbolicExpressionTreeView.cs
===================================================================
--- /branches/HeuristicLab.TreeLayout/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/GraphicalSymbolicExpressionTreeView.cs	(revision 9650)
+++ /branches/HeuristicLab.TreeLayout/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/GraphicalSymbolicExpressionTreeView.cs	(revision 9650)
@@ -0,0 +1,55 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2013 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.Windows.Forms;
+using HeuristicLab.Core.Views;
+using HeuristicLab.MainForm;
+using HeuristicLab.MainForm.WindowsForms;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views {
+  [View("Graphical SymbolicExpressionTree View")]
+  [Content(typeof(ISymbolicExpressionTree), true)]
+  public partial class GraphicalSymbolicExpressionTreeView : ItemView {
+    public new ISymbolicExpressionTree Content {
+      get { return (ISymbolicExpressionTree)base.Content; }
+      set { base.Content = value; }
+    }
+
+    public GraphicalSymbolicExpressionTreeView()
+      : base() {
+      InitializeComponent();
+    }
+
+    protected override void OnContentChanged() {
+      base.OnContentChanged();
+      if (Content == null) {
+        symbolicExpressionTreeChart.Tree = null;
+      } else {
+        symbolicExpressionTreeChart.Tree = Content;
+      }
+    }
+
+    protected override void SetEnabledStateOfControls() {
+      base.SetEnabledStateOfControls();
+      symbolicExpressionTreeChart.Enabled = Content != null;
+    }
+  }
+}
Index: /branches/HeuristicLab.TreeLayout/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views-3.4.csproj
===================================================================
--- /branches/HeuristicLab.TreeLayout/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views-3.4.csproj	(revision 9650)
+++ /branches/HeuristicLab.TreeLayout/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views-3.4.csproj	(revision 9650)
@@ -0,0 +1,284 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>9.0.30729</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{423BD94F-963A-438E-BA45-3BB3D61CD03B}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views</RootNamespace>
+    <AssemblyName>HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views-3.4</AssemblyName>
+    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <TargetFrameworkProfile>
+    </TargetFrameworkProfile>
+    <FileAlignment>512</FileAlignment>
+    <SignAssembly>true</SignAssembly>
+    <AssemblyOriginatorKeyFile>HeuristicLab.snk</AssemblyOriginatorKeyFile>
+    <FileUpgradeFlags>
+    </FileUpgradeFlags>
+    <OldToolsVersion>3.5</OldToolsVersion>
+    <UpgradeBackupLocation />
+    <PublishUrl>publish\</PublishUrl>
+    <Install>true</Install>
+    <InstallFrom>Disk</InstallFrom>
+    <UpdateEnabled>false</UpdateEnabled>
+    <UpdateMode>Foreground</UpdateMode>
+    <UpdateInterval>7</UpdateInterval>
+    <UpdateIntervalUnits>Days</UpdateIntervalUnits>
+    <UpdatePeriodically>false</UpdatePeriodically>
+    <UpdateRequired>false</UpdateRequired>
+    <MapFileExtensions>true</MapFileExtensions>
+    <ApplicationRevision>0</ApplicationRevision>
+    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
+    <IsWebBootstrapper>false</IsWebBootstrapper>
+    <UseApplicationTrust>false</UseApplicationTrust>
+    <BootstrapperEnabled>true</BootstrapperEnabled>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
+    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="HeuristicLab.Collections-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.Collections-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Common-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.Common-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Common.Resources-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.Common.Resources-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Core-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.Core-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Core.Views-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.Core.Views-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Data-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.Data-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Data.Views-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.Data.Views-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.MainForm-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.MainForm-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.MainForm.WindowsForms-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.MainForm.WindowsForms-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Operators-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.Operators-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Optimization-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.Optimization-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.PluginInfrastructure-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Random-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.Random-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Visualization.ChartControlsExtensions-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\Trunk\sources\bin\HeuristicLab.Visualization.ChartControlsExtensions-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Core">
+      <RequiredTargetFramework>3.5</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="System.Drawing" />
+    <Reference Include="System.Windows.Forms" />
+    <Reference Include="System.Windows.Forms.DataVisualization" />
+    <Reference Include="System.Xml.Linq">
+      <RequiredTargetFramework>3.5</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="System.Data.DataSetExtensions">
+      <RequiredTargetFramework>3.5</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="System.Data" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Plugin.cs" />
+    <Compile Include="SymbolicExpressionGrammarAllowedChildSymbolsControl.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="SymbolicExpressionGrammarAllowedChildSymbolsControl.Designer.cs">
+      <DependentUpon>SymbolicExpressionGrammarAllowedChildSymbolsControl.cs</DependentUpon>
+    </Compile>
+    <Compile Include="SymbolicExpressionGrammarEditorView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="SymbolicExpressionGrammarEditorView.Designer.cs">
+      <DependentUpon>SymbolicExpressionGrammarEditorView.cs</DependentUpon>
+    </Compile>
+    <Compile Include="SymbolicExpressionGrammarSampleExpressionTreeView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="SymbolicExpressionGrammarSampleExpressionTreeView.Designer.cs">
+      <DependentUpon>SymbolicExpressionGrammarSampleExpressionTreeView.cs</DependentUpon>
+    </Compile>
+    <Compile Include="SymbolicExpressionGrammarView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="SymbolicExpressionGrammarView.Designer.cs">
+      <DependentUpon>SymbolicExpressionGrammarView.cs</DependentUpon>
+    </Compile>
+    <Compile Include="SymbolView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="SymbolView.Designer.cs">
+      <DependentUpon>SymbolView.cs</DependentUpon>
+    </Compile>
+    <Compile Include="GraphicalSymbolicExpressionTreeView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="GraphicalSymbolicExpressionTreeView.Designer.cs">
+      <DependentUpon>GraphicalSymbolicExpressionTreeView.cs</DependentUpon>
+    </Compile>
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="SymbolicExpressionTreeChart.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="SymbolicExpressionTreeChart.Designer.cs">
+      <DependentUpon>SymbolicExpressionTreeChart.cs</DependentUpon>
+    </Compile>
+    <Compile Include="SymbolicExpressionView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="SymbolicExpressionView.Designer.cs">
+      <DependentUpon>SymbolicExpressionView.cs</DependentUpon>
+    </Compile>
+    <Compile Include="TreeLayout.cs" />
+    <Compile Include="VisualSymbolicExpressionTreeNode.cs" />
+    <Compile Include="VisualSymbolicExpressionTreeNodeConnection.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding\3.4\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.csproj">
+      <Project>{06D4A186-9319-48A0-BADE-A2058D462EEA}</Project>
+      <Name>HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4</Name>
+      <Private>False</Private>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Optimization.Views\3.3\HeuristicLab.Optimization.Views-3.3.csproj">
+      <Project>{662B4B15-8F4D-4AE5-B3EB-D91C215F5AF2}</Project>
+      <Name>HeuristicLab.Optimization.Views-3.3</Name>
+      <Private>False</Private>
+    </ProjectReference>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="HeuristicLab.snk" />
+    <None Include="Plugin.cs.frame" />
+    <None Include="Properties\AssemblyInfo.cs.frame" />
+  </ItemGroup>
+  <ItemGroup>
+    <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
+      <Visible>False</Visible>
+      <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
+      <Install>false</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
+      <Visible>False</Visible>
+      <ProductName>.NET Framework 3.5 SP1</ProductName>
+      <Install>true</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
+      <Visible>False</Visible>
+      <ProductName>Windows Installer 3.1</ProductName>
+      <Install>true</Install>
+    </BootstrapperPackage>
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="SymbolicExpressionTreeChart.resx">
+      <DependentUpon>SymbolicExpressionTreeChart.cs</DependentUpon>
+    </EmbeddedResource>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+  <PropertyGroup>
+    <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
+set ProjectDir=$(ProjectDir)
+set SolutionDir=$(SolutionDir)
+set Outdir=$(Outdir)
+
+call PreBuildEvent.cmd
+</PreBuildEvent>
+    <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
+export ProjectDir=$(ProjectDir)
+export SolutionDir=$(SolutionDir)
+
+$SolutionDir/PreBuildEvent.sh
+</PreBuildEvent>
+  </PropertyGroup>
+</Project>
Index: /branches/HeuristicLab.TreeLayout/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/Plugin.cs.frame
===================================================================
--- /branches/HeuristicLab.TreeLayout/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/Plugin.cs.frame	(revision 9650)
+++ /branches/HeuristicLab.TreeLayout/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/Plugin.cs.frame	(revision 9650)
@@ -0,0 +1,41 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2013 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;
+using System.Collections.Generic;
+using System.Text;
+using HeuristicLab.PluginInfrastructure;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views {
+  [Plugin("HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views","Provides views for the symbolic expression tree encoding.", "3.4.4.$WCREV$")]
+  [PluginFile("HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views-3.4.dll", PluginFileType.Assembly)]
+  [PluginDependency("HeuristicLab.Collections", "3.3")]
+  [PluginDependency("HeuristicLab.Common", "3.3")]
+  [PluginDependency("HeuristicLab.Common.Resources", "3.3")]
+  [PluginDependency("HeuristicLab.Core", "3.3")]
+  [PluginDependency("HeuristicLab.Core.Views", "3.3")]
+  [PluginDependency("HeuristicLab.Encodings.SymbolicExpressionTreeEncoding", "3.4")]
+  [PluginDependency("HeuristicLab.MainForm", "3.3")]
+  [PluginDependency("HeuristicLab.MainForm.WindowsForms", "3.3")]
+  [PluginDependency("HeuristicLab.Random","3.3")]
+  public class HeuristicLabEncodingsSymbolicExpressionTreeEncodingViewsPlugin : PluginBase {
+  }
+}
Index: /branches/HeuristicLab.TreeLayout/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/Properties/AssemblyInfo.cs.frame
===================================================================
--- /branches/HeuristicLab.TreeLayout/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/Properties/AssemblyInfo.cs.frame	(revision 9650)
+++ /branches/HeuristicLab.TreeLayout/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/Properties/AssemblyInfo.cs.frame	(revision 9650)
@@ -0,0 +1,47 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2013 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.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following 
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views")]
+[assembly: AssemblyDescription("Provides views for the symbolic expression tree encoding.")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("HeuristicLab")]
+[assembly: AssemblyCopyright("(c) 2002-2013 HEAL")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible 
+// to COM components.  If you need to access a type in this assembly from 
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("673A0460-B43A-4853-84D2-4125532B7F51")]
+
+[assembly: AssemblyVersion("3.4.0.0")]
+[assembly: AssemblyFileVersion("3.4.4.$WCREV$")]
Index: /branches/HeuristicLab.TreeLayout/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolView.Designer.cs
===================================================================
--- /branches/HeuristicLab.TreeLayout/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolView.Designer.cs	(revision 9650)
+++ /branches/HeuristicLab.TreeLayout/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolView.Designer.cs	(revision 9650)
@@ -0,0 +1,184 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2013 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
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views {
+  partial class SymbolView {
+    /// <summary> 
+    /// Required designer variable.
+    /// </summary>
+    private System.ComponentModel.IContainer components = null;
+
+    /// <summary> 
+    /// Clean up any resources being used.
+    /// </summary>
+    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+    protected override void Dispose(bool disposing) {
+      if (disposing && (components != null)) {
+        components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
+    #region Component Designer generated code
+
+    /// <summary> 
+    /// Required method for Designer support - do not modify 
+    /// the contents of this method with the code editor.
+    /// </summary>
+    private void InitializeComponent() {
+      this.initialFrequencyLabel = new System.Windows.Forms.Label();
+      this.initialFrequencyTextBox = new System.Windows.Forms.TextBox();
+      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();
+      // 
+      // nameTextBox
+      // 
+      this.errorProvider.SetIconAlignment(this.nameTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
+      this.errorProvider.SetIconPadding(this.nameTextBox, 2);
+      this.nameTextBox.Location = new System.Drawing.Point(93, 0);
+      this.nameTextBox.Size = new System.Drawing.Size(202, 20);
+      // 
+      // infoLabel
+      // 
+      this.infoLabel.Location = new System.Drawing.Point(301, 3);
+      // 
+      // initialFrequencyLabel
+      // 
+      this.initialFrequencyLabel.AutoSize = true;
+      this.initialFrequencyLabel.Location = new System.Drawing.Point(3, 29);
+      this.initialFrequencyLabel.Name = "initialFrequencyLabel";
+      this.initialFrequencyLabel.Size = new System.Drawing.Size(84, 13);
+      this.initialFrequencyLabel.TabIndex = 3;
+      this.initialFrequencyLabel.Text = "Initial frequency:";
+      this.toolTip.SetToolTip(this.initialFrequencyLabel, "Relative frequency of the symbol in randomly created trees");
+      // 
+      // initialFrequencyTextBox
+      // 
+      this.initialFrequencyTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+            | System.Windows.Forms.AnchorStyles.Right)));
+      this.errorProvider.SetIconAlignment(this.initialFrequencyTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
+      this.initialFrequencyTextBox.Location = new System.Drawing.Point(93, 26);
+      this.initialFrequencyTextBox.Name = "initialFrequencyTextBox";
+      this.initialFrequencyTextBox.Size = new System.Drawing.Size(227, 20);
+      this.initialFrequencyTextBox.TabIndex = 4;
+      this.initialFrequencyTextBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.initialFrequencyTextBox_KeyDown);
+      this.initialFrequencyTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.initialFrequencyTextBox_Validating);
+      this.initialFrequencyTextBox.Validated += new System.EventHandler(this.initialFrequencyTextBox_Validated);
+      // 
+      // enabledCheckBox
+      // 
+      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, "The minimum arity of the symbol");
+      // 
+      // 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, "The maximum arity of the symbol");
+      // 
+      // 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
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
+      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.enabledCheckBox);
+      this.Name = "SymbolView";
+      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);
+      this.Controls.SetChildIndex(this.nameTextBox, 0);
+      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
+      this.ResumeLayout(false);
+      this.PerformLayout();
+
+    }
+
+    #endregion
+
+    protected System.Windows.Forms.Label initialFrequencyLabel;
+    protected System.Windows.Forms.TextBox initialFrequencyTextBox;
+    protected 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/HeuristicLab.TreeLayout/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolView.cs
===================================================================
--- /branches/HeuristicLab.TreeLayout/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolView.cs	(revision 9650)
+++ /branches/HeuristicLab.TreeLayout/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolView.cs	(revision 9650)
@@ -0,0 +1,121 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2013 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;
+using System.ComponentModel;
+using System.Windows.Forms;
+using HeuristicLab.Core.Views;
+using HeuristicLab.MainForm;
+using HeuristicLab.MainForm.WindowsForms;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views {
+  [View("Symbol View")]
+  [Content(typeof(ISymbol), true)]
+  public partial class SymbolView : NamedItemView {
+    public new ISymbol Content {
+      get { return (ISymbol)base.Content; }
+      set { base.Content = value; }
+    }
+
+    public SymbolView() {
+      InitializeComponent();
+    }
+
+    protected override void RegisterContentEvents() {
+      base.RegisterContentEvents();
+      Content.Changed += new EventHandler(Content_Changed);
+    }
+
+    protected override void DeregisterContentEvents() {
+      base.DeregisterContentEvents();
+      Content.Changed -= new EventHandler(Content_Changed);
+    }
+
+    protected override void OnContentChanged() {
+      base.OnContentChanged();
+      UpdateControl();
+    }
+
+    protected override void SetEnabledStateOfControls() {
+      base.SetEnabledStateOfControls();
+      initialFrequencyTextBox.Enabled = Content != null && !Locked;
+      initialFrequencyTextBox.ReadOnly = ReadOnly;
+      enabledCheckBox.Enabled = Content != null && !Locked && !ReadOnly;
+    }
+
+    #region content event handlers
+    private void Content_Changed(object sender, EventArgs e) {
+      UpdateControl();
+    }
+    #endregion
+
+    #region control event handlers
+    private void initialFrequencyTextBox_KeyDown(object sender, KeyEventArgs e) {
+      if ((e.KeyCode == Keys.Enter) || (e.KeyCode == Keys.Return))
+        initialFrequencyLabel.Select();  // select label to validate data
+
+      if (e.KeyCode == Keys.Escape) {
+        initialFrequencyTextBox.Text = Content.InitialFrequency.ToString();
+        initialFrequencyLabel.Select();  // select label to validate data
+      }
+    }
+    private void initialFrequencyTextBox_Validating(object sender, CancelEventArgs e) {
+      double freq;
+      if (double.TryParse(initialFrequencyTextBox.Text, out freq) && freq >= 0.0) {
+        errorProvider.SetError(initialFrequencyTextBox, string.Empty);
+        e.Cancel = false;
+      } else {
+        errorProvider.SetError(initialFrequencyTextBox, "Invalid value");
+        e.Cancel = true;
+      }
+    }
+    private void initialFrequencyTextBox_Validated(object sender, EventArgs e) {
+      double freq;
+      if (double.TryParse(initialFrequencyTextBox.Text, out freq) && freq >= 0.0) {
+        Content.InitialFrequency = freq;
+      }
+    }
+
+    private void checkBoxEnabled_CheckedChanged(object sender, EventArgs e) {
+      if (Content != null)
+        Content.Enabled = enabledCheckBox.Checked;
+    }
+    #endregion
+
+    #region helpers
+    private void UpdateControl() {
+      if (Content == null) {
+        initialFrequencyTextBox.Text = string.Empty;
+        minimumArityTextBox.Text = string.Empty;
+        maximumArityTextBox.Text = string.Empty;
+        enabledCheckBox.Checked = false;
+      } else {
+        initialFrequencyTextBox.Text = Content.InitialFrequency.ToString();
+        minimumArityTextBox.Text = Content.MinimumArity.ToString();
+        maximumArityTextBox.Text = Content.MaximumArity.ToString();
+        enabledCheckBox.Checked = Content.Enabled;
+      }
+      SetEnabledStateOfControls();
+    }
+    #endregion
+
+  }
+}
Index: /branches/HeuristicLab.TreeLayout/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarAllowedChildSymbolsControl.Designer.cs
===================================================================
--- /branches/HeuristicLab.TreeLayout/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarAllowedChildSymbolsControl.Designer.cs	(revision 9650)
+++ /branches/HeuristicLab.TreeLayout/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarAllowedChildSymbolsControl.Designer.cs	(revision 9650)
@@ -0,0 +1,102 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2013 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
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views {
+  partial class SymbolicExpressionGrammarAllowedChildSymbolsControl {
+    /// <summary> 
+    /// Required designer variable.
+    /// </summary>
+    private System.ComponentModel.IContainer components = null;
+
+    /// <summary> 
+    /// Clean up any resources being used.
+    /// </summary>
+    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+    protected override void Dispose(bool disposing) {
+      if (disposing && (components != null)) {
+        components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
+    #region Component Designer generated code
+
+    /// <summary> 
+    /// Required method for Designer support - do not modify 
+    /// the contents of this method with the code editor.
+    /// </summary>
+    private void InitializeComponent() {
+      this.allowedChildSymbolsGroupBox = new System.Windows.Forms.GroupBox();
+      this.symbolicExpressionTreeChart = new HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views.SymbolicExpressionTreeChart();
+      this.allowedChildSymbolsGroupBox.SuspendLayout();
+      this.SuspendLayout();
+      // 
+      // allowedChildSymbolsGroupBox
+      // 
+      this.allowedChildSymbolsGroupBox.Controls.Add(this.symbolicExpressionTreeChart);
+      this.allowedChildSymbolsGroupBox.Dock = System.Windows.Forms.DockStyle.Fill;
+      this.allowedChildSymbolsGroupBox.Location = new System.Drawing.Point(0, 0);
+      this.allowedChildSymbolsGroupBox.Name = "allowedChildSymbolsGroupBox";
+      this.allowedChildSymbolsGroupBox.Size = new System.Drawing.Size(651, 405);
+      this.allowedChildSymbolsGroupBox.TabIndex = 2;
+      this.allowedChildSymbolsGroupBox.TabStop = false;
+      this.allowedChildSymbolsGroupBox.Text = "Allowed Child Symbols";
+      // 
+      // allowedChildSymbolsControl
+      // 
+      this.symbolicExpressionTreeChart.AllowDrop = true;
+      this.symbolicExpressionTreeChart.BackgroundColor = System.Drawing.Color.White;
+      this.symbolicExpressionTreeChart.Dock = System.Windows.Forms.DockStyle.Fill;
+      this.symbolicExpressionTreeChart.LineColor = System.Drawing.Color.Black;
+      this.symbolicExpressionTreeChart.Location = new System.Drawing.Point(3, 16);
+      this.symbolicExpressionTreeChart.Name = "allowedChildSymbolsControl";
+      this.symbolicExpressionTreeChart.Size = new System.Drawing.Size(645, 386);
+      this.symbolicExpressionTreeChart.Spacing = 5;
+      this.symbolicExpressionTreeChart.SuspendRepaint = false;
+      this.symbolicExpressionTreeChart.TabIndex = 0;
+      this.symbolicExpressionTreeChart.TextFont = new System.Drawing.Font("Times New Roman", 8F);
+      this.symbolicExpressionTreeChart.Tree = null;
+      this.symbolicExpressionTreeChart.SymbolicExpressionTreeNodeClicked += new System.Windows.Forms.MouseEventHandler(this.symbolicExpressionTreeChart_SymbolicExpressionTreeNodeClicked);
+      this.symbolicExpressionTreeChart.DragDrop += new System.Windows.Forms.DragEventHandler(this.symbolicExpressionTreeChart_DragDrop);
+      this.symbolicExpressionTreeChart.DragEnter += new System.Windows.Forms.DragEventHandler(this.symbolicExpressionTreeChart_DragEnter);
+      this.symbolicExpressionTreeChart.DragOver += new System.Windows.Forms.DragEventHandler(this.symbolicExpressionTreeChart_DragOver);
+      this.symbolicExpressionTreeChart.Paint += new System.Windows.Forms.PaintEventHandler(this.allowedChildSymbolsControl_Paint);
+      this.symbolicExpressionTreeChart.KeyDown += new System.Windows.Forms.KeyEventHandler(this.symbolicExpressionTreeChart_KeyDown);
+      this.symbolicExpressionTreeChart.MouseDown += new System.Windows.Forms.MouseEventHandler(this.allowedChildSymbolsControl_MouseDown);
+      // 
+      // SymbolicExpressionGrammarAllowedChildSymbolsControl
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
+      this.Controls.Add(this.allowedChildSymbolsGroupBox);
+      this.Name = "SymbolicExpressionGrammarAllowedChildSymbolsControl";
+      this.Size = new System.Drawing.Size(651, 405);
+      this.allowedChildSymbolsGroupBox.ResumeLayout(false);
+      this.ResumeLayout(false);
+
+    }
+
+    #endregion
+
+    private System.Windows.Forms.GroupBox allowedChildSymbolsGroupBox;
+    private SymbolicExpressionTreeChart symbolicExpressionTreeChart;
+  }
+}
Index: /branches/HeuristicLab.TreeLayout/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarAllowedChildSymbolsControl.cs
===================================================================
--- /branches/HeuristicLab.TreeLayout/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarAllowedChildSymbolsControl.cs	(revision 9650)
+++ /branches/HeuristicLab.TreeLayout/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarAllowedChildSymbolsControl.cs	(revision 9650)
@@ -0,0 +1,341 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2013 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;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Linq;
+using System.Windows.Forms;
+using HeuristicLab.Collections;
+using HeuristicLab.Common;
+using HeuristicLab.PluginInfrastructure;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views {
+  public sealed partial class SymbolicExpressionGrammarAllowedChildSymbolsControl : UserControl {
+    private ObservableList<ISymbolicExpressionTreeNode> selectedSymbolicExpressionTreeNodes;
+
+    public SymbolicExpressionGrammarAllowedChildSymbolsControl() {
+      InitializeComponent();
+      selectedSymbolicExpressionTreeNodes = new ObservableList<ISymbolicExpressionTreeNode>();
+    }
+
+    private ISymbolicExpressionGrammar grammar;
+    public ISymbolicExpressionGrammar Grammar {
+      get { return grammar; }
+      set {
+        if (grammar != value) {
+          if (grammar != null) DeregisterGrammarEvents();
+          grammar = value;
+          if (grammar != null) RegisterGrammarEvents();
+          OnGrammarChanged();
+        }
+      }
+    }
+
+    private ISymbol symbol;
+    public ISymbol Symbol {
+      get { return symbol; }
+      set {
+        if (symbol != value) {
+          if (value != null && grammar == null) throw new InvalidOperationException("grammar is null");
+          if (value != null && !grammar.ContainsSymbol(value)) throw new ArgumentException("grammar does not contain symbol.");
+          symbol = value;
+          OnSymbolChanged();
+        }
+      }
+    }
+
+    private void RegisterGrammarEvents() {
+      grammar.Changed += new EventHandler(Grammar_Changed);
+      grammar.ReadOnlyChanged += new EventHandler(Grammar_ReadOnlyChanged);
+    }
+    private void DeregisterGrammarEvents() {
+      grammar.Changed -= new EventHandler(Grammar_Changed);
+      grammar.ReadOnlyChanged -= new EventHandler(Grammar_ReadOnlyChanged);
+    }
+
+    private void Grammar_Changed(object sender, EventArgs e) {
+      if (Grammar == null) return;
+      if (Symbol == null) return;
+      if (Symbol != null && !Grammar.ContainsSymbol(Symbol)) Symbol = null;
+      else BuildAllowedChildSymbolsTree();
+    }
+
+    private void Grammar_ReadOnlyChanged(object sender, EventArgs e) {
+      if (InvokeRequired) Invoke((MethodInvoker)BuildAllowedChildSymbolsTree);
+      else BuildAllowedChildSymbolsTree();
+    }
+
+    private void OnGrammarChanged() {
+      if (Grammar == null) {
+        symbolicExpressionTreeChart.Tree = null;
+        Symbol = null;
+      }
+    }
+    private void OnSymbolChanged() {
+      if (Symbol == null) symbolicExpressionTreeChart.Tree = null;
+      else BuildAllowedChildSymbolsTree();
+    }
+
+    private void BuildAllowedChildSymbolsTree() {
+      if (Symbol == null) {
+        symbolicExpressionTreeChart.Tree = null;
+        return;
+      }
+
+      var tree = new SymbolicExpressionTree(new SymbolicExpressionTreeNode(Symbol));
+      symbolicExpressionTreeChart.SuspendRepaint = true;
+      if (Grammar.GetMaximumSubtreeCount(Symbol) > 0) {
+        for (int i = 0; i < Grammar.GetMaximumSubtreeCount(Symbol); i++) {
+          var node = new DummySymbol("Subtree " + i).CreateTreeNode();
+          var groupSymbols = grammar.GetAllowedChildSymbols(Symbol, i).OfType<GroupSymbol>().ToList();
+          foreach (var childSymbol in Grammar.GetAllowedChildSymbols(Symbol, i)) {
+            if (!groupSymbols.Any(g => g != childSymbol && g.Flatten().Contains(childSymbol)))
+              node.AddSubtree(new SymbolicExpressionTreeNode(childSymbol));
+          }
+          tree.Root.AddSubtree(node);
+        }
+      }
+      symbolicExpressionTreeChart.Tree = tree;
+
+      foreach (var subtreeNode in tree.Root.Subtrees) {
+        foreach (var allowedChildNode in subtreeNode.Subtrees) {
+          var visualLine = symbolicExpressionTreeChart.GetVisualSymbolicExpressionTreeNodeConnection(subtreeNode, allowedChildNode);
+          visualLine.DashStyle = System.Drawing.Drawing2D.DashStyle.Dot;
+        }
+      }
+
+      for (int i = Grammar.GetMinimumSubtreeCount(symbol); i < Grammar.GetMaximumSubtreeCount(symbol); i++) {
+        var subtreeNode = tree.Root.GetSubtree(i);
+        var visualTreeNode = symbolicExpressionTreeChart.GetVisualSymbolicExpressionTreeNode(subtreeNode);
+        visualTreeNode.TextColor = Color.Gray;
+        visualTreeNode.LineColor = Color.LightGray;
+
+        var visualLine = symbolicExpressionTreeChart.GetVisualSymbolicExpressionTreeNodeConnection(tree.Root, subtreeNode);
+        visualLine.LineColor = Color.LightGray;
+
+        foreach (var allowedChildNode in subtreeNode.Subtrees) {
+          visualTreeNode = symbolicExpressionTreeChart.GetVisualSymbolicExpressionTreeNode(allowedChildNode);
+          visualTreeNode.TextColor = Color.Gray;
+          visualTreeNode.LineColor = Color.LightGray;
+
+          visualLine = symbolicExpressionTreeChart.GetVisualSymbolicExpressionTreeNodeConnection(subtreeNode, allowedChildNode);
+          visualLine.LineColor = Color.LightGray;
+        }
+      }
+
+      symbolicExpressionTreeChart.SuspendRepaint = false;
+      UpdateSelectedSymbolicExpressionTreeNodes();
+    }
+
+    private void UpdateSelectedSymbolicExpressionTreeNodes() {
+      foreach (var node in symbolicExpressionTreeChart.Tree.IterateNodesPrefix()) {
+        var visualNode = symbolicExpressionTreeChart.GetVisualSymbolicExpressionTreeNode(node);
+        if (!selectedSymbolicExpressionTreeNodes.Contains(node)) visualNode.FillColor = Color.White;
+        else visualNode.FillColor = Color.LightSteelBlue;
+      }
+      symbolicExpressionTreeChart.Repaint();
+    }
+
+    private void symbolicExpressionTreeChart_SymbolicExpressionTreeNodeClicked(object sender, MouseEventArgs e) {
+      if (Grammar.ReadOnly) return;
+      if ((Control.ModifierKeys & Keys.Control) == 0)
+        selectedSymbolicExpressionTreeNodes.Clear();
+
+      VisualSymbolicExpressionTreeNode clickedNode = (VisualSymbolicExpressionTreeNode)sender;
+      var selectedNode = clickedNode.SymbolicExpressionTreeNode;
+      if (selectedNode.SubtreeCount == 0) {
+        if (!selectedSymbolicExpressionTreeNodes.Contains(selectedNode))
+          selectedSymbolicExpressionTreeNodes.Add(selectedNode);
+        else
+          selectedSymbolicExpressionTreeNodes.Remove(selectedNode);
+      }
+
+      UpdateSelectedSymbolicExpressionTreeNodes();
+    }
+
+    private void symbolicExpressionTreeChart_KeyDown(object sender, KeyEventArgs e) {
+      if (Grammar.ReadOnly) return;
+      if (e.KeyCode == Keys.Delete) {
+        var root = symbolicExpressionTreeChart.Tree.Root;
+        Grammar.StartGrammarManipulation();
+        foreach (var node in selectedSymbolicExpressionTreeNodes) {
+          int argIndex = root.IndexOfSubtree(node.Parent);
+          Grammar.RemoveAllowedChildSymbol(root.Symbol, node.Symbol, argIndex);
+        }
+
+        selectedSymbolicExpressionTreeNodes.Clear();
+        Grammar.FinishedGrammarManipulation();
+      }
+    }
+
+    #region drag & drop operations
+    private bool validDragOperation;
+    private void symbolicExpressionTreeChart_DragEnter(object sender, DragEventArgs e) {
+      validDragOperation = false;
+      if (Grammar.ReadOnly) return;
+
+      var data = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat);
+      var symbol = data as ISymbol;
+      var symbols = data as IEnumerable<ISymbol>;
+      if (symbol != null && !(symbol is IReadOnlySymbol) && Grammar.ContainsSymbol(symbol)) validDragOperation = true;
+      else if (symbols != null && symbols.All(s => !(symbol is IReadOnlySymbol) && Grammar.ContainsSymbol(s))) validDragOperation = true;
+    }
+
+    private void symbolicExpressionTreeChart_DragOver(object sender, DragEventArgs e) {
+      e.Effect = DragDropEffects.None;
+      if (validDragOperation) {
+        Point coordinates = symbolicExpressionTreeChart.PointToClient(new Point(e.X, e.Y));
+        var visualNode = symbolicExpressionTreeChart.FindVisualSymbolicExpressionTreeNodeAt(coordinates.X, coordinates.Y);
+        if (visualNode != null) {
+          var node = visualNode.SymbolicExpressionTreeNode;
+          var root = symbolicExpressionTreeChart.Tree.Root;
+          if (node == root || node.Parent == root) e.Effect = DragDropEffects.Copy;
+        }
+      }
+    }
+
+    private void symbolicExpressionTreeChart_DragDrop(object sender, DragEventArgs e) {
+      Point coordinates = symbolicExpressionTreeChart.PointToClient(new Point(e.X, e.Y));
+      var node = symbolicExpressionTreeChart.FindVisualSymbolicExpressionTreeNodeAt(coordinates.X, coordinates.Y);
+      var root = symbolicExpressionTreeChart.Tree.Root;
+
+      var data = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat);
+      var symbol = data as ISymbol;
+      var symbols = data as IEnumerable<ISymbol>;
+
+      if (node.SymbolicExpressionTreeNode == root) {
+        if (symbol != null)
+          Grammar.AddAllowedChildSymbol(root.Symbol, symbol);
+        else if (symbols != null)
+          foreach (var s in symbols) Grammar.AddAllowedChildSymbol(root.Symbol, s);
+      } else {
+        int argumentIndex = root.IndexOfSubtree(node.SymbolicExpressionTreeNode);
+        if (symbol != null)
+          Grammar.AddAllowedChildSymbol(root.Symbol, symbol, argumentIndex);
+        else if (symbols != null)
+          foreach (var s in symbols) Grammar.AddAllowedChildSymbol(root.Symbol, s, argumentIndex);
+      }
+      BuildAllowedChildSymbolsTree();
+    }
+    #endregion
+
+    #region draw and handle root node with buttons to manipulate the subtree count
+    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 (Grammar == null) return;
+      if (symbolicExpressionTreeChart.Tree == null) return;
+
+      var rootNode = symbolicExpressionTreeChart.Tree.Root;
+      var visualRootNode = symbolicExpressionTreeChart.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 = Grammar.ReadOnly || Grammar.GetMaximumSubtreeCount(rootNode.Symbol) == Grammar.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 = Grammar.ReadOnly || Grammar.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 = Grammar.ReadOnly || Grammar.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 = Grammar.ReadOnly || Grammar.GetMaximumSubtreeCount(rootNode.Symbol) == Grammar.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;
+        }
+      }
+    }
+
+    private void allowedChildSymbolsControl_MouseDown(object sender, MouseEventArgs e) {
+      if (Grammar == null || Grammar.ReadOnly) return;
+      if (symbolicExpressionTreeChart.Tree == null) return;
+
+      var pointF = new PointF(e.X, e.Y);
+      var rootSymbol = symbolicExpressionTreeChart.Tree.Root.Symbol;
+      int minimumSubtreeCount = Grammar.GetMinimumSubtreeCount(rootSymbol);
+      int maximumSubtreecount = Grammar.GetMaximumSubtreeCount(rootSymbol);
+
+      bool changed = true;
+      if (increaseMinimumSubtreeCountRectangle.Contains(pointF))
+        Grammar.SetSubtreeCount(rootSymbol, minimumSubtreeCount + 1, maximumSubtreecount);
+      else if (decreaseMinimumSubtreeCountRectangle.Contains(pointF))
+        Grammar.SetSubtreeCount(rootSymbol, minimumSubtreeCount - 1, maximumSubtreecount);
+      else if (increaseMaximumSubtreeCountRectangle.Contains(pointF))
+        Grammar.SetSubtreeCount(rootSymbol, minimumSubtreeCount, maximumSubtreecount + 1);
+      else if (decreaseMaximumSubtreeCountRectangle.Contains(pointF))
+        Grammar.SetSubtreeCount(rootSymbol, minimumSubtreeCount, maximumSubtreecount - 1);
+      else
+        changed = false;
+
+      if (changed) BuildAllowedChildSymbolsTree();
+    }
+    #endregion
+
+  }
+
+  [NonDiscoverableType]
+  internal class DummySymbol : Symbol {
+    private const int minimumArity = 1;
+    private const int maximumArity = byte.MaxValue;
+
+    public override int MinimumArity {
+      get { return minimumArity; }
+    }
+    public override int MaximumArity {
+      get { return maximumArity; }
+    }
+
+    public DummySymbol(DummySymbol original, Cloner cloner) : base(original, cloner) { }
+    public DummySymbol(string name) : base(name, "DummySymbol for views") { }
+    public override IDeepCloneable Clone(Cloner cloner) { return new DummySymbol(this, cloner); }
+  }
+}
Index: /branches/HeuristicLab.TreeLayout/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarEditorView.Designer.cs
===================================================================
--- /branches/HeuristicLab.TreeLayout/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarEditorView.Designer.cs	(revision 9650)
+++ /branches/HeuristicLab.TreeLayout/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarEditorView.Designer.cs	(revision 9650)
@@ -0,0 +1,309 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2013 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
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views {
+  partial class SymbolicExpressionGrammarEditorView {
+    /// <summary> 
+    /// Required designer variable.
+    /// </summary>
+    private System.ComponentModel.IContainer components = null;
+
+    /// <summary> 
+    /// Clean up any resources being used.
+    /// </summary>
+    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+    protected override void Dispose(bool disposing) {
+      if (disposing && (components != null)) {
+        components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
+    #region Component Designer generated code
+
+    /// <summary> 
+    /// Required method for Designer support - do not modify 
+    /// the contents of this method with the code editor.
+    /// </summary>
+    private void InitializeComponent() {
+      this.components = new System.ComponentModel.Container();
+      System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SymbolicExpressionGrammarEditorView));
+      this.grpSymbols = new System.Windows.Forms.GroupBox();
+      this.splitContainer1 = new System.Windows.Forms.SplitContainer();
+      this.copyButton = new System.Windows.Forms.Button();
+      this.showDetailsCheckBox = new System.Windows.Forms.CheckBox();
+      this.removeButton = new System.Windows.Forms.Button();
+      this.addButton = new System.Windows.Forms.Button();
+      this.symbolsTreeView = new HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views.CheckBoxTreeView();
+      this.imageList = new System.Windows.Forms.ImageList(this.components);
+      this.splitContainer2 = new System.Windows.Forms.SplitContainer();
+      this.allowedChildSymbolsControl = new HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views.SymbolicExpressionGrammarAllowedChildSymbolsControl();
+      this.symbolDetailsGroupBox = new System.Windows.Forms.GroupBox();
+      this.symbolDetailsViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
+      this.showSampleTreeButton = new System.Windows.Forms.Button();
+      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
+      this.grpSymbols.SuspendLayout();
+      ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
+      this.splitContainer1.Panel1.SuspendLayout();
+      this.splitContainer1.Panel2.SuspendLayout();
+      this.splitContainer1.SuspendLayout();
+      ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).BeginInit();
+      this.splitContainer2.Panel1.SuspendLayout();
+      this.splitContainer2.Panel2.SuspendLayout();
+      this.splitContainer2.SuspendLayout();
+      this.symbolDetailsGroupBox.SuspendLayout();
+      this.SuspendLayout();
+      // 
+      // nameTextBox
+      // 
+      this.errorProvider.SetIconAlignment(this.nameTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
+      this.errorProvider.SetIconPadding(this.nameTextBox, 2);
+      this.nameTextBox.Size = new System.Drawing.Size(686, 20);
+      // 
+      // infoLabel
+      // 
+      this.infoLabel.Location = new System.Drawing.Point(750, 3);
+      // 
+      // grpSymbols
+      // 
+      this.grpSymbols.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+            | System.Windows.Forms.AnchorStyles.Left)
+            | System.Windows.Forms.AnchorStyles.Right)));
+      this.grpSymbols.Controls.Add(this.splitContainer1);
+      this.grpSymbols.Location = new System.Drawing.Point(0, 26);
+      this.grpSymbols.Name = "grpSymbols";
+      this.grpSymbols.Size = new System.Drawing.Size(769, 378);
+      this.grpSymbols.TabIndex = 3;
+      this.grpSymbols.TabStop = false;
+      this.grpSymbols.Text = "Symbols";
+      // 
+      // splitContainer1
+      // 
+      this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
+      this.splitContainer1.Location = new System.Drawing.Point(3, 16);
+      this.splitContainer1.Name = "splitContainer1";
+      // 
+      // splitContainer1.Panel1
+      // 
+      this.splitContainer1.Panel1.Controls.Add(this.showSampleTreeButton);
+      this.splitContainer1.Panel1.Controls.Add(this.copyButton);
+      this.splitContainer1.Panel1.Controls.Add(this.showDetailsCheckBox);
+      this.splitContainer1.Panel1.Controls.Add(this.removeButton);
+      this.splitContainer1.Panel1.Controls.Add(this.addButton);
+      this.splitContainer1.Panel1.Controls.Add(this.symbolsTreeView);
+      // 
+      // splitContainer1.Panel2
+      // 
+      this.splitContainer1.Panel2.Controls.Add(this.splitContainer2);
+      this.splitContainer1.Size = new System.Drawing.Size(763, 359);
+      this.splitContainer1.SplitterDistance = 191;
+      this.splitContainer1.TabIndex = 0;
+      // 
+      // copyButton
+      // 
+      this.copyButton.Enabled = false;
+      this.copyButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Copy;
+      this.copyButton.Location = new System.Drawing.Point(33, 3);
+      this.copyButton.Name = "copyButton";
+      this.copyButton.Size = new System.Drawing.Size(24, 24);
+      this.copyButton.TabIndex = 8;
+      this.toolTip.SetToolTip(this.copyButton, "Copy Symbol");
+      this.copyButton.UseVisualStyleBackColor = true;
+      this.copyButton.Click += new System.EventHandler(this.copyButton_Click);
+      // 
+      // 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(93, 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(63, 3);
+      this.removeButton.Name = "removeButton";
+      this.removeButton.Size = new System.Drawing.Size(24, 24);
+      this.removeButton.TabIndex = 6;
+      this.toolTip.SetToolTip(this.removeButton, "Remove Symbol");
+      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 Symbol");
+      this.addButton.UseVisualStyleBackColor = true;
+      this.addButton.Click += new System.EventHandler(this.addButton_Click);
+      // 
+      // symbolsTreeView
+      // 
+      this.symbolsTreeView.AllowDrop = true;
+      this.symbolsTreeView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+            | System.Windows.Forms.AnchorStyles.Left)
+            | System.Windows.Forms.AnchorStyles.Right)));
+      this.symbolsTreeView.CheckBoxes = true;
+      this.symbolsTreeView.HideSelection = false;
+      this.symbolsTreeView.ImageIndex = 0;
+      this.symbolsTreeView.ImageList = this.imageList;
+      this.symbolsTreeView.Location = new System.Drawing.Point(3, 28);
+      this.symbolsTreeView.Name = "symbolsTreeView";
+      this.symbolsTreeView.SelectedImageIndex = 0;
+      this.symbolsTreeView.Size = new System.Drawing.Size(185, 299);
+      this.symbolsTreeView.TabIndex = 0;
+      this.symbolsTreeView.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.symbolsTreeView_AfterCheck);
+      this.symbolsTreeView.BeforeCheck += new System.Windows.Forms.TreeViewCancelEventHandler(symbolsTreeView_BeforeCheck);
+      this.symbolsTreeView.ItemDrag += new System.Windows.Forms.ItemDragEventHandler(this.symbolsTreeView_ItemDrag);
+      this.symbolsTreeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.symbolsTreeView_AfterSelect);
+      this.symbolsTreeView.DragDrop += new System.Windows.Forms.DragEventHandler(this.symbolsTreeView_DragDrop);
+      this.symbolsTreeView.DragEnter += new System.Windows.Forms.DragEventHandler(this.symbolsTreeView_DragEnter);
+      this.symbolsTreeView.DragOver += new System.Windows.Forms.DragEventHandler(this.symbolsTreeView_DragOver);
+      this.symbolsTreeView.KeyDown += new System.Windows.Forms.KeyEventHandler(this.symbolsTreeView_KeyDown);
+      this.symbolsTreeView.MouseDown += new System.Windows.Forms.MouseEventHandler(this.symbolsTreeView_MouseDown);
+      this.symbolsTreeView.NodeMouseDoubleClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(symbolsTreeView_NodeMouseDoubleClick);
+      // 
+      // imageList
+      // 
+      this.imageList.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;
+      this.imageList.ImageSize = new System.Drawing.Size(16, 16);
+      this.imageList.TransparentColor = System.Drawing.Color.Transparent;
+      // 
+      // splitContainer2
+      // 
+      this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill;
+      this.splitContainer2.Location = new System.Drawing.Point(0, 0);
+      this.splitContainer2.Name = "splitContainer2";
+      this.splitContainer2.Orientation = System.Windows.Forms.Orientation.Horizontal;
+      // 
+      // splitContainer2.Panel1
+      // 
+      this.splitContainer2.Panel1.Controls.Add(this.allowedChildSymbolsControl);
+      // 
+      // splitContainer2.Panel2
+      // 
+      this.splitContainer2.Panel2.Controls.Add(this.symbolDetailsGroupBox);
+      this.splitContainer2.Size = new System.Drawing.Size(568, 359);
+      this.splitContainer2.SplitterDistance = 165;
+      this.splitContainer2.TabIndex = 0;
+      // 
+      // allowedChildSymbolsControl
+      // 
+      this.allowedChildSymbolsControl.AllowDrop = true;
+      this.allowedChildSymbolsControl.Dock = System.Windows.Forms.DockStyle.Fill;
+      this.allowedChildSymbolsControl.Grammar = null;
+      this.allowedChildSymbolsControl.Location = new System.Drawing.Point(0, 0);
+      this.allowedChildSymbolsControl.Name = "allowedChildSymbolsControl";
+      this.allowedChildSymbolsControl.Size = new System.Drawing.Size(568, 165);
+      this.allowedChildSymbolsControl.Symbol = null;
+      this.allowedChildSymbolsControl.TabIndex = 0;
+      // 
+      // symbolDetailsGroupBox
+      // 
+      this.symbolDetailsGroupBox.Controls.Add(this.symbolDetailsViewHost);
+      this.symbolDetailsGroupBox.Dock = System.Windows.Forms.DockStyle.Fill;
+      this.symbolDetailsGroupBox.Location = new System.Drawing.Point(0, 0);
+      this.symbolDetailsGroupBox.Name = "symbolDetailsGroupBox";
+      this.symbolDetailsGroupBox.Size = new System.Drawing.Size(568, 190);
+      this.symbolDetailsGroupBox.TabIndex = 1;
+      this.symbolDetailsGroupBox.TabStop = false;
+      this.symbolDetailsGroupBox.Text = "Symbol Details";
+      // 
+      // 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(3, 16);
+      this.symbolDetailsViewHost.Name = "symbolDetailsViewHost";
+      this.symbolDetailsViewHost.ReadOnly = false;
+      this.symbolDetailsViewHost.Size = new System.Drawing.Size(562, 171);
+      this.symbolDetailsViewHost.TabIndex = 1;
+      this.symbolDetailsViewHost.ViewsLabelVisible = true;
+      this.symbolDetailsViewHost.ViewType = null;
+      // 
+      // showSampleTreeButton
+      // 
+      this.showSampleTreeButton.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
+            | System.Windows.Forms.AnchorStyles.Right)));
+      this.showSampleTreeButton.Location = new System.Drawing.Point(3, 333);
+      this.showSampleTreeButton.Name = "showSampleTreeButton";
+      this.showSampleTreeButton.Size = new System.Drawing.Size(185, 23);
+      this.showSampleTreeButton.TabIndex = 9;
+      this.showSampleTreeButton.Text = "Show Sample Tree";
+      this.showSampleTreeButton.UseVisualStyleBackColor = true;
+      this.showSampleTreeButton.Click += new System.EventHandler(this.showSampleTreeButton_Click);
+      // 
+      // SymbolicExpressionGrammarEditorView
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
+      this.Controls.Add(this.grpSymbols);
+      this.Name = "SymbolicExpressionGrammarEditorView";
+      this.Size = new System.Drawing.Size(769, 404);
+      this.Controls.SetChildIndex(this.grpSymbols, 0);
+      this.Controls.SetChildIndex(this.nameLabel, 0);
+      this.Controls.SetChildIndex(this.nameTextBox, 0);
+      this.Controls.SetChildIndex(this.infoLabel, 0);
+      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
+      this.grpSymbols.ResumeLayout(false);
+      this.splitContainer1.Panel1.ResumeLayout(false);
+      this.splitContainer1.Panel2.ResumeLayout(false);
+      ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
+      this.splitContainer1.ResumeLayout(false);
+      this.splitContainer2.Panel1.ResumeLayout(false);
+      this.splitContainer2.Panel2.ResumeLayout(false);
+      ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit();
+      this.splitContainer2.ResumeLayout(false);
+      this.symbolDetailsGroupBox.ResumeLayout(false);
+      this.ResumeLayout(false);
+      this.PerformLayout();
+
+    }
+    #endregion
+
+    private System.Windows.Forms.GroupBox grpSymbols;
+    private System.Windows.Forms.SplitContainer splitContainer1;
+    private CheckBoxTreeView symbolsTreeView;
+    private System.Windows.Forms.SplitContainer splitContainer2;
+    private System.Windows.Forms.ImageList imageList;
+    protected System.Windows.Forms.CheckBox showDetailsCheckBox;
+    protected System.Windows.Forms.Button removeButton;
+    protected System.Windows.Forms.Button addButton;
+    private System.Windows.Forms.GroupBox symbolDetailsGroupBox;
+    private MainForm.WindowsForms.ViewHost symbolDetailsViewHost;
+    protected System.Windows.Forms.Button copyButton;
+    private SymbolicExpressionGrammarAllowedChildSymbolsControl allowedChildSymbolsControl;
+    private System.Windows.Forms.Button showSampleTreeButton;
+  }
+}
Index: /branches/HeuristicLab.TreeLayout/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarEditorView.cs
===================================================================
--- /branches/HeuristicLab.TreeLayout/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarEditorView.cs	(revision 9650)
+++ /branches/HeuristicLab.TreeLayout/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarEditorView.cs	(revision 9650)
@@ -0,0 +1,450 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2013 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;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Linq;
+using System.Windows.Forms;
+using HeuristicLab.Common;
+using HeuristicLab.Core.Views;
+using HeuristicLab.MainForm;
+using HeuristicLab.PluginInfrastructure;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views {
+  [View("Symbolic Expression Grammar Editor")]
+  [Content(typeof(ISymbolicExpressionGrammar), true)]
+  public partial class SymbolicExpressionGrammarEditorView : NamedItemView {
+    public SymbolicExpressionGrammarEditorView() {
+      InitializeComponent();
+    }
+
+    public override bool ReadOnly {
+      get {
+        if ((Content != null) && Content.ReadOnly) return true;
+        return base.ReadOnly;
+      }
+      set {
+        if ((Content != null) && Content.ReadOnly) base.ReadOnly = true;
+        else base.ReadOnly = value;
+      }
+    }
+
+    public new ISymbolicExpressionGrammar Content {
+      get { return (ISymbolicExpressionGrammar)base.Content; }
+      set { base.Content = value; }
+    }
+
+    private Color treeViewBackColor = Color.Empty;
+    protected override void SetEnabledStateOfControls() {
+      base.SetEnabledStateOfControls();
+      if (Content == null || Content.ReadOnly || ReadOnly || Locked) {
+        addButton.Enabled = false;
+        removeButton.Enabled = false;
+        copyButton.Enabled = false;
+        treeViewBackColor = symbolsTreeView.BackColor;
+        symbolsTreeView.BackColor = Color.FromArgb(255, 240, 240, 240);
+      } else {
+        addButton.Enabled = true;
+        if (symbolsTreeView.SelectedNode != null && !(symbolsTreeView.SelectedNode.Tag is IReadOnlySymbol)) {
+          removeButton.Enabled = true;
+          copyButton.Enabled = true;
+        }
+        treeViewBackColor = Color.Empty;
+        symbolsTreeView.BackColor = treeViewBackColor;
+      }
+    }
+
+    protected override void OnContentChanged() {
+      base.OnContentChanged();
+      if (Content != null) {
+        symbolsTreeView.Nodes.Clear();
+        UpdateSymbolsTreeView();
+
+        symbolsTreeView.CollapseAll();
+        foreach (var node in IterateTreeNodes())
+          if (node.Checked) node.Expand();
+
+        allowedChildSymbolsControl.Grammar = Content;
+        allowedChildSymbolsControl.Symbol = null;
+        symbolDetailsViewHost.Content = null;
+      } else {
+        symbolsTreeView.Nodes.Clear();
+        allowedChildSymbolsControl.Grammar = null;
+        symbolDetailsViewHost.Content = null;
+      }
+    }
+
+    #region events
+    protected override void RegisterContentEvents() {
+      base.RegisterContentEvents();
+      Content.ReadOnlyChanged += new System.EventHandler(Content_ReadOnlyChanged);
+      Content.Changed += new System.EventHandler(Content_Changed);
+    }
+    protected override void DeregisterContentEvents() {
+      Content.ReadOnlyChanged -= new System.EventHandler(Content_ReadOnlyChanged);
+      Content.Changed -= new System.EventHandler(Content_Changed);
+      base.DeregisterContentEvents();
+    }
+
+    private void Content_ReadOnlyChanged(object sender, EventArgs e) {
+      ReadOnly = Content.ReadOnly;
+    }
+
+    private void Content_Changed(object sender, EventArgs e) {
+      ISymbol symbol = null;
+      if (symbolsTreeView.SelectedNode != null)
+        symbol = (ISymbol)symbolsTreeView.SelectedNode.Tag;
+
+      allowedChildSymbolsControl.Grammar = Content;
+
+      UpdateSymbolsTreeView();
+      if (symbol != null && Content.ContainsSymbol(symbol)) {
+        symbolsTreeView.SelectedNode = IterateTreeNodes().Where(n => n.Tag == symbol).ToList().FirstOrDefault();
+        UpdateSymbolDetailsViews();
+      }
+    }
+    #endregion
+
+    private void UpdateSymbolsTreeView() {
+      var symbols = Content.Symbols.ToList();
+      foreach (var treeNode in IterateTreeNodes().ToList()) {
+        var symbol = treeNode.Tag as ISymbol;
+        if (!symbols.Contains(symbol))
+          treeNode.Remove();
+      }
+
+      var groupSymbols = symbols.OfType<GroupSymbol>().ToList();
+      var topLevelSymbols = Content.Symbols.Where(s => !groupSymbols.Any(g => g.Symbols.Contains(s)));
+      UpdateChildTreeNodes(symbolsTreeView.Nodes, topLevelSymbols);
+
+      RebuildImageList();
+    }
+
+    private void UpdateChildTreeNodes(TreeNodeCollection collection, IEnumerable<ISymbol> symbols) {
+      foreach (ISymbol symbol in symbols) {
+        if (symbol is ProgramRootSymbol) continue;
+        if (symbol is Defun) continue;
+
+        TreeNode node = collection.Cast<TreeNode>().Where(n => n.Tag == symbol).FirstOrDefault();
+        if (node == null) {
+          node = new TreeNode();
+          node.Tag = symbol;
+          collection.Add(node);
+        }
+        node.Checked = symbol.Enabled;
+        node.Text = symbol.Name;
+
+        var groupSymbol = symbol as GroupSymbol;
+        if (groupSymbol != null) UpdateChildTreeNodes(node.Nodes, groupSymbol.Symbols);
+      }
+    }
+
+    private void symbolsTreeView_AfterSelect(object sender, TreeViewEventArgs e) {
+      if (e.Action != TreeViewAction.Unknown) UpdateSymbolDetailsViews();
+      SetEnabledStateOfControls();
+    }
+
+    private void symbolsTreeView_BeforeCheck(object sender, TreeViewCancelEventArgs e) {
+      if (e.Action == TreeViewAction.Unknown) return;
+      e.Cancel = Content == null || Content.ReadOnly || ReadOnly || Locked;
+    }
+
+    private void symbolsTreeView_AfterCheck(object sender, TreeViewEventArgs e) {
+      if (e.Action == TreeViewAction.Unknown) return;
+      Content.StartGrammarManipulation();
+      allowedChildSymbolsControl.Symbol = null;
+      var symbol = (ISymbol)e.Node.Tag;
+      symbol.Enabled = e.Node.Checked;
+      foreach (var node in IterateTreeNodes())
+        node.Checked = ((ISymbol)node.Tag).Enabled;
+
+      Content.FinishedGrammarManipulation();
+    }
+
+    #region drag & drop operations
+    private void symbolsTreeView_ItemDrag(object sender, ItemDragEventArgs e) {
+      if (!Locked) {
+        var treeNode = e.Item as TreeNode;
+        var data = new DataObject();
+        data.SetData(HeuristicLab.Common.Constants.DragDropDataFormat, treeNode.Tag);
+        validDragOperation = true;
+        DoDragDrop(data, DragDropEffects.Copy | DragDropEffects.Move);
+      }
+    }
+
+
+    private bool validDragOperation;
+    private void symbolsTreeView_DragEnter(object sender, DragEventArgs e) {
+      validDragOperation = false;
+      if (Content == null || Content.ReadOnly || ReadOnly || Locked) return;
+
+      var data = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat);
+      var symbol = data as ISymbol;
+      if (symbol != null && !(symbol is IReadOnlySymbol)) validDragOperation = true;
+    }
+    private void symbolsTreeView_DragOver(object sender, DragEventArgs e) {
+      e.Effect = DragDropEffects.None;
+      if (validDragOperation) {
+        GroupSymbol groupSymbol = null;
+        Point mouse = symbolsTreeView.PointToClient(new Point(e.X, e.Y));
+        TreeNode node = symbolsTreeView.GetNodeAt(mouse);
+        if (node == null) return;
+        groupSymbol = node.Tag as GroupSymbol;
+        if (groupSymbol == null) return;
+        var symbol = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat);
+        if (symbol == groupSymbol) return;
+
+        if (e.AllowedEffect.HasFlag(DragDropEffects.Copy)) e.Effect = DragDropEffects.Copy;
+      }
+    }
+    private void symbolsTreeView_DragDrop(object sender, DragEventArgs e) {
+      var symbol = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat) as ISymbol;
+
+      GroupSymbol groupSymbol = null;
+      Point mouse = symbolsTreeView.PointToClient(new Point(e.X, e.Y));
+      TreeNode node = symbolsTreeView.GetNodeAt(mouse);
+      if (node != null) groupSymbol = node.Tag as GroupSymbol;
+      if (node != null && groupSymbol == null) groupSymbol = node.Parent.Tag as GroupSymbol;
+
+      Content.StartGrammarManipulation();
+      Cloner cloner = new Cloner();
+      var clonedSymbol = cloner.Clone(symbol);
+      ChangeDuplicateSymbolNames(clonedSymbol);
+
+      if (groupSymbol != null) groupSymbol.SymbolsCollection.Add(clonedSymbol);
+      else Content.AddSymbol(clonedSymbol);
+
+      UpdateGrammerConstraintsForClonedSymbol(symbol, cloner);
+      Content.FinishedGrammarManipulation();
+    }
+    #endregion
+
+    private void symbolsTreeView_MouseDown(object sender, MouseEventArgs e) {
+      // enables deselection of treeNodes
+      Point coordinates = new Point(e.X, e.Y);
+      TreeNode node = symbolsTreeView.GetNodeAt(coordinates);
+      if (e.Button == MouseButtons.Left && node == null) {
+        symbolsTreeView.SelectedNode = null;
+        symbolDetailsViewHost.Content = null;
+        SetEnabledStateOfControls();
+      }
+    }
+
+    private void symbolsTreeView_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e) {
+      var symbol = e.Node.Tag as ISymbol;
+      if (symbol == null) return;
+      if (e.Button != MouseButtons.Left) return;
+      if (e.X < e.Node.Bounds.Left - symbolsTreeView.ImageList.Images[e.Node.ImageIndex].Width || e.X > e.Node.Bounds.Right) return;
+      MainFormManager.MainForm.ShowContent(symbol);
+      e.Node.Toggle();
+    }
+
+    private void symbolsTreeView_KeyDown(object sender, KeyEventArgs e) {
+      if (Content == null || Content.ReadOnly || ReadOnly || Locked) return;
+      if (symbolsTreeView.SelectedNode == null) return;
+      if (e.KeyCode != Keys.Delete) return;
+
+      var symbol = (ISymbol)symbolsTreeView.SelectedNode.Tag;
+      if (!(symbol is IReadOnlySymbol))
+        Content.RemoveSymbol(symbol);
+
+      SetEnabledStateOfControls();
+      UpdateSymbolDetailsViews();
+      RebuildImageList();
+    }
+
+    #region button events
+    private TypeSelectorDialog typeSelectorDialog;
+    private void addButton_Click(object sender, EventArgs e) {
+      if (typeSelectorDialog == null) {
+        typeSelectorDialog = new TypeSelectorDialog();
+        typeSelectorDialog.Caption = "Select Symbol";
+        typeSelectorDialog.TypeSelector.Caption = "Available Symbols";
+        typeSelectorDialog.TypeSelector.Configure(typeof(ISymbol), false, false, (t) => { return !typeof(IReadOnlySymbol).IsAssignableFrom(t); });
+      }
+      if (typeSelectorDialog.ShowDialog(this) == DialogResult.OK) {
+        try {
+          ISymbol symbol = (ISymbol)typeSelectorDialog.TypeSelector.CreateInstanceOfSelectedType();
+          ChangeDuplicateSymbolNames(symbol);
+          GroupSymbol groupSymbol = null;
+
+          TreeNode selectedNode = symbolsTreeView.SelectedNode;
+          if (selectedNode != null) {
+            groupSymbol = selectedNode.Tag as GroupSymbol;
+            if (groupSymbol == null && selectedNode.Parent != null) groupSymbol = selectedNode.Parent.Tag as GroupSymbol;
+          }
+          if (groupSymbol != null) groupSymbol.SymbolsCollection.Add(symbol);
+          else Content.AddSymbol(symbol);
+        }
+        catch (Exception ex) {
+          ErrorHandling.ShowErrorDialog(this, ex);
+        }
+      }
+    }
+
+    private void copyButton_Click(object sender, EventArgs e) {
+      var symbol = symbolsTreeView.SelectedNode.Tag as ISymbol;
+      if (symbol != null && !(symbol is IReadOnlySymbol)) {
+
+        Content.StartGrammarManipulation();
+        Cloner cloner = new Cloner();
+        var clonedSymbol = cloner.Clone(symbol);
+        ChangeDuplicateSymbolNames(clonedSymbol);
+
+        GroupSymbol groupSymbol = null;
+        if (symbolsTreeView.SelectedNode.Parent != null) groupSymbol = symbolsTreeView.SelectedNode.Parent.Tag as GroupSymbol;
+
+        if (groupSymbol != null) groupSymbol.SymbolsCollection.Add(clonedSymbol);
+        else Content.AddSymbol(clonedSymbol);
+
+        UpdateGrammerConstraintsForClonedSymbol(symbol, cloner);
+        Content.FinishedGrammarManipulation();
+      }
+    }
+
+    private void removeButton_Click(object sender, EventArgs e) {
+      var symbol = symbolsTreeView.SelectedNode.Tag as ISymbol;
+      if (symbol != null && !(symbol is IReadOnlySymbol)) {
+        Content.RemoveSymbol(symbol);
+      }
+    }
+
+    private void showDetailsCheckBox_CheckedChanged(object sender, EventArgs e) {
+      splitContainer1.Panel2Collapsed = !showDetailsCheckBox.Checked;
+    }
+
+    private void showSampleTreeButton_Click(object sender, EventArgs e) {
+      SymbolicExpressionGrammarSampleExpressionTreeView view = new SymbolicExpressionGrammarSampleExpressionTreeView();
+      view.Content = Content;
+      view.Show();
+    }
+
+    #endregion
+
+    #region helpers
+    private void UpdateGrammerConstraintsForClonedSymbol(ISymbol symbol, Cloner cloner) {
+      foreach (var s in symbol.Flatten().Where(x => !(x is GroupSymbol))) {
+        if (!cloner.ClonedObjectRegistered(s)) throw new InvalidOperationException();
+        var clone = cloner.Clone(s);
+        Content.SetSubtreeCount(clone, Content.GetMinimumSubtreeCount(s), Content.GetMaximumSubtreeCount(s));
+        foreach (var childSymbol in Content.GetAllowedChildSymbols(s)) {
+          var newChildSymbol = childSymbol;
+          if (cloner.ClonedObjectRegistered(childSymbol)) newChildSymbol = cloner.Clone(childSymbol);
+          Content.AddAllowedChildSymbol(clone, newChildSymbol);
+        }
+        for (int i = 0; i < Content.GetMaximumSubtreeCount(s); i++) {
+          foreach (var childSymbol in Content.GetAllowedChildSymbols(s, i)) {
+            var newChildSymbol = childSymbol;
+            if (cloner.ClonedObjectRegistered(childSymbol)) newChildSymbol = cloner.Clone(childSymbol);
+            Content.AddAllowedChildSymbol(clone, newChildSymbol, i);
+          }
+        }
+      }
+    }
+
+    private void ChangeDuplicateSymbolNames(ISymbol symbol) {
+      foreach (var s in symbol.Flatten()) {
+        var originalSymbolName = s.Name;
+        int i = 1;
+        while (Content.ContainsSymbol(s)) {
+          s.Name = originalSymbolName + i;
+          i++;
+        }
+      }
+    }
+
+    private void UpdateSymbolDetailsViews() {
+      if (symbolsTreeView.SelectedNode != null) {
+        symbolDetailsViewHost.Content = (ISymbol)symbolsTreeView.SelectedNode.Tag;
+        allowedChildSymbolsControl.Symbol = (ISymbol)symbolsTreeView.SelectedNode.Tag;
+      } else {
+        symbolDetailsViewHost.Content = null;
+        allowedChildSymbolsControl.Symbol = null;
+      }
+    }
+
+    private IEnumerable<TreeNode> IterateTreeNodes(TreeNode node = null) {
+      TreeNodeCollection nodes;
+      if (node == null)
+        nodes = symbolsTreeView.Nodes;
+      else {
+        nodes = node.Nodes;
+        yield return node;
+      }
+
+      foreach (var childNode in nodes.OfType<TreeNode>())
+        foreach (var n in IterateTreeNodes(childNode))
+          yield return n;
+    }
+
+    protected virtual void RebuildImageList() {
+      symbolsTreeView.ImageList.Images.Clear();
+      foreach (TreeNode treeNode in IterateTreeNodes()) {
+        var symbol = (ISymbol)treeNode.Tag;
+        symbolsTreeView.ImageList.Images.Add(symbol == null ? HeuristicLab.Common.Resources.VSImageLibrary.Nothing : symbol.ItemImage);
+        treeNode.ImageIndex = symbolsTreeView.ImageList.Images.Count - 1;
+      }
+    }
+
+    //necessary code to handle dock correctly regarding the expanded nodes
+    bool[] expandendedState;
+    protected override void OnHandleCreated(EventArgs e) {
+      base.OnHandleCreated(e);
+      if (expandendedState == null) return;
+      var nodes = IterateTreeNodes().ToList();
+      for (int i = 0; i < nodes.Count; i++)
+        if (expandendedState[i]) nodes[i].Expand();
+    }
+    protected override void OnHandleDestroyed(EventArgs e) {
+      base.OnHandleDestroyed(e);
+      var nodes = IterateTreeNodes().ToList();
+      expandendedState = new bool[nodes.Count];
+      for (int i = 0; i < nodes.Count; i++)
+        expandendedState[i] = nodes[i].IsExpanded;
+    }
+    #endregion
+  }
+
+  //this class is necessary to prevent double clicks which do not fire the checkbox checked event
+  //workaround taken from http://connect.microsoft.com/VisualStudio/feedback/details/374516/treeview-control-does-not-fire-events-reliably-when-double-clicking-on-checkbox
+  internal class CheckBoxTreeView : TreeView {
+    protected override void WndProc(ref Message m) {
+      // Suppress WM_LBUTTONDBLCLK
+      if (m.Msg == 0x203 && IsOnCheckBox(m)) { m.Result = IntPtr.Zero; } else base.WndProc(ref m);
+    }
+
+    private int GetXLParam(IntPtr lParam) {
+      return lParam.ToInt32() & 0xffff;
+    }
+
+    private int GetYLParam(IntPtr lParam) {
+      return lParam.ToInt32() >> 16;
+    }
+
+    private bool IsOnCheckBox(Message m) {
+      int x = GetXLParam(m.LParam);
+      int y = GetYLParam(m.LParam);
+      TreeNode node = this.GetNodeAt(x, y);
+      return ((x <= node.Bounds.Left - 20) && (x >= node.Bounds.Left - 32));
+    }
+  }
+}
Index: /branches/HeuristicLab.TreeLayout/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarSampleExpressionTreeView.Designer.cs
===================================================================
--- /branches/HeuristicLab.TreeLayout/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarSampleExpressionTreeView.Designer.cs	(revision 9650)
+++ /branches/HeuristicLab.TreeLayout/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarSampleExpressionTreeView.Designer.cs	(revision 9650)
@@ -0,0 +1,215 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2013 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
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views {
+  partial class SymbolicExpressionGrammarSampleExpressionTreeView {
+    /// <summary> 
+    /// Required designer variable.
+    /// </summary>
+    private System.ComponentModel.IContainer components = null;
+
+    /// <summary> 
+    /// Clean up any resources being used.
+    /// </summary>
+    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+    protected override void Dispose(bool disposing) {
+      if (disposing && (components != null)) {
+        components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
+    #region Component Designer generated code
+
+    /// <summary> 
+    /// Required method for Designer support - do not modify 
+    /// the contents of this method with the code editor.
+    /// </summary>
+    private void InitializeComponent() {
+      this.sampleTreeGroupBox = new System.Windows.Forms.GroupBox();
+      this.sampleTreeView = new HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views.GraphicalSymbolicExpressionTreeView();
+      this.maxTreeLengthLabel = new System.Windows.Forms.Label();
+      this.maxTreeDepthLabel = new System.Windows.Forms.Label();
+      this.maxTreeLengthTextBox = new System.Windows.Forms.TextBox();
+      this.maxTreeDepthTextBox = new System.Windows.Forms.TextBox();
+      this.generateSampleTreeButton = new System.Windows.Forms.Button();
+      this.treeCreatorComboBox = new System.Windows.Forms.ComboBox();
+      this.treeCreatorLabel = new System.Windows.Forms.Label();
+      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
+      this.sampleTreeGroupBox.SuspendLayout();
+      this.SuspendLayout();
+      // 
+      // nameTextBox
+      // 
+      this.errorProvider.SetIconAlignment(this.nameTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
+      this.errorProvider.SetIconPadding(this.nameTextBox, 2);
+      this.nameTextBox.Location = new System.Drawing.Point(93, 0);
+      this.nameTextBox.Size = new System.Drawing.Size(319, 20);
+      // 
+      // infoLabel
+      // 
+      this.infoLabel.Location = new System.Drawing.Point(418, 3);
+      // 
+      // sampleTreeGroupBox
+      // 
+      this.sampleTreeGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+                  | System.Windows.Forms.AnchorStyles.Left)
+                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.sampleTreeGroupBox.Controls.Add(this.sampleTreeView);
+      this.sampleTreeGroupBox.Location = new System.Drawing.Point(3, 134);
+      this.sampleTreeGroupBox.Name = "sampleTreeGroupBox";
+      this.sampleTreeGroupBox.Size = new System.Drawing.Size(431, 265);
+      this.sampleTreeGroupBox.TabIndex = 3;
+      this.sampleTreeGroupBox.TabStop = false;
+      this.sampleTreeGroupBox.Text = "Sample SymbolicExpressionTree";
+      // 
+      // sampleTreeView
+      // 
+      this.sampleTreeView.AllowDrop = true;
+      this.sampleTreeView.Caption = "Graphical SymbolicExpressionTree View";
+      this.sampleTreeView.Content = null;
+      this.sampleTreeView.Dock = System.Windows.Forms.DockStyle.Fill;
+      this.sampleTreeView.Location = new System.Drawing.Point(3, 16);
+      this.sampleTreeView.Name = "sampleTreeView";
+      this.sampleTreeView.ReadOnly = false;
+      this.sampleTreeView.Size = new System.Drawing.Size(425, 246);
+      this.sampleTreeView.TabIndex = 0;
+      // 
+      // maxTreeLengthLabel
+      // 
+      this.maxTreeLengthLabel.AutoSize = true;
+      this.maxTreeLengthLabel.Location = new System.Drawing.Point(3, 29);
+      this.maxTreeLengthLabel.Name = "maxTreeLengthLabel";
+      this.maxTreeLengthLabel.Size = new System.Drawing.Size(88, 13);
+      this.maxTreeLengthLabel.TabIndex = 4;
+      this.maxTreeLengthLabel.Text = "Max TreeLength:";
+      // 
+      // maxTreeDepthLabel
+      // 
+      this.maxTreeDepthLabel.AutoSize = true;
+      this.maxTreeDepthLabel.Location = new System.Drawing.Point(3, 55);
+      this.maxTreeDepthLabel.Name = "maxTreeDepthLabel";
+      this.maxTreeDepthLabel.Size = new System.Drawing.Size(84, 13);
+      this.maxTreeDepthLabel.TabIndex = 5;
+      this.maxTreeDepthLabel.Text = "Max TreeDepth:";
+      // 
+      // maxTreeLengthTextBox
+      // 
+      this.maxTreeLengthTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.maxTreeLengthTextBox.Location = new System.Drawing.Point(93, 26);
+      this.maxTreeLengthTextBox.Name = "maxTreeLengthTextBox";
+      this.maxTreeLengthTextBox.Size = new System.Drawing.Size(341, 20);
+      this.maxTreeLengthTextBox.TabIndex = 6;
+      this.maxTreeLengthTextBox.Text = "50";
+      this.maxTreeLengthTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.maxTreeLengthTextBox_Validating);
+      this.maxTreeLengthTextBox.Validated += new System.EventHandler(this.maxTreeLengthTextBox_Validated);
+      // 
+      // maxTreeDepthTextBox
+      // 
+      this.maxTreeDepthTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.maxTreeDepthTextBox.Location = new System.Drawing.Point(93, 52);
+      this.maxTreeDepthTextBox.Name = "maxTreeDepthTextBox";
+      this.maxTreeDepthTextBox.Size = new System.Drawing.Size(341, 20);
+      this.maxTreeDepthTextBox.TabIndex = 7;
+      this.maxTreeDepthTextBox.Text = "10";
+      this.maxTreeDepthTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.maxTreeDepthTextBox_Validating);
+      this.maxTreeDepthTextBox.Validated += new System.EventHandler(this.maxTreeDepthTextBox_Validated);
+      // 
+      // generateSampleTreeButton
+      // 
+      this.generateSampleTreeButton.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.generateSampleTreeButton.Location = new System.Drawing.Point(6, 105);
+      this.generateSampleTreeButton.Name = "generateSampleTreeButton";
+      this.generateSampleTreeButton.Size = new System.Drawing.Size(431, 23);
+      this.generateSampleTreeButton.TabIndex = 8;
+      this.generateSampleTreeButton.Text = "Generate SymbolicExpressionTree";
+      this.generateSampleTreeButton.UseVisualStyleBackColor = true;
+      this.generateSampleTreeButton.Click += new System.EventHandler(this.generateSampleTreeButton_Click);
+      // 
+      // treeCreatorComboBox
+      // 
+      this.treeCreatorComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.treeCreatorComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+      this.treeCreatorComboBox.FormattingEnabled = true;
+      this.treeCreatorComboBox.Location = new System.Drawing.Point(93, 78);
+      this.treeCreatorComboBox.Name = "treeCreatorComboBox";
+      this.treeCreatorComboBox.Size = new System.Drawing.Size(341, 21);
+      this.treeCreatorComboBox.TabIndex = 9;
+      this.treeCreatorComboBox.SelectedIndexChanged += new System.EventHandler(this.treeCreatorComboBox_SelectedIndexChanged);
+      // 
+      // treeCreatorLabel
+      // 
+      this.treeCreatorLabel.AutoSize = true;
+      this.treeCreatorLabel.Location = new System.Drawing.Point(3, 81);
+      this.treeCreatorLabel.Name = "treeCreatorLabel";
+      this.treeCreatorLabel.Size = new System.Drawing.Size(69, 13);
+      this.treeCreatorLabel.TabIndex = 10;
+      this.treeCreatorLabel.Text = "Tree Creator:";
+      // 
+      // SymbolicExpressionGrammarSampleExpressionTreeView
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
+      this.Controls.Add(this.treeCreatorLabel);
+      this.Controls.Add(this.sampleTreeGroupBox);
+      this.Controls.Add(this.maxTreeDepthLabel);
+      this.Controls.Add(this.maxTreeLengthTextBox);
+      this.Controls.Add(this.treeCreatorComboBox);
+      this.Controls.Add(this.maxTreeLengthLabel);
+      this.Controls.Add(this.maxTreeDepthTextBox);
+      this.Controls.Add(this.generateSampleTreeButton);
+      this.Name = "SymbolicExpressionGrammarSampleExpressionTreeView";
+      this.Size = new System.Drawing.Size(437, 402);
+      this.Controls.SetChildIndex(this.generateSampleTreeButton, 0);
+      this.Controls.SetChildIndex(this.maxTreeDepthTextBox, 0);
+      this.Controls.SetChildIndex(this.maxTreeLengthLabel, 0);
+      this.Controls.SetChildIndex(this.treeCreatorComboBox, 0);
+      this.Controls.SetChildIndex(this.maxTreeLengthTextBox, 0);
+      this.Controls.SetChildIndex(this.maxTreeDepthLabel, 0);
+      this.Controls.SetChildIndex(this.sampleTreeGroupBox, 0);
+      this.Controls.SetChildIndex(this.treeCreatorLabel, 0);
+      this.Controls.SetChildIndex(this.nameTextBox, 0);
+      this.Controls.SetChildIndex(this.infoLabel, 0);
+      this.Controls.SetChildIndex(this.nameLabel, 0);
+      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
+      this.sampleTreeGroupBox.ResumeLayout(false);
+      this.ResumeLayout(false);
+      this.PerformLayout();
+
+    }
+
+    #endregion
+
+    private System.Windows.Forms.GroupBox sampleTreeGroupBox;
+    private System.Windows.Forms.Label maxTreeLengthLabel;
+    private System.Windows.Forms.Label maxTreeDepthLabel;
+    private System.Windows.Forms.TextBox maxTreeLengthTextBox;
+    private System.Windows.Forms.TextBox maxTreeDepthTextBox;
+    private System.Windows.Forms.Button generateSampleTreeButton;
+    private GraphicalSymbolicExpressionTreeView sampleTreeView;
+    private System.Windows.Forms.ComboBox treeCreatorComboBox;
+    private System.Windows.Forms.Label treeCreatorLabel;
+  }
+}
Index: /branches/HeuristicLab.TreeLayout/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarSampleExpressionTreeView.cs
===================================================================
--- /branches/HeuristicLab.TreeLayout/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarSampleExpressionTreeView.cs	(revision 9650)
+++ /branches/HeuristicLab.TreeLayout/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarSampleExpressionTreeView.cs	(revision 9650)
@@ -0,0 +1,158 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2013 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;
+using System.ComponentModel;
+using System.Linq;
+using System.Windows.Forms;
+using HeuristicLab.Core;
+using HeuristicLab.Core.Views;
+using HeuristicLab.MainForm;
+using HeuristicLab.PluginInfrastructure;
+using HeuristicLab.Random;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views {
+  [View("Symbolic Expression Grammar Sample Tree")]
+  public partial class SymbolicExpressionGrammarSampleExpressionTreeView : NamedItemView {
+    private IRandom random;
+    public SymbolicExpressionGrammarSampleExpressionTreeView() {
+      InitializeComponent();
+      random = new MersenneTwister();
+      maxSampleTreeLength = int.Parse(maxTreeLengthTextBox.Text);
+      maxSampleTreeDepth = int.Parse(maxTreeDepthTextBox.Text);
+      foreach (var treeCreator in ApplicationManager.Manager.GetInstances<ISymbolicExpressionTreeCreator>()) {
+        treeCreatorComboBox.Items.Add(treeCreator);
+      }
+      treeCreatorComboBox.SelectedIndex = 0;
+    }
+
+    private int maxSampleTreeLength;
+    public int MaxSampleTreeLength {
+      get { return maxSampleTreeLength; }
+      set {
+        if (maxSampleTreeLength != value) {
+          maxSampleTreeLength = value;
+          UpdateSampleTreeView();
+        }
+      }
+    }
+
+    private int maxSampleTreeDepth;
+    public int MaxSampleTreeDepth {
+      get { return maxSampleTreeDepth; }
+      set {
+        if (maxSampleTreeDepth != value) {
+          maxSampleTreeDepth = value;
+          UpdateSampleTreeView();
+        }
+      }
+    }
+
+    public new ISymbolicExpressionGrammar Content {
+      get { return (ISymbolicExpressionGrammar)base.Content; }
+      set { base.Content = value; }
+    }
+
+    protected override void SetEnabledStateOfControls() {
+      base.SetEnabledStateOfControls();
+      maxTreeLengthTextBox.Enabled = Content != null;
+      maxTreeDepthTextBox.Enabled = Content != null;
+      generateSampleTreeButton.Enabled = Content != null;
+    }
+
+    protected override void RegisterContentEvents() {
+      base.RegisterContentEvents();
+      Content.Changed += new EventHandler(Content_Changed);
+    }
+
+    protected override void DeregisterContentEvents() {
+      Content.Changed -= new EventHandler(Content_Changed);
+      base.DeregisterContentEvents();
+    }
+
+    protected override void OnContentChanged() {
+      base.OnContentChanged();
+      if (Content == null) sampleTreeView.Content = null;
+      else UpdateSampleTreeView();
+    }
+
+    private void Content_Changed(object sender, System.EventArgs e) {
+      UpdateSampleTreeView();
+    }
+
+    private void UpdateSampleTreeView() {
+      try {
+        ISymbolicExpressionTreeCreator creator = (ISymbolicExpressionTreeCreator)treeCreatorComboBox.SelectedItem;
+        ISymbolicExpressionTree tree = creator.CreateTree(random, Content, MaxSampleTreeLength, MaxSampleTreeDepth);
+        foreach (var node in tree.Root.IterateNodesPrefix().OfType<SymbolicExpressionTreeTopLevelNode>())
+          node.SetGrammar(null);
+        sampleTreeView.Content = tree;
+      }
+      catch (Exception ex) {
+        sampleTreeView.Content = null;
+        ErrorHandling.ShowErrorDialog(ex);
+      }
+    }
+
+    #region control events
+    private void generateSampleTreeButton_Click(object sender, EventArgs e) {
+      UpdateSampleTreeView();
+    }
+
+    private void maxTreeLengthTextBox_Validating(object sender, CancelEventArgs e) {
+      int maxTreeLength;
+      if (int.TryParse(maxTreeLengthTextBox.Text, out maxTreeLength) && maxTreeLength > 3) {
+        errorProvider.SetError(maxTreeLengthTextBox, string.Empty);
+        e.Cancel = false;
+      } else {
+        errorProvider.SetError(maxTreeLengthTextBox, "Invalid value: maximum tree length must be larger than 3.");
+        e.Cancel = true;
+      }
+    }
+    private void maxTreeLengthTextBox_Validated(object sender, EventArgs e) {
+      int maxTreeLength;
+      if (int.TryParse(maxTreeLengthTextBox.Text, out maxTreeLength) && maxTreeLength > 3) {
+        MaxSampleTreeLength = maxTreeLength;
+      }
+    }
+
+    private void maxTreeDepthTextBox_Validating(object sender, CancelEventArgs e) {
+      int maxTreeDepth;
+      if (int.TryParse(maxTreeDepthTextBox.Text, out maxTreeDepth) && maxTreeDepth > 3) {
+        errorProvider.SetError(maxTreeDepthTextBox, string.Empty);
+        e.Cancel = false;
+      } else {
+        errorProvider.SetError(maxTreeDepthTextBox, "Invalid value: maximum tree depth must be larger than 3.");
+        e.Cancel = true;
+      }
+    }
+    private void maxTreeDepthTextBox_Validated(object sender, EventArgs e) {
+      int maxTreeDepth;
+      if (int.TryParse(maxTreeDepthTextBox.Text, out maxTreeDepth) && maxTreeDepth > 3) {
+        MaxSampleTreeDepth = maxTreeDepth;
+      }
+    }
+    #endregion
+
+    private void treeCreatorComboBox_SelectedIndexChanged(object sender, EventArgs e) {
+    }
+  }
+}
Index: /branches/HeuristicLab.TreeLayout/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarView.Designer.cs
===================================================================
--- /branches/HeuristicLab.TreeLayout/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarView.Designer.cs	(revision 9650)
+++ /branches/HeuristicLab.TreeLayout/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarView.Designer.cs	(revision 9650)
@@ -0,0 +1,72 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2013 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
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views {
+  partial class SymbolicExpressionGrammarView {
+    /// <summary> 
+    /// Required designer variable.
+    /// </summary>
+    private System.ComponentModel.IContainer components = null;
+
+    /// <summary> 
+    /// Clean up any resources being used.
+    /// </summary>
+    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+    protected override void Dispose(bool disposing) {
+      if (disposing && (components != null)) {
+        components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
+    #region Component Designer generated code
+
+    /// <summary> 
+    /// Required method for Designer support - do not modify 
+    /// the contents of this method with the code editor.
+    /// </summary>
+    private void InitializeComponent() {
+      this.checkedItemListView = new HeuristicLab.Core.Views.CheckedItemListView<ISymbol>();
+      this.SuspendLayout();
+      this.checkedItemListView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+                  | System.Windows.Forms.AnchorStyles.Left)
+                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.checkedItemListView.Location = new System.Drawing.Point(0, 52);
+      this.checkedItemListView.Name = "itemListView";
+      this.checkedItemListView.Size = new System.Drawing.Size(351, 190);
+      this.checkedItemListView.TabIndex = 0;
+      //                                        
+      // DefaultSymbolicExpressionGrammarView
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
+      this.Controls.Add(this.checkedItemListView);
+      this.Name = "DefaultSymbolicExpressionGrammarView";
+      this.Size = new System.Drawing.Size(351, 245);
+      this.ResumeLayout(false);
+
+    }
+
+    #endregion
+
+    protected HeuristicLab.Core.Views.CheckedItemListView<ISymbol> checkedItemListView;
+  }
+}
Index: /branches/HeuristicLab.TreeLayout/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarView.cs
===================================================================
--- /branches/HeuristicLab.TreeLayout/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarView.cs	(revision 9650)
+++ /branches/HeuristicLab.TreeLayout/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarView.cs	(revision 9650)
@@ -0,0 +1,118 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2013 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;
+using System.Windows.Forms;
+using HeuristicLab.Collections;
+using HeuristicLab.Core;
+using HeuristicLab.Core.Views;
+using HeuristicLab.MainForm;
+using HeuristicLab.MainForm.WindowsForms;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views {
+  [View("Symbolic Expression Grammar View")]
+  [Content(typeof(ISymbolicExpressionGrammar), false)]
+  public partial class SymbolicExpressionGrammarView : NamedItemView {
+    private CheckedItemList<ISymbol> symbols;
+
+    public new ISymbolicExpressionGrammar Content {
+      get { return (ISymbolicExpressionGrammar)base.Content; }
+      set { base.Content = value; }
+    }
+
+    public override bool ReadOnly {
+      get {
+        if ((Content != null) && Content.ReadOnly) return true;
+        return base.ReadOnly;
+      }
+      set {
+        if ((Content != null) && Content.ReadOnly) base.ReadOnly = true;
+        else base.ReadOnly = value;
+      }
+    }
+
+    public SymbolicExpressionGrammarView() {
+      InitializeComponent();
+      symbols = new CheckedItemList<ISymbol>();
+      symbols.CheckedItemsChanged += new CollectionItemsChangedEventHandler<IndexedItem<ISymbol>>(symbols_CheckedItemsChanged);
+    }
+
+    protected override void RegisterContentEvents() {
+      base.RegisterContentEvents();
+      Content.ReadOnlyChanged += new EventHandler(Content_ReadOnlyChanged);
+    }
+    protected override void DeregisterContentEvents() {
+      base.DeregisterContentEvents();
+      Content.ReadOnlyChanged -= new EventHandler(Content_ReadOnlyChanged);
+    }
+
+    protected override void OnContentChanged() {
+      base.OnContentChanged();
+      UpdateControl();
+    }
+
+    private void Content_ReadOnlyChanged(object sender, EventArgs e) {
+      ReadOnly = Content.ReadOnly;
+    }
+
+    #region content event handlers
+    private void Content_Changed(object sender, EventArgs e) {
+      UpdateControl();
+    }
+    #endregion
+
+    #region helpers
+    private void UpdateControl() {
+      if (Content == null) {
+        ClearSymbols();
+        checkedItemListView.Content = symbols.AsReadOnly();
+      } else {
+        ClearSymbols();
+        foreach (ISymbol symbol in Content.Symbols) {
+          if (!(symbol is IReadOnlySymbol)) {
+            symbol.Changed += new EventHandler(symbol_Changed);
+            symbols.Add(symbol, symbol.Enabled);
+          }
+        }
+        checkedItemListView.Content = symbols.AsReadOnly();
+      }
+      SetEnabledStateOfControls();
+    }
+
+
+    private void symbol_Changed(object sender, EventArgs e) {
+      ISymbol symbol = (ISymbol)sender;
+      symbols.SetItemCheckedState(symbol, symbol.Enabled);
+    }
+
+    private void symbols_CheckedItemsChanged(object sender, CollectionItemsChangedEventArgs<IndexedItem<ISymbol>> e) {
+      ICheckedItemList<ISymbol> checkedItemList = (ICheckedItemList<ISymbol>)sender;
+      foreach (var indexedItem in e.Items)
+        indexedItem.Value.Enabled = checkedItemList.ItemChecked(indexedItem.Value);
+    }
+    private void ClearSymbols() {
+      foreach (Symbol s in symbols)
+        s.Changed -= new EventHandler(symbol_Changed);
+      symbols.Clear();
+    }
+    #endregion
+  }
+}
Index: /branches/HeuristicLab.TreeLayout/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionTreeChart.Designer.cs
===================================================================
--- /branches/HeuristicLab.TreeLayout/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionTreeChart.Designer.cs	(revision 9650)
+++ /branches/HeuristicLab.TreeLayout/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionTreeChart.Designer.cs	(revision 9650)
@@ -0,0 +1,96 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2013 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
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views {
+  public partial class SymbolicExpressionTreeChart {
+    /// <summary> 
+    /// Required designer variable.
+    /// </summary>
+    private System.ComponentModel.IContainer components = null;
+
+    /// <summary> 
+    /// Clean up any resources being used.
+    /// </summary>
+    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+    protected override void Dispose(bool disposing) {
+      if (disposing && (components != null)) {
+        components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
+    #region Component Designer generated code
+
+    /// <summary> 
+    /// Required method for Designer support - do not modify 
+    /// the contents of this method with the code editor.
+    /// </summary>
+    private void InitializeComponent() {
+      this.components = new System.ComponentModel.Container();
+      this.toolTip = new System.Windows.Forms.ToolTip(this.components);
+      this.contextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components);
+      this.saveImageToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+      this.saveFileDialog = new System.Windows.Forms.SaveFileDialog();
+      this.contextMenuStrip.SuspendLayout();
+      this.SuspendLayout();
+      // 
+      // contextMenuStrip
+      // 
+      this.contextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+            this.saveImageToolStripMenuItem});
+      this.contextMenuStrip.Name = "contextMenuStrip";
+      this.contextMenuStrip.Size = new System.Drawing.Size(135, 26);
+      // 
+      // saveImageToolStripMenuItem
+      // 
+      this.saveImageToolStripMenuItem.Name = "saveImageToolStripMenuItem";
+      this.saveImageToolStripMenuItem.Size = new System.Drawing.Size(134, 22);
+      this.saveImageToolStripMenuItem.Text = "Save Image";
+      this.saveImageToolStripMenuItem.Click += new System.EventHandler(this.saveImageToolStripMenuItem_Click);
+      // 
+      // saveFileDialog
+      // 
+      this.saveFileDialog.Filter = "Bitmap (*.bmp)|*.bmp|EMF (*.emf)|*.emf";
+      // 
+      // SymbolicExpressionTreeChart
+      // 
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
+      this.ContextMenuStrip = this.contextMenuStrip;
+      this.DoubleBuffered = true;
+      this.Name = "SymbolicExpressionTreeChart";
+      this.MouseClick += new System.Windows.Forms.MouseEventHandler(this.SymbolicExpressionTreeChart_MouseClick);
+      this.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.SymbolicExpressionTreeChart_MouseDoubleClick);
+      this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.SymbolicExpressionTreeChart_MouseDown);
+      this.MouseMove += new System.Windows.Forms.MouseEventHandler(this.SymbolicExpressionTreeChart_MouseMove);
+      this.MouseUp += new System.Windows.Forms.MouseEventHandler(this.SymbolicExpressionTreeChart_MouseUp);
+      this.contextMenuStrip.ResumeLayout(false);
+      this.ResumeLayout(false);
+
+    }
+
+    #endregion
+
+    protected System.Windows.Forms.ToolTip toolTip;
+    protected System.Windows.Forms.ContextMenuStrip contextMenuStrip;
+    protected System.Windows.Forms.ToolStripMenuItem saveImageToolStripMenuItem;
+    protected System.Windows.Forms.SaveFileDialog saveFileDialog;
+  }
+}
Index: /branches/HeuristicLab.TreeLayout/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionTreeChart.cs
===================================================================
--- /branches/HeuristicLab.TreeLayout/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionTreeChart.cs	(revision 9650)
+++ /branches/HeuristicLab.TreeLayout/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionTreeChart.cs	(revision 9650)
@@ -0,0 +1,458 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2013 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;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Drawing.Imaging;
+using System.Windows.Forms;
+using Point = System.Drawing.Point;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views {
+  public partial class SymbolicExpressionTreeChart : UserControl {
+    private Image image;
+    private StringFormat stringFormat;
+    private Dictionary<ISymbolicExpressionTreeNode, VisualSymbolicExpressionTreeNode> visualTreeNodes;
+    private Dictionary<Tuple<ISymbolicExpressionTreeNode, ISymbolicExpressionTreeNode>, VisualSymbolicExpressionTreeNodeConnection> visualLines;
+
+    public SymbolicExpressionTreeChart() {
+      InitializeComponent();
+      this.image = new Bitmap(Width, Height);
+      this.stringFormat = new StringFormat { Alignment = StringAlignment.Center, LineAlignment = StringAlignment.Center };
+      this.spacing = 5;
+      this.lineColor = Color.Black;
+      this.backgroundColor = Color.White;
+      this.textFont = new Font("Times New Roman", 8);
+    }
+
+    public SymbolicExpressionTreeChart(ISymbolicExpressionTree tree)
+      : this() {
+      this.Tree = tree;
+    }
+
+    #region Public properties
+    private int spacing;
+    public int Spacing {
+      get { return this.spacing; }
+      set {
+        this.spacing = value;
+        this.Repaint();
+      }
+    }
+
+    private Color lineColor;
+    public Color LineColor {
+      get { return this.lineColor; }
+      set {
+        this.lineColor = value;
+        this.Repaint();
+      }
+    }
+
+    private Color backgroundColor;
+    public Color BackgroundColor {
+      get { return this.backgroundColor; }
+      set {
+        this.backgroundColor = value;
+        this.Repaint();
+      }
+    }
+
+    private Font textFont;
+    public Font TextFont {
+      get { return this.textFont; }
+      set {
+        this.textFont = value;
+        this.Repaint();
+      }
+    }
+
+    private ISymbolicExpressionTree tree;
+    public ISymbolicExpressionTree Tree {
+      get { return this.tree; }
+      set {
+        tree = value;
+        visualTreeNodes = new Dictionary<ISymbolicExpressionTreeNode, VisualSymbolicExpressionTreeNode>();
+        visualLines = new Dictionary<Tuple<ISymbolicExpressionTreeNode, ISymbolicExpressionTreeNode>, VisualSymbolicExpressionTreeNodeConnection>();
+        if (tree != null) {
+          foreach (ISymbolicExpressionTreeNode node in tree.IterateNodesPrefix()) {
+            visualTreeNodes[node] = new VisualSymbolicExpressionTreeNode(node);
+            if (node.Parent != null) visualLines[Tuple.Create(node.Parent, node)] = new VisualSymbolicExpressionTreeNodeConnection();
+          }
+        }
+        Repaint();
+      }
+    }
+
+    private bool suspendRepaint;
+    public bool SuspendRepaint {
+      get { return suspendRepaint; }
+      set { suspendRepaint = value; }
+    }
+    #endregion
+
+    protected override void OnPaint(PaintEventArgs e) {
+      e.Graphics.DrawImage(image, 0, 0);
+      base.OnPaint(e);
+    }
+    protected override void OnResize(EventArgs e) {
+      base.OnResize(e);
+      if (this.Width <= 1 || this.Height <= 1)
+        this.image = new Bitmap(1, 1);
+      else
+        this.image = new Bitmap(Width, Height);
+      this.Repaint();
+    }
+
+    public void Repaint() {
+      if (!suspendRepaint) {
+        this.GenerateImage();
+        this.Refresh();
+      }
+    }
+
+    public void RepaintNodes() {
+      if (!suspendRepaint) {
+        using (var graphics = Graphics.FromImage(image)) {
+          graphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.High;
+          graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
+          foreach (var visualNode in visualTreeNodes.Values) {
+            DrawTreeNode(graphics, visualNode);
+          }
+        }
+        this.Refresh();
+      }
+    }
+
+    public void RepaintNode(VisualSymbolicExpressionTreeNode visualNode) {
+      if (!suspendRepaint) {
+        using (var graphics = Graphics.FromImage(image)) {
+          graphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.High;
+          graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
+          DrawTreeNode(graphics, visualNode);
+        }
+        this.Refresh();
+      }
+    }
+
+    private void GenerateImage() {
+      using (Graphics graphics = Graphics.FromImage(image)) {
+        graphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.High;
+        graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
+        graphics.Clear(backgroundColor);
+        if (tree != null) {
+          int height = this.Height / tree.Depth;
+          DrawFunctionTree(tree, graphics, 0, 0, this.Width, height);
+        }
+      }
+    }
+
+    public VisualSymbolicExpressionTreeNode GetVisualSymbolicExpressionTreeNode(ISymbolicExpressionTreeNode symbolicExpressionTreeNode) {
+      if (visualTreeNodes.ContainsKey(symbolicExpressionTreeNode))
+        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;
+    }
+
+    #region events
+    public event MouseEventHandler SymbolicExpressionTreeNodeClicked;
+    protected virtual void OnSymbolicExpressionTreeNodeClicked(object sender, MouseEventArgs e) {
+      var clicked = SymbolicExpressionTreeNodeClicked;
+      if (clicked != null)
+        clicked(sender, e);
+    }
+
+    protected virtual void SymbolicExpressionTreeChart_MouseClick(object sender, MouseEventArgs e) {
+      VisualSymbolicExpressionTreeNode visualTreeNode = FindVisualSymbolicExpressionTreeNodeAt(e.X, e.Y);
+      if (visualTreeNode != null) {
+        OnSymbolicExpressionTreeNodeClicked(visualTreeNode, e);
+      }
+    }
+
+    public event MouseEventHandler SymbolicExpressionTreeNodeDoubleClicked;
+    protected virtual void OnSymbolicExpressionTreeNodeDoubleClicked(object sender, MouseEventArgs e) {
+      var doubleClicked = SymbolicExpressionTreeNodeDoubleClicked;
+      if (doubleClicked != null)
+        doubleClicked(sender, e);
+    }
+
+    protected virtual void SymbolicExpressionTreeChart_MouseDoubleClick(object sender, MouseEventArgs e) {
+      VisualSymbolicExpressionTreeNode visualTreeNode = FindVisualSymbolicExpressionTreeNodeAt(e.X, e.Y);
+      if (visualTreeNode != null)
+        OnSymbolicExpressionTreeNodeDoubleClicked(visualTreeNode, e);
+    }
+
+    public event ItemDragEventHandler SymbolicExpressionTreeNodeDrag;
+    protected virtual void OnSymbolicExpressionTreeNodeDragDrag(object sender, ItemDragEventArgs e) {
+      var dragged = SymbolicExpressionTreeNodeDrag;
+      if (dragged != null)
+        dragged(sender, e);
+    }
+
+    private VisualSymbolicExpressionTreeNode draggedSymbolicExpressionTree;
+    private MouseButtons dragButtons;
+    private void SymbolicExpressionTreeChart_MouseDown(object sender, MouseEventArgs e) {
+      this.dragButtons = e.Button;
+      this.draggedSymbolicExpressionTree = FindVisualSymbolicExpressionTreeNodeAt(e.X, e.Y);
+    }
+    private void SymbolicExpressionTreeChart_MouseUp(object sender, MouseEventArgs e) {
+      this.draggedSymbolicExpressionTree = null;
+      this.dragButtons = MouseButtons.None;
+    }
+
+    private void SymbolicExpressionTreeChart_MouseMove(object sender, MouseEventArgs e) {
+      VisualSymbolicExpressionTreeNode visualTreeNode = FindVisualSymbolicExpressionTreeNodeAt(e.X, e.Y);
+      if (draggedSymbolicExpressionTree != null &&
+        draggedSymbolicExpressionTree != visualTreeNode) {
+        OnSymbolicExpressionTreeNodeDragDrag(draggedSymbolicExpressionTree, new ItemDragEventArgs(dragButtons, draggedSymbolicExpressionTree));
+        draggedSymbolicExpressionTree = null;
+      } else if (draggedSymbolicExpressionTree == null &&
+        visualTreeNode != null) {
+        string tooltipText = visualTreeNode.ToolTip;
+        if (this.toolTip.GetToolTip(this) != tooltipText)
+          this.toolTip.SetToolTip(this, tooltipText);
+
+      } else if (visualTreeNode == null)
+        this.toolTip.SetToolTip(this, "");
+    }
+
+    public VisualSymbolicExpressionTreeNode FindVisualSymbolicExpressionTreeNodeAt(int x, int y) {
+      foreach (var visualTreeNode in visualTreeNodes.Values) {
+        if (x >= visualTreeNode.X && x <= visualTreeNode.X + visualTreeNode.Width &&
+            y >= visualTreeNode.Y && y <= visualTreeNode.Y + visualTreeNode.Height)
+          return visualTreeNode;
+      }
+      return null;
+    }
+    #endregion
+
+    #region methods for painting the symbolic expression tree
+
+    private void DrawFunctionTree(ISymbolicExpressionTree tree, Graphics graphics, int x, int y, int width, int height) {
+      //      DrawFunctionTree(tree.Root, graphics, x, y, width, height, Point.Empty);
+      AlternateDraw(tree, graphics, 70, 46, 20, 50);
+    }
+
+    private void AlternateDraw(ISymbolicExpressionTree tree, Graphics graphics, int preferredWidth, int preferredHeight, int minDistance, int maxDistance) {
+      var tl = new TreeLayout();
+      tl.Distance = 5;
+      tl.SymbolicExpressionTree = tree;
+
+      var nodePositions = tl.GetNodeCoordinates();
+      var bounds = tl.Bounds();
+
+      double sx = Width / bounds.Width;
+      double sy = Height / bounds.Height;
+
+      double dx = tl.Distance * sx; // scaled horizontal distance
+      double dy = tl.Distance * sy; // scaled vertical distance
+
+      int maxWidth = (int)Math.Round(dx);
+      int maxHeight = (int)Math.Round(dy);
+
+      // instead of using the preferred with/height of each node inside the foreach loop below,
+      // we assume the same width/height for all nodes
+      int w = Math.Min(preferredWidth, maxWidth - minDistance / 2);
+      int h = Math.Min(preferredHeight, maxHeight - minDistance / 2);
+      // adjust scaling factor so that nodes will be at most maxDistance far from each other on the horizontal axis
+      double offset = 0;
+      if (maxDistance + w < maxWidth) {
+        sx *= (double)(maxDistance + w) / maxWidth;
+        offset = (Width - (sx * bounds.Width)) / 2;
+      }
+      foreach (var node in visualTreeNodes.Keys) {
+        var visualNode = visualTreeNodes[node];
+        var pos = nodePositions[node];
+        visualNode.Width = w;
+        visualNode.Height = h;
+        visualNode.X = (int)Math.Round(pos.X * sx + offset); ;
+        visualNode.Y = (int)Math.Round(pos.Y * sy);
+        DrawTreeNode(graphics, visualNode);
+      }
+      graphics.ResetClip(); // reset clip region
+      foreach (var visualNode in visualTreeNodes.Values) {
+        var node = visualNode.SymbolicExpressionTreeNode;
+        foreach (var subtree in node.Subtrees) {
+          var visualLine = GetVisualSymbolicExpressionTreeNodeConnection(node, subtree);
+          var visualSubtree = visualTreeNodes[subtree];
+          var origin = new Point(visualNode.X + visualNode.Width / 2, visualNode.Y + visualNode.Height);
+          var target = new Point(visualSubtree.X + visualSubtree.Width / 2, visualSubtree.Y);
+          using (var linePen = new Pen(visualLine.LineColor)) {
+            linePen.DashStyle = visualLine.DashStyle;
+            graphics.DrawLine(linePen, origin, target);
+          }
+        }
+      }
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="node">the root of the function tree to draw</param>
+    /// <param name="graphics">graphics object to draw on</param>
+    /// <param name="x">x coordinate of drawing area</param>
+    /// <param name="y">y coordinate of drawing area</param>
+    /// <param name="width">width of drawing area</param>
+    /// <param name="height">height of drawing area</param>
+    private void DrawFunctionTree(ISymbolicExpressionTreeNode node, Graphics graphics, int x, int y, int width, int height, Point connectionPoint) {
+      VisualSymbolicExpressionTreeNode visualTreeNode = visualTreeNodes[node];
+      float center_x = x + width / 2;
+      float center_y = y + height / 2;
+      int actualWidth = width - spacing;
+      int actualHeight = height - spacing;
+
+      using (var textBrush = new SolidBrush(visualTreeNode.TextColor))
+      using (var nodeLinePen = new Pen(visualTreeNode.LineColor))
+      using (var nodeFillBrush = new SolidBrush(visualTreeNode.FillColor)) {
+
+        //calculate size of node
+        if (actualWidth >= visualTreeNode.PreferredWidth && actualHeight >= visualTreeNode.PreferredHeight) {
+          visualTreeNode.Width = visualTreeNode.PreferredWidth;
+          visualTreeNode.Height = visualTreeNode.PreferredHeight;
+          visualTreeNode.X = (int)center_x - visualTreeNode.Width / 2;
+          visualTreeNode.Y = (int)center_y - visualTreeNode.Height / 2;
+        }
+          //width too small to draw in desired sized
+        else if (actualWidth < visualTreeNode.PreferredWidth && actualHeight >= visualTreeNode.PreferredHeight) {
+          visualTreeNode.Width = actualWidth;
+          visualTreeNode.Height = visualTreeNode.PreferredHeight;
+          visualTreeNode.X = x;
+          visualTreeNode.Y = (int)center_y - visualTreeNode.Height / 2;
+        }
+          //height too small to draw in desired sized
+        else if (actualWidth >= visualTreeNode.PreferredWidth && actualHeight < visualTreeNode.PreferredHeight) {
+          visualTreeNode.Width = visualTreeNode.PreferredWidth;
+          visualTreeNode.Height = actualHeight;
+          visualTreeNode.X = (int)center_x - visualTreeNode.Width / 2;
+          visualTreeNode.Y = y;
+        }
+          //width and height too small to draw in desired size
+        else {
+          visualTreeNode.Width = actualWidth;
+          visualTreeNode.Height = actualHeight;
+          visualTreeNode.X = x;
+          visualTreeNode.Y = y;
+        }
+
+        //draw terminal node
+        if (node.SubtreeCount == 0) {
+          graphics.FillRectangle(nodeFillBrush, visualTreeNode.X, visualTreeNode.Y, visualTreeNode.Width, visualTreeNode.Height);
+          graphics.DrawRectangle(nodeLinePen, visualTreeNode.X, visualTreeNode.Y, visualTreeNode.Width, visualTreeNode.Height);
+        } else {
+          graphics.FillEllipse(nodeFillBrush, visualTreeNode.X, visualTreeNode.Y, visualTreeNode.Width, visualTreeNode.Height);
+          graphics.DrawEllipse(nodeLinePen, visualTreeNode.X, visualTreeNode.Y, visualTreeNode.Width, visualTreeNode.Height);
+        }
+
+        //draw name of symbol
+        var text = node.ToString();
+        graphics.DrawString(text, textFont, textBrush, new RectangleF(visualTreeNode.X, visualTreeNode.Y, visualTreeNode.Width, visualTreeNode.Height), stringFormat);
+
+        //draw connection line to parent node
+        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
+        Point connectFrom = new Point(visualTreeNode.X + visualTreeNode.Width / 2, visualTreeNode.Y + visualTreeNode.Height);
+        int[] xBoundaries = new int[node.SubtreeCount + 1];
+        xBoundaries[0] = x;
+        for (int i = 0; i < node.SubtreeCount; i++) {
+          xBoundaries[i + 1] = (int)(xBoundaries[i] + (width * (double)node.GetSubtree(i).GetLength()) / (node.GetLength() - 1));
+          DrawFunctionTree(node.GetSubtree(i), graphics, xBoundaries[i], y + height, xBoundaries[i + 1] - xBoundaries[i], height, connectFrom);
+        }
+      }
+    }
+
+    protected void DrawTreeNode(VisualSymbolicExpressionTreeNode visualTreeNode) {
+      using (var graphics = Graphics.FromImage(image)) {
+        graphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.High;
+        graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
+        DrawTreeNode(graphics, visualTreeNode);
+      }
+    }
+
+    protected void DrawTreeNode(Graphics graphics, VisualSymbolicExpressionTreeNode visualTreeNode) {
+      graphics.Clip = new Region(new Rectangle(visualTreeNode.X, visualTreeNode.Y, visualTreeNode.Width + 1, visualTreeNode.Height + 1));
+      graphics.Clear(backgroundColor);
+      var node = visualTreeNode.SymbolicExpressionTreeNode;
+      using (var textBrush = new SolidBrush(visualTreeNode.TextColor))
+      using (var nodeLinePen = new Pen(visualTreeNode.LineColor))
+      using (var nodeFillBrush = new SolidBrush(visualTreeNode.FillColor)) {
+        //draw terminal node
+        if (node.SubtreeCount == 0) {
+          graphics.FillRectangle(nodeFillBrush, visualTreeNode.X, visualTreeNode.Y, visualTreeNode.Width, visualTreeNode.Height);
+          graphics.DrawRectangle(nodeLinePen, visualTreeNode.X, visualTreeNode.Y, visualTreeNode.Width, visualTreeNode.Height);
+        } else {
+          graphics.FillEllipse(nodeFillBrush, visualTreeNode.X, visualTreeNode.Y, visualTreeNode.Width, visualTreeNode.Height);
+          graphics.DrawEllipse(nodeLinePen, visualTreeNode.X, visualTreeNode.Y, visualTreeNode.Width, visualTreeNode.Height);
+        }
+        //draw name of symbol
+        var text = node.ToString();
+        graphics.DrawString(text, textFont, textBrush, new RectangleF(visualTreeNode.X, visualTreeNode.Y, visualTreeNode.Width, visualTreeNode.Height), stringFormat);
+      }
+    }
+    #endregion
+    #region save image
+    private void saveImageToolStripMenuItem_Click(object sender, EventArgs e) {
+      if (saveFileDialog.ShowDialog() == DialogResult.OK) {
+        string filename = saveFileDialog.FileName.ToLower();
+        if (filename.EndsWith("bmp")) SaveImageAsBitmap(filename);
+        else if (filename.EndsWith("emf")) SaveImageAsEmf(filename);
+        else SaveImageAsBitmap(filename);
+      }
+    }
+
+    public void SaveImageAsBitmap(string filename) {
+      if (tree == null) return;
+      Image image = new Bitmap(Width, Height);
+      using (Graphics g = Graphics.FromImage(image)) {
+        int height = this.Height / tree.Depth;
+        DrawFunctionTree(tree, g, 0, 0, Width, height);
+      }
+      image.Save(filename);
+    }
+
+    public void SaveImageAsEmf(string filename) {
+      if (tree == null) return;
+      using (Graphics g = CreateGraphics()) {
+        using (Metafile file = new Metafile(filename, g.GetHdc())) {
+          using (Graphics emfFile = Graphics.FromImage(file)) {
+            int height = this.Height / tree.Depth;
+            DrawFunctionTree(tree, emfFile, 0, 0, Width, height);
+          }
+        }
+        g.ReleaseHdc();
+      }
+    }
+    #endregion
+  }
+}
Index: /branches/HeuristicLab.TreeLayout/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionView.Designer.cs
===================================================================
--- /branches/HeuristicLab.TreeLayout/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionView.Designer.cs	(revision 9650)
+++ /branches/HeuristicLab.TreeLayout/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionView.Designer.cs	(revision 9650)
@@ -0,0 +1,107 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2013 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
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views {
+  partial class SymbolicExpressionView {
+    /// <summary> 
+    /// Required designer variable.
+    /// </summary>
+    private System.ComponentModel.IContainer components = null;
+
+    /// <summary> 
+    /// Clean up any resources being used.
+    /// </summary>
+    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+    protected override void Dispose(bool disposing) {
+      if (disposing && (components != null)) {
+        components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
+    #region Component Designer generated code
+
+    /// <summary> 
+    /// Required method for Designer support - do not modify 
+    /// the contents of this method with the code editor.
+    /// </summary>
+    private void InitializeComponent() {
+      this.textBox = new System.Windows.Forms.TextBox();
+      this.formattersComboBox = new System.Windows.Forms.ComboBox();
+      this.formatterLabel = new System.Windows.Forms.Label();
+      this.SuspendLayout();
+      // 
+      // textBox
+      // 
+      this.textBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+                  | System.Windows.Forms.AnchorStyles.Left)
+                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.textBox.BackColor = System.Drawing.Color.White;
+      this.textBox.Location = new System.Drawing.Point(3, 30);
+      this.textBox.Multiline = true;
+      this.textBox.Name = "textBox";
+      this.textBox.ReadOnly = true;
+      this.textBox.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
+      this.textBox.Size = new System.Drawing.Size(475, 282);
+      this.textBox.TabIndex = 0;
+      // 
+      // formattersComboBox
+      // 
+      this.formattersComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.formattersComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+      this.formattersComboBox.FormattingEnabled = true;
+      this.formattersComboBox.Location = new System.Drawing.Point(72, 3);
+      this.formattersComboBox.Name = "formattersComboBox";
+      this.formattersComboBox.Size = new System.Drawing.Size(406, 21);
+      this.formattersComboBox.TabIndex = 1;
+      this.formattersComboBox.SelectedIndexChanged += new System.EventHandler(this.formattersComboBox_SelectedIndexChanged);
+      // 
+      // formatterLabel
+      // 
+      this.formatterLabel.AutoSize = true;
+      this.formatterLabel.Location = new System.Drawing.Point(3, 6);
+      this.formatterLabel.Name = "formatterLabel";
+      this.formatterLabel.Size = new System.Drawing.Size(54, 13);
+      this.formatterLabel.TabIndex = 2;
+      this.formatterLabel.Text = "Formatter:";
+      // 
+      // SymbolicExpressionView
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
+      this.Controls.Add(this.formatterLabel);
+      this.Controls.Add(this.formattersComboBox);
+      this.Controls.Add(this.textBox);
+      this.Name = "SymbolicExpressionView";
+      this.Size = new System.Drawing.Size(481, 315);
+      this.ResumeLayout(false);
+      this.PerformLayout();
+
+    }
+
+    #endregion
+
+    private System.Windows.Forms.TextBox textBox;
+    private System.Windows.Forms.ComboBox formattersComboBox;
+    private System.Windows.Forms.Label formatterLabel;
+  }
+}
Index: /branches/HeuristicLab.TreeLayout/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionView.cs
===================================================================
--- /branches/HeuristicLab.TreeLayout/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionView.cs	(revision 9650)
+++ /branches/HeuristicLab.TreeLayout/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionView.cs	(revision 9650)
@@ -0,0 +1,82 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2013 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;
+using System.Collections.Generic;
+using System.Windows.Forms;
+using HeuristicLab.MainForm;
+using HeuristicLab.MainForm.WindowsForms;
+using HeuristicLab.PluginInfrastructure;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views {
+  [View("SymbolicExpression View")]
+  [Content(typeof(ISymbolicExpressionTree), false)]
+  public partial class SymbolicExpressionView : AsynchronousContentView {
+
+    List<ISymbolicExpressionTreeStringFormatter> treeFormattersList = new List<ISymbolicExpressionTreeStringFormatter>();
+
+    public new ISymbolicExpressionTree Content {
+      get { return (ISymbolicExpressionTree)base.Content; }
+      set { base.Content = value; }
+    }
+
+    public SymbolicExpressionView() {
+      InitializeComponent();
+      IEnumerable<ISymbolicExpressionTreeStringFormatter> formatters = ApplicationManager.Manager.GetInstances<ISymbolicExpressionTreeStringFormatter>();
+      treeFormattersList = new List<ISymbolicExpressionTreeStringFormatter>();
+      foreach (ISymbolicExpressionTreeStringFormatter formatter in formatters) {
+        treeFormattersList.Add(formatter);
+        formattersComboBox.Items.Add(formatter.Name);
+      }
+      if (formattersComboBox.Items.Count > 0)
+        formattersComboBox.SelectedIndex = 0;
+      else
+        formattersComboBox.SelectedIndex = -1;
+    }
+
+    protected override void OnContentChanged() {
+      base.OnContentChanged();
+      UpdateTextbox();
+    }
+
+    private void UpdateTextbox() {
+      if (Content == null || formattersComboBox.SelectedIndex < 0)
+        textBox.Text = string.Empty;
+      else {
+        try {
+          textBox.Text = treeFormattersList[formattersComboBox.SelectedIndex].Format(Content);
+        }
+        catch (ArgumentException) { textBox.Text = "Cannot format the symbolic expression tree with the selected formatter."; }
+        catch (NotSupportedException) { textBox.Text = "Formatting of the symbolic expression tree is not supported by the selected formatter."; }
+      }
+    }
+
+    protected override void SetEnabledStateOfControls() {
+      base.SetEnabledStateOfControls();
+      textBox.Enabled = Content != null;
+      textBox.ReadOnly = ReadOnly;
+    }
+
+    private void formattersComboBox_SelectedIndexChanged(object sender, System.EventArgs e) {
+      UpdateTextbox();
+    }
+  }
+}
Index: /branches/HeuristicLab.TreeLayout/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/TreeLayout.cs
===================================================================
--- /branches/HeuristicLab.TreeLayout/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/TreeLayout.cs	(revision 9650)
+++ /branches/HeuristicLab.TreeLayout/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/TreeLayout.cs	(revision 9650)
@@ -0,0 +1,287 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2013 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;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Linq;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views {
+  public class Node {
+    public Node Thread;
+    public Node Ancestor;
+
+    public float Mod; // position modifier
+    public float Prelim;
+    public float Change;
+    public float Shift;
+    public int Number;
+
+    public float X;
+    public float Y;
+
+    public ISymbolicExpressionTreeNode SymbolicExpressionTreeNode;
+
+    //    public int Number {
+    //      get {
+    //        var parent = SymbolicExpressionTreeNode.Parent;
+    //        if (parent == null) return -1;
+    //        return parent.IndexOfSubtree(SymbolicExpressionTreeNode);
+    //      }
+    //    }
+
+    public bool IsLeaf {
+      get { return SymbolicExpressionTreeNode.SubtreeCount == 0; }
+    }
+  }
+
+  public class TreeLayout {
+    private float distance = 5;
+    public float Distance {
+      get { return distance; }
+      set { distance = value; }
+    }
+
+    private ISymbolicExpressionTree symbolicExpressionTree;
+    public ISymbolicExpressionTree SymbolicExpressionTree {
+      get { return symbolicExpressionTree; }
+      set {
+        symbolicExpressionTree = value;
+        nodes.Clear();
+        var treeNodes = SymbolicExpressionTree.IterateNodesBreadth().ToList();
+        foreach (var treeNode in treeNodes) {
+          var node = new Node { SymbolicExpressionTreeNode = treeNode };
+          node.Ancestor = node;
+          nodes.Add(treeNode, node);
+        }
+        // assign a number to each node, representing its position among its siblings (parent.IndexOfSubtree)
+        foreach (var treeNode in treeNodes.Where(x => x.SubtreeCount > 0)) {
+          for (int i = 0; i != treeNode.SubtreeCount; ++i) {
+            nodes[treeNode.GetSubtree(i)].Number = i;
+          }
+        }
+        var r = nodes[symbolicExpressionTree.Root];
+        FirstWalk(r);
+        SecondWalk(r, -r.Prelim);
+        NormalizeCoordinates();
+      }
+    }
+
+    /// <summary>
+    /// Returns a map of coordinates for each node in the symbolic expression tree.
+    /// </summary>
+    /// <returns></returns>
+    public Dictionary<ISymbolicExpressionTreeNode, PointF> GetNodeCoordinates() {
+      var dict = new Dictionary<ISymbolicExpressionTreeNode, PointF>();
+      if (nodes == null || nodes.Count == 0) return dict;
+      foreach (var node in nodes.Values) {
+        dict.Add(node.SymbolicExpressionTreeNode, new PointF { X = node.X, Y = node.Y });
+      }
+      return dict;
+    }
+
+    /// <summary>
+    /// Returns the bounding box for this layout. When the layout is normalized, the rectangle should be [0,0,xmin,xmax].
+    /// </summary>
+    /// <returns></returns>
+    public RectangleF Bounds() {
+      float xmin, xmax, ymin, ymax; xmin = xmax = ymin = ymax = 0;
+      var list = nodes.Values.ToList();
+      for (int i = 0; i != list.Count; ++i) {
+        float x = list[i].X, y = list[i].Y;
+        if (xmin > x) xmin = x;
+        if (xmax < x) xmax = x;
+        if (ymin > y) ymin = y;
+        if (ymax < y) ymax = y;
+      }
+      return new RectangleF(xmin, ymin, xmax + distance, ymax + distance);
+    }
+
+    /// <summary>
+    /// Returns a string containing all the coordinates (useful for debugging).
+    /// </summary>
+    /// <returns></returns>
+    public string DumpCoordinates() {
+      if (nodes == null || nodes.Count == 0) return string.Empty;
+      return nodes.Values.Aggregate("", (current, node) => current + (node.X + " " + node.Y + Environment.NewLine));
+    }
+
+    private readonly Dictionary<ISymbolicExpressionTreeNode, Node> nodes;
+
+    public TreeLayout() {
+      nodes = new Dictionary<ISymbolicExpressionTreeNode, Node>();
+    }
+
+    /// <summary>
+    /// Transform node coordinates so that all coordinates are positive and start from 0.
+    /// </summary>
+    private void NormalizeCoordinates() {
+      var list = nodes.Values.ToList();
+      float xmin = 0, ymin = 0;
+      for (int i = 0; i != list.Count; ++i) {
+        if (xmin > list[i].X) xmin = list[i].X;
+        if (ymin > list[i].Y) ymin = list[i].Y;
+      }
+      for (int i = 0; i != list.Count; ++i) {
+        list[i].X -= xmin;
+        list[i].Y -= ymin;
+      }
+    }
+
+    private void FirstWalk(Node v) {
+      Node w;
+      if (v.IsLeaf) {
+        w = LeftSibling(v);
+        if (w != null) {
+          v.Prelim = w.Prelim + distance;
+        }
+      } else {
+        var symbExprNode = v.SymbolicExpressionTreeNode;
+        var defaultAncestor = nodes[symbExprNode.GetSubtree(0)]; // let defaultAncestor be the leftmost child of v
+        for (int i = 0; i != symbExprNode.SubtreeCount; ++i) {
+          var s = symbExprNode.GetSubtree(i);
+          w = nodes[s];
+          FirstWalk(w);
+          Apportion(w, ref defaultAncestor);
+        }
+        ExecuteShifts(v);
+        int c = symbExprNode.SubtreeCount;
+        var leftmost = nodes[symbExprNode.GetSubtree(0)];
+        var rightmost = nodes[symbExprNode.GetSubtree(c - 1)];
+        float midPoint = (leftmost.Prelim + rightmost.Prelim) / 2;
+        w = LeftSibling(v);
+        if (w != null) {
+          v.Prelim = w.Prelim + distance;
+          v.Mod = v.Prelim - midPoint;
+        } else {
+          v.Prelim = midPoint;
+        }
+      }
+    }
+
+    private void SecondWalk(Node v, float m) {
+      v.X = v.Prelim + m;
+      v.Y = symbolicExpressionTree.Root.GetBranchLevel(v.SymbolicExpressionTreeNode) * distance;
+      var symbExprNode = v.SymbolicExpressionTreeNode;
+      foreach (var s in symbExprNode.Subtrees) {
+        SecondWalk(nodes[s], m + v.Mod);
+      }
+    }
+
+    private void Apportion(Node v, ref Node defaultAncestor) {
+      var w = LeftSibling(v);
+      if (w == null) return;
+      Node vip = v;
+      Node vop = v;
+      Node vim = w;
+      Node vom = LeftmostSibling(vip);
+
+      float sip = vip.Mod;
+      float sop = vop.Mod;
+      float sim = vim.Mod;
+      float som = vom.Mod;
+
+      while (NextRight(vim) != null && NextLeft(vip) != null) {
+        vim = NextRight(vim);
+        vip = NextLeft(vip);
+        vom = NextLeft(vom);
+        vop = NextRight(vop);
+        vop.Ancestor = v;
+        float shift = (vim.Prelim + sim) - (vip.Prelim + sip) + distance;
+        if (shift > 0) {
+          var ancestor = Ancestor(vim, v) ?? defaultAncestor;
+          MoveSubtree(ancestor, v, shift);
+          sip += shift;
+          sop += shift;
+        }
+        sim += vim.Mod;
+        sip += vip.Mod;
+        som += vom.Mod;
+        sop += vop.Mod;
+      }
+      if (NextRight(vim) != null && NextRight(vop) == null) {
+        vop.Thread = NextRight(vim);
+        vop.Mod += (sim - sop);
+      }
+      if (NextLeft(vip) != null && NextLeft(vom) == null) {
+        vom.Thread = NextLeft(vip);
+        vom.Mod += (sip - som);
+        defaultAncestor = v;
+      }
+    }
+
+    private void MoveSubtree(Node wm, Node wp, float shift) {
+      int subtrees = wp.Number - wm.Number;
+      wp.Change -= shift / subtrees;
+      wp.Shift += shift;
+      wm.Change += shift / subtrees;
+      wp.Prelim += shift;
+      wp.Mod += shift;
+    }
+
+    private void ExecuteShifts(Node v) {
+      if (v.IsLeaf) return;
+      float shift = 0;
+      float change = 0;
+      for (int i = v.SymbolicExpressionTreeNode.SubtreeCount - 1; i >= 0; --i) {
+        var subtree = v.SymbolicExpressionTreeNode.GetSubtree(i);
+        var w = nodes[subtree];
+        w.Prelim += shift;
+        w.Mod += shift;
+        change += w.Change;
+        shift += (w.Shift + change);
+      }
+    }
+
+    #region Helper functions
+    private Node Ancestor(Node vi, Node v) {
+      var ancestor = vi.Ancestor;
+      return ancestor.SymbolicExpressionTreeNode.Parent == v.SymbolicExpressionTreeNode.Parent ? ancestor : null;
+    }
+
+    private Node NextLeft(Node v) {
+      int c = v.SymbolicExpressionTreeNode.SubtreeCount;
+      return c == 0 ? v.Thread : nodes[v.SymbolicExpressionTreeNode.GetSubtree(0)]; // return leftmost child
+    }
+
+    private Node NextRight(Node v) {
+      int c = v.SymbolicExpressionTreeNode.SubtreeCount;
+      return c == 0 ? v.Thread : nodes[v.SymbolicExpressionTreeNode.GetSubtree(c - 1)]; // return rightmost child
+    }
+
+    private Node LeftSibling(Node n) {
+      var parent = n.SymbolicExpressionTreeNode.Parent;
+      if (parent == null) return null;
+      int i = parent.IndexOfSubtree(n.SymbolicExpressionTreeNode);
+      if (i == 0) return null;
+      return nodes[parent.GetSubtree(i - 1)];
+    }
+
+    private Node LeftmostSibling(Node n) {
+      var parent = n.SymbolicExpressionTreeNode.Parent;
+      if (parent == null) return null;
+      int i = parent.IndexOfSubtree(n.SymbolicExpressionTreeNode);
+      if (i == 0) return null;
+      return nodes[parent.GetSubtree(0)];
+    }
+    #endregion
+  }
+}
Index: /branches/HeuristicLab.TreeLayout/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/VisualSymbolicExpressionTreeNode.cs
===================================================================
--- /branches/HeuristicLab.TreeLayout/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/VisualSymbolicExpressionTreeNode.cs	(revision 9650)
+++ /branches/HeuristicLab.TreeLayout/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/VisualSymbolicExpressionTreeNode.cs	(revision 9650)
@@ -0,0 +1,129 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2013 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;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views {
+  public class VisualSymbolicExpressionTreeNode : object {
+    private static readonly Color defaultLineColor = Color.Black;
+    private static readonly Color defaultTextColor = Color.Black;
+    private static readonly Color defaultFillColor = Color.White;
+    private const int defaultPreferredWidth = 70;
+    private const int defaultPreferredHeight = 46;
+
+    public VisualSymbolicExpressionTreeNode(ISymbolicExpressionTreeNode symbolicExpressionTreeNode) :
+      this(symbolicExpressionTreeNode, defaultLineColor) {
+    }
+
+    public VisualSymbolicExpressionTreeNode(ISymbolicExpressionTreeNode symbolicExpressionTreeNode, Color lineColor) :
+      this(symbolicExpressionTreeNode, lineColor, defaultTextColor) {
+    }
+
+    public VisualSymbolicExpressionTreeNode(ISymbolicExpressionTreeNode symbolicExpressionTreeNode, Color lineColor, Color textColor) :
+      this(symbolicExpressionTreeNode, lineColor, textColor, defaultFillColor) {
+    }
+
+    public VisualSymbolicExpressionTreeNode(ISymbolicExpressionTreeNode symbolicExpressionTreeNode, Color lineColor, Color textColor, Color fillColor) :
+      this(symbolicExpressionTreeNode, lineColor, textColor, fillColor, defaultPreferredWidth, defaultPreferredHeight) {
+    }
+
+    public VisualSymbolicExpressionTreeNode(ISymbolicExpressionTreeNode symbolicExpressionTreeNode, Color lineColor, Color textColor, Color fillColor, int width, int height) {
+      this.symbolicExpressionTreeNode = symbolicExpressionTreeNode;
+      this.lineColor = lineColor;
+      this.textColor = textColor;
+      this.fillColor = fillColor;
+      this.preferredWidth = width;
+      this.preferredHeight = height;
+      this.ToolTip = symbolicExpressionTreeNode.ToString();
+    }
+
+    #region members for internal use only
+    private int x;
+    public int X {
+      get { return x; }
+      internal set { this.x = value; }
+    }
+
+    private int y;
+    public int Y {
+      get { return y; }
+      internal set { this.y = value; }
+    }
+
+    private int width;
+    public int Width {
+      get { return this.width; }
+      internal set { this.width = value; }
+    }
+
+    private int height;
+    public int Height {
+      get { return this.height; }
+      internal set { this.height = value; }
+    }
+    #endregion
+
+    private ISymbolicExpressionTreeNode symbolicExpressionTreeNode;
+    public ISymbolicExpressionTreeNode SymbolicExpressionTreeNode {
+      get { return this.symbolicExpressionTreeNode; }
+      set {
+        symbolicExpressionTreeNode = value;
+        ToolTip = SymbolicExpressionTreeNode.ToString();
+      }
+    }
+
+    private int preferredWidth;
+    public int PreferredWidth {
+      get { return this.preferredWidth; }
+      set { this.preferredWidth = value; }
+    }
+
+    private int preferredHeight;
+    public int PreferredHeight {
+      get { return this.preferredHeight; }
+      set { this.preferredHeight = value; }
+    }
+
+    private Color lineColor;
+    public Color LineColor {
+      get { return this.lineColor; }
+      set { this.lineColor = value; }
+    }
+
+    private Color textColor;
+    public Color TextColor {
+      get { return this.textColor; }
+      set { this.textColor = value; }
+    }
+
+    private Color fillColor;
+    public Color FillColor {
+      get { return this.fillColor; }
+      set { this.fillColor = value; }
+    }
+
+    private string toolTip;
+    public string ToolTip {
+      get { return toolTip; }
+      set { toolTip = value; }
+    }
+  }
+}
Index: /branches/HeuristicLab.TreeLayout/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/VisualSymbolicExpressionTreeNodeConnection.cs
===================================================================
--- /branches/HeuristicLab.TreeLayout/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/VisualSymbolicExpressionTreeNodeConnection.cs	(revision 9650)
+++ /branches/HeuristicLab.TreeLayout/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/VisualSymbolicExpressionTreeNodeConnection.cs	(revision 9650)
@@ -0,0 +1,48 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2013 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;
+    }
+  }
+}
