public void Invalidate() { this.EdgeLabel.InvokeInUiThread(() => { this.UpdateVisibility(this.Edge); if (!this.Edge.IsVisible) { return; } this.EdgePath.Data = VisualsFactory.CreateEdgePath(Edge.GeometryEdge.Curve); // arrows should be nulled and removed if they are nor required anymore. // revist on graphic property editing // --wgross 28.09.2018 if (this.Edge.Attr.ArrowAtSource) { this.SourceArrowHeadPath.Data = VisualsFactory.CreateEdgeSourceArrow(this.Edge.GeometryEdge.EdgeGeometry, this.PathStrokeThickness); } if (this.Edge.Attr.ArrowAtTarget) { this.TargetArrowHeadPath.Data = VisualsFactory.CreateEdgeTargetArrow(this.Edge.GeometryEdge.EdgeGeometry, this.PathStrokeThickness); } this.SetPathStroke(); if (VLabel != null) { ((IInvalidatable)VLabel).Invalidate(); } }); }
public (FrameworkElement edgeLabel, Path edgePath, Path edgeSourceArrow, Path edgeTargetArrow) SetupEdgeVisuals(FrameworkElement edgeLabel) { // nope: this must be VLabel//edgeLabel.Tag = this; var edgePath = new Path { Data = VisualsFactory.CreateEdgePath(this.Edge.GeometryEdge.Curve), Tag = this }; var edgeSourceArrow = this.Edge.Attr.ArrowAtSource ? new Path { Data = VisualsFactory.CreateEdgeSourceArrow(this.Edge.GeometryEdge.EdgeGeometry, this.PathStrokeThickness), Tag = this } : null; var edgeTargetArrow = this.Edge.Attr.ArrowAtTarget ? new Path { Data = VisualsFactory.CreateEdgeTargetArrow(this.Edge.GeometryEdge.EdgeGeometry, this.PathStrokeThickness), Tag = this } : null; return(edgeLabel, edgePath, edgeSourceArrow, edgeTargetArrow); }
private static Path CreateFrameworkElementForRailCurve(Rail rail, ICurve iCurve, byte transparency) { var path = new Path { Data = VisualsFactory.CreateEdgePath(iCurve), }; return(path); }
public void DrawRubberLine(Point rubberEnd) { if (_rubberLinePath == null) { _rubberLinePath = new Path { Stroke = Brushes.Black, StrokeThickness = GetBorderPathThickness() * 3 }; GraphCanvas.Children.Add(_rubberLinePath); // targetArrowheadPathForRubberLine = new Path { // Stroke = Brushes.Black, // StrokeThickness = GetBorderPathThickness()*3 // }; // graphCanvas.Children.Add(targetArrowheadPathForRubberLine); } _rubberLinePath.Data = VisualsFactory.CreateEdgePath(new LineSegment(_sourcePortLocationForEdgeRouting, rubberEnd)); }
public KosmographViewerEdge(DrawingEdge edge, FrameworkElement labelFrameworkElement) { this.Edge = edge; this.EdgePath = new Path { Data = VisualsFactory.CreateEdgePath(this.Edge.GeometryEdge.Curve), Tag = this }; (this.EdgeLabel, this.EdgePath, this.SourceArrowHeadPath, this.TargetArrowHeadPath) = this.SetupEdgeVisuals(labelFrameworkElement); this.SetPathStroke(); Wpf2MsaglConverters.PositionFrameworkElement(this.EdgeLabel, this.Edge.Label.Center, 1); // events sent from the MSAGL graphs this.Edge.Attr.VisualsChanged += (a, b) => Invalidate(); this.Edge.IsVisibleChanged += this.UpdateVisibility; }
public void DrawRubberEdge(EdgeGeometry edgeGeometry) { if (_rubberEdgePath == null) { _rubberEdgePath = new Path { Stroke = Brushes.Black, StrokeThickness = GetBorderPathThickness() * 3 }; GraphCanvas.Children.Add(_rubberEdgePath); _targetArrowheadPathForRubberEdge = new Path { Stroke = Brushes.Black, StrokeThickness = GetBorderPathThickness() * 3 }; GraphCanvas.Children.Add(_targetArrowheadPathForRubberEdge); } _rubberEdgePath.Data = VisualsFactory.CreateEdgePath(edgeGeometry.Curve); _targetArrowheadPathForRubberEdge.Data = VisualsFactory.CreateEdgeTargetArrow(edgeGeometry, edgeGeometry.LineWidth); }
public TextBlock CreateTextBlockFromDrawingObjectLabel(Microsoft.Msagl.Drawing.Label drawingLabel) { return(VisualsFactory.CreateLabel(drawingLabel)); }