Esempio n. 1
0
        private static themeCategory GetThemeCategorial(CategorialTheme theme)
        {
            var themeCategory = new themeCategory
            {
                columnName   = theme.AttributeName,
                defaultStyle = GetDefaultStyle(theme)
            };

            var catThemeItems = new List <themeItem>();

            foreach (var item in theme.ThemeItems)
            {
                // Add theme items (style and label) to the CategorialTheme
                var catThemeItem = new themeItem
                {
                    label = item.Label,
                    style = GetStyle(item)
                };

                catThemeItems.Add(catThemeItem);
            }

            themeCategory.categoryThemeItems = catThemeItems.ToArray();
            return(themeCategory);
        }
Esempio n. 2
0
        private static themeQuantity GetThemeQuantity(QuantityTheme theme)
        {
            // QuantityTheme properties
            var quanThemeItems = new List <themeItem>();

            foreach (QuantityThemeItem item in theme.ThemeItems)
            {
                // Add theme items (style and label) to the QuantityTheme
                // NOTE: The actual Category of this specific ThemeItem is always equal to the Label (no need to store it twice)
                // NOTE: Symbol isn't stored but generated during rebuilding in the QuantityThemeItem.AddStyle() method
                var quanThemeItem = new themeItem
                {
                    label            = item.Label,
                    style            = GetStyleConverter().ConvertToString(item.Style),
                    intervalMinValue = item.Interval.Min,
                    intervalMaxValue = item.Interval.Max
                };

                quanThemeItems.Add(quanThemeItem);
            }

            var themeQuantity = new themeQuantity
            {
                columnName         = theme.AttributeName,
                defaultStyle       = GetDefaultStyle(theme),
                noDataValues       = GetNoDataValues(theme.NoDataValues),
                noDataValueType    = GetNoDataValueType(theme.NoDataValues),
                quantityThemeItems = quanThemeItems.ToArray()
            };

            return(themeQuantity);
        }
Esempio n. 3
0
        private static themeGradient GetThemeGradient(GradientTheme theme)
        {
            // GradientTheme properties
            string minStyle = GetStyleConverter().ConvertToString(theme.MinStyle);
            string maxStyle = GetStyleConverter().ConvertToString(theme.MaxStyle);

            var gradThemeItems = new List <themeItem>();

            foreach (GradientThemeItem item in theme.ThemeItems)
            {
                // Add theme items (style and label) to the QuantityTheme
                // NOTE: Symbol isn't stored but generated during rebuilding in the QuantityThemeItem.AddStyle() method
                var gradThemeItem = new themeItem
                {
                    label            = item.Label,
                    style            = GetStyleConverter().ConvertToString(item.Style),
                    intervalMaxValue = Convert.ToDouble(item.Range)
                };

                gradThemeItems.Add(gradThemeItem);
            }

            var themeGradient = new themeGradient
            {
                gradientThemeItems = gradThemeItems.ToArray(),
                columnName         = theme.ColumnName,
                minValue           = theme.Min,
                maxValue           = theme.Max,
                minStyle           = minStyle,
                maxStyle           = maxStyle,
                noDataValues       = GetNoDataValues(theme.NoDataValues),
                noDataValueType    = GetNoDataValueType(theme.NoDataValues),

                // Color blends
                textColorBlends = (theme.TextColorBlend != null)
                                                ? CreateBlendsFromTheme(theme.TextColorBlend)
                                                : null,
                lineColorBlends = (theme.LineColorBlend != null)
                                                ? CreateBlendsFromTheme(theme.LineColorBlend)
                                                : null,
                fillColorBlends = (theme.FillColorBlend != null)
                                                ? CreateBlendsFromTheme(theme.FillColorBlend)
                                                : null
            };

            return(themeGradient);
        }
Esempio n. 4
0
 private static IStyle GetStyle(themeItem themeItem)
 {
     return (IStyle) GetStyleConverter().ConvertFrom(themeItem.style);
 }
Esempio n. 5
0
        private static themeCategory GetThemeCategorial(CategorialTheme theme)
        {
            var themeCategory = new themeCategory
                                    {
                                        columnName = theme.AttributeName,
                                        defaultStyle = GetDefaultStyle(theme)
                                    };

            var catThemeItems = new List<themeItem>();

            foreach (var item in theme.ThemeItems)
            {
                // Add theme items (style and label) to the CategorialTheme
                var catThemeItem = new themeItem
                                       {
                                           label = item.Label, 
                                           style = GetStyle(item)
                                       };

                catThemeItems.Add(catThemeItem);
            }

            themeCategory.categoryThemeItems = catThemeItems.ToArray();
            return themeCategory;
        }
Esempio n. 6
0
        private static themeGradient GetThemeGradient(GradientTheme theme)
        {
            // GradientTheme properties
            string minStyle = GetStyleConverter().ConvertToString(theme.MinStyle);
            string maxStyle = GetStyleConverter().ConvertToString(theme.MaxStyle);
            
            var gradThemeItems = new List<themeItem>();
            foreach (GradientThemeItem item in theme.ThemeItems)
            {
                // Add theme items (style and label) to the QuantityTheme
                // NOTE: Symbol isn't stored but generated during rebuilding in the QuantityThemeItem.AddStyle() method
                var gradThemeItem = new themeItem
                                        {
                                            label = item.Label,
                                            style = GetStyleConverter().ConvertToString(item.Style),
                                            intervalMaxValue = Convert.ToDouble(item.Range)
                                        };

                gradThemeItems.Add(gradThemeItem);
            }

            var themeGradient = new themeGradient
                                    {
                                        gradientThemeItems = gradThemeItems.ToArray(),
                                        columnName = theme.ColumnName,
                                        minValue = theme.Min,
                                        maxValue = theme.Max,
                                        minStyle = minStyle,
                                        maxStyle = maxStyle,
                                        noDataValues = GetNoDataValues(theme.NoDataValues),
                                        noDataValueType = GetNoDataValueType(theme.NoDataValues),

                                        // Color blends
                                        textColorBlends = (theme.TextColorBlend != null)
                                                ? CreateBlendsFromTheme(theme.TextColorBlend)
                                                : null,
                                        lineColorBlends = (theme.LineColorBlend != null)
                                                ? CreateBlendsFromTheme(theme.LineColorBlend)
                                                : null,
                                        fillColorBlends = (theme.FillColorBlend != null)
                                                ? CreateBlendsFromTheme(theme.FillColorBlend)
                                                : null
                                    };
            return themeGradient;
        }
Esempio n. 7
0
        private static themeQuantity GetThemeQuantity(QuantityTheme theme)
        {
            // QuantityTheme properties
            var quanThemeItems = new List<themeItem>();

            foreach (QuantityThemeItem item in theme.ThemeItems)
            {
                // Add theme items (style and label) to the QuantityTheme
                // NOTE: The actual Category of this specific ThemeItem is always equal to the Label (no need to store it twice)
                // NOTE: Symbol isn't stored but generated during rebuilding in the QuantityThemeItem.AddStyle() method
                var quanThemeItem = new themeItem
                                        {
                                            label = item.Label,
                                            style = GetStyleConverter().ConvertToString(item.Style),
                                            intervalMinValue = item.Interval.Min,
                                            intervalMaxValue = item.Interval.Max
                                        };

                quanThemeItems.Add(quanThemeItem);
            }

            var themeQuantity = new themeQuantity
                                    {
                                        columnName = theme.AttributeName,
                                        defaultStyle = GetDefaultStyle(theme),
                                        noDataValues = GetNoDataValues(theme.NoDataValues),
                                        noDataValueType = GetNoDataValueType(theme.NoDataValues),
                                        quantityThemeItems = quanThemeItems.ToArray()
                                    };

            return themeQuantity;
        }
Esempio n. 8
0
 private static IStyle GetStyle(themeItem themeItem)
 {
     return((IStyle)GetStyleConverter().ConvertFrom(themeItem.style));
 }