Changeset 6497


Ignore:
Timestamp:
06/29/11 13:08:43 (8 years ago)
Author:
mkommend
Message:

#1479: Generate sample tree and minor bug fixes.

Location:
branches/GP.Grammar.Editor/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • branches/GP.Grammar.Editor/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views-3.4.csproj

    r6415 r6497  
    122122      <DependentUpon>SymbolicExpressionGrammarEditorView.cs</DependentUpon>
    123123    </Compile>
     124    <Compile Include="SymbolicExpressionGrammarSampleExpressionTreeView.cs">
     125      <SubType>UserControl</SubType>
     126    </Compile>
     127    <Compile Include="SymbolicExpressionGrammarSampleExpressionTreeView.Designer.cs">
     128      <DependentUpon>SymbolicExpressionGrammarSampleExpressionTreeView.cs</DependentUpon>
     129    </Compile>
    124130    <Compile Include="SymbolicExpressionGrammarView.cs">
    125131      <SubType>UserControl</SubType>
     
    198204      <Name>HeuristicLab.MainForm-3.3</Name>
    199205    </ProjectReference>
     206    <ProjectReference Include="..\..\HeuristicLab.Operators\3.3\HeuristicLab.Operators-3.3.csproj">
     207      <Project>{23DA7FF4-D5B8-41B6-AA96-F0561D24F3EE}</Project>
     208      <Name>HeuristicLab.Operators-3.3</Name>
     209    </ProjectReference>
    200210    <ProjectReference Include="..\..\HeuristicLab.Optimization.Views\3.3\HeuristicLab.Optimization.Views-3.3.csproj">
    201211      <Project>{662B4B15-8F4D-4AE5-B3EB-D91C215F5AF2}</Project>
    202212      <Name>HeuristicLab.Optimization.Views-3.3</Name>
    203213    </ProjectReference>
     214    <ProjectReference Include="..\..\HeuristicLab.Optimization\3.3\HeuristicLab.Optimization-3.3.csproj">
     215      <Project>{14AB8D24-25BC-400C-A846-4627AA945192}</Project>
     216      <Name>HeuristicLab.Optimization-3.3</Name>
     217    </ProjectReference>
    204218    <ProjectReference Include="..\..\HeuristicLab.PluginInfrastructure\3.3\HeuristicLab.PluginInfrastructure-3.3.csproj">
    205219      <Project>{94186A6A-5176-4402-AE83-886557B53CCA}</Project>
    206220      <Name>HeuristicLab.PluginInfrastructure-3.3</Name>
     221    </ProjectReference>
     222    <ProjectReference Include="..\..\HeuristicLab.Random\3.3\HeuristicLab.Random-3.3.csproj">
     223      <Project>{F4539FB6-4708-40C9-BE64-0A1390AEA197}</Project>
     224      <Name>HeuristicLab.Random-3.3</Name>
    207225    </ProjectReference>
    208226    <ProjectReference Include="..\..\HeuristicLab.Visualization.ChartControlsExtensions\3.3\HeuristicLab.Visualization.ChartControlsExtensions-3.3.csproj">
     
    232250      <Install>true</Install>
    233251    </BootstrapperPackage>
     252  </ItemGroup>
     253  <ItemGroup>
     254    <EmbeddedResource Include="SymbolicExpressionGrammarEditorView.resx">
     255      <DependentUpon>SymbolicExpressionGrammarEditorView.cs</DependentUpon>
     256    </EmbeddedResource>
    234257  </ItemGroup>
    235258  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  • branches/GP.Grammar.Editor/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/HeuristicLabEncodingsSymbolicExpressionTreeEncodingViewsPlugin.cs.frame

    r5869 r6497  
    3030  [PluginDependency("HeuristicLab.Collections", "3.3")]
    3131  [PluginDependency("HeuristicLab.Common", "3.3")]
     32  [PluginDependency("HeuristicLab.Common.Resources", "3.3")]
    3233  [PluginDependency("HeuristicLab.Core", "3.3")]
    3334  [PluginDependency("HeuristicLab.Core.Views", "3.3")]
     
    3536  [PluginDependency("HeuristicLab.MainForm", "3.3")]
    3637  [PluginDependency("HeuristicLab.MainForm.WindowsForms", "3.3")]
     38  [PluginDependency("HeuristicLab.Random","3.3")]
    3739  public class HeuristicLabEncodingsSymbolicExpressionTreeEncodingViewsPlugin : PluginBase {
    3840  }
  • branches/GP.Grammar.Editor/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarEditorView.Designer.cs

    r6493 r6497  
    3838      this.symbolDetailsGroupBox = new System.Windows.Forms.GroupBox();
    3939      this.symbolDetailsViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
     40      this.showSampleTreeButton = new System.Windows.Forms.Button();
    4041      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
    4142      this.grpSymbols.SuspendLayout();
     
    8283      // splitContainer1.Panel1
    8384      //
     85      this.splitContainer1.Panel1.Controls.Add(this.showSampleTreeButton);
    8486      this.splitContainer1.Panel1.Controls.Add(this.copyButton);
    8587      this.splitContainer1.Panel1.Controls.Add(this.showDetailsCheckBox);
     
    157159      this.symbolsTreeView.Name = "symbolsTreeView";
    158160      this.symbolsTreeView.SelectedImageIndex = 0;
    159       this.symbolsTreeView.Size = new System.Drawing.Size(185, 331);
     161      this.symbolsTreeView.Size = new System.Drawing.Size(185, 299);
    160162      this.symbolsTreeView.TabIndex = 0;
    161163      this.symbolsTreeView.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.symbolsTreeView_AfterCheck);
     164      this.symbolsTreeView.ItemDrag += new System.Windows.Forms.ItemDragEventHandler(this.symbolsTreeView_ItemDrag);
    162165      this.symbolsTreeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.symbolsTreeView_AfterSelect);
    163166      this.symbolsTreeView.DragDrop += new System.Windows.Forms.DragEventHandler(this.symbolsTreeView_DragDrop);
    164167      this.symbolsTreeView.DragEnter += new System.Windows.Forms.DragEventHandler(this.symbolsTreeView_DragEnter);
    165168      this.symbolsTreeView.DragOver += new System.Windows.Forms.DragEventHandler(this.symbolsTreeView_DragOver);
    166       this.symbolsTreeView.ItemDrag += new System.Windows.Forms.ItemDragEventHandler(this.symbolsTreeView_ItemDrag);
    167169      this.symbolsTreeView.KeyDown += new System.Windows.Forms.KeyEventHandler(this.symbolsTreeView_KeyDown);
    168170      this.symbolsTreeView.MouseDown += new System.Windows.Forms.MouseEventHandler(this.symbolsTreeView_MouseDown);
     
    227229      this.symbolDetailsViewHost.ViewsLabelVisible = true;
    228230      this.symbolDetailsViewHost.ViewType = null;
     231      //
     232      // showSampleTreeButton
     233      //
     234      this.showSampleTreeButton.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
     235            | System.Windows.Forms.AnchorStyles.Right)));
     236      this.showSampleTreeButton.Location = new System.Drawing.Point(3, 333);
     237      this.showSampleTreeButton.Name = "showSampleTreeButton";
     238      this.showSampleTreeButton.Size = new System.Drawing.Size(185, 23);
     239      this.showSampleTreeButton.TabIndex = 9;
     240      this.showSampleTreeButton.Text = "Show Sample Tree";
     241      this.showSampleTreeButton.UseVisualStyleBackColor = true;
     242      this.showSampleTreeButton.Click += new System.EventHandler(this.showSampleTreeButton_Click);
    229243      //
    230244      // SymbolicExpressionGrammarEditorView
     
    268282    protected System.Windows.Forms.Button copyButton;
    269283    private SymbolicExpressionGrammarAllowedChildSymbolsControl allowedChildSymbolsControl;
     284    private System.Windows.Forms.Button showSampleTreeButton;
    270285  }
    271286}
  • branches/GP.Grammar.Editor/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarEditorView.cs

    r6494 r6497  
    3232namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views {
    3333  [View("Symbolic Expression Grammar Editor")]
    34   [Content(typeof(ISymbolicExpressionGrammar), false)]
     34  [Content(typeof(ISymbolicExpressionGrammar), true)]
    3535  public partial class SymbolicExpressionGrammarEditorView : NamedItemView {
    3636    public SymbolicExpressionGrammarEditorView() {
     
    220220    private void symbolsTreeView_MouseDown(object sender, MouseEventArgs e) {
    221221      // enables deselection of treeNodes
    222       if (symbolsTreeView.SelectedNode == null) return;
    223222      Point coordinates = new Point(e.X, e.Y);
    224       if (e.Button == System.Windows.Forms.MouseButtons.Left && symbolsTreeView.GetNodeAt(coordinates) == null) {
     223      TreeNode node = symbolsTreeView.GetNodeAt(coordinates);
     224      if (e.Button == System.Windows.Forms.MouseButtons.Left && node == null) {
    225225        symbolsTreeView.SelectedNode = null;
    226226        symbolDetailsViewHost.Content = null;
     
    256256          ISymbol symbol = (ISymbol)typeSelectorDialog.TypeSelector.CreateInstanceOfSelectedType();
    257257          ChangeDuplicateSymbolNames(symbol);
    258 
    259           var selectedNode = symbolsTreeView.SelectedNode;
    260           GroupSymbol groupSymbol = selectedNode.Tag as GroupSymbol;
    261           if (groupSymbol == null && selectedNode.Parent != null) groupSymbol = selectedNode.Parent.Tag as GroupSymbol;
    262 
     258          GroupSymbol groupSymbol = null;
     259
     260          TreeNode selectedNode = symbolsTreeView.SelectedNode;
     261          if (selectedNode != null) {
     262            groupSymbol = selectedNode.Tag as GroupSymbol;
     263            if (groupSymbol == null && selectedNode.Parent != null) groupSymbol = selectedNode.Parent.Tag as GroupSymbol;
     264          }
    263265          if (groupSymbol != null) groupSymbol.SymbolsCollection.Add(symbol);
    264266          else Content.AddSymbol(symbol);
     
    300302      splitContainer1.Panel2Collapsed = !showDetailsCheckBox.Checked;
    301303    }
     304
     305    private void showSampleTreeButton_Click(object sender, EventArgs e) {
     306      SymbolicExpressionGrammarSampleExpressionTreeView view = new SymbolicExpressionGrammarSampleExpressionTreeView();
     307      view.Content = Content;
     308      view.Show();
     309    }
     310
    302311    #endregion
    303312
  • branches/GP.Grammar.Editor/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarView.cs

    r6299 r6497  
    3030namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views {
    3131  [View("Symbolic Expression Grammar View")]
    32   [Content(typeof(ISymbolicExpressionGrammar), true)]
     32  [Content(typeof(ISymbolicExpressionGrammar), false)]
    3333  public partial class SymbolicExpressionGrammarView : NamedItemView {
    3434    private CheckedItemList<ISymbol> symbols;
Note: See TracChangeset for help on using the changeset viewer.