Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/21/11 17:16:50 (13 years ago)
Author:
mkommend
Message:

#1486: Decoupled operator graph visualization content classes from view classes.

File:
1 edited

Legend:

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

    r5445 r6036  
    2525using HeuristicLab.Common;
    2626using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    27 using Netron.Diagramming.Core;
    2827
    2928namespace HeuristicLab.Operators.Views.GraphVisualization {
     
    3433    protected ShapeInfo(ShapeInfo original, Cloner cloner)
    3534      : base(original, cloner) {
    36       shapeType = original.shapeType;
    3735      location = original.location;
    3836    }
    3937
    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() { }
    5139
    5240    [Storable]
     
    6957      if (handler != null) this.Changed(this, EventArgs.Empty);
    7058    }
    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     }
    8659  }
    8760}
Note: See TracChangeset for help on using the changeset viewer.