Free cookie consent management tool by TermsFeed Policy Generator

Changeset 4840


Ignore:
Timestamp:
11/18/10 18:50:16 (14 years ago)
Author:
swinkler
Message:

Renamed solution in formatters branch; implemented view for display of symbolic expression trees as strings depending on the chosen formatter. (#1270)

Location:
branches/DataAnalysis.Extensions
Files:
1 added
11 edited
1 moved

Legend:

Unmodified
Added
Removed
  • branches/DataAnalysis.Extensions/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Formatters/3.3/HeuristicLabEncodingsSymbolicExpressionTreeEncodingFormattersPlugin.cs

    r4821 r4840  
    2626
    2727namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Formatters {
    28   [Plugin("HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Formatters", "3.3.1.4820")]
     28  [Plugin("HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Formatters", "3.3.1.4829")]
    2929  [PluginFile("HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Formatters-3.3.dll", PluginFileType.Assembly)]
    3030  [PluginDependency("HeuristicLab.Analysis", "3.3.1.0")]
  • branches/DataAnalysis.Extensions/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Formatters/3.3/Properties/AssemblyInfo.cs

    r4821 r4840  
    4545
    4646[assembly: AssemblyVersion("3.3.0.0")]
    47 [assembly: AssemblyFileVersion("3.3.1.4820")]
     47[assembly: AssemblyFileVersion("3.3.1.4829")]
  • branches/DataAnalysis.Extensions/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Formatters/3.3/SymbolicExpressionTreeSmalltalkStringFormatter.cs

    r4823 r4840  
    3636    protected SymbolicExpressionTreeSmalltalkStringFormatter(bool deserializing) : base(deserializing) { }
    3737    protected SymbolicExpressionTreeSmalltalkStringFormatter(SymbolicExpressionTreeSmalltalkStringFormatter original, Cloner cloner) : base(original, cloner) { }
    38     public SymbolicExpressionTreeSmalltalkStringFormatter() : base() { }
     38    public SymbolicExpressionTreeSmalltalkStringFormatter()
     39        : base() {
     40      Name = "Smalltalk String Formatter";
     41    }
    3942
    4043    public string Format(SymbolicExpressionTree symbolicExpressionTree) {
  • branches/DataAnalysis.Extensions/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.3/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views-3.3.csproj

    r4820 r4840  
    190190    </BootstrapperPackage>
    191191  </ItemGroup>
     192  <ItemGroup>
     193    <EmbeddedResource Include="SymbolicExpressionView.resx">
     194      <DependentUpon>SymbolicExpressionView.cs</DependentUpon>
     195    </EmbeddedResource>
     196  </ItemGroup>
    192197  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
    193198  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
  • branches/DataAnalysis.Extensions/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.3/HeuristicLabEncodingsSymbolicExpressionTreeEncodingViewsPlugin.cs

    r4821 r4840  
    2626
    2727namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views {
    28   [Plugin("HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views", "3.3.1.4820")]
     28  [Plugin("HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views", "3.3.1.4829")]
    2929  [PluginFile("HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views-3.3.dll", PluginFileType.Assembly)]
    3030  [PluginDependency("HeuristicLab.Collections", "3.3")]
  • branches/DataAnalysis.Extensions/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.3/Properties/AssemblyInfo.cs

    r4821 r4840  
    4545
    4646[assembly: AssemblyVersion("3.3.0.0")]
    47 [assembly: AssemblyFileVersion("3.3.1.4820")]
     47[assembly: AssemblyFileVersion("3.3.1.4829")]
  • branches/DataAnalysis.Extensions/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.3/SymbolicExpressionView.Designer.cs

    r4803 r4840  
    4646    private void InitializeComponent() {
    4747      this.textBox = new System.Windows.Forms.TextBox();
     48      this.formattersComboBox = new System.Windows.Forms.ComboBox();
     49      this.formatterLabel = new System.Windows.Forms.Label();
    4850      this.SuspendLayout();
    4951      //
    5052      // textBox
    5153      //
    52       this.textBox.Dock = System.Windows.Forms.DockStyle.Fill;
    53       this.textBox.Location = new System.Drawing.Point(0, 0);
     54      this.textBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     55                  | System.Windows.Forms.AnchorStyles.Left)
     56                  | System.Windows.Forms.AnchorStyles.Right)));
     57      this.textBox.Location = new System.Drawing.Point(3, 30);
    5458      this.textBox.Multiline = true;
    5559      this.textBox.Name = "textBox";
    56       this.textBox.Size = new System.Drawing.Size(150, 150);
     60      this.textBox.Size = new System.Drawing.Size(475, 282);
    5761      this.textBox.TabIndex = 0;
    5862      //
    59       // SymbolicExpressionTreeView
     63      // formattersComboBox
     64      //
     65      this.formattersComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     66                  | System.Windows.Forms.AnchorStyles.Right)));
     67      this.formattersComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
     68      this.formattersComboBox.FormattingEnabled = true;
     69      this.formattersComboBox.Location = new System.Drawing.Point(72, 3);
     70      this.formattersComboBox.Name = "formattersComboBox";
     71      this.formattersComboBox.Size = new System.Drawing.Size(406, 21);
     72      this.formattersComboBox.TabIndex = 1;
     73      this.formattersComboBox.SelectedIndexChanged += new System.EventHandler(this.formattersComboBox_SelectedIndexChanged);
     74      //
     75      // formatterLabel
     76      //
     77      this.formatterLabel.AutoSize = true;
     78      this.formatterLabel.Location = new System.Drawing.Point(3, 6);
     79      this.formatterLabel.Name = "formatterLabel";
     80      this.formatterLabel.Size = new System.Drawing.Size(54, 13);
     81      this.formatterLabel.TabIndex = 2;
     82      this.formatterLabel.Text = "Formatter:";
     83      //
     84      // SymbolicExpressionView
    6085      //
    6186      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    6287      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     88      this.Controls.Add(this.formatterLabel);
     89      this.Controls.Add(this.formattersComboBox);
    6390      this.Controls.Add(this.textBox);
    64       this.Name = "SymbolicExpressionTreeView";
     91      this.Name = "SymbolicExpressionView";
     92      this.Size = new System.Drawing.Size(481, 315);
    6593      this.ResumeLayout(false);
    6694      this.PerformLayout();
     
    7199
    72100    private System.Windows.Forms.TextBox textBox;
     101    private System.Windows.Forms.ComboBox formattersComboBox;
     102    private System.Windows.Forms.Label formatterLabel;
    73103  }
    74104}
  • branches/DataAnalysis.Extensions/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.3/SymbolicExpressionView.cs

    r4803 r4840  
    2323using HeuristicLab.MainForm;
    2424using HeuristicLab.MainForm.WindowsForms;
     25using HeuristicLab.PluginInfrastructure;
     26using System.Collections.Generic;
    2527
    2628namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views {
     
    2830  [Content(typeof(SymbolicExpressionTree), false)]
    2931  public partial class SymbolicExpressionView : AsynchronousContentView {
    30     private SymbolicExpressionTreeStringFormatter treeFormatter;
     32    private ISymbolicExpressionTreeStringFormatter treeFormatter;
     33    List<ISymbolicExpressionTreeStringFormatter> treeFormattersList = new List<ISymbolicExpressionTreeStringFormatter>();
    3134
    3235    public new SymbolicExpressionTree Content {
     
    3740    public SymbolicExpressionView() {
    3841      InitializeComponent();
    39       treeFormatter = new SymbolicExpressionTreeStringFormatter();
     42      IEnumerator<ISymbolicExpressionTreeStringFormatter> formatters = ApplicationManager.Manager.GetInstances<ISymbolicExpressionTreeStringFormatter>().GetEnumerator();
     43      treeFormattersList = new List<ISymbolicExpressionTreeStringFormatter>();
     44      formatters.MoveNext();
     45      int selectedIndex = -1;
     46      while (formatters.Current != null) {
     47        if (formatters.Current is SymbolicExpressionTreeStringFormatter)
     48          selectedIndex = treeFormattersList.Count;
     49        treeFormattersList.Add(formatters.Current.Clone() as ISymbolicExpressionTreeStringFormatter);
     50        formattersComboBox.Items.Add(treeFormattersList[treeFormattersList.Count - 1].Name);
     51        formatters.MoveNext();
     52      }
     53      formattersComboBox.SelectedIndex = selectedIndex;
     54      //treeFormatter = new SymbolicExpressionTreeStringFormatter();
    4055    }
    4156
     
    5368      textBox.ReadOnly = ReadOnly;
    5469    }
     70
     71    private void formattersComboBox_SelectedIndexChanged(object sender, System.EventArgs e) {
     72      treeFormatter = treeFormattersList[formattersComboBox.SelectedIndex];
     73      OnContentChanged();
     74    }
    5575  }
    5676}
  • branches/DataAnalysis.Extensions/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/HeuristicLabEncodingsSymbolicExpressionTreeEncodingPlugin.cs

    r4821 r4840  
    2626
    2727namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
    28   [Plugin("HeuristicLab.Encodings.SymbolicExpressionTreeEncoding", "3.3.1.4820")]
     28  [Plugin("HeuristicLab.Encodings.SymbolicExpressionTreeEncoding", "3.3.1.4829")]
    2929  [PluginFile("HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.3.dll", PluginFileType.Assembly)]
    3030  [PluginDependency("HeuristicLab.Analysis", "3.3.1.0")]
  • branches/DataAnalysis.Extensions/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Properties/AssemblyInfo.cs

    r4821 r4840  
    4545
    4646[assembly: AssemblyVersion("3.3.0.0")]
    47 [assembly: AssemblyFileVersion("3.3.1.4820")]
     47[assembly: AssemblyFileVersion("3.3.1.4829")]
  • branches/DataAnalysis.Extensions/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/SymbolicExpressionTreeStringFormatter.cs

    r4820 r4840  
    3535    [StorableConstructor]
    3636    protected SymbolicExpressionTreeStringFormatter(bool deserializing) : base(deserializing) { }
    37     protected SymbolicExpressionTreeStringFormatter(SymbolicExpressionTreeStringFormatter original, Cloner cloner) : base(original, cloner) { }
     37    protected SymbolicExpressionTreeStringFormatter(SymbolicExpressionTreeStringFormatter original, Cloner cloner)
     38      : base(original, cloner) {
     39      Indent = original.Indent;
     40    }
    3841    public SymbolicExpressionTreeStringFormatter()
    3942      : base() {
     43      Name = "Default String Formatter";
    4044      Indent = true;
    4145    }
Note: See TracChangeset for help on using the changeset viewer.