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 /// A class encapsulating the property map of the border visual.
23 /// <since_tizen> 3 </since_tizen>
24 public class BorderVisual : VisualMap
26 private Color _color = null;
27 private float? _size = null;
28 private bool? _antiAliasing = null;
33 /// <since_tizen> 3 </since_tizen>
34 public BorderVisual() : base()
39 /// Gets or sets the color of the border.<br />
42 /// <since_tizen> 3 </since_tizen>
57 /// Gets or sets the width of the border (in pixels).<br />
60 /// <since_tizen> 3 </since_tizen>
61 public float BorderSize
65 return _size ?? (-1.0f);
75 /// Gets or sets whether the anti-aliasing of the border is required.<br />
76 /// If not supplied, the default is false.<br />
79 /// <since_tizen> 3 </since_tizen>
80 public bool AntiAliasing
84 return _antiAliasing ?? (false);
88 _antiAliasing = value;
94 /// Compose the out visual map.
96 /// <since_tizen> 3 </since_tizen>
97 protected override void ComposingPropertyMap()
99 if (_color != null && _size != null)
101 _outputVisualMap = new PropertyMap();
102 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Border));
103 _outputVisualMap.Add(BorderVisualProperty.Size, new PropertyValue((float)_size));
104 _outputVisualMap.Add(BorderVisualProperty.Color, new PropertyValue(_color));
105 if (_antiAliasing != null) { _outputVisualMap.Add(BorderVisualProperty.AntiAliasing, new PropertyValue((bool)_antiAliasing)); }
106 base.ComposingPropertyMap();