public DiagramColorState GetBaseColorStateForThisShape(string modelId)
        {
            DiagramColorState baseColorState = new DiagramColorState();

            string shapeStyleName = "";
            if(m_shapeStyleNames.TryGetValue(modelId, out shapeStyleName))
            {
                DiagramStyle dgmStyle;
                if (m_diagramStyles.TryGetValue(shapeStyleName, out dgmStyle))
                {
                    baseColorState.BaseSchemeName = shapeStyleName;
                    baseColorState.Background = ResolveColour(dgmStyle.FillColourList, baseColorState.Background);
                    baseColorState.Foreground = ResolveColour(dgmStyle.TextFillColourList, baseColorState.Foreground);
                    baseColorState.Outline = ResolveColour(dgmStyle.LineColourList, baseColorState.Outline);//? should this be textlinecolourlist
                }
            }
            return baseColorState;
        }
示例#2
0
        private void HandleShapeEnd()
        {
            m_stateTracker.HandleShapeEnd();
            if (m_paragraphPassedThrough)
            {
                TextType paragraphTextList = GetTextType(ContentType.Paragraph, false);
                if (paragraphTextList != null && paragraphTextList.GetChildCount() > 0)
                {
                    IAbstractTextNode iChild = paragraphTextList.GetChild(paragraphTextList.GetChildCount() - 1);

                    NodeInfo nModelId = iChild.GetInfo("ModelId")[0];
                    if (nModelId != null && nModelId.value == "")
                    {
                        nModelId.value = m_currentModelId;
                    }
                }
            }
            m_currentModelId = "";
            m_currentBaseColorState = null;
        }
示例#3
0
        private void HandleShapeStart(XmlNodeInformation nodeInfo)
        {
            m_stateTracker.InShape = true;
            m_currentModelId = nodeInfo.GetAttributeValue("modelId");

            m_resolvedColorState = new DiagramColorState();
            m_currentBaseColorState =  m_DiagramHelper.GetBaseColorStateForThisShape(m_currentModelId);
            m_resolvedColorState.Background = m_currentBaseColorState.Background;
            m_resolvedColorState.Foreground = m_currentBaseColorState.Foreground;
            m_resolvedColorState.Outline = m_currentBaseColorState.Outline;
            m_resolvedColorState.BaseSchemeName = m_currentBaseColorState.BaseSchemeName;

            m_paragraphPassedThrough = false;
        }