示例#1
0
        TransferToGraphDrawer
        (
            GraphDrawer graphDrawer
        )
        {
            Debug.Assert(graphDrawer != null);
            AssertValid();

            Font oFont = this.Font;

            System.Windows.Media.Typeface oTypeface =
                WpfGraphicsUtil.FontToTypeface(oFont);

            Double dFontSize = WpfGraphicsUtil.WindowsFormsFontSizeToWpfFontSize(
                oFont.Size);

            VertexDrawer oVertexDrawer = graphDrawer.VertexDrawer;

            oVertexDrawer.SetFont(oTypeface, dFontSize);

            oVertexDrawer.LabelFillColor =
                WpfGraphicsUtil.ColorToWpfColor(this.VertexLabelFillColor);

            oVertexDrawer.LabelPosition      = this.VertexLabelPosition;
            oVertexDrawer.MaximumLabelLength = this.VertexLabelMaximumLength;

            EdgeDrawer oEdgeDrawer = graphDrawer.EdgeDrawer;

            oEdgeDrawer.SetFont(oTypeface, dFontSize);
            oEdgeDrawer.MaximumLabelLength = this.EdgeLabelMaximumLength;
        }
示例#2
0
        TransferToGraphDrawer
        (
            GraphDrawer graphDrawer
        )
        {
            Debug.Assert(graphDrawer != null);
            AssertValid();

            System.Windows.Media.Typeface oTypeface;
            Double dFontSize;

            //***********
            //  Vertex
            //***********

            VertexDrawer oVertexDrawer = graphDrawer.VertexDrawer;

            FontToTypefaceAndFontSize(this.VertexFont,
                                      out oTypeface, out dFontSize);

            oVertexDrawer.SetFont(oTypeface, dFontSize);

            oVertexDrawer.LabelFillColor =
                WpfGraphicsUtil.ColorToWpfColor(this.VertexLabelFillColor);

            oVertexDrawer.LabelPosition      = this.VertexLabelPosition;
            oVertexDrawer.MaximumLabelLength = this.VertexLabelMaximumLength;
            oVertexDrawer.LabelWrapText      = this.VertexLabelWrapText;

            oVertexDrawer.LabelWrapMaxTextWidth =
                this.VertexLabelWrapMaxTextWidth;

            //***********
            //  Edge
            //***********

            EdgeDrawer oEdgeDrawer = graphDrawer.EdgeDrawer;

            FontToTypefaceAndFontSize(this.EdgeFont, out oTypeface, out dFontSize);

            oEdgeDrawer.SetFont(oTypeface, dFontSize);

            oEdgeDrawer.LabelTextColor =
                WpfGraphicsUtil.ColorToWpfColor(this.EdgeLabelTextColor);

            oEdgeDrawer.MaximumLabelLength = this.EdgeLabelMaximumLength;

            //***********
            //  Group
            //***********

            GroupDrawer oGroupDrawer = graphDrawer.GroupDrawer;

            FontToTypefaceAndFontSize(this.GroupFont,
                                      out oTypeface, out dFontSize);

            oGroupDrawer.SetFont(oTypeface, dFontSize);

            oGroupDrawer.LabelTextColor = WpfGraphicsUtil.ColorToWpfColor(

                Color.FromArgb((new AlphaConverter()).WorkbookToGraphAsByte(
                                   this.GroupLabelTextAlpha),

                               this.GroupLabelTextColor)
                );

            oGroupDrawer.LabelPosition = this.GroupLabelPosition;
        }