Ejemplo n.º 1
0
        private void ShapeStyle_cmb_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (_iset_ShapeStyle)
            {
                _iset_ShapeStyle = false;
                return;
            }
            var objs = _graphViewer.LayoutEditor.dragGroup;

            if ((objs.First() as VNode) == null)
            {
                return;
            }
            foreach (var obj in objs)
            {
                VNode vnode = obj as VNode;
                var   sh    = (Shape)shapeStyle_cmb.SelectedValue;
                if (vnode.Node.Attr.Shape == sh)
                {
                    continue;
                }
                var node = vnode.Node;
                node.Attr.Shape = sh;
                var sz  = Common.MeasureLabel(node.Label);
                var pos = node.GeometryNode.Center;
                node.GeometryNode.BoundaryCurve = NodeBoundaryCurves.GetNodeBoundaryCurve(vnode.Node, sz.Width, sz.Height);
                node.GeometryNode.Center        = pos;
                foreach (var dEdge in node.Edges)
                {
                    StraightLineEdges.CreateSimpleEdgeCurveWithUnderlyingPolyline(dEdge.GeometryEdge);
                    (_graphViewer.GetIViewerObject(dEdge) as VEdge).Invalidate();
                }
                vnode.Invalidate();
            }
        }