Changeset 6036 for trunk/sources/HeuristicLab.Operators.Views.GraphVisualization/3.3/General/ShapeInfo.cs
- Timestamp:
- 04/21/11 17:16:50 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Operators.Views.GraphVisualization/3.3/General/ShapeInfo.cs
r5445 r6036 25 25 using HeuristicLab.Common; 26 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 using Netron.Diagramming.Core;28 27 29 28 namespace HeuristicLab.Operators.Views.GraphVisualization { … … 34 33 protected ShapeInfo(ShapeInfo original, Cloner cloner) 35 34 : base(original, cloner) { 36 shapeType = original.shapeType;37 35 location = original.location; 38 36 } 39 37 40 protected ShapeInfo(Type shapeType) { 41 if (!typeof(IShape).IsAssignableFrom(shapeType)) 42 throw new ArgumentException("The passed shape type " + shapeType + " must be derived from IShape."); 43 this.shapeType = shapeType; 44 } 45 46 [Storable] 47 private Type shapeType; 48 public Type ShapeType { 49 get { return this.shapeType; } 50 } 38 protected ShapeInfo() : base() { } 51 39 52 40 [Storable] … … 69 57 if (handler != null) this.Changed(this, EventArgs.Empty); 70 58 } 71 72 public virtual IShape CreateShape() {73 IShape shape = (IShape)Activator.CreateInstance(this.shapeType);74 shape.Tag = this;75 shape.Location = this.Location;76 return shape;77 }78 79 public virtual void UpdateShape(IShape shape) {80 shape.Location = this.Location;81 }82 83 public virtual void UpdateShapeInfo(IShape shape) {84 this.Location = shape.Location;85 }86 59 } 87 60 }
Note: See TracChangeset
for help on using the changeset viewer.