Example #1
0
        /// <summary>
        /// Vykreslí přímou linku nebo S křivku { Prev.End to Next.Begin }
        /// </summary>
        /// <param name="e">Data pro kreslení</param>
        /// <param name="mode">Důvody zobrazení</param>
        /// <param name="ratio">Poměr průhlednosti: hodnota v rozsahu 0.0 (neviditelná) - 1.0 (plná barva)</param>
        protected void DrawPrevNext(GInteractiveDrawArgs e, TimeGraphLinkMode mode, float ratio)
        {
            TimeGraph     graph         = (this.ItemNext != null ? this.ItemNext.Graph : (this.ItemPrev != null ? this.ItemPrev.Graph : null));
            RelationState relationState = GetRelationState(this.ItemPrev, this.ItemNext);
            Color         color1        = this.GetColorForState(relationState, graph);

            Point?prevPoint = GetPoint(this.ItemPrev, RectangleSide.MiddleRight, true, true);
            Point?nextPoint = GetPoint(this.ItemNext, RectangleSide.MiddleLeft, true, true);

            LinkLineType lineType = this.CurrentLineShape;
            float?       treshold = 4f * (float)(this.LinkWidth.HasValue ? this.LinkWidth.Value : 3);

            using (System.Drawing.Drawing2D.GraphicsPath graphicsPath = Painter.CreatePathLink(lineType, prevPoint, nextPoint, treshold))
            {
                bool useRoundAnchor = (lineType == LinkLineType.ZigZagHorizontal || lineType == LinkLineType.ZigZagVertical || lineType == LinkLineType.ZigZagOptimal);
                System.Drawing.Drawing2D.LineCap startCap = (useRoundAnchor ? System.Drawing.Drawing2D.LineCap.RoundAnchor : System.Drawing.Drawing2D.LineCap.Round);
                System.Drawing.Drawing2D.LineCap endCap   = System.Drawing.Drawing2D.LineCap.ArrowAnchor;
                Painter.DrawLinkPath(e.Graphics, graphicsPath, color1, null, this.LinkWidth, startCap, endCap, ratio);
            }
        }
Example #2
0
 /// <summary>
 /// Určí aktuálně platný tvar čáry <see cref="CurrentLineShape"/> podle hodnoty v datech <see cref="LineShape"/>, a pokud není zadáno pak vezme defaultní (parametr).
 /// </summary>
 /// <param name="defaultLineType">Výchozí tvar křivky dle konfigurace</param>
 internal void PrepareCurrentLine(LinkLineType defaultLineType)
 {
     this.CurrentLineShape = this.LineShape ?? defaultLineType;
 }