Пример #1
0
        public XNode(Node node, GraphNode gnode = null)
        {
            Node             = node;
            _vsGraphNodeInfo = gnode;

            _visualObject = new LevelOfDetailsContainer();

            Brush strokeBrush = CommonX.BrushFromMsaglColor(Node.Attr.Color);

            _fill = CommonX.BrushFromMsaglColor(Node.Attr.FillColor);
            if (gnode != null)
            {
                if (gnode.Categories.Count() > 0)
                {
                    _category = gnode.Categories.ElementAt(0).ToString().Replace("CodeSchema_", "");

                    _fill = NodeCategories.GetFill(_category);
                    Brush brush = NodeCategories.GetStroke(_category);
                    if (brush != null)
                    {
                        strokeBrush = brush;
                    }
                }
            }

            BoundaryPath = new Path {
                //Data = CreatePathFromNodeBoundary(),
                Stroke          = strokeBrush,
                Fill            = _fill,
                StrokeThickness = Node.Attr.LineWidth,
                Tag             = this
            };
            BoundaryCurveIsDirty = true;

            Node.Attr.VisualsChanged += AttrLineWidthHasChanged;
            //Node.Attr.GeometryNode.LayoutChangeEvent += GeometryNodeBeforeLayoutChangeEvent;
        }
Пример #2
0
        public XNode(Node node, GraphNode gnode = null)
        {
            Node = node;
            _vsGraphNodeInfo = gnode;

            _visualObject = new LevelOfDetailsContainer();

            Brush strokeBrush = CommonX.BrushFromMsaglColor(Node.Attr.Color);
            _fill = CommonX.BrushFromMsaglColor(Node.Attr.FillColor);
            if (gnode != null)
            {
                if (gnode.Categories.Count() > 0)
                {
                    _category = gnode.Categories.ElementAt(0).ToString().Replace("CodeSchema_", "");

                    _fill = NodeCategories.GetFill(_category);
                    Brush brush = NodeCategories.GetStroke(_category);
                    if (brush != null) strokeBrush = brush;
                }
            }

            BoundaryPath = new Path {
                //Data = CreatePathFromNodeBoundary(),
                Stroke = strokeBrush,
                Fill = _fill,
                StrokeThickness = Node.Attr.LineWidth,
                Tag = this
            };
            BoundaryCurveIsDirty = true;

            Node.Attr.VisualsChanged += AttrLineWidthHasChanged;
            //Node.Attr.GeometryNode.LayoutChangeEvent += GeometryNodeBeforeLayoutChangeEvent;
        }