1 // Copyright (c) 2017 Samsung Electronics Co., Ltd.
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
7 // http://www.apache.org/licenses/LICENSE-2.0
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
18 using Tizen.NUI.BaseComponents;
21 /// A class encapsulating the transform map of visual.
23 public class VisualMap
25 private Vector2 _visualSize = null;
26 private Vector2 _visualOffset = null;
27 private Vector2 _visualOffsetPolicy = null;
28 private Vector2 _visualSizePolicy = null;
29 private Visual.AlignType? _visualOrigin = null;
30 private Visual.AlignType? _visualAnchorPoint = null;
32 private PropertyMap _visualTransformMap = null;
34 private int? _depthIndex = null;
35 protected PropertyMap _outputVisualMap = null;
43 internal int VisualIndex
49 internal VisualView Parent
60 /// Get or set size of the visual.<br>
61 /// It can be either relative (percentage of the parent)
62 /// or absolute (in world units).<br>
69 return _visualSize ?? (new Size2D(1, 1));
74 if (_visualSizePolicy == null)
76 _visualSizePolicy = new Vector2(0.0f, 0.0f);
83 /// Get or set offset of the visual.<br>
84 /// It can be either relative (percentage of the parent)
85 /// or absolute (in world units).<br>
88 public Vector2 Position
92 return _visualOffset ?? (new Vector2(0.0f, 0.0f));
96 _visualOffset = value;
97 if (_visualOffsetPolicy == null)
99 _visualOffsetPolicy = new Vector2(0.0f, 0.0f);
106 /// Get or set relative size of the visual<br>
107 /// (percentage [0.0f to 1.0f] of the control).<br>
110 public RelativeVector2 RelativeSize
114 return _visualSize ?? (new RelativeVector2(1.0f, 1.0f));
119 _visualSizePolicy = new Vector2(0.0f, 0.0f);
125 /// Get or set relative offset of the visual<br>
126 /// (percentage [0.0f to 1.0f] of the control).<br>
129 public RelativeVector2 RelativePosition
133 return _visualOffset ?? (new RelativeVector2(0.0f, 0.0f));
137 _visualOffset = value;
138 _visualOffsetPolicy = new Vector2(0.0f, 0.0f);
144 /// Get or set whether the x and y offset values are relative<br>
145 /// (percentage [0.0f to 1.0f] of the control) or absolute (in world units).<br>
146 /// Be default, both the x and the y offset is relative.<br>
149 public VisualTransformPolicyType PositionPolicy
153 if (_visualOffsetPolicy != null && _visualOffsetPolicy.X == 1.0f
154 && _visualOffsetPolicy.Y == 1.0f)
156 return VisualTransformPolicyType.Absolute;
158 return VisualTransformPolicyType.Relative;
164 case VisualTransformPolicyType.Relative:
165 _visualOffsetPolicy = new Vector2(0.0f, 0.0f);
167 case VisualTransformPolicyType.Absolute:
168 _visualOffsetPolicy = new Vector2(1.0f, 1.0f);
171 _visualOffsetPolicy = new Vector2(0.0f, 0.0f);
179 /// Get or set whether the x offset values are relative<br>
180 /// (percentage [0.0f to 1.0f] of the control) or absolute (in world units).<br>
181 /// Be default, the x offset is relative.<br>
184 public VisualTransformPolicyType PositionPolicyX
188 if (_visualOffsetPolicy != null && _visualOffsetPolicy.X == 1.0f)
190 return VisualTransformPolicyType.Absolute;
192 return VisualTransformPolicyType.Relative;
196 if (_visualOffsetPolicy == null)
198 _visualOffsetPolicy = new Vector2(0.0f, 0.0f);
203 case VisualTransformPolicyType.Relative:
204 _visualOffsetPolicy.X = 0.0f;
206 case VisualTransformPolicyType.Absolute:
207 _visualOffsetPolicy.X = 1.0f;
210 _visualOffsetPolicy.X = 0.0f;
219 /// Get or set whether the y offset values are relative<br>
220 /// (percentage [0.0f to 1.0f] of the control) or absolute (in world units).<br>
221 /// Be default, the y offset is relative.<br>
224 public VisualTransformPolicyType PositionPolicyY
228 if (_visualOffsetPolicy != null && _visualOffsetPolicy.Y == 1.0f)
230 return VisualTransformPolicyType.Absolute;
232 return VisualTransformPolicyType.Relative;
236 if (_visualOffsetPolicy == null)
238 _visualOffsetPolicy = new Vector2(0.0f, 0.0f);
243 case VisualTransformPolicyType.Relative:
244 _visualOffsetPolicy.Y = 0.0f;
246 case VisualTransformPolicyType.Absolute:
247 _visualOffsetPolicy.Y = 1.0f;
250 _visualOffsetPolicy.Y = 0.0f;
258 /// Get or set whether the width or height size values are relative<br>
259 /// (percentage [0.0f to 1.0f] of the control) or absolute (in world units).<br>
260 /// Be default, both the width and the height offset is relative to the control's size.<br>
263 public VisualTransformPolicyType SizePolicy
267 if (_visualSizePolicy != null && _visualSizePolicy.X == 1.0f
268 && _visualSizePolicy.Y == 1.0f)
270 return VisualTransformPolicyType.Absolute;
272 return VisualTransformPolicyType.Relative;
278 case VisualTransformPolicyType.Relative:
279 _visualSizePolicy = new Vector2(0.0f, 0.0f);
281 case VisualTransformPolicyType.Absolute:
282 _visualSizePolicy = new Vector2(1.0f, 1.0f);
285 _visualSizePolicy = new Vector2(0.0f, 0.0f);
293 /// Get or set whether the width size values are relative<br>
294 /// (percentage [0.0f to 1.0f] of the control) or absolute (in world units).<br>
295 /// Be default, the width value is relative to the control's width.<br>
298 public VisualTransformPolicyType SizePolicyWidth
302 if (_visualSizePolicy != null && _visualSizePolicy.Width == 1.0f)
304 return VisualTransformPolicyType.Absolute;
306 return VisualTransformPolicyType.Relative;
310 if (_visualSizePolicy == null)
312 _visualSizePolicy = new Vector2(0.0f, 0.0f);
317 case VisualTransformPolicyType.Relative:
318 _visualSizePolicy.Width = 0.0f;
320 case VisualTransformPolicyType.Absolute:
321 _visualSizePolicy.Width = 1.0f;
324 _visualSizePolicy.Width = 0.0f;
332 /// Get or set whether the height size values are relative<br>
333 /// (percentage [0.0f to 1.0f] of the control) or absolute (in world units).<br>
334 /// Be default, both the height value is relative to the control's height.<br>
337 public VisualTransformPolicyType SizePolicyHeight
341 if (_visualSizePolicy != null && _visualSizePolicy.Height == 1.0f)
343 return VisualTransformPolicyType.Absolute;
345 return VisualTransformPolicyType.Relative;
349 if (_visualSizePolicy == null)
351 _visualSizePolicy = new Vector2(0.0f, 0.0f);
356 case VisualTransformPolicyType.Relative:
357 _visualSizePolicy.Height = 0.0f;
359 case VisualTransformPolicyType.Absolute:
360 _visualSizePolicy.Height = 1.0f;
363 _visualSizePolicy.Height = 0.0f;
371 /// Get or set the origin of the visual within its control area.<br>
372 /// By default, the origin is Center.<br>
375 public Visual.AlignType Origin
379 return _visualOrigin ?? (Visual.AlignType.Center);
383 _visualOrigin = value;
389 /// Get or set the anchor-point of the visual.<br>
390 /// By default, the anchor point is Center.<br>
393 public Visual.AlignType AnchorPoint
397 return _visualAnchorPoint ?? (Visual.AlignType.Center);
401 _visualAnchorPoint = value;
407 /// Get or set the depth index of the visual.<br>
408 /// By default, the depth index is 0.<br>
411 public int DepthIndex
415 return _depthIndex ?? (0);
423 private void ComposingTransformMap()
425 _visualTransformMap = new PropertyMap();
426 if (_visualSize != null) { _visualTransformMap.Add((int)VisualTransformPropertyType.Size, new PropertyValue(_visualSize)); }
427 if (_visualOffset != null) { _visualTransformMap.Add((int)VisualTransformPropertyType.Offset, new PropertyValue(_visualOffset)); }
428 if (_visualOffsetPolicy != null) { _visualTransformMap.Add((int)VisualTransformPropertyType.OffsetPolicy, new PropertyValue(_visualOffsetPolicy)); }
429 if (_visualSizePolicy != null) { _visualTransformMap.Add((int)VisualTransformPropertyType.SizePolicy, new PropertyValue(_visualSizePolicy)); }
430 if (_visualOrigin != null) { _visualTransformMap.Add((int)VisualTransformPropertyType.Origin, new PropertyValue((int)_visualOrigin)); }
431 if (_visualAnchorPoint != null) { _visualTransformMap.Add((int)VisualTransformPropertyType.AnchorPoint, new PropertyValue((int)_visualAnchorPoint)); }
435 /// Get the transform map used by the visual.
437 public PropertyMap OutputTransformMap
441 ComposingTransformMap();
442 return _visualTransformMap;
446 protected virtual void ComposingPropertyMap()
448 _outputVisualMap = new PropertyMap();
452 /// Get the property map to create the visual.
454 public PropertyMap OutputVisualMap
458 ComposingPropertyMap();
459 return _outputVisualMap;
463 internal void UpdateVisual()
467 NUILog.Debug("UpdateVisual()! VisualIndex=" + VisualIndex);
468 Parent.UpdateVisual(VisualIndex, Name, this);
472 NUILog.Debug("VisualIndex was not set");
476 protected PropertyMap _shader = null;
477 //private PropertyMap _transform = null;
478 protected bool? _premultipliedAlpha = null;
479 protected Color _mixColor = null;
480 protected float? _opacity = null;
481 protected PropertyMap _commonlyUsedMap = null;
484 /// The shader to use in the visual.
486 public PropertyMap Shader
500 /// Enables/disables premultiplied alpha. <br>
501 /// The premultiplied alpha is false by default unless this behaviour is modified by the derived Visual type.
503 public bool PremultipliedAlpha
507 return _premultipliedAlpha ?? (false);
511 _premultipliedAlpha = value;
517 /// Mix color is a blend color for any visual.
519 public Color MixColor
533 /// Opacity is the alpha component of the mixColor, above.
539 return _opacity ?? (1.0f);
551 /// A class encapsulating the property map of a image visual.
553 public class ImageVisual : VisualMap
555 public ImageVisual() : base()
559 private string _url = null;
560 private string _alphaMaskUrl = null;
561 private FittingModeType? _fittingMode = null;
562 private SamplingModeType? _samplingMode = null;
563 private int? _desiredWidth = null;
564 private int? _desiredHeight = null;
565 private bool? _synchronousLoading = false;
566 private bool? _borderOnly = null;
567 private Vector4 _pixelArea = null;
568 private WrapModeType? _wrapModeU = null;
569 private WrapModeType? _wrapModeV = null;
572 /// Get or set the URL of the image.<br>
589 /// Get or set the URL of the alpha mask.<br>
592 public string AlphaMaskURL
596 return _alphaMaskUrl;
600 _alphaMaskUrl = value;
606 /// Get or set fitting options, used when resizing images to fit desired dimensions.<br>
607 /// If not supplied, default is FittingModeType.ShrinkToFit.<br>
608 /// For Normal Quad images only.<br>
611 public FittingModeType FittingMode
615 return _fittingMode ?? (FittingModeType.ShrinkToFit);
619 _fittingMode = value;
625 /// Get or set filtering options, used when resizing images to sample original pixels.<br>
626 /// If not supplied, default is SamplingModeType.Box.<br>
627 /// For Normal Quad images only.<br>
630 public SamplingModeType SamplingMode
634 return _samplingMode ?? (SamplingModeType.Box);
638 _samplingMode = value;
644 /// Get or set the desired image width.<br>
645 /// If not specified, the actual image width is used.<br>
646 /// For Normal Quad images only.<br>
649 public int DesiredWidth
653 return _desiredWidth ?? (-1);
657 _desiredWidth = value;
663 /// Get or set the desired image height.<br>
664 /// If not specified, the actual image height is used.<br>
665 /// For Normal Quad images only.<br>
668 public int DesiredHeight
672 return _desiredHeight ?? (-1);
676 _desiredHeight = value;
682 /// Get or set whether to load the image synchronously.<br>
683 /// If not specified, the default is false, i.e. the image is loaded asynchronously.<br>
684 /// For Normal Quad images only.<br>
687 public bool SynchronousLoading
691 return _synchronousLoading ?? (false);
695 _synchronousLoading = value;
701 /// Get or set whether to draws the borders only(If true).<br>
702 /// If not specified, the default is false.<br>
703 /// For N-Patch images only.<br>
706 public bool BorderOnly
710 return _borderOnly ?? (false);
720 /// Get or set the image area to be displayed.<br>
721 /// It is a rectangular area.<br>
722 /// The first two elements indicate the top-left position of the area, and the last two elements are the area width and height respectively.<br>
723 /// If not specified, the default value is Vector4(0.0, 0.0, 1.0, 1.0), i.e. the entire area of the image.<br>
724 /// For For Normal QUAD image only.<br>
727 public Vector4 PixelArea
731 return _pixelArea ?? (new Vector4(0.0f, 0.0f, 1.0f, 1.0f));
741 /// Get or set the wrap mode for u coordinate.<br>
742 /// It decides how the texture should be sampled when the u coordinate exceeds the range of 0.0 to 1.0.<br>
743 /// If not specified, the default is WrapModeType.Default(CLAMP).<br>
744 /// For Normal QUAD image only.<br>
747 public WrapModeType WrapModeU
751 return _wrapModeU ?? (WrapModeType.Default);
761 /// Get or set the wrap mode for v coordinate.<br>
762 /// It decides how the texture should be sampled when the v coordinate exceeds the range of 0.0 to 1.0.<br>
763 /// The first two elements indicate the top-left position of the area, and the last two elements are the area width and height respectively.<br>
764 /// If not specified, the default is WrapModeType.Default(CLAMP).<br>
765 /// For Normal QUAD image only.
768 public WrapModeType WrapModeV
772 return _wrapModeV ?? (WrapModeType.Default);
781 protected override void ComposingPropertyMap()
785 _outputVisualMap = new PropertyMap();
786 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Image));
787 _outputVisualMap.Add(ImageVisualProperty.URL, new PropertyValue(_url));
788 if (_alphaMaskUrl != null ) { _outputVisualMap.Add(ImageVisualProperty.AlphaMaskURL, new PropertyValue(_alphaMaskUrl)); }
789 if (_fittingMode != null) { _outputVisualMap.Add(ImageVisualProperty.FittingMode, new PropertyValue((int)_fittingMode)); }
790 if (_samplingMode != null) { _outputVisualMap.Add(ImageVisualProperty.SamplingMode, new PropertyValue((int)_samplingMode)); }
791 if (_desiredWidth != null) { _outputVisualMap.Add(ImageVisualProperty.DesiredWidth, new PropertyValue((int)_desiredWidth)); }
792 if (_desiredHeight != null) { _outputVisualMap.Add(ImageVisualProperty.DesiredHeight, new PropertyValue((int)_desiredHeight)); }
793 if (_synchronousLoading != null) { _outputVisualMap.Add(ImageVisualProperty.SynchronousLoading, new PropertyValue((bool)_synchronousLoading)); }
794 if (_borderOnly != null) { _outputVisualMap.Add(ImageVisualProperty.BorderOnly, new PropertyValue((bool)_borderOnly)); }
795 if (_pixelArea != null) { _outputVisualMap.Add(ImageVisualProperty.PixelArea, new PropertyValue(_pixelArea)); }
796 if (_wrapModeU != null) { _outputVisualMap.Add(ImageVisualProperty.WrapModeU, new PropertyValue((int)_wrapModeU)); }
797 if (_wrapModeV != null) { _outputVisualMap.Add(ImageVisualProperty.WrapModeV, new PropertyValue((int)_wrapModeV)); }
798 if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
799 if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
800 if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
801 if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
807 /// A class encapsulating the property map of a text visual.
809 public class TextVisual : VisualMap
811 public TextVisual() : base()
815 private string _text = null;
816 private string _fontFamily = null;
817 private PropertyMap _fontStyle = null;
818 private float? _pointSize = null;
819 private bool? _multiLine = null;
820 private string _horizontalAlignment = null;
821 private string _verticalAlignment = null;
822 private Color _textColor = null;
823 private bool? _enableMarkup = null;
826 /// Get or set the text to display in UTF-8 format.<br>
843 /// Get or set the requested font family to use.<br>
846 public string FontFamily
860 /// Get or set the requested font style to use.<br>
863 public PropertyMap FontStyle
877 /// Get or set the size of font in points.<br>
880 public float PointSize
884 return _pointSize ?? (0.0f);
894 /// Get or set the single-line or multi-line layout option.<br>
895 /// If not specified, the default is false.<br>
898 public bool MultiLine
902 return _multiLine ?? (false);
912 /// Get or set the line horizontal alignment.<br>
913 /// If not specified, the default is Begin.<br>
916 public HorizontalAlignment HorizontalAlignment
920 switch (_horizontalAlignment)
923 return HorizontalAlignment.Begin;
925 return HorizontalAlignment.Center;
927 return HorizontalAlignment.End;
929 return HorizontalAlignment.Begin;
936 case HorizontalAlignment.Begin:
938 _horizontalAlignment = "BEGIN";
941 case HorizontalAlignment.Center:
943 _horizontalAlignment = "CENTER";
946 case HorizontalAlignment.End:
948 _horizontalAlignment = "END";
953 _horizontalAlignment = "BEGIN";
962 /// Get or set the line vertical alignment.<br>
963 /// If not specified, the default is Top.<br>
966 public VerticalAlignment VerticalAlignment
970 switch (_verticalAlignment)
973 return VerticalAlignment.Top;
975 return VerticalAlignment.Center;
977 return VerticalAlignment.Bottom;
979 return VerticalAlignment.Top;
986 case VerticalAlignment.Top:
988 _verticalAlignment = "TOP";
991 case VerticalAlignment.Center:
993 _verticalAlignment = "CENTER";
996 case VerticalAlignment.Bottom:
998 _verticalAlignment = "BOTTOM";
1003 _verticalAlignment = "TOP";
1012 /// Get or set the color of the text.<br>
1015 public Color TextColor
1029 /// Get or set whether the mark-up processing is enabled.<br>
1032 public bool EnableMarkup
1036 return _enableMarkup ?? (false);
1040 _enableMarkup = value;
1045 protected override void ComposingPropertyMap()
1047 if (_text != null && _pointSize != null)
1049 _outputVisualMap = new PropertyMap();
1050 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Text));
1051 _outputVisualMap.Add(TextVisualProperty.Text, new PropertyValue(_text));
1052 _outputVisualMap.Add(TextVisualProperty.PointSize, new PropertyValue((float)_pointSize));
1053 if (_fontFamily != null) { _outputVisualMap.Add(TextVisualProperty.FontFamily, new PropertyValue(_fontFamily)); }
1054 if (_fontStyle != null) { _outputVisualMap.Add(TextVisualProperty.FontStyle, new PropertyValue(_fontStyle)); }
1055 if (_multiLine != null) { _outputVisualMap.Add(TextVisualProperty.MultiLine, new PropertyValue((bool)_multiLine)); }
1056 if (_horizontalAlignment != null) { _outputVisualMap.Add(TextVisualProperty.HorizontalAlignment, new PropertyValue(_horizontalAlignment)); }
1057 if (_verticalAlignment != null) { _outputVisualMap.Add(TextVisualProperty.VerticalAlignment, new PropertyValue(_verticalAlignment)); }
1058 if (_textColor != null) { _outputVisualMap.Add(TextVisualProperty.TextColor, new PropertyValue(_textColor)); }
1059 if (_enableMarkup != null) { _outputVisualMap.Add(TextVisualProperty.EnableMarkup, new PropertyValue((bool)_enableMarkup)); }
1060 if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
1061 if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
1062 if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
1063 if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
1069 /// A class encapsulating the property map of a border visual.
1071 public class BorderVisual : VisualMap
1073 public BorderVisual() : base()
1077 private Color _color = null;
1078 private float? _size = null;
1079 private bool? _antiAliasing = null;
1082 /// Get or set the color of the border.<br>
1099 /// Get or set the width of the border (in pixels).<br>
1102 public float BorderSize
1106 return _size ?? (-1.0f);
1116 /// Get or set whether anti-aliasing of the border is required.<br>
1117 /// If not supplied, default is false.<br>
1120 public bool AntiAliasing
1124 return _antiAliasing ?? (false);
1128 _antiAliasing = value;
1133 protected override void ComposingPropertyMap()
1135 if (_color != null && _size != null)
1137 _outputVisualMap = new PropertyMap();
1138 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Border));
1139 _outputVisualMap.Add(BorderVisualProperty.Size, new PropertyValue((float)_size));
1140 _outputVisualMap.Add(BorderVisualProperty.Color, new PropertyValue(_color));
1141 if (_antiAliasing != null) { _outputVisualMap.Add(BorderVisualProperty.AntiAliasing, new PropertyValue((bool)_antiAliasing)); }
1142 if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
1143 if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
1144 if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
1145 if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
1151 /// A class encapsulating the property map of a color visual.
1153 public class ColorVisual : VisualMap
1155 public ColorVisual() : base()
1159 private Color _mixColorForColorVisual = null;
1162 /// Get or set the solid color required.<br>
1169 return _mixColorForColorVisual;
1173 _mixColorForColorVisual = value;
1178 protected override void ComposingPropertyMap()
1180 if (_mixColorForColorVisual != null)
1182 _outputVisualMap = new PropertyMap();
1183 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Color));
1184 _outputVisualMap.Add(ColorVisualProperty.MixColor, new PropertyValue(_mixColorForColorVisual));
1185 if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
1186 if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
1187 if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
1193 /// A class encapsulating the property map of a gradient visual.
1195 public class GradientVisual : VisualMap
1197 public GradientVisual() : base()
1201 private Vector2 _startPosition = null;
1202 private Vector2 _endPosition = null;
1203 private Vector2 _center = null;
1204 private float? _radius = null;
1205 private PropertyArray _stopOffset = null;
1206 private PropertyArray _stopColor = null;
1207 private GradientVisualUnitsType? _units = null;
1208 private GradientVisualSpreadMethodType? _spreadMethod = null;
1211 /// Get or set the start position of a linear gradient.<br>
1212 /// Mandatory for Linear.<br>
1214 public Vector2 StartPosition
1218 return _startPosition;
1222 _startPosition = value;
1228 /// Get or set the end position of a linear gradient.<br>
1229 /// Mandatory for Linear.<br>
1231 public Vector2 EndPosition
1235 return _endPosition;
1239 _endPosition = value;
1245 /// Get or set the center point of a radial gradient.<br>
1246 /// Mandatory for Radial.<br>
1248 public Vector2 Center
1262 /// Get or set the size of the radius of a radial gradient.<br>
1263 /// Mandatory for Radial.<br>
1269 return _radius ?? (-1.0f);
1279 /// Get or set all the stop offsets.<br>
1280 /// A PropertyArray of float.<br>
1281 /// If not supplied, default is 0.0f and 1.0f.<br>
1284 public PropertyArray StopOffset
1292 _stopOffset = value;
1298 /// Get or set the color at the stop offsets.<br>
1299 /// A PropertyArray of Color.<br>
1300 /// At least 2 values required to show a gradient.<br>
1303 public PropertyArray StopColor
1317 /// Get or set defines the coordinate system for certain attributes of the points in a gradient.<br>
1318 /// If not supplied, default is GradientVisualUnitsType.ObjectBoundingBox.<br>
1321 public GradientVisualUnitsType Units
1325 return _units ?? (GradientVisualUnitsType.ObjectBoundingBox);
1335 /// Get or set indicates what happens if the gradient starts or ends inside the bounds of the target rectangle.<br>
1336 /// If not supplied, default is GradientVisualSpreadMethodType.Pad.<br>
1339 public GradientVisualSpreadMethodType SpreadMethod
1343 return _spreadMethod ?? (GradientVisualSpreadMethodType.Pad);
1347 _spreadMethod = value;
1352 protected override void ComposingPropertyMap()
1354 if (((_startPosition != null && _endPosition != null) || (_center != null && _radius != null)) && _stopColor != null)
1356 _outputVisualMap = new PropertyMap();
1357 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Gradient));
1358 _outputVisualMap.Add(GradientVisualProperty.StopColor, new PropertyValue(_stopColor));
1359 if (_startPosition != null) { _outputVisualMap.Add(GradientVisualProperty.StartPosition, new PropertyValue(_startPosition)); }
1360 if (_endPosition != null) { _outputVisualMap.Add(GradientVisualProperty.EndPosition, new PropertyValue(_endPosition)); }
1361 if (_center != null) { _outputVisualMap.Add(GradientVisualProperty.Center, new PropertyValue(_center)); }
1362 if (_radius != null) { _outputVisualMap.Add(GradientVisualProperty.Radius, new PropertyValue((float)_radius)); }
1363 if (_stopOffset != null) { _outputVisualMap.Add(GradientVisualProperty.StopOffset, new PropertyValue(_stopOffset)); }
1364 if (_units != null) { _outputVisualMap.Add(GradientVisualProperty.Units, new PropertyValue((int)_units)); }
1365 if (_spreadMethod != null) { _outputVisualMap.Add(GradientVisualProperty.SpreadMethod, new PropertyValue((int)_spreadMethod)); }
1366 if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
1367 if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
1368 if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
1369 if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
1375 /// A class encapsulating the property map of a mesh visual.
1377 public class MeshVisual : VisualMap
1379 public MeshVisual() : base()
1383 private string _objectURL = null;
1384 private string _materialtURL = null;
1385 private string _texturesPath = null;
1386 private MeshVisualShadingModeValue? _shadingMode = null;
1387 private bool? _useMipmapping = null;
1388 private bool? _useSoftNormals = null;
1389 private Vector3 _lightPosition = null;
1392 /// Get or set the location of the ".obj" file.<br>
1395 public string ObjectURL
1409 /// Get or set the location of the ".mtl" file.<br>
1410 /// If not specified, then a textureless object is assumed.<br>
1413 public string MaterialtURL
1417 return _materialtURL;
1421 _materialtURL = value;
1427 /// Get or set path to the directory the textures (including gloss and normal) are stored in.<br>
1428 /// Mandatory if using material.<br>
1430 public string TexturesPath
1434 return _texturesPath;
1438 _texturesPath = value;
1444 /// Get or set the type of shading mode that the mesh will use.<br>
1445 /// If anything the specified shading mode requires is missing, a simpler mode that can be handled with what has been supplied will be used instead.<br>
1446 /// If not specified, it will use the best it can support (will try MeshVisualShadingModeValue.TexturedWithDetailedSpecularLighting first).<br>
1449 public MeshVisualShadingModeValue ShadingMode
1453 return _shadingMode ?? (MeshVisualShadingModeValue.TexturedWithDetailedSpecularLighting);
1457 _shadingMode = value;
1463 /// Get or set whether to use mipmaps for textures or not.<br>
1464 /// If not specified, the default is true.<br>
1467 public bool UseMipmapping
1471 return _useMipmapping ?? (true);
1475 _useMipmapping = value;
1481 /// Get or set whether to average normals at each point to smooth textures or not.<br>
1482 /// If not specified, the default is true.<br>
1485 public bool UseSoftNormals
1489 return _useSoftNormals ?? (true);
1493 _useSoftNormals = value;
1499 /// Get or set the position, in stage space, of the point light that applies lighting to the model.<br>
1500 /// This is based off the stage's dimensions, so using the width and height of the stage halved will correspond to the center,
1501 /// and using all zeroes will place the light at the top left corner.<br>
1502 /// If not specified, the default is an offset outwards from the center of the screen.<br>
1505 public Vector3 LightPosition
1509 return _lightPosition;
1513 _lightPosition = value;
1518 protected override void ComposingPropertyMap()
1520 if (_objectURL != null)
1522 _outputVisualMap = new PropertyMap();
1523 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Mesh));
1524 _outputVisualMap.Add(MeshVisualProperty.ObjectURL, new PropertyValue(_objectURL));
1525 if (_materialtURL != null) { _outputVisualMap.Add(MeshVisualProperty.MaterialtURL, new PropertyValue(_materialtURL)); }
1526 if (_texturesPath != null) { _outputVisualMap.Add(MeshVisualProperty.TexturesPath, new PropertyValue(_texturesPath)); }
1527 if (_shadingMode != null) { _outputVisualMap.Add(MeshVisualProperty.ShadingMode, new PropertyValue((int)_shadingMode)); }
1528 if (_useMipmapping != null) { _outputVisualMap.Add(MeshVisualProperty.UseMipmapping, new PropertyValue((bool)_useMipmapping)); }
1529 if (_useSoftNormals != null) { _outputVisualMap.Add(MeshVisualProperty.UseSoftNormals, new PropertyValue((bool)_useSoftNormals)); }
1530 if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
1531 if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
1532 if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
1533 if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
1539 /// A class encapsulating the property map of a primetive visual.
1541 public class PrimitiveVisual : VisualMap
1543 public PrimitiveVisual() : base()
1547 private PrimitiveVisualShapeType? _shape = null;
1548 private Color _mixColorForPrimitiveVisual = null;
1549 private int? _slices = null;
1550 private int? _stacks = null;
1551 private float? _scaleTopRadius = null;
1552 private float? _scaleBottomRadius = null;
1553 private float? _scaleHeight = null;
1554 private float? _scaleRadius = null;
1555 private Vector3 _scaleDimensions = null;
1556 private float? _bevelPercentage = null;
1557 private float? _bevelSmoothness = null;
1558 private Vector3 _lightPosition = null;
1561 /// Get or set the specific shape to render.<br>
1562 /// If not specified, the default is PrimitiveVisualShapeType.Sphere.<br>
1565 public PrimitiveVisualShapeType Shape
1569 return _shape ?? (PrimitiveVisualShapeType.Sphere);
1579 /// Get or set the color of the shape.<br>
1580 /// If not specified, the default is Color(0.5, 0.5, 0.5, 1.0).<br>
1581 /// Applies to ALL shapes.<br>
1584 public Color MixColor
1588 return _mixColorForPrimitiveVisual ?? (new Color(0.5f, 0.5f, 0.5f, 1.0f));
1592 _mixColorForPrimitiveVisual = value;
1598 /// Get or set the number of slices as you go around the shape.<br>
1599 /// For spheres and conical frustrums, this determines how many divisions there are as you go around the object.<br>
1600 /// If not specified, the default is 128.<br>
1601 /// The range is from 1 to 255.<br>
1608 return _slices ?? (128);
1618 /// Get or set the number of stacks as you go down the shape.<br>
1619 /// For spheres, 'stacks' determines how many layers there are as you go down the object.<br>
1620 /// If not specified, the default is 128.<br>
1621 /// The range is from 1 to 255.<br>
1628 return _stacks ?? (128);
1638 /// Get or set the scale of the radius of the top circle of a conical frustrum.<br>
1639 /// If not specified, the default is 1.0f.<br>
1640 /// Applies to: - PrimitiveVisualShapeType.ConicalFrustrum<br>
1641 /// Only values greater than or equal to 0.0f are accepted.<br>
1644 public float ScaleTopRadius
1648 return _scaleTopRadius ?? (1.0f);
1652 _scaleTopRadius = value;
1658 /// Get or set the scale of the radius of the bottom circle of a conical frustrum.<br>
1659 /// If not specified, the default is 1.5f.<br>
1660 /// Applies to: - PrimitiveVisualShapeType.ConicalFrustrum<br>
1661 /// - PrimitiveVisualShapeType.Cone<br>
1662 /// Only values greater than or equal to 0.0f are accepted.<br>
1665 public float ScaleBottomRadius
1669 return _scaleBottomRadius ?? (1.5f);
1673 _scaleBottomRadius = value;
1679 /// Get or set the scale of the height of a conic.<br>
1680 /// If not specified, the default is 3.0f.<br>
1682 /// - PrimitiveVisualShapeType.ConicalFrustrum<br>
1683 /// - PrimitiveVisualShapeType.Cone<br>
1684 /// - PrimitiveVisualShapeType.Cylinder<br>
1685 /// Only values greater than or equal to 0.0f are accepted.<br>
1688 public float ScaleHeight
1692 return _scaleHeight ?? (3.0f);
1696 _scaleHeight = value;
1702 /// Get or set the scale of the radius of a cylinder.<br>
1703 /// If not specified, the default is 1.0f.<br>
1705 /// - PrimitiveVisualShapeType.Cylinder<br>
1706 /// Only values greater than or equal to 0.0f are accepted.<br>
1709 public float ScaleRadius
1713 return _scaleRadius ?? (1.0f);
1717 _scaleRadius = value;
1723 /// Get or set the dimensions of a cuboid. Scales in the same fashion as a 9-patch image.<br>
1724 /// If not specified, the default is Vector3.One.<br>
1726 /// - PrimitiveVisualShapeType.Cube<br>
1727 /// - PrimitiveVisualShapeType.Octahedron<br>
1728 /// - PrimitiveVisualShapeType.BevelledCube<br>
1729 /// Each vector3 parameter should be greater than or equal to 0.0f.<br>
1732 public Vector3 ScaleDimensions
1736 return _scaleDimensions ?? (Vector3.One);
1740 _scaleDimensions = value;
1746 /// Get or set determines how bevelled the cuboid should be, based off the smallest dimension.<br>
1747 /// Bevel percentage ranges from 0.0 to 1.0. It affects the ratio of the outer face widths to the width of the overall cube.<br>
1748 /// If not specified, the default is 0.0f (no bevel).<br>
1750 /// - PrimitiveVisualShapeType.BevelledCube<br>
1751 /// The range is from 0.0f to 1.0f.<br>
1754 public float BevelPercentage
1758 return _bevelPercentage ?? (0.0f);
1762 _bevelPercentage = value;
1768 /// Get or set defines how smooth the bevelled edges should be.<br>
1769 /// If not specified, the default is 0.0f (sharp edges).<br>
1771 /// - PrimitiveVisualShapeType.BevelledCube<br>
1772 /// The range is from 0.0f to 1.0f.<br>
1775 public float BevelSmoothness
1779 return _bevelSmoothness ?? (0.0f);
1783 _bevelSmoothness = value;
1789 /// Get or set the position, in stage space, of the point light that applies lighting to the model.<br>
1790 /// This is based off the stage's dimensions, so using the width and height of the stage halved will correspond to the center,
1791 /// and using all zeroes will place the light at the top left corner.<br>
1792 /// If not specified, the default is an offset outwards from the center of the screen.<br>
1793 /// Applies to ALL shapes.<br>
1796 public Vector3 LightPosition
1800 return _lightPosition;
1804 _lightPosition = value;
1809 protected override void ComposingPropertyMap()
1811 _outputVisualMap = new PropertyMap(); ;
1812 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Primitive));
1813 if (_shape != null) { _outputVisualMap.Add(PrimitiveVisualProperty.Shape, new PropertyValue((int)_shape)); }
1814 if (_mixColorForPrimitiveVisual != null) { _outputVisualMap.Add(PrimitiveVisualProperty.MixColor, new PropertyValue(_mixColorForPrimitiveVisual)); }
1815 if (_slices != null) { _outputVisualMap.Add(PrimitiveVisualProperty.Slices, new PropertyValue((int)_slices)); }
1816 if (_stacks != null) { _outputVisualMap.Add(PrimitiveVisualProperty.Stacks, new PropertyValue((int)_stacks)); }
1817 if (_scaleTopRadius != null) { _outputVisualMap.Add(PrimitiveVisualProperty.ScaleTopRadius, new PropertyValue((float)_scaleTopRadius)); }
1818 if (_scaleBottomRadius != null) { _outputVisualMap.Add(PrimitiveVisualProperty.ScaleBottomRadius, new PropertyValue((float)_scaleBottomRadius)); }
1819 if (_scaleHeight != null) { _outputVisualMap.Add(PrimitiveVisualProperty.ScaleHeight, new PropertyValue((float)_scaleHeight)); }
1820 if (_scaleRadius != null) { _outputVisualMap.Add(PrimitiveVisualProperty.ScaleRadius, new PropertyValue((float)_scaleRadius)); }
1821 if (_scaleDimensions != null) { _outputVisualMap.Add(PrimitiveVisualProperty.ScaleDimensions, new PropertyValue(_scaleDimensions)); }
1822 if (_bevelPercentage != null) { _outputVisualMap.Add(PrimitiveVisualProperty.BevelPercentage, new PropertyValue((float)_bevelPercentage)); }
1823 if (_bevelSmoothness != null) { _outputVisualMap.Add(PrimitiveVisualProperty.BevelSmoothness, new PropertyValue((float)_bevelSmoothness)); }
1824 if (_lightPosition != null) { _outputVisualMap.Add(PrimitiveVisualProperty.LightPosition, new PropertyValue(_lightPosition)); }
1825 if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
1826 if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
1827 if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
1832 /// A class encapsulating the property map of a n-patch image visual.
1834 public class NPatchVisual : VisualMap
1836 public NPatchVisual() : base()
1840 private string _url = null;
1841 private bool? _borderOnly = null;
1842 private Rectangle _border = null;
1845 /// Get or set the URL of the image.<br>
1862 /// Get or set whether to draws the borders only(If true).<br>
1863 /// If not specified, the default is false.<br>
1864 /// For N-Patch images only.<br>
1867 public bool BorderOnly
1871 return _borderOnly ?? false;
1875 _borderOnly = value;
1881 /// The border of the image in the order: left, right, bottom, top.<br>
1882 /// For N-Patch images only.<br>
1885 public Rectangle Border
1898 protected override void ComposingPropertyMap()
1902 _outputVisualMap = new PropertyMap();
1903 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.NPatch));
1904 _outputVisualMap.Add(NpatchImageVisualProperty.URL, new PropertyValue(_url));
1905 if (_borderOnly != null) { _outputVisualMap.Add(NpatchImageVisualProperty.BorderOnly, new PropertyValue((bool)_borderOnly)); }
1906 if (_border != null) { _outputVisualMap.Add(NpatchImageVisualProperty.Border, new PropertyValue(_border)); }
1907 if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
1908 if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
1909 if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
1910 if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
1916 /// A class encapsulating the property map of a SVG visual.
1918 public class SVGVisual : VisualMap
1920 public SVGVisual() : base()
1924 private string _url = null;
1939 protected override void ComposingPropertyMap()
1943 _outputVisualMap = new PropertyMap();
1944 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.SVG));
1945 _outputVisualMap.Add(ImageVisualProperty.URL, new PropertyValue(_url));
1946 if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
1947 if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
1948 if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
1949 if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
1955 /// A class encapsulating the property map of a Animated Image(AGIF) visual.
1957 public class AnimatedImageVisual : VisualMap
1959 public AnimatedImageVisual() : base()
1963 private string _url = null;
1978 protected override void ComposingPropertyMap()
1982 _outputVisualMap = new PropertyMap();
1983 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.AnimatedImage));
1984 _outputVisualMap.Add(ImageVisualProperty.URL, new PropertyValue(_url));
1985 if (_shader != null) { _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader)); }
1986 if (_premultipliedAlpha != null) { _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
1987 if (_mixColor != null) { _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor)); }
1988 if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
1995 //temporary fix for TCT
1996 public class VisualAnimator : VisualMap
1998 public VisualAnimator() : base()
2002 private string _alphaFunction = null;
2003 private int _startTime = 0;
2004 private int _endTime = 0;
2005 private string _target = null;
2006 private string _propertyIndex = null;
2007 private object _destinationValue = null;
2009 public AlphaFunction.BuiltinFunctions AlphaFunction
2013 switch (_alphaFunction)
2016 return Tizen.NUI.AlphaFunction.BuiltinFunctions.Linear;
2018 return Tizen.NUI.AlphaFunction.BuiltinFunctions.Reverse;
2019 case "EASE_IN_SQUARE":
2020 return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInSquare;
2021 case "EASE_OUT_SQUARE":
2022 return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOutSquare;
2024 return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseIn;
2026 return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOut;
2028 return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInOut;
2029 case "EASE_IN_SINE":
2030 return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInSine;
2031 case "EASE_OUT_SINE":
2032 return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOutSine;
2033 case "EASE_IN_OUT_SINE":
2034 return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInOutSine;
2036 return Tizen.NUI.AlphaFunction.BuiltinFunctions.Bounce;
2038 return Tizen.NUI.AlphaFunction.BuiltinFunctions.Sin;
2039 case "EASE_OUT_BACK":
2040 return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOutBack;
2042 return Tizen.NUI.AlphaFunction.BuiltinFunctions.Default;
2049 case Tizen.NUI.AlphaFunction.BuiltinFunctions.Linear:
2051 _alphaFunction = "LINEAR";
2054 case Tizen.NUI.AlphaFunction.BuiltinFunctions.Reverse:
2056 _alphaFunction = "REVERSE";
2059 case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInSquare:
2061 _alphaFunction = "EASE_IN_SQUARE";
2064 case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOutSquare:
2066 _alphaFunction = "EASE_OUT_SQUARE";
2069 case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseIn:
2071 _alphaFunction = "EASE_IN";
2074 case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOut:
2076 _alphaFunction = "EASE_OUT";
2079 case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInOut:
2081 _alphaFunction = "EASE_IN_OUT";
2084 case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInSine:
2086 _alphaFunction = "EASE_IN_SINE";
2089 case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOutSine:
2091 _alphaFunction = "EASE_OUT_SINE";
2094 case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInOutSine:
2096 _alphaFunction = "EASE_IN_OUT_SINE";
2099 case Tizen.NUI.AlphaFunction.BuiltinFunctions.Bounce:
2101 _alphaFunction = "BOUNCE";
2104 case Tizen.NUI.AlphaFunction.BuiltinFunctions.Sin:
2106 _alphaFunction = "SIN";
2109 case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOutBack:
2111 _alphaFunction = "EASE_OUT_BACK";
2116 _alphaFunction = "DEFAULT";
2123 public int StartTime
2147 public string Target
2159 public string PropertyIndex
2163 return _propertyIndex;
2167 _propertyIndex = value;
2171 public object DestinationValue
2175 return _destinationValue;
2179 _destinationValue = value;
2183 protected override void ComposingPropertyMap()
2185 PropertyMap _animator = new PropertyMap();
2186 _animator.Add("alphaFunction", new PropertyValue(_alphaFunction));
2188 PropertyMap _timePeriod = new PropertyMap();
2189 _timePeriod.Add("duration", new PropertyValue((_endTime - _startTime) / 1000.0f));
2190 _timePeriod.Add("delay", new PropertyValue(_startTime / 1000.0f));
2191 _animator.Add("timePeriod", new PropertyValue(_timePeriod));
2193 string _str1 = _propertyIndex.Substring(0, 1);
2194 string _str2 = _propertyIndex.Substring(1);
2195 string _str = _str1.ToLower() + _str2;
2197 PropertyValue val = PropertyValue.CreateFromObject(_destinationValue);
2199 PropertyMap _transition = new PropertyMap();
2200 _transition.Add("target", new PropertyValue(_target));
2201 _transition.Add("property", new PropertyValue(_str));
2202 _transition.Add("targetValue", val);
2203 _transition.Add("animator", new PropertyValue(_animator));
2205 _outputVisualMap = _transition;
2208 //temporary fix for TCT