コード例 #1
0
        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();
                }
            });
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        private static Path CreateFrameworkElementForRailCurve(Rail rail, ICurve iCurve, byte transparency)
        {
            var path = new Path
            {
                Data = VisualsFactory.CreateEdgePath(iCurve),
            };

            return(path);
        }
コード例 #4
0
 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));
 }
コード例 #5
0
        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;
        }
コード例 #6
0
 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);
 }
コード例 #7
0
 public TextBlock CreateTextBlockFromDrawingObjectLabel(Microsoft.Msagl.Drawing.Label drawingLabel)
 {
     return(VisualsFactory.CreateLabel(drawingLabel));
 }