- Timestamp:
- 03/08/10 15:15:47 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.Operators.Views.GraphVisualization/3.3/Model
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Operators.Views.GraphVisualization/3.3/Model/GraphVisualizationInfo.cs
r2966 r2968 49 49 } 50 50 51 foreach (IOperator oper in value.FirstValues) {51 foreach (IOperator oper in value.FirstValues) { 52 52 foreach (IParameter param in oper.Parameters) { 53 53 this.parameterOperatorMapping.Add(param, oper); … … 89 89 } 90 90 91 public override IDeepCloneable Clone(Cloner cloner) { 92 GraphVisualizationInfo clone = new GraphVisualizationInfo(); 93 cloner.RegisterClonedObject(this, clone); 94 clone.operatorGraph = (OperatorGraph)cloner.Clone(this.operatorGraph); 95 clone.oldInitialShape = (IOperatorShapeInfo)this.oldInitialShape.Clone(cloner); 96 clone.oldInitialShapeColor = this.oldInitialShapeColor; 97 98 IOperator op; 99 IOperatorShapeInfo shapeInfo; 100 foreach (KeyValuePair<IOperator, IOperatorShapeInfo> pair in this.operatorShapeInfoMapping.FirstEnumerable) { 101 op = (IOperator)cloner.Clone(pair.Key); 102 shapeInfo = (IOperatorShapeInfo)cloner.Clone(pair.Value); 103 clone.RegisterOperatorEvents(op); 104 clone.operatorParameterCollectionMapping.Add(op, pair.Key.Parameters); 105 clone.operatorShapeInfoMapping.Add(op, shapeInfo); 106 clone.shapeInfos.Add(shapeInfo); 107 } 108 109 foreach (IOperator oper in clone.operatorShapeInfoMapping.FirstValues) { 110 foreach (IParameter param in oper.Parameters) { 111 clone.parameterOperatorMapping.Add(param, oper); 112 IValueParameter<IOperator> opParam = param as IValueParameter<IOperator>; 113 if (opParam != null) { 114 clone.RegisterOperatorParameterEvents(opParam); 115 shapeInfo = clone.operatorShapeInfoMapping.GetByFirst(oper); 116 if (opParam.Value != null) { 117 clone.connections.Add(new KeyValuePair<IOperatorShapeInfo, string>(shapeInfo, param.Name), clone.operatorShapeInfoMapping.GetByFirst(opParam.Value)); 118 } 119 } else 120 clone.RegisterParameterEvents(param); 121 } 122 } 123 124 return clone; 125 } 126 91 127 public event EventHandler InitialShapeChanged; 92 128 private void operatorGraph_InitialOperatorChanged(object sender, EventArgs e) { … … 129 165 } 130 166 131 167 132 168 private OperatorGraph operatorGraph; 133 169 [Storable] -
trunk/sources/HeuristicLab.Operators.Views.GraphVisualization/3.3/Model/IShapeInfo.cs
r2934 r2968 30 30 31 31 namespace HeuristicLab.Operators.Views.GraphVisualization { 32 public interface IShapeInfo : I Item{32 public interface IShapeInfo : IDeepCloneable{ 33 33 Type ShapeType { get; } 34 34 Point Location { get; set; } -
trunk/sources/HeuristicLab.Operators.Views.GraphVisualization/3.3/Model/OperatorShapeInfo.cs
r2966 r2968 192 192 } 193 193 } 194 195 public override IDeepCloneable Clone(Cloner cloner) { 196 OperatorShapeInfo clone = (OperatorShapeInfo) base.Clone(cloner); 197 clone.collapsed = this.collapsed; 198 clone.color = this.color; 199 clone.lineColor = this.lineColor; 200 clone.lineWidth = this.lineWidth; 201 clone.title = this.title; 202 clone.icon = (Bitmap) this.icon.Clone(); 203 204 clone.connectorNames = this.connectorNames.ToList(); 205 clone.labels = this.labels.ToList(); 206 207 return clone; 208 } 194 209 } 195 210 } -
trunk/sources/HeuristicLab.Operators.Views.GraphVisualization/3.3/Model/ShapeInfo.cs
r2934 r2968 31 31 32 32 namespace HeuristicLab.Operators.Views.GraphVisualization { 33 internal abstract class ShapeInfo : Item,IShapeInfo {33 internal abstract class ShapeInfo : DeepCloneable, IShapeInfo { 34 34 private ShapeInfo() { 35 } 35 36 36 }37 37 protected ShapeInfo(Type shapeType) { 38 38 if (!typeof(IShape).IsAssignableFrom(shapeType)) … … 40 40 this.shapeType = shapeType; 41 41 } 42 43 public event EventHandler Changed;44 42 45 43 [Storable] … … 61 59 } 62 60 61 public event EventHandler Changed; 63 62 protected void OnChanged() { 64 63 if (this.Changed != null) … … 76 75 shape.Location = this.Location; 77 76 } 77 78 public override IDeepCloneable Clone(Cloner cloner) { 79 ShapeInfo clone = (ShapeInfo) base.Clone(cloner); 80 clone.shapeType = this.shapeType; 81 clone.location = this.location; 82 return clone; 83 } 78 84 } 79 85 }
Note: See TracChangeset
for help on using the changeset viewer.