Free cookie consent management tool by TermsFeed Policy Generator

source: branches/OptimizationNetworks/HeuristicLab.Networks.Views.NetworkVisualization/3.3/NodeVisualProperties.cs @ 15689

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

#2205: worked on optimization networks

  • improved network visualization
File size: 2.9 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 NodeVisualProperties : VisualProperties, INodeVisualProperties {
30    [Storable]
31    private Point2D<double> lowerLeft;
32    public Point2D<double> LowerLeft {
33      get { return lowerLeft; }
34      set {
35        if (lowerLeft == value) return;
36        lowerLeft = value;
37        OnChanged();
38      }
39    }
40
41    [Storable]
42    private Point2D<double> upperRight;
43    public Point2D<double> UpperRight {
44      get { return upperRight; }
45      set {
46        if (upperRight == value) return;
47        upperRight = 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 NodeVisualProperties(bool deserializing) : base(deserializing) { }
77    private NodeVisualProperties(NodeVisualProperties original, Cloner cloner)
78      : base(original, cloner) {
79      lowerLeft = original.lowerLeft;
80      upperRight = original.upperRight;
81      brushColor = original.brushColor;
82      penColor = original.penColor;
83    }
84
85    public NodeVisualProperties() {
86      lowerLeft = new Point2D<double>(0.0, 0.0);
87      upperRight = new Point2D<double>(200.0, 100.0);
88      brushColor = Color.FromArgb(255, 120, 200, 240);
89      penColor = Color.Black;
90    }
91
92    public override IDeepCloneable Clone(Cloner cloner) {
93      return new NodeVisualProperties(this, cloner);
94    }
95    #endregion
96  }
97}
Note: See TracBrowser for help on using the repository browser.