Esempio n. 1
0
        private KosmographViewerEdge CreateEdge(DrawingEdge edge, LgLayoutSettings lgSettings)
        {
            lock (this.syncRoot)
            {
                if (drawingObjectsToIViewerObjects.ContainsKey(edge))
                {
                    return((KosmographViewerEdge)drawingObjectsToIViewerObjects[edge]);
                }
                if (lgSettings != null)
                {
                    return(CreateEdgeForLgCase(lgSettings, edge));
                }

                FrameworkElement labelTextBox;
                drawingObjectsToFrameworkElements.TryGetValue(edge, out labelTextBox);
                var vEdge = new KosmographViewerEdge(edge, labelTextBox);

                var zIndex = ZIndexOfEdge(edge);
                drawingObjectsToIViewerObjects[edge] = vEdge;

                if (edge.Label != null)
                {
                    SetVEdgeLabel(edge, vEdge, zIndex);
                }

                Panel.SetZIndex(vEdge.EdgePath, zIndex);
                GraphCanvas.Children.Add(vEdge.EdgePath);
                SetVEdgeArrowheads(vEdge, zIndex);

                return(vEdge);
            }
        }
Esempio n. 2
0
 private KosmographViewerEdge CreateEdgeForLgCase(LgLayoutSettings lgSettings, DrawingEdge edge)
 {
     return((KosmographViewerEdge)(drawingObjectsToIViewerObjects[edge] = new KosmographViewerEdge(edge, lgSettings)
     {
         PathStrokeThicknessFunc = () => GetBorderPathThickness() * edge.Attr.LineWidth
     }));
 }
Esempio n. 3
0
 private void SetVEdgeArrowheads(KosmographViewerEdge vEdge, int zIndex)
 {
     if (vEdge.SourceArrowHeadPath != null)
     {
         Panel.SetZIndex(vEdge.SourceArrowHeadPath, zIndex);
         GraphCanvas.Children.Add(vEdge.SourceArrowHeadPath);
     }
     if (vEdge.TargetArrowHeadPath != null)
     {
         Panel.SetZIndex(vEdge.TargetArrowHeadPath, zIndex);
         GraphCanvas.Children.Add(vEdge.TargetArrowHeadPath);
     }
 }
Esempio n. 4
0
        private void HandleClickForEdge(KosmographViewerEdge vEdge)
        {
            //todo : add a hook
            var lgSettings = Graph.LayoutAlgorithmSettings as LgLayoutSettings;

            if (lgSettings != null)
            {
                var lgEi = lgSettings.GeometryEdgesToLgEdgeInfos[vEdge.Edge.GeometryEdge];
                lgEi.SlidingZoomLevel = lgEi.SlidingZoomLevel != 0 ? 0 : double.PositiveInfinity;

                ViewChangeEvent(null, null);
            }
        }
Esempio n. 5
0
        private void SetVEdgeLabel(DrawingEdge edge, KosmographViewerEdge vEdge, int zIndex)
        {
            FrameworkElement frameworkElementForEdgeLabel;

            if (!drawingObjectsToFrameworkElements.TryGetValue(edge, out frameworkElementForEdgeLabel))
            {
                this.FillFrameworkElementsWithEdgeLabels(edge, out frameworkElementForEdgeLabel);
                frameworkElementForEdgeLabel.Tag = new VLabel(edge, frameworkElementForEdgeLabel);
            }

            vEdge.VLabel = (VLabel)frameworkElementForEdgeLabel.Tag;
            if (frameworkElementForEdgeLabel.Parent == null)
            {
                GraphCanvas.Children.Add(frameworkElementForEdgeLabel);
                Panel.SetZIndex(frameworkElementForEdgeLabel, zIndex);
            }
        }