- Timestamp:
- 04/21/11 17:16:50 (13 years ago)
- Location:
- trunk/sources/HeuristicLab.Operators.Views.GraphVisualization/3.3/General
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Operators.Views.GraphVisualization/3.3/General/IShapeInfo.cs
r5445 r6036 24 24 using System.Drawing; 25 25 using HeuristicLab.Common; 26 using Netron.Diagramming.Core;27 26 28 27 namespace HeuristicLab.Operators.Views.GraphVisualization { 29 28 public interface IShapeInfo : IDeepCloneable { 30 Type ShapeType { get; }31 29 Point Location { get; set; } 32 33 IShape CreateShape();34 30 IEnumerable<string> Connectors { get; } 35 void UpdateShape(IShape shape);36 void UpdateShapeInfo(IShape shape);37 31 38 32 event EventHandler Changed; -
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.