Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.3/VisualSymbolicExpressionTreeNode.cs @ 3611

Last change on this file since 3611 was 3244, checked in by gkronber, 15 years ago

Integrated graphical symbolic expression tree view from model analyzer. #937 (Data types and operators for symbolic expression tree encoding)

File size: 4.3 KB
RevLine 
[3244]1#region License Information
2/* HeuristicLab
3 * Copyright (C) 2002-2010 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;
23using System.Collections.Generic;
24using System.Linq;
25using System.Text;
26using System.Drawing;
27
28namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views {
29  public class VisualSymbolicExpressionTreeNode {
30    private static readonly Color defaultLineColor = Color.Black;
31    private static readonly Color defaultTextColor = Color.Black;
32    private static readonly Color defaultFillColor = Color.White;
33    private const int defaultPreferredWidth = 70;
34    private const int defaultPreferredHeight = 46;
35
36    public VisualSymbolicExpressionTreeNode(SymbolicExpressionTreeNode symbolicExpressionTreeNode) :
37      this(symbolicExpressionTreeNode, defaultLineColor) {
38    }
39
40    public VisualSymbolicExpressionTreeNode(SymbolicExpressionTreeNode symbolicExpressionTreeNode, Color lineColor) :
41      this(symbolicExpressionTreeNode, lineColor, defaultTextColor) {
42    }
43
44    public VisualSymbolicExpressionTreeNode(SymbolicExpressionTreeNode symbolicExpressionTreeNode, Color lineColor, Color textColor) :
45      this(symbolicExpressionTreeNode, lineColor, textColor, defaultFillColor) {
46    }
47
48    public VisualSymbolicExpressionTreeNode(SymbolicExpressionTreeNode symbolicExpressionTreeNode, Color lineColor, Color textColor, Color fillColor) :
49      this(symbolicExpressionTreeNode, lineColor, textColor, fillColor, defaultPreferredWidth, defaultPreferredHeight) {
50    }
51
52    public VisualSymbolicExpressionTreeNode(SymbolicExpressionTreeNode symbolicExpressionTreeNode, Color lineColor, Color textColor, Color fillColor, int width, int height) {
53      this.symbolicExpressionTreeNode = symbolicExpressionTreeNode;
54      this.lineColor = lineColor;
55      this.textColor = textColor;
56      this.fillColor = fillColor;
57      this.preferredWidth = width;
58      this.preferredHeight = height;
59      this.ToolTip = symbolicExpressionTreeNode.ToString();
60    }
61
62    #region members for internal use only
63    private int x;
64    public int X {
65      get { return x; }
66      internal set { this.x = value; }
67    }
68
69    private int y;
70    public int Y {
71      get { return y; }
72      internal set { this.y = value; }
73    }
74
75    private int width;
76    public int Width {
77      get { return this.width; }
78      internal set { this.width = value; }
79    }
80
81    private int height;
82    public int Height {
83      get { return this.height; }
84      internal set { this.height = value; }
85    }
86    #endregion
87
88    private SymbolicExpressionTreeNode symbolicExpressionTreeNode;
89    public SymbolicExpressionTreeNode SymbolicExpressionTreeNode {
90      get { return this.symbolicExpressionTreeNode; }
91    }
92
93    private int preferredWidth;
94    public int PreferredWidth {
95      get { return this.preferredWidth; }
96      set { this.preferredWidth = value; }
97    }
98
99    private int preferredHeight;
100    public int PreferredHeight {
101      get { return this.preferredHeight; }
102      set { this.preferredHeight = value; }
103    }
104
105    private Color lineColor;
106    public Color LineColor {
107      get { return this.lineColor; }
108      set { this.lineColor = value; }
109    }
110
111    private Color textColor;
112    public Color TextColor {
113      get { return this.textColor; }
114      set { this.textColor = value; }
115    }
116
117    private Color fillColor;
118    public Color FillColor {
119      get { return this.fillColor; }
120      set { this.fillColor = value; }
121    }
122
123    private string toolTip;
124    public string ToolTip {
125      get { return toolTip; }
126      set { toolTip = value; }
127    }
128  }
129}
Note: See TracBrowser for help on using the repository browser.