Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/05/10 13:08:50 (14 years ago)
Author:
mkommend
Message:

added visual indication for operator breakpoints (ticket #867)

Location:
trunk/sources/HeuristicLab.Operators.Views.GraphVisualization/3.3/Model
Files:
5 edited

Legend:

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

    r2934 r2935  
    202202    }
    203203
     204    private void OperatorBreakpointChanged(object sender, EventArgs e) {
     205      IOperator op = (IOperator)sender;
     206      IOperatorShapeInfo operatorShapeInfo = this.operatorShapeInfoMapping.GetByFirst(op);
     207      if (op.Breakpoint) {
     208        operatorShapeInfo.LineColor = Color.Red;
     209        operatorShapeInfo.LineWidth = 2;
     210      } else {
     211        operatorShapeInfo.LineColor = Color.Black;
     212        operatorShapeInfo.LineWidth = 1;
     213      }
     214    }
     215
    204216    private void OperatorNameChanged(object sender, EventArgs e) {
    205217      IOperator op = (IOperator)sender;
     
    229241      op.Parameters.CollectionReset += new CollectionItemsChangedEventHandler<IParameter>(Parameters_CollectionReset);
    230242      op.NameChanged += new EventHandler(OperatorNameChanged);
     243      op.BreakpointChanged += new EventHandler(OperatorBreakpointChanged);
    231244    }
    232245
     
    237250      op.Parameters.CollectionReset -= new CollectionItemsChangedEventHandler<IParameter>(Parameters_CollectionReset);
    238251      op.NameChanged -= new EventHandler(OperatorNameChanged);
     252      op.BreakpointChanged -= new EventHandler(OperatorBreakpointChanged);
    239253    }
    240254    #endregion
  • trunk/sources/HeuristicLab.Operators.Views.GraphVisualization/3.3/Model/IOperatorShapeInfo.cs

    r2934 r2935  
    3131    string Title { get; set; }
    3232    Color Color { get; set; }
     33    Color LineColor { get; set; }
     34    float LineWidth { get; set; }
    3335    Bitmap Icon { get; set; }
    3436
  • trunk/sources/HeuristicLab.Operators.Views.GraphVisualization/3.3/Model/OperatorShape.cs

    r2934 r2935  
    2929using HeuristicLab.Netron;
    3030
     31
    3132namespace HeuristicLab.Operators.Views.GraphVisualization {
    3233  public class OperatorShape : ComplexShapeBase {
     
    5455          this.expandIconMaterial.Collapsed = value;
    5556      }
     57    }
     58
     59    private Color lineColor;
     60    public Color LineColor {
     61      get { return this.lineColor; }
     62      set { this.lineColor = value; }
     63    }
     64
     65    private float lineWidth;
     66    public float LineWidth {
     67      get { return this.lineWidth; }
     68      set { this.lineWidth = value; }
    5669    }
    5770
     
    205218      g.SmoothingMode = SmoothingMode.HighQuality;
    206219
    207       Pen pen;
    208       if (Hovered)
    209         pen = ArtPalette.HighlightPen;
    210       else
    211         pen = mPenStyle.DrawingPen();
     220      Pen pen = new Pen(lineColor,lineWidth);
    212221
    213222      GraphicsPath path = new GraphicsPath();
  • trunk/sources/HeuristicLab.Operators.Views.GraphVisualization/3.3/Model/OperatorShapeInfo.cs

    r2934 r2935  
    111111
    112112    [Storable]
     113    private Color lineColor;
     114    public Color LineColor {
     115      get { return this.lineColor; }
     116      set {
     117        if (this.lineColor != value) {
     118          this.lineColor = value;
     119          this.OnChanged();
     120        }
     121      }
     122    }
     123
     124    [Storable]
     125    private float lineWidth;
     126    public float LineWidth {
     127      get { return this.lineWidth; }
     128      set {
     129        if (this.lineWidth != value) {
     130          this.lineWidth = value;
     131          this.OnChanged();
     132        }
     133      }
     134    }
     135
     136    [Storable]
    113137    private Bitmap icon;
    114138    public Bitmap Icon {
     
    126150      shape.Title = this.Title;
    127151      shape.Color = this.Color;
     152      shape.LineColor = this.LineColor;
     153      shape.LineWidth = this.LineWidth;
    128154      shape.Icon = this.Icon;
    129155      shape.Collapsed = this.Collapsed;
     
    141167        operatorShape.Title = this.Title;
    142168        operatorShape.Color = this.Color;
     169        operatorShape.LineColor = this.LineColor;
     170        operatorShape.LineWidth = this.LineWidth;
    143171        operatorShape.Collapsed = this.Collapsed;
    144172
  • trunk/sources/HeuristicLab.Operators.Views.GraphVisualization/3.3/Model/ShapeInfoFactory.cs

    r2934 r2935  
    4646      operatorShapeInfo.Title = op.Name;
    4747      operatorShapeInfo.Color = Color.LightBlue;
     48      operatorShapeInfo.LineWidth = 1;
     49      operatorShapeInfo.LineColor = Color.Black;
    4850      operatorShapeInfo.Icon = new Bitmap(op.ItemImage);
    4951
Note: See TracChangeset for help on using the changeset viewer.