Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.Problems.GrammaticalOptimization/SharpVectorModel/Fills/SvgRadialGradientElement.cs @ 12762

Last change on this file since 12762 was 12762, checked in by aballeit, 9 years ago

#2283 GUI updates, Tree-chart, MCTS Version 2 (prune leaves)

File size: 3.4 KB
Line 
1using System;
2using System.Xml;
3
4using SharpVectors.Dom.Css;
5
6namespace SharpVectors.Dom.Svg
7{
8  /// <summary>
9  /// Summary description for SvgRadialGradientElement.
10  /// </summary>
11  public sealed class SvgRadialGradientElement : SvgGradientElement, ISvgRadialGradientElement
12    {
13        #region Private Fields
14
15        private ISvgAnimatedLength cx;
16        private ISvgAnimatedLength cy;
17        private ISvgAnimatedLength r;
18        private ISvgAnimatedLength fx;
19        private ISvgAnimatedLength fy;
20
21        #endregion
22
23        #region Constructors and Destructor
24
25        public SvgRadialGradientElement(string prefix, string localname, string ns, SvgDocument doc)
26      : base(prefix, localname, ns, doc)
27    {
28        }
29
30        #endregion
31
32        #region ISvgRadialGradientElement Members
33
34        public ISvgAnimatedLength Cx
35    {
36      get
37      {
38        if(!HasAttribute("cx") && ReferencedElement != null)
39        {
40          return ReferencedElement.Cx;
41        }
42        else
43        {
44
45          if(cx == null)
46          {
47            cx = new SvgAnimatedLength(this, "cx", SvgLengthDirection.Horizontal, "50%");
48          }
49          return cx;
50        }
51      }
52    }
53
54    public ISvgAnimatedLength Cy
55    {
56      get
57      {
58        if(!HasAttribute("cy") && ReferencedElement != null)
59        {
60          return ReferencedElement.Cy;
61        }
62        else
63        {
64
65          if(cy == null)
66          {
67            cy = new SvgAnimatedLength(this, "cy", SvgLengthDirection.Vertical, "50%");
68          }
69          return cy;
70        }
71      }
72    }
73
74    public ISvgAnimatedLength R
75    {
76      get
77      {
78        if(!HasAttribute("r") && ReferencedElement != null)
79        {
80          return ReferencedElement.R;
81        }
82        else
83        {
84
85          if(r == null)
86          {
87            r = new SvgAnimatedLength(this, "r", SvgLengthDirection.Viewport, "50%");
88          }
89          return r;
90        }
91      }
92    }
93
94    public ISvgAnimatedLength Fx
95    {
96      get
97      {
98        if (!HasAttribute("fx") && HasAttribute("fy"))
99        {
100          return Fy;
101        }
102        else if (!HasAttribute("fx") && ReferencedElement != null)
103        {
104          return ReferencedElement.Fx;
105        }
106        else
107        {
108          if (fx == null)
109          {
110            fx = new SvgAnimatedLength(this, "fx", SvgLengthDirection.Horizontal, "50%");
111          }
112          return fx;
113        }
114      }
115    }
116
117    public ISvgAnimatedLength Fy
118    {
119      get
120      {
121        if (!HasAttribute("fy") && HasAttribute("fx"))
122        {
123          return Fx;
124        }
125        else if (!HasAttribute("fy") && ReferencedElement != null)
126        {
127          return ReferencedElement.Fy;
128        }
129        else
130        {
131          if (fy == null)
132          {
133            fy = new SvgAnimatedLength(this, "fy", SvgLengthDirection.Vertical, "50%");
134          }
135          return fy;
136        }
137      }
138    }
139
140    #endregion
141
142    #region ISvgURIReference Members
143
144    public new SvgRadialGradientElement ReferencedElement
145    {
146      get
147      {
148        return base.ReferencedElement as SvgRadialGradientElement;
149      }
150    }
151
152    #endregion
153
154    #region Update handling
155    /*public override void OnAttributeChange(XmlNodeChangedAction action, XmlAttribute attribute)
156    {
157      base.OnAttributeChange(action, attribute);
158
159      if(attribute.NamespaceURI.Length == 0)
160      {
161        switch(attribute.LocalName)
162        {
163          case "cx":
164            cx = null;
165            break;
166          case "cy":
167            cy = null;
168            break;
169          case "r":
170            r = null;
171            break;
172          case "fx":
173            fx = null;
174            break;
175          case "fy":
176            fy = null;
177            break;
178        }
179      }
180    }*/
181    #endregion
182  }
183}
Note: See TracBrowser for help on using the repository browser.