2 * Copyright(c) 2019 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
21 //temporary fix for TCT
23 /// A class encapsulating the property map of the transition data.
25 /// <since_tizen> 3 </since_tizen>
26 public class VisualAnimator : VisualMap
28 private string _alphaFunction = null;
29 private int _startTime = 0;
30 private int _endTime = 0;
31 private string _target = null;
32 private string _propertyIndex = null;
33 private object _destinationValue = null;
36 /// Create VisualAnimator object.
38 /// <since_tizen> 3 </since_tizen>
39 public VisualAnimator() : base()
44 /// Sets and Gets the AlphaFunction of this transition.
46 /// <since_tizen> 3 </since_tizen>
47 public AlphaFunction.BuiltinFunctions AlphaFunction
51 return _alphaFunction.GetValueByDescription<AlphaFunction.BuiltinFunctions>();
55 _alphaFunction = value.GetDescription();
60 /// Sets and Gets the StartTime of this transition.
62 /// <since_tizen> 3 </since_tizen>
76 /// Sets and Gets the EndTime of this transition.
78 /// <since_tizen> 3 </since_tizen>
92 /// Sets and Gets the Target of this transition.
94 /// <since_tizen> 3 </since_tizen>
108 /// Sets and Gets the PropertyIndex of this transition.
110 /// <since_tizen> 3 </since_tizen>
111 public string PropertyIndex
115 return _propertyIndex;
119 _propertyIndex = value;
124 /// Sets and Gets the DestinationValue of this transition.
126 /// <since_tizen> 3 </since_tizen>
127 public object DestinationValue
131 return _destinationValue;
135 _destinationValue = value;
140 /// Compose the out visual map.
142 /// <since_tizen> 3 </since_tizen>
143 protected override void ComposingPropertyMap()
145 PropertyMap _animator = new PropertyMap();
146 _animator.Add("alphaFunction", new PropertyValue(_alphaFunction));
148 PropertyMap _timePeriod = new PropertyMap();
149 _timePeriod.Add("duration", new PropertyValue((_endTime - _startTime) / 1000.0f));
150 _timePeriod.Add("delay", new PropertyValue(_startTime / 1000.0f));
151 _animator.Add("timePeriod", new PropertyValue(_timePeriod));
153 StringBuilder sb = new StringBuilder(_propertyIndex);
154 sb[0] = (char)(sb[0] | 0x20);
155 string _str = sb.ToString();
157 PropertyValue val = PropertyValue.CreateFromObject(_destinationValue);
159 PropertyMap _transition = new PropertyMap();
160 _transition.Add("target", new PropertyValue(_target));
161 _transition.Add("property", new PropertyValue(_str));
162 _transition.Add("targetValue", val);
163 _transition.Add("animator", new PropertyValue(_animator));
165 _outputVisualMap = _transition;
166 base.ComposingPropertyMap();
169 //temporary fix for TCT