Free cookie consent management tool by TermsFeed Policy Generator

source: branches/2205_OptimizationNetworks/HeuristicLab.Networks.Views.NetworkVisualization/3.3/PortVisualProperties.cs @ 16147

Last change on this file since 16147 was 13799, checked in by jkarder, 9 years ago

#2205: worked on optimization networks

  • improved network visualization
File size: 2.8 KB
Line 
1#region License Information
2/* HeuristicLab
3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
4 *
5 * This file is part of HeuristicLab.
6 *
7 * HeuristicLab is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * HeuristicLab is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
19 */
20#endregion
21
22using System.Drawing;
23using HeuristicLab.Common;
24using HeuristicLab.Core.Networks;
25using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
26
27namespace HeuristicLab.Networks.Views.NetworkVisualization {
28  [StorableClass]
29  public sealed class PortVisualProperties : VisualProperties, IPortVisualProperties {
30    [Storable]
31    private Orientation orientation;
32    public Orientation Orientation {
33      get { return orientation; }
34      set {
35        if (orientation == value) return;
36        orientation = value;
37        OnChanged();
38      }
39    }
40
41    [Storable]
42    private double offset;
43    public double Offset {
44      get { return offset; }
45      set {
46        if (offset == value) return;
47        offset = value;
48        OnChanged();
49      }
50    }
51
52    [Storable]
53    private Color brushColor;
54    public Color BrushColor {
55      get { return brushColor; }
56      set {
57        if (brushColor == value) return;
58        brushColor = value;
59        OnChanged();
60      }
61    }
62
63    [Storable]
64    private Color penColor;
65    public Color PenColor {
66      get { return penColor; }
67      set {
68        if (penColor == value) return;
69        penColor = value;
70        OnChanged();
71      }
72    }
73
74    #region Constructors & Cloning
75    [StorableConstructor]
76    private PortVisualProperties(bool deserializing) : base(deserializing) { }
77    private PortVisualProperties(PortVisualProperties original, Cloner cloner)
78      : base(original, cloner) {
79      orientation = original.orientation;
80      offset = original.offset;
81      brushColor = original.brushColor;
82      penColor = original.penColor;
83    }
84
85    public PortVisualProperties() {
86      orientation = Orientation.South;
87      offset = 0.5;
88      brushColor = Color.RosyBrown;
89      penColor = Color.Black;
90    }
91
92    public override IDeepCloneable Clone(Cloner cloner) {
93      return new PortVisualProperties(this, cloner);
94    }
95    #endregion
96  }
97}
Note: See TracBrowser for help on using the repository browser.