public class TextVisual : VisualMap
{
static private float defaultPointSize = 18;
- private string _text = null;
- private string _fontFamily = null;
- private PropertyMap _fontStyle = null;
- private float _pointSize = defaultPointSize;
- private bool? _multiLine = null;
- private string _horizontalAlignment = null;
- private string _verticalAlignment = null;
- private Color _textColor = null;
- private bool? _enableMarkup = null;
- private PropertyMap _shadow = null;
- private PropertyMap _underline = null;
- private PropertyMap _outline = null;
- private PropertyMap _background = null;
+ private string text = null;
+ private string fontFamily = null;
+ private PropertyMap fontStyle = null;
+ private float pointSize = defaultPointSize;
+ private bool? multiLine = null;
+ private string horizontalAlignment = null;
+ private string verticalAlignment = null;
+ private Color textColor = null;
+ private bool? enableMarkup = null;
+ private PropertyMap shadow = null;
+ private PropertyMap underline = null;
+ private PropertyMap outline = null;
+ private PropertyMap background = null;
/// <summary>
/// Constructor.
{
get
{
- return _text;
+ return text;
}
set
{
- _text = value;
+ text = value;
UpdateVisual();
}
}
{
get
{
- return _fontFamily;
+ return fontFamily;
}
set
{
- _fontFamily = value;
+ fontFamily = value;
UpdateVisual();
}
}
{
get
{
- return _fontStyle;
+ return fontStyle;
}
set
{
- _fontStyle = value;
+ fontStyle = value;
UpdateVisual();
}
}
{
get
{
- return _pointSize;
+ return pointSize;
}
set
{
- _pointSize = value;
+ pointSize = value;
UpdateVisual();
}
}
{
get
{
- return _multiLine ?? (false);
+ return multiLine ?? (false);
}
set
{
- _multiLine = value;
+ multiLine = value;
UpdateVisual();
}
}
{
get
{
- switch (_horizontalAlignment)
+ switch (horizontalAlignment)
{
case "BEGIN":
return HorizontalAlignment.Begin;
{
case HorizontalAlignment.Begin:
{
- _horizontalAlignment = "BEGIN";
+ horizontalAlignment = "BEGIN";
break;
}
case HorizontalAlignment.Center:
{
- _horizontalAlignment = "CENTER";
+ horizontalAlignment = "CENTER";
break;
}
case HorizontalAlignment.End:
{
- _horizontalAlignment = "END";
+ horizontalAlignment = "END";
break;
}
default:
{
- _horizontalAlignment = "BEGIN";
+ horizontalAlignment = "BEGIN";
break;
}
}
{
get
{
- switch (_verticalAlignment)
+ switch (verticalAlignment)
{
case "TOP":
return VerticalAlignment.Top;
{
case VerticalAlignment.Top:
{
- _verticalAlignment = "TOP";
+ verticalAlignment = "TOP";
break;
}
case VerticalAlignment.Center:
{
- _verticalAlignment = "CENTER";
+ verticalAlignment = "CENTER";
break;
}
case VerticalAlignment.Bottom:
{
- _verticalAlignment = "BOTTOM";
+ verticalAlignment = "BOTTOM";
break;
}
default:
{
- _verticalAlignment = "TOP";
+ verticalAlignment = "TOP";
break;
}
}
{
get
{
- return _textColor;
+ return textColor;
}
set
{
- _textColor = value;
+ textColor = value;
UpdateVisual();
}
}
{
get
{
- return _enableMarkup ?? (false);
+ return enableMarkup ?? (false);
}
set
{
- _enableMarkup = value;
+ enableMarkup = value;
UpdateVisual();
}
}
{
get
{
- return _shadow;
+ return shadow;
}
set
{
- _shadow = value;
+ shadow = value;
UpdateVisual();
}
}
{
get
{
- return _underline;
+ return underline;
}
set
{
- _underline = value;
+ underline = value;
UpdateVisual();
}
}
{
get
{
- return _outline;
+ return outline;
}
set
{
- _outline = value;
+ outline = value;
UpdateVisual();
}
}
{
get
{
- return _background;
+ return background;
}
set
{
- _background = value;
+ background = value;
UpdateVisual();
}
}
{
_outputVisualMap = new PropertyMap();
- if (_text != null)
+ if (text != null)
{
- _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Text));
- _outputVisualMap.Add(TextVisualProperty.Text, new PropertyValue(_text));
- _outputVisualMap.Add(TextVisualProperty.PointSize, new PropertyValue((float)_pointSize));
- if (_fontFamily != null) { _outputVisualMap.Add(TextVisualProperty.FontFamily, new PropertyValue(_fontFamily)); }
- if (_fontStyle != null) { _outputVisualMap.Add(TextVisualProperty.FontStyle, new PropertyValue(_fontStyle)); }
- if (_multiLine != null) { _outputVisualMap.Add(TextVisualProperty.MultiLine, new PropertyValue((bool)_multiLine)); }
- if (_horizontalAlignment != null) { _outputVisualMap.Add(TextVisualProperty.HorizontalAlignment, new PropertyValue(_horizontalAlignment)); }
- if (_verticalAlignment != null) { _outputVisualMap.Add(TextVisualProperty.VerticalAlignment, new PropertyValue(_verticalAlignment)); }
- if (_textColor != null) { _outputVisualMap.Add(TextVisualProperty.TextColor, new PropertyValue(_textColor)); }
- if (_enableMarkup != null) { _outputVisualMap.Add(TextVisualProperty.EnableMarkup, new PropertyValue((bool)_enableMarkup)); }
- if (_shadow != null) { _outputVisualMap.Add(TextVisualProperty.Shadow, new PropertyValue(_shadow)); }
- if (_underline != null) { _outputVisualMap.Add(TextVisualProperty.Underline, new PropertyValue(_underline)); }
- if (_outline != null) { _outputVisualMap.Add(TextVisualProperty.Outline, new PropertyValue(_outline)); }
- if (_background != null) { _outputVisualMap.Add(TextVisualProperty.Background, new PropertyValue(_background)); }
+ PropertyValue temp = new PropertyValue((int)Visual.Type.Text);
+ _outputVisualMap.Add(Visual.Property.Type, temp);
+ temp.Dispose();
+
+ temp = new PropertyValue(text);
+ _outputVisualMap.Add(TextVisualProperty.Text, temp);
+ temp.Dispose();
+
+ temp = new PropertyValue((float)pointSize);
+ _outputVisualMap.Add(TextVisualProperty.PointSize, temp);
+ temp.Dispose();
+
+ if (fontFamily != null)
+ {
+ temp = new PropertyValue(fontFamily);
+ _outputVisualMap.Add(TextVisualProperty.FontFamily, temp);
+ temp.Dispose();
+ }
+ if (fontStyle != null)
+ {
+ temp = new PropertyValue(fontStyle);
+ _outputVisualMap.Add(TextVisualProperty.FontStyle, temp);
+ temp.Dispose();
+ }
+ if (multiLine != null)
+ {
+ temp = new PropertyValue((bool)multiLine);
+ _outputVisualMap.Add(TextVisualProperty.MultiLine, temp);
+ temp.Dispose();
+ }
+ if (horizontalAlignment != null)
+ {
+ temp = new PropertyValue(horizontalAlignment);
+ _outputVisualMap.Add(TextVisualProperty.HorizontalAlignment, temp);
+ temp.Dispose();
+ }
+ if (verticalAlignment != null)
+ {
+ temp = new PropertyValue(verticalAlignment);
+ _outputVisualMap.Add(TextVisualProperty.VerticalAlignment, temp);
+ temp.Dispose();
+ }
+ if (textColor != null)
+ {
+ temp = new PropertyValue(textColor);
+ _outputVisualMap.Add(TextVisualProperty.TextColor, temp);
+ temp.Dispose();
+ }
+ if (enableMarkup != null)
+ {
+ temp = new PropertyValue((bool)enableMarkup);
+ _outputVisualMap.Add(TextVisualProperty.EnableMarkup, temp);
+ temp.Dispose();
+ }
+ if (shadow != null)
+ {
+ temp = new PropertyValue(shadow);
+ _outputVisualMap.Add(TextVisualProperty.Shadow, temp);
+ temp.Dispose();
+ }
+ if (underline != null)
+ {
+ temp = new PropertyValue(underline);
+ _outputVisualMap.Add(TextVisualProperty.Underline, temp);
+ temp.Dispose();
+ }
+ if (outline != null)
+ {
+ temp = new PropertyValue(outline);
+ _outputVisualMap.Add(TextVisualProperty.Outline, temp);
+ temp.Dispose();
+ }
+ if (background != null)
+ {
+ temp = new PropertyValue(background);
+ _outputVisualMap.Add(TextVisualProperty.Background, temp);
+ temp.Dispose();
+ }
base.ComposingPropertyMap();
}
}
/// <since_tizen> 3 </since_tizen>
public class VisualAnimator : VisualMap
{
- private string _alphaFunction = null;
- private int _startTime = 0;
- private int _endTime = 0;
- private string _target = null;
- private string _propertyIndex = null;
- private object _destinationValue = null;
+ private string alphaFunction = null;
+ private int startTime = 0;
+ private int endTime = 0;
+ private string target = null;
+ private string propertyIndex = null;
+ private object destinationValue = null;
/// <summary>
/// Create VisualAnimator object.
{
get
{
- return _alphaFunction.GetValueByDescription<AlphaFunction.BuiltinFunctions>();
+ return alphaFunction.GetValueByDescription<AlphaFunction.BuiltinFunctions>();
}
set
{
- _alphaFunction = value.GetDescription();
+ alphaFunction = value.GetDescription();
}
}
{
get
{
- return _startTime;
+ return startTime;
}
set
{
- _startTime = value;
+ startTime = value;
}
}
{
get
{
- return _endTime;
+ return endTime;
}
set
{
- _endTime = value;
+ endTime = value;
}
}
{
get
{
- return _target;
+ return target;
}
set
{
- _target = value;
+ target = value;
}
}
{
get
{
- return _propertyIndex;
+ return propertyIndex;
}
set
{
- _propertyIndex = value;
+ propertyIndex = value;
}
}
{
get
{
- return _destinationValue;
+ return destinationValue;
}
set
{
- _destinationValue = value;
+ destinationValue = value;
}
}
/// <since_tizen> 3 </since_tizen>
protected override void ComposingPropertyMap()
{
- PropertyMap _animator = new PropertyMap();
- _animator.Add("alphaFunction", new PropertyValue(_alphaFunction));
+ PropertyMap animator = new PropertyMap();
+ PropertyValue temp = new PropertyValue(alphaFunction);
+ animator.Add("alphaFunction", temp);
+ temp.Dispose();
- PropertyMap _timePeriod = new PropertyMap();
- _timePeriod.Add("duration", new PropertyValue((_endTime - _startTime) / 1000.0f));
- _timePeriod.Add("delay", new PropertyValue(_startTime / 1000.0f));
- _animator.Add("timePeriod", new PropertyValue(_timePeriod));
+ PropertyMap timePeriod = new PropertyMap();
+ temp = new PropertyValue((endTime - startTime) / 1000.0f);
+ timePeriod.Add("duration", temp);
+ temp.Dispose();
- StringBuilder sb = new StringBuilder(_propertyIndex);
+ temp = new PropertyValue(startTime / 1000.0f);
+ timePeriod.Add("delay", temp);
+ temp.Dispose();
+
+ temp = new PropertyValue(timePeriod);
+ animator.Add("timePeriod", temp);
+ temp.Dispose();
+
+ StringBuilder sb = new StringBuilder(propertyIndex);
sb[0] = (char)(sb[0] | 0x20);
- string _str = sb.ToString();
+ string str = sb.ToString();
+
+ PropertyValue val = PropertyValue.CreateFromObject(destinationValue);
- PropertyValue val = PropertyValue.CreateFromObject(_destinationValue);
+ PropertyMap transition = new PropertyMap();
+ temp = new PropertyValue(target);
+ transition.Add("target", temp);
+ temp.Dispose();
- PropertyMap _transition = new PropertyMap();
- _transition.Add("target", new PropertyValue(_target));
- _transition.Add("property", new PropertyValue(_str));
- _transition.Add("targetValue", val);
- _transition.Add("animator", new PropertyValue(_animator));
+ temp = new PropertyValue(str);
+ transition.Add("property", temp);
+ temp.Dispose();
- _outputVisualMap = _transition;
+ transition.Add("targetValue", val);
+ temp = new PropertyValue(animator);
+ transition.Add("animator", temp);
+ temp.Dispose();
+
+ _outputVisualMap = transition;
base.ComposingPropertyMap();
+
+ animator.Dispose();
+ timePeriod.Dispose();
+ val.Dispose();
}
}
//temporary fix for TCT