Ejemplo n.º 1
0
        public void PrintGraph(SemanticWeb web)
        {
            Load   = true;
            Reload = true;
            DD.ClearAll();
            var nodeMap = new Dictionary <int, DiagramNode>();

            foreach (var node in web.Nodes)
            {
                var bounds      = new Rect(new Point(node.X, node.Y), new Point(node.X + NodeWidth, node.Y + NodeHeight));
                var diagramNode = DD.Factory.CreateShapeNode(bounds);
                //diagramNode.Brush = new LinearGradientBrush(new GradientStopCollection
                nodeMap[node.ID] = diagramNode;
                diagramNode.Text = node.Name;
                diagramNode.Tag  = node;
            }
            foreach (var arc in web.Arcs)
            {
                var diagramArc =
                    DD.Factory.CreateDiagramLink(nodeMap[arc.From], nodeMap[arc.To]);
                diagramArc.Text = arc.Name;
                diagramArc.Tag  = true;
            }
            Load   = false;
            Reload = false;
        }
Ejemplo n.º 2
0
        void PrintGraph(SemanticWebUsersLevel web)
        {
            DD.ClearAll();
            Dictionary <int, DiagramNode> nodeMap = new Dictionary <int, DiagramNode>();

            foreach (var node in web.Nodes)
            {
                var diagramNode = DD.Factory.CreateShapeNode(bounds);
                //diagramNode.Brush = new LinearGradientBrush(new GradientStopCollection
                nodeMap[node.ID] = diagramNode;
                diagramNode.Text = node.Name;
                diagramNode.Tag  = node;
            }


            foreach (var arc in web.Arcs)
            {
                if (!arc.Name.Contains("_#"))
                {
                    var diagramArc =
                        DD.Factory.CreateDiagramLink(nodeMap[arc.From.ID], nodeMap[arc.To.ID]);
                    diagramArc.Text = arc.Name;
                }
            }
            load = false;
            // arrange the graph(расстановка)
            var layout = new LayeredLayout();

            layout.Arrange(DD);
            //sbState.Style = (Style)FindResource("ReadySBStyle");
        }
Ejemplo n.º 3
0
 public void ClearAll()
 {
     DD.ClearAll();
 }