static void FillStreamGeometryContext(StreamGeometryContext context, ICurve curve) { if (curve == null) { return; } VEdge.FillContextForICurve(context, curve); }
void HandleClickForEdge(VEdge 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); } }
void SetVEdgeArrowheads(VEdge 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); } }
void SetVEdgeLabel(DrawingEdge edge, VEdge vEdge, int zIndex) { FrameworkElement frameworkElementForEdgeLabel; if (!drawingObjectsToFrameworkElements.TryGetValue(edge, out frameworkElementForEdgeLabel)) { drawingObjectsToFrameworkElements[edge] = frameworkElementForEdgeLabel = CreateTextBlockForDrawingObj(edge); frameworkElementForEdgeLabel.Tag = new VLabel(edge, frameworkElementForEdgeLabel); } vEdge.VLabel = (VLabel) frameworkElementForEdgeLabel.Tag; if (frameworkElementForEdgeLabel.Parent == null) { _graphCanvas.Children.Add(frameworkElementForEdgeLabel); Panel.SetZIndex(frameworkElementForEdgeLabel, zIndex); } }
VEdge CreateEdgeForLgCase(LgLayoutSettings lgSettings, DrawingEdge edge) { return (VEdge) (drawingObjectsToIViewerObjects[edge] = new VEdge(edge, lgSettings) { PathStrokeThicknessFunc = () => GetBorderPathThickness()*edge.Attr.LineWidth }); }
VEdge CreateEdge(DrawingEdge edge, LgLayoutSettings lgSettings) { lock (this) { if (drawingObjectsToIViewerObjects.ContainsKey(edge)) return (VEdge) drawingObjectsToIViewerObjects[edge]; if (lgSettings != null) return CreateEdgeForLgCase(lgSettings, edge); FrameworkElement labelTextBox; drawingObjectsToFrameworkElements.TryGetValue(edge, out labelTextBox); var vEdge = new VEdge(edge, labelTextBox); var zIndex = ZIndexOfEdge(edge); drawingObjectsToIViewerObjects[edge] = vEdge; if (edge.Label != null) SetVEdgeLabel(edge, vEdge, zIndex); Panel.SetZIndex(vEdge.CurvePath, zIndex); _graphCanvas.Children.Add(vEdge.CurvePath); SetVEdgeArrowheads(vEdge, zIndex); return vEdge; } }