Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/05/10 12:37:59 (14 years ago)
Author:
mkommend
Message:

added parameters, corrected drag and drop position (ticket #867)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Operators.Views.GraphVisualization/3.3/Model/ShapeInfo.cs

    r2893 r2934  
    2828using Netron.Diagramming.Core;
    2929using HeuristicLab.Collections;
     30using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    3031
    3132namespace HeuristicLab.Operators.Views.GraphVisualization {
    32   internal abstract class ShapeInfo : Item, IShapeInfo {
     33  internal abstract class ShapeInfo : Item,IShapeInfo {
     34    private ShapeInfo() {
     35
     36    }
    3337    protected ShapeInfo(Type shapeType) {
    3438      if (!typeof(IShape).IsAssignableFrom(shapeType))
     
    3741    }
    3842
     43    public event EventHandler Changed;
     44
     45    [Storable]
    3946    private Type shapeType;
    4047    public Type ShapeType {
     
    4249    }
    4350
     51    [Storable]
    4452    private Point location;
    4553    public Point Location {
     
    5361    }
    5462
    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);
    6466    }
    65 
    66     public abstract void AddConnector(string connectorName);
    67     public abstract void RemoveConnector(string connectorName);
    6867
    6968    public virtual IShape CreateShape() {
     
    7170      shape.Tag = this;
    7271      shape.Location = this.Location;
    73       shape.Height = this.Size.Height;
    74       shape.Width = this.Size.Width;
    7572      return shape;
    7673    }
     
    7875    public virtual void UpdateShape(IShape shape) {
    7976      shape.Location = this.Location;
    80       shape.Height = this.Size.Height;
    81       shape.Width = this.Size.Width;
    8277    }
    8378  }
Note: See TracChangeset for help on using the changeset viewer.