Beispiel #1
0
        // renders the given node to the internal ElementData dictionary. If the given node is
        // not a element, will recursively descend until we render its elements.
        private void RenderNode(ElementNode node)
        {
            //Collect all the points first.
            double[] allPointsTimeOrdered = _GetAllSignificantDataPoints().ToArray();
            foreach (ElementNode elementNode in node.GetLeafEnumerator())
            {
                // this is probably always going to be a single element for the given node, as
                // we have iterated down to leaf nodes in RenderNode() above. May as well do
                // it this way, though, in case something changes in future.
                if (elementNode == null || elementNode.Element == null)
                {
                    continue;
                }

                ElementColorType colorType = ColorModule.getColorTypeForElementNode(elementNode);

                if (colorType == ElementColorType.FullColor)
                {
                    addIntentsToElement(elementNode.Element, allPointsTimeOrdered);
                }
                else
                {
                    IEnumerable <Color> colors = ColorModule.getValidColorsForElementNode(elementNode, false)
                                                 .Intersect(ColorGradient.GetColorsInGradient());
                    foreach (Color color in colors)
                    {
                        addIntentsToElement(elementNode.Element, allPointsTimeOrdered, color);
                    }
                }
            }
        }
Beispiel #2
0
        // static 'helper' methods in the color property
        // a simpler version of the getColorTypeForElementNode call -- often, we only care if an element should be discretely colored or not.
        public static bool isElementNodeDiscreteColored(IElementNode element)
        {
            ElementColorType type = getColorTypeForElementNode(element);

            if (type == ElementColorType.MultipleDiscreteColors || type == ElementColorType.SingleColor)
            {
                return(true);
            }
            return(false);
        }
Beispiel #3
0
        public void SetColorType(ElementColorType colorType)
        {
            switch (colorType)
            {
            case ElementColorType.FullColor:
                radioButtonOptionFullColor.Checked = true;
                break;

            case ElementColorType.MultipleDiscreteColors:
                radioButtonOptionMultiple.Checked = true;
                break;

            default:
                radioButtonOptionSingle.Checked = true;
                break;
            }
        }