DrawPlusSign
(
VertexShape eVertexShape,
Color oVertexColor,
GraphDrawingContext oGraphDrawingContext,
DrawingContext oDrawingContext,
Double dGraphScale,
VertexLabelDrawer oVertexLabelDrawer,
FormattedTextManager oFormattedTextManager,
VertexDrawingHistory oVertexDrawingHistory
)
{
Debug.Assert(oGraphDrawingContext != null);
Debug.Assert(oDrawingContext != null);
Debug.Assert(dGraphScale >= GraphDrawer.MinimumGraphScale);
Debug.Assert(dGraphScale <= GraphDrawer.MaximumGraphScale);
Debug.Assert(oVertexLabelDrawer != null);
Debug.Assert(oFormattedTextManager != null);
Debug.Assert(oVertexDrawingHistory != null);
AssertValid();
Color oFillColor;
switch (eVertexShape)
{
case VertexShape.Circle:
case VertexShape.Square:
case VertexShape.Diamond:
case VertexShape.Triangle:
// The fill color is the color of the background. Adjust the
// fill color for the opacity of the vertex.
oFillColor = WpfGraphicsUtil.SetWpfColorAlpha(
oGraphDrawingContext.BackColor, oVertexColor.A);
break;
default:
oFillColor = oVertexColor;
break;
}
Color oContrastingColor =
WpfGraphicsUtil.GetContrastingColor(oFillColor);
// The font size used below was chosen so that it is large enough to be
// easily readable, but small enough to fit within the smallest
// collapsed group vertex created by this class.
oVertexLabelDrawer.DrawLabel(oDrawingContext, oGraphDrawingContext,
oVertexDrawingHistory, VertexLabelPosition.MiddleCenter,
oFormattedTextManager.CreateFormattedText("+", oContrastingColor,
15.0, dGraphScale),
oContrastingColor, false);
}