Changeset 576
- Timestamp:
- 09/15/08 13:48:36 (16 years ago)
- Location:
- trunk/sources/HeuristicLab.CEDMA.Charting
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.CEDMA.Charting/ModelView.Designer.cs
r567 r576 26 26 this.splitContainer = new System.Windows.Forms.SplitContainer(); 27 27 this.lowerSplitContainer = new System.Windows.Forms.SplitContainer(); 28 this.algoButton = new System.Windows.Forms.Button(); 28 29 this.splitContainer.Panel2.SuspendLayout(); 29 30 this.splitContainer.SuspendLayout(); … … 33 34 // splitContainer 34 35 // 35 this.splitContainer.Dock = System.Windows.Forms.DockStyle.Fill; 36 this.splitContainer.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 37 | System.Windows.Forms.AnchorStyles.Left) 38 | System.Windows.Forms.AnchorStyles.Right))); 36 39 this.splitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel2; 37 40 this.splitContainer.Location = new System.Drawing.Point(0, 0); … … 42 45 // 43 46 this.splitContainer.Panel2.Controls.Add(this.lowerSplitContainer); 44 this.splitContainer.Size = new System.Drawing.Size(450, 4 59);45 this.splitContainer.SplitterDistance = 217;47 this.splitContainer.Size = new System.Drawing.Size(450, 427); 48 this.splitContainer.SplitterDistance = 185; 46 49 this.splitContainer.TabIndex = 0; 47 50 // … … 56 59 this.lowerSplitContainer.TabIndex = 0; 57 60 // 61 // algoButton 62 // 63 this.algoButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 64 this.algoButton.Location = new System.Drawing.Point(352, 433); 65 this.algoButton.Name = "algoButton"; 66 this.algoButton.Size = new System.Drawing.Size(95, 23); 67 this.algoButton.TabIndex = 1; 68 this.algoButton.Text = "Open algorithm"; 69 this.algoButton.UseVisualStyleBackColor = true; 70 this.algoButton.Click += new System.EventHandler(this.algoButton_Click); 71 // 58 72 // ModelView 59 73 // 60 74 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 61 75 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 76 this.Controls.Add(this.algoButton); 62 77 this.Controls.Add(this.splitContainer); 63 78 this.Name = "ModelView"; … … 74 89 private System.Windows.Forms.SplitContainer splitContainer; 75 90 private System.Windows.Forms.SplitContainer lowerSplitContainer; 91 private System.Windows.Forms.Button algoButton; 76 92 77 93 } -
trunk/sources/HeuristicLab.CEDMA.Charting/ModelView.cs
r567 r576 19 19 private IFunctionTree model; 20 20 private int targetVariable; 21 private Record record; 21 22 22 public ModelView( Dataset dataset, IFunctionTree model, int targetVariable) {23 public ModelView(Record record, Dataset dataset, IFunctionTree model, int targetVariable) { 23 24 InitializeComponent(); 24 25 this.dataset = dataset; 25 26 this.model = model; 26 27 this.targetVariable = targetVariable; 28 this.record = record; 27 29 28 30 splitContainer.Panel1.Controls.Add((Control)model.CreateView()); … … 111 113 return control; 112 114 } 115 116 private void algoButton_Click(object sender, EventArgs e) { 117 record.OpenGeneratingAlgorithm(); 118 } 113 119 } 114 120 } -
trunk/sources/HeuristicLab.CEDMA.Charting/Record.cs
r575 r576 108 108 resultList.OpenModel(this); 109 109 } 110 111 internal void OpenGeneratingAlgorithm() { 112 resultList.OpenAlgorithm(this); 113 } 110 114 } 111 115 } -
trunk/sources/HeuristicLab.CEDMA.Charting/ResultList.cs
r575 r576 63 63 private readonly Entity rawDataPredicate = new Entity(cedmaNS + "RawData"); 64 64 private readonly Entity hasModelPredicate = new Entity(cedmaNS + "Model"); 65 private readonly Entity generatedByPredicate = new Entity(cedmaNS + "GeneratedBy"); 65 66 private readonly Entity anyEntity = new Entity(null); 66 67 private Dictionary<Record, Dataset> datasets; … … 169 170 Dataset dataset = GetDataset(record); 170 171 171 ModelView modelView = new ModelView( dataset, tree, targetVariable);172 ModelView modelView = new ModelView(record, dataset, tree, targetVariable); 172 173 PluginManager.ControlManager.ShowControl(modelView); 173 174 } … … 190 191 return datasets[record]; 191 192 } 193 194 internal void OpenAlgorithm(Record record) { 195 IList<Statement> generatedBy = store.Select(new Statement(new Entity(record.Uri), generatedByPredicate, anyEntity)); 196 if(generatedBy.Count == 1) { 197 IList<Statement> algoResult = store.Select(new Statement((Entity)generatedBy[0].Property, rawDataPredicate, anyEntity)); 198 if(algoResult.Count == 1) { 199 string rawData = ((SerializedLiteral)algoResult[0].Property).RawData; 200 XmlDocument doc = new XmlDocument(); 201 doc.LoadXml(rawData); 202 IItem algo = (IItem)PersistenceManager.Restore(doc.ChildNodes[1], new Dictionary<Guid, IStorable>()); 203 PluginManager.ControlManager.ShowControl(algo.CreateView()); 204 } 205 } 206 } 192 207 } 193 208 }
Note: See TracChangeset
for help on using the changeset viewer.