Changeset 2934 for trunk/sources/HeuristicLab.Operators.Views.GraphVisualization/3.3/Model/ShapeInfo.cs
- Timestamp:
- 03/05/10 12:37:59 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Operators.Views.GraphVisualization/3.3/Model/ShapeInfo.cs
r2893 r2934 28 28 using Netron.Diagramming.Core; 29 29 using HeuristicLab.Collections; 30 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 30 31 31 32 namespace HeuristicLab.Operators.Views.GraphVisualization { 32 internal abstract class ShapeInfo : Item, IShapeInfo { 33 internal abstract class ShapeInfo : Item,IShapeInfo { 34 private ShapeInfo() { 35 36 } 33 37 protected ShapeInfo(Type shapeType) { 34 38 if (!typeof(IShape).IsAssignableFrom(shapeType)) … … 37 41 } 38 42 43 public event EventHandler Changed; 44 45 [Storable] 39 46 private Type shapeType; 40 47 public Type ShapeType { … … 42 49 } 43 50 51 [Storable] 44 52 private Point location; 45 53 public Point Location { … … 53 61 } 54 62 55 private Size size; 56 public Size Size { 57 get { return this.size; } 58 set { 59 if (this.size != value) { 60 this.size = value; 61 this.OnChanged(); 62 } 63 } 63 protected void OnChanged() { 64 if (this.Changed != null) 65 this.Changed(this, EventArgs.Empty); 64 66 } 65 66 public abstract void AddConnector(string connectorName);67 public abstract void RemoveConnector(string connectorName);68 67 69 68 public virtual IShape CreateShape() { … … 71 70 shape.Tag = this; 72 71 shape.Location = this.Location; 73 shape.Height = this.Size.Height;74 shape.Width = this.Size.Width;75 72 return shape; 76 73 } … … 78 75 public virtual void UpdateShape(IShape shape) { 79 76 shape.Location = this.Location; 80 shape.Height = this.Size.Height;81 shape.Width = this.Size.Width;82 77 } 83 78 }
Note: See TracChangeset
for help on using the changeset viewer.