예제 #1
0
        static void RenderTimelineEventBase(Color color, Image ss, bool selected, string desc, IDrawingToolkit tk,
                                            IContext context, Area backgroundArea, Area cellArea, CellState state,
                                            out Point selectPoint, out Point textPoint, out Point imagePoint,
                                            out Point circlePoint, out double textWidth)
        {
            selectPoint = new Point(backgroundArea.Start.X, backgroundArea.Start.Y);
            textPoint   = new Point(selectPoint.X + Sizes.ListSelectedWidth + Sizes.ListRowSeparator, selectPoint.Y);
            imagePoint  = new Point(textPoint.X + Sizes.ListTextWidth + Sizes.ListRowSeparator, selectPoint.Y);
            textWidth   = Sizes.ListTextWidth;
            circlePoint = new Point(selectPoint.X + Sizes.ListSelectedWidth / 2, selectPoint.Y + backgroundArea.Height / 2);

            tk.LineWidth = 0;
            if (state.HasFlag(CellState.Prelit))
            {
                tk.FillColor = App.Current.Style.ThemeContrastSecondary;
            }
            else
            {
                tk.FillColor = App.Current.Style.ThemeBase;
            }
            tk.DrawRectangle(backgroundArea.Start, backgroundArea.Width, backgroundArea.Height);
            /* Selection rectangle */
            tk.LineWidth = 0;
            tk.FillColor = color;
            tk.DrawRectangle(selectPoint, Sizes.ListSelectedWidth, backgroundArea.Height);
            tk.FillColor = App.Current.Style.ThemeBase;
            tk.DrawCircle(circlePoint, (Sizes.ListSelectedWidth / 2) - 1);
            if (state.HasFlag(CellState.Selected))
            {
                tk.FillColor = App.Current.Style.ScreenBase;
                tk.FillColor = App.Current.Style.ThemeContrastDisabled;
                tk.DrawCircle(circlePoint, (Sizes.ListSelectedWidth / 2) - 2);
            }

            if (desc != null)
            {
                tk.FontSize      = 10;
                tk.FontWeight    = FontWeight.Normal;
                tk.StrokeColor   = App.Current.Style.TextBase;
                tk.FontAlignment = FontAlignment.Left;
                tk.DrawText(textPoint, textWidth, cellArea.Height, desc);
            }
            if (selected)
            {
                if (EyeSurface == null)
                {
                    EyeSurface = App.Current.DrawingToolkit.CreateSurfaceFromIcon(Icons.ListEyePath, false);
                }
                tk.DrawSurface(new Point(imagePoint.X - EyeSurface.Width - Sizes.ListEyeIconOffset, imagePoint.Y + backgroundArea.Height / 2 - EyeSurface.Height / 2),
                               Sizes.ListEyeIconWidth, Sizes.ListEyeIconHeight, EyeSurface, ScaleMode.AspectFit);
            }
            if (ss != null)
            {
                tk.DrawImage(imagePoint, Sizes.ListImageWidth, cellArea.Height, ss,
                             ScaleMode.AspectFit);
            }
        }
예제 #2
0
        static void RenderTimelineEventBase(Color color, Image ss, bool selected, string desc, IDrawingToolkit tk,
                                            IContext context, Area backgroundArea, Area cellArea, CellState state,
                                            out Point selectPoint, out Point textPoint, out Point imagePoint,
                                            out Point circlePoint, out double textWidth)
        {
            selectPoint = new Point(backgroundArea.Start.X, backgroundArea.Start.Y);
            textPoint   = new Point(selectPoint.X + StyleConf.ListSelectedWidth + StyleConf.ListRowSeparator, selectPoint.Y);
            imagePoint  = new Point(textPoint.X + StyleConf.ListTextWidth + StyleConf.ListRowSeparator, selectPoint.Y);
            textWidth   = StyleConf.ListTextWidth;
            circlePoint = new Point(selectPoint.X + StyleConf.ListSelectedWidth / 2, selectPoint.Y + backgroundArea.Height / 2);

            tk.LineWidth = 0;
            if (state.HasFlag(CellState.Prelit))
            {
                tk.FillColor = Config.Style.PaletteBackgroundDarkBright;
            }
            else
            {
                tk.FillColor = Config.Style.PaletteBackgroundDark;
            }
            tk.DrawRectangle(backgroundArea.Start, backgroundArea.Width, backgroundArea.Height);
            /* Selection rectangle */
            tk.LineWidth = 0;
            tk.FillColor = color;
            tk.DrawRectangle(selectPoint, StyleConf.ListSelectedWidth, backgroundArea.Height);
            tk.FillColor = Config.Style.PaletteBackgroundDark;
            tk.DrawCircle(circlePoint, (StyleConf.ListSelectedWidth / 2) - 1);
            if (state.HasFlag(CellState.Selected))
            {
                tk.FillColor = Config.Style.PaletteBackground;
                tk.FillColor = Config.Style.PaletteActive;
                tk.DrawCircle(circlePoint, (StyleConf.ListSelectedWidth / 2) - 2);
            }

            if (desc != null)
            {
                tk.FontSize      = 10;
                tk.FontWeight    = FontWeight.Normal;
                tk.StrokeColor   = Config.Style.PaletteSelected;
                tk.FontAlignment = FontAlignment.Left;
                tk.DrawText(textPoint, textWidth, cellArea.Height, desc);
            }
            if (selected)
            {
                if (EyeSurface == null)
                {
                    EyeSurface = Config.DrawingToolkit.CreateSurface(Path.Combine(Config.IconsDir, StyleConf.ListEyeIconPath));
                }
                tk.DrawSurface(EyeSurface, new Point(imagePoint.X - EyeSurface.Width - StyleConf.ListEyeIconOffset, imagePoint.Y + backgroundArea.Height / 2 - EyeSurface.Height / 2));
            }
            if (ss != null)
            {
                tk.DrawImage(imagePoint, StyleConf.ListImageWidth, cellArea.Height, ss, true);
            }
        }
예제 #3
0
        protected void DrawCenterSelection(IDrawingToolkit tk, Point p)
        {
            tk.StrokeColor = tk.FillColor = App.Current.Style.ColorShadow;
            tk.LineStyle   = LineStyle.Normal;
            tk.LineWidth   = 0;
            tk.DrawCircle(new Point(p.X + 1, p.Y + 1),
                          selectionSize);

            tk.StrokeColor = tk.FillColor = CanvasSelectionAnchor;
            tk.DrawCircle(p, selectionSize);
        }
예제 #4
0
        static void RenderCount(bool isExpanded, Color color, int count, IDrawingToolkit tk, Area backgroundArea, Area cellArea)
        {
            double   countX1, countX2, countY, countYC;
            Point    arrowY;
            ISurface arrow;

            countX1 = cellArea.Start.X + StyleConf.ListRowSeparator + StyleConf.ListCountRadio;
            countX2 = countX1 + StyleConf.ListCountWidth;
            countYC = backgroundArea.Start.Y + backgroundArea.Height / 2;
            countY  = countYC - StyleConf.ListCountRadio;
            if (count > 0)
            {
                if (!isExpanded)
                {
                    if (ArrowRight == null)
                    {
                        ArrowRight = Config.DrawingToolkit.CreateSurface(Path.Combine(Config.IconsDir,
                                                                                      StyleConf.ListArrowRightPath));
                    }
                    arrow  = ArrowRight;
                    arrowY = new Point(cellArea.Start.X + 1,
                                       cellArea.Start.Y + cellArea.Height / 2 - arrow.Height / 2);
                }
                else
                {
                    if (ArrowDown == null)
                    {
                        ArrowDown = Config.DrawingToolkit.CreateSurface(Path.Combine(Config.IconsDir,
                                                                                     StyleConf.ListArrowDownPath));
                    }
                    arrow  = ArrowDown;
                    arrowY = new Point(cellArea.Start.X + 1, cellArea.Start.Y + cellArea.Height / 2);
                }
                tk.DrawSurface(arrow, arrowY);
            }

            tk.LineWidth = 0;
            tk.FillColor = color;
            tk.DrawCircle(new Point(countX1, countYC), StyleConf.ListCountRadio);
            tk.DrawCircle(new Point(countX2, countYC), StyleConf.ListCountRadio);
            tk.DrawRectangle(new Point(countX1, countY), StyleConf.ListCountWidth, 2 * StyleConf.ListCountRadio);
            tk.StrokeColor   = Config.Style.PaletteBackgroundDark;
            tk.FontAlignment = FontAlignment.Center;
            tk.FontWeight    = FontWeight.Bold;
            tk.FontSize      = 14;
            tk.DrawText(new Point(countX1, countY), StyleConf.ListCountWidth,
                        2 * StyleConf.ListCountRadio, count.ToString());
        }
예제 #5
0
        public override void Draw(IDrawingToolkit tk, Area area)
        {
            tk.Begin();
            var center = new Point(Position.X + Width / 2, Position.Y + Height / 2);
            var radius = Math.Min(Width, Height) / 2;

            tk.FillColor   = BackgroundColor;
            tk.StrokeColor = BackgroundColor;
            tk.LineWidth   = 0;

            if (Image != null)
            {
                tk.DrawCircleImage(center, radius, Image);
            }
            else
            {
                tk.DrawCircle(center, radius);
                if (!String.IsNullOrEmpty(BackupText))
                {
                    tk.FontSize      = (int)(radius * 1.3);
                    tk.FontWeight    = FontWeight.Bold;
                    tk.FontAlignment = FontAlignment.Center;
                    tk.StrokeColor   = TextColor;
                    tk.DrawText(Position, Width, Height, BackupText [0].ToString());
                }
            }
            tk.End();
        }
예제 #6
0
 protected void DrawCenterSelection(IDrawingToolkit tk, Point p)
 {
     tk.StrokeColor = tk.FillColor = Constants.SELECTION_INDICATOR_COLOR;
     tk.LineWidth   = 0;
     tk.LineStyle   = LineStyle.Normal;
     tk.DrawCircle(p, selectionSize);
 }
예제 #7
0
        public override void Draw(IDrawingToolkit tk, Area area)
        {
            Color lineColor;
            int   lineWidth = 4;

            if (!UpdateDrawArea(tk, area, Area))
            {
                return;
            }

            if (Selected)
            {
                lineColor = StyleConf.ActionLinkSelected;
            }
            else if (Highlighted)
            {
                lineColor = StyleConf.ActionLinkPrelight;
            }
            else
            {
                lineColor = StyleConf.ActionLinkNormal;
            }

            tk.Begin();
            tk.FillColor   = lineColor;
            tk.StrokeColor = lineColor;
            tk.LineWidth   = lineWidth;
            tk.LineStyle   = LineStyle.Normal;
            tk.DrawLine(line.Start, line.Stop);
            tk.FillColor = tk.StrokeColor = Config.Style.PaletteActive;
            tk.DrawCircle(line.Stop, 2);
            tk.End();
        }
예제 #8
0
        /// <summary>
        /// Draw the specified tk and area.
        /// </summary>
        /// <param name="tk">Tk.</param>
        /// <param name="area">Area.</param>
        public override void Draw(IDrawingToolkit tk, Area area)
        {
            Color lineColor;
            int   lineWidth = 4;

            if (!UpdateDrawArea(tk, area, Area))
            {
                return;
            }

            if (Selected)
            {
                lineColor = App.Current.Style.ColorPrimary;
            }
            else if (Highlighted)
            {
                lineColor = App.Current.Style.ThemeDisabled;
            }
            else
            {
                lineColor = App.Current.Style.ThemeSecondary;
            }

            tk.Begin();
            tk.FillColor   = lineColor;
            tk.StrokeColor = lineColor;
            tk.LineWidth   = lineWidth;
            tk.LineStyle   = LineStyle.Normal;
            tk.DrawLine(line.Start, line.Stop);
            tk.FillColor = tk.StrokeColor = App.Current.Style.ThemeContrastDisabled;
            tk.DrawCircle(line.Stop, 2);
            tk.End();
        }
예제 #9
0
        public override void Draw(IDrawingToolkit tk, Area area)
        {
            Color  fillColor, strokeColor;
            double relSize;

            relSize = Math.Max(1, (double)Width / 200);

            if (!UpdateDrawArea(tk, area, GetArea(relSize)))
            {
                return;
            }

            tk.Begin();
            if (Play != null)
            {
                fillColor   = Play.Color;
                strokeColor = fillColor;
                if (Project != null)
                {
                    TeamType team = Project.EventTaggedTeam(Play);
                    if (team == TeamType.LOCAL)
                    {
                        strokeColor = Project.LocalTeamTemplate.Color;
                    }
                    else if (team == TeamType.VISITOR)
                    {
                        strokeColor = Project.VisitorTeamTemplate.Color;
                    }
                }
            }
            else
            {
                fillColor = strokeColor = Constants.TAGGER_POINT_COLOR;
            }

            if (Selected)
            {
                fillColor = Constants.TAGGER_SELECTION_COLOR;
            }
            else if (Highlighted)
            {
                fillColor = Config.Style.PaletteActive;
            }

            tk.FillColor   = fillColor;
            tk.StrokeColor = strokeColor;
            tk.LineWidth   = (int)relSize;
            tk.DrawCircle(Start, relSize * 1.5);
            if (Points.Count == 2)
            {
                tk.StrokeColor = fillColor;
                tk.LineWidth   = (int)relSize;
                tk.DrawLine(Start, Stop);
                tk.DrawArrow(Start, Stop, 10, 0.3, true);
            }
            tk.End();
        }
예제 #10
0
        static void RenderCount(bool isExpanded, Color color, int count, IDrawingToolkit tk, Area backgroundArea, Area cellArea)
        {
            double   countX1, countX2, countY, countYC;
            Point    arrowY;
            ISurface arrow;

            countX1 = cellArea.Start.X + Sizes.ListRowSeparator * 2 + Sizes.ListCountRadio;
            countX2 = countX1 + Sizes.ListCountWidth;
            countYC = backgroundArea.Start.Y + backgroundArea.Height / 2;
            countY  = countYC - Sizes.ListCountRadio;
            if (count > 0)
            {
                if (!isExpanded)
                {
                    if (ArrowRight == null)
                    {
                        ArrowRight = App.Current.DrawingToolkit.CreateSurfaceFromIcon(Icons.ListArrowRightPath, false);
                    }
                    arrow = ArrowRight;
                }
                else
                {
                    if (ArrowDown == null)
                    {
                        ArrowDown = App.Current.DrawingToolkit.CreateSurfaceFromIcon(Icons.ListArrowDownPath, false);
                    }
                    arrow = ArrowDown;
                }
                arrowY = new Point(cellArea.Start.X + 1, cellArea.Start.Y + cellArea.Height / 2 - arrow.Height / 2);
                tk.DrawSurface(arrowY, Sizes.ListArrowRightWidth, Sizes.ListArrowRightHeight, arrow, ScaleMode.AspectFit);
            }

            tk.LineWidth = 0;
            tk.FillColor = color;
            tk.DrawCircle(new Point(countX1, countYC), Sizes.ListCountRadio);
            tk.DrawCircle(new Point(countX2, countYC), Sizes.ListCountRadio);
            tk.DrawRectangle(new Point(countX1, countY), Sizes.ListCountWidth, 2 * Sizes.ListCountRadio);
            tk.StrokeColor   = App.Current.Style.ThemeBase;
            tk.FontAlignment = FontAlignment.Center;
            tk.FontWeight    = FontWeight.Bold;
            tk.FontSize      = 14;
            tk.DrawText(new Point(countX1, countY), Sizes.ListCountWidth,
                        2 * Sizes.ListCountRadio, count.ToString());
        }
예제 #11
0
            public override void Draw(IContext context, Area area)
            {
                IDrawingToolkit dt         = App.Current.DrawingToolkit;
                IContext        oldcontext = dt.Context;

                dt.Context = context;
                dt.DrawCircle(new Point(0, 0), 50);

                dt.Context = oldcontext;
            }
예제 #12
0
        public override void Draw(IDrawingToolkit tk, Area area)
        {
            Color front, back;
            int width;

            if (!UpdateDrawArea (tk, area, Area)) {
                return;
            }
            tk.Begin ();

            if (Active) {
                tk.LineWidth = StyleConf.ButtonLineWidth;
                tk.StrokeColor = BackgroundColor;
                tk.FillColor = TextColor;
            } else {
                tk.LineWidth = 0;
                tk.StrokeColor = TextColor;
                tk.FillColor = BackgroundColor;
            }

            /* Draw Shape */
            switch (Button.PenaltyCard.Shape) {
            case CardShape.Rectangle:
                tk.DrawRoundedRectangle (Button.Position, Button.Width, Button.Height, 3);
                break;
            case CardShape.Circle:
                tk.DrawCircle (new Point (Button.Position.X + Button.Width / 2,
                    Button.Position.Y + Button.Height / 2),
                    Math.Min (Button.Width, Button.Height) / 2);
                break;
            case CardShape.Triangle:
                tk.DrawTriangle (new Point (Button.Position.X + Button.Width / 2, Button.Position.Y),
                    Button.Width, Button.Height, SelectionPosition.Top);
                break;
            }

            /* Draw header */
            tk.LineWidth = 2;
            tk.FontSize = StyleConf.ButtonNameFontSize;
            tk.FontWeight = FontWeight.Light;
            tk.FontAlignment = FontAlignment.Center;
            if (Recording) {
                tk.DrawText (Position, Button.Width, Button.Height, (CurrentTime - Start).ToSecondsString ());
            } else {
                tk.DrawText (Position, Button.Width, Button.Height, Button.PenaltyCard.Name);
            }
            DrawSelectionArea (tk);
            if (ShowLinks) {
                GetAnchor (null).Draw (tk, area);
            }
            tk.End ();
        }
예제 #13
0
        void DrawLine(IDrawingToolkit tk, double start, double stop, int lineWidth)
        {
            double y;

            y              = OffsetY + Height / 2;
            tk.LineWidth   = lineWidth;
            tk.FillColor   = Event.Color;
            tk.StrokeColor = Event.Color;
            if (stop - start <= lineWidth)
            {
                tk.LineWidth = 0;
                tk.DrawCircle(new Point(start + (stop - start) / 2, y), 3);
            }
            else
            {
                tk.DrawLine(new Point(start + lineWidth / 2, y),
                            new Point(stop - lineWidth / 2, y));
            }
        }
예제 #14
0
        public override void Draw(IDrawingToolkit tk, Area area)
        {
            Color fillColor, strokeColor;

            if (Points == null)
            {
                return;
            }

            if (!UpdateDrawArea(tk, area, Area))
            {
                return;
            }

            tk.Begin();
            fillColor   = Color;
            strokeColor = OutlineColor;

            if (Selected)
            {
                fillColor = VASDrawing.Constants.TAGGER_SELECTION_COLOR;
            }
            else if (Highlighted)
            {
                fillColor = App.Current.Style.ThemeContrastDisabled;
            }

            tk.FillColor   = fillColor;
            tk.StrokeColor = strokeColor;
            tk.LineWidth   = (int)PointRelativeSize;
            tk.DrawCircle(Start, PointRelativeSize * 1.5);
            if (Points.Count == 2)
            {
                tk.StrokeColor = fillColor;
                tk.LineWidth   = (int)PointRelativeSize;
                tk.DrawLine(Start, Stop);
                tk.DrawArrow(Start, Stop, 10, 0.3, true);
            }
            tk.End();
        }
예제 #15
0
        public override void Draw(IDrawingToolkit tk, Area area)
        {
            Area darea;

            darea = Drawable.Area;
            if (!UpdateDrawArea(tk, area, darea))
            {
                return;
            }

            tk.Begin();
            tk.FillColor   = Drawable.FillColor;
            tk.StrokeColor = Drawable.StrokeColor;
            tk.LineWidth   = Drawable.LineWidth;
            tk.DrawCircle(Drawable.Center, Drawable.Radius);
            tk.StrokeColor   = Drawable.TextColor;
            tk.FontAlignment = FontAlignment.Center;
            tk.FontSize      = (int)Drawable.AxisX;
            tk.DrawText(darea.Start, darea.Width, darea.Height,
                        Drawable.Count.ToString());
            DrawSelectionArea(tk);
            tk.End();
        }
예제 #16
0
        public override void Draw(IDrawingToolkit tk, Area area)
        {
            tk.Begin ();
            var center = new Point (Position.X + Width / 2, Position.Y + Height / 2);
            var radius = Math.Min (Width, Height) / 2;

            tk.FillColor = BackgroundColor;
            tk.StrokeColor = BackgroundColor;
            tk.LineWidth = 0;

            if (Image != null) {
                tk.DrawCircleImage (center, radius, Image);
            } else {
                tk.DrawCircle (center, radius);
                if (!String.IsNullOrEmpty (BackupText)) {
                    tk.FontSize = (int)(radius * 1.3);
                    tk.FontWeight = FontWeight.Bold;
                    tk.FontAlignment = FontAlignment.Center;
                    tk.StrokeColor = TextColor;
                    tk.DrawText (Position, Width, Height, BackupText [0].ToString ());
                }
            }
            tk.End ();
        }
예제 #17
0
        void DrawLine(IDrawingToolkit tk, double start, double stop, int lineWidth)
        {
            double y;

            y = OffsetY + Height / 2;
            tk.LineWidth = lineWidth;
            tk.FillColor = Event.Color;
            tk.StrokeColor = Event.Color;
            if (stop - start <= lineWidth) {
                tk.LineWidth = 0;
                tk.DrawCircle (new Point (start + (stop - start) / 2, y), 3);
            } else {
                tk.DrawLine (new Point (start + lineWidth / 2, y),
                    new Point (stop - lineWidth / 2, y));
            }
        }
예제 #18
0
        public override void Draw(IDrawingToolkit tk, Area area)
        {
            Color fillColor, strokeColor;
            double relSize;

            relSize = Math.Max (1, (double)Width / 200);

            if (!UpdateDrawArea (tk, area, GetArea (relSize))) {
                return;
            }

            tk.Begin ();
            if (Play != null) {
                fillColor = Play.Color;
                strokeColor = fillColor;
                if (Play.Teams.Count == 1) {
                    strokeColor = Play.Teams.First ().Color;
                }
            } else {
                fillColor = strokeColor = VASDrawing.Constants.TAGGER_POINT_COLOR;
            }

            if (Selected) {
                fillColor = VASDrawing.Constants.TAGGER_SELECTION_COLOR;
            } else if (Highlighted) {
                fillColor = App.Current.Style.PaletteActive;
            }

            tk.FillColor = fillColor;
            tk.StrokeColor = strokeColor;
            tk.LineWidth = (int)relSize;
            tk.DrawCircle (Start, relSize * 1.5);
            if (Points.Count == 2) {
                tk.StrokeColor = fillColor;
                tk.LineWidth = (int)relSize;
                tk.DrawLine (Start, Stop);
                tk.DrawArrow (Start, Stop, 10, 0.3, true);
            }
            tk.End ();
        }
예제 #19
0
        public override void Draw(IDrawingToolkit tk, Area area)
        {
            Color front, back;
            int   width;

            if (!UpdateDrawArea(tk, area, Area))
            {
                return;
            }
            tk.Begin();

            if (Active)
            {
                tk.LineWidth   = StyleConf.ButtonLineWidth;
                tk.StrokeColor = BackgroundColor;
                tk.FillColor   = TextColor;
            }
            else
            {
                tk.LineWidth   = 0;
                tk.StrokeColor = TextColor;
                tk.FillColor   = BackgroundColor;
            }

            /* Draw Shape */
            switch (Button.PenaltyCard.Shape)
            {
            case CardShape.Rectangle:
                tk.DrawRoundedRectangle(Button.Position, Button.Width, Button.Height, 3);
                break;

            case CardShape.Circle:
                tk.DrawCircle(new Point(Button.Position.X + Button.Width / 2,
                                        Button.Position.Y + Button.Height / 2),
                              Math.Min(Button.Width, Button.Height) / 2);
                break;

            case CardShape.Triangle:
                tk.DrawTriangle(new Point(Button.Position.X + Button.Width / 2, Button.Position.Y),
                                Button.Width, Button.Height, SelectionPosition.Top);
                break;
            }

            /* Draw header */
            tk.LineWidth     = 2;
            tk.FontSize      = StyleConf.ButtonNameFontSize;
            tk.FontWeight    = FontWeight.Light;
            tk.FontAlignment = FontAlignment.Center;
            if (Recording)
            {
                tk.DrawText(Position, Button.Width, Button.Height, (CurrentTime - Start).ToSecondsString());
            }
            else
            {
                tk.DrawText(Position, Button.Width, Button.Height, Button.PenaltyCard.Name);
            }
            DrawSelectionArea(tk);
            if (ShowLinks)
            {
                GetAnchor(null).Draw(tk, area);
            }
            tk.End();
        }
예제 #20
0
        static void RenderTimelineEventBase(Color color, Image ss, bool selected, string desc, IDrawingToolkit tk,
		                                     IContext context, Area backgroundArea, Area cellArea, CellState state,
		                                     out Point selectPoint, out Point textPoint, out Point imagePoint,
		                                     out Point circlePoint, out double textWidth)
        {
            selectPoint = new Point (backgroundArea.Start.X, backgroundArea.Start.Y);
            textPoint = new Point (selectPoint.X + StyleConf.ListSelectedWidth + StyleConf.ListRowSeparator, selectPoint.Y);
            imagePoint = new Point (textPoint.X + StyleConf.ListTextWidth + StyleConf.ListRowSeparator, selectPoint.Y);
            textWidth = StyleConf.ListTextWidth;
            circlePoint = new Point (selectPoint.X + StyleConf.ListSelectedWidth / 2, selectPoint.Y + backgroundArea.Height / 2);

            tk.LineWidth = 0;
            if (state.HasFlag (CellState.Prelit)) {
                tk.FillColor = Config.Style.PaletteBackgroundDarkBright;
            } else {
                tk.FillColor = Config.Style.PaletteBackgroundDark;
            }
            tk.DrawRectangle (backgroundArea.Start, backgroundArea.Width, backgroundArea.Height);
            /* Selection rectangle */
            tk.LineWidth = 0;
            tk.FillColor = color;
            tk.DrawRectangle (selectPoint, StyleConf.ListSelectedWidth, backgroundArea.Height);
            tk.FillColor = Config.Style.PaletteBackgroundDark;
            tk.DrawCircle (circlePoint, (StyleConf.ListSelectedWidth / 2) - 1);
            if (state.HasFlag (CellState.Selected)) {
                tk.FillColor = Config.Style.PaletteBackground;
                tk.FillColor = Config.Style.PaletteActive;
                tk.DrawCircle (circlePoint, (StyleConf.ListSelectedWidth / 2) - 2);
            }

            if (desc != null) {
                tk.FontSize = 10;
                tk.FontWeight = FontWeight.Normal;
                tk.StrokeColor = Config.Style.PaletteSelected;
                tk.FontAlignment = FontAlignment.Left;
                tk.DrawText (textPoint, textWidth, cellArea.Height, desc);
            }
            if (selected) {
                if (EyeSurface == null) {
                    EyeSurface = Config.DrawingToolkit.CreateSurface (Path.Combine (Config.IconsDir, StyleConf.ListEyeIconPath));
                }
                tk.DrawSurface (EyeSurface, new Point (imagePoint.X - EyeSurface.Width - StyleConf.ListEyeIconOffset, imagePoint.Y + backgroundArea.Height / 2 - EyeSurface.Height / 2));
            }
            if (ss != null) {
                tk.DrawImage (imagePoint, StyleConf.ListImageWidth, cellArea.Height, ss, true);
            }
        }
예제 #21
0
        static void RenderCount(bool isExpanded, Color color, int count, IDrawingToolkit tk, Area backgroundArea, Area cellArea)
        {
            double countX1, countX2, countY, countYC;
            Point arrowY;
            ISurface arrow;

            countX1 = cellArea.Start.X + StyleConf.ListRowSeparator + StyleConf.ListCountRadio;
            countX2 = countX1 + StyleConf.ListCountWidth;
            countYC = backgroundArea.Start.Y + backgroundArea.Height / 2;
            countY = countYC - StyleConf.ListCountRadio;
            if (count > 0) {
                if (!isExpanded) {
                    if (ArrowRight == null) {
                        ArrowRight = Config.DrawingToolkit.CreateSurface (Path.Combine (Config.IconsDir,
                            StyleConf.ListArrowRightPath));
                    }
                    arrow = ArrowRight;
                    arrowY = new Point (cellArea.Start.X + 1,
                        cellArea.Start.Y + cellArea.Height / 2 - arrow.Height / 2);
                } else {
                    if (ArrowDown == null) {
                        ArrowDown = Config.DrawingToolkit.CreateSurface (Path.Combine (Config.IconsDir,
                            StyleConf.ListArrowDownPath));
                    }
                    arrow = ArrowDown;
                    arrowY = new Point (cellArea.Start.X + 1, cellArea.Start.Y + cellArea.Height / 2);
                }
                tk.DrawSurface (arrow, arrowY);
            }

            tk.LineWidth = 0;
            tk.FillColor = color;
            tk.DrawCircle (new Point (countX1, countYC), StyleConf.ListCountRadio);
            tk.DrawCircle (new Point (countX2, countYC), StyleConf.ListCountRadio);
            tk.DrawRectangle (new Point (countX1, countY), StyleConf.ListCountWidth, 2 * StyleConf.ListCountRadio);
            tk.StrokeColor = Config.Style.PaletteBackgroundDark;
            tk.FontAlignment = FontAlignment.Center;
            tk.FontWeight = FontWeight.Bold;
            tk.FontSize = 14;
            tk.DrawText (new Point (countX1, countY), StyleConf.ListCountWidth,
                2 * StyleConf.ListCountRadio, count.ToString ());
        }
예제 #22
0
        public override void Draw(IDrawingToolkit tk, Area area)
        {
            Color lineColor;
            int lineWidth = 4;

            if (!UpdateDrawArea (tk, area, Area)) {
                return;
            }

            if (Selected) {
                lineColor = StyleConf.ActionLinkSelected;
            } else if (Highlighted) {
                lineColor = StyleConf.ActionLinkPrelight;
            } else {
                lineColor = StyleConf.ActionLinkNormal;
            }

            tk.Begin ();
            tk.FillColor = lineColor;
            tk.StrokeColor = lineColor;
            tk.LineWidth = lineWidth;
            tk.LineStyle = LineStyle.Normal;
            tk.DrawLine (line.Start, line.Stop);
            tk.FillColor = tk.StrokeColor = Config.Style.PaletteActive;
            tk.DrawCircle (line.Stop, 2);
            tk.End ();
        }
예제 #23
0
        public override void Draw(IDrawingToolkit tk, Area area)
        {
            Point    arrowLocation;
            ISurface arrow;

            if (Player == null)
            {
                return;
            }

            var zero = new Point(0, 0);

            GetArrowAndLocation(out arrow, out arrowLocation);

            tk.Begin();
            tk.TranslateAndScale(Position, new Point(1, 1));

            if (!UpdateDrawArea(tk, area, new Area(zero, Size, Size)))
            {
                tk.End();
                return;
            }

            // Draw shadow and clip
            if (Circular)
            {
                tk.FillColor = App.Current.Style.ColorShadow;
                tk.LineWidth = 0;
                tk.DrawCircle(new Point(Size / 2, Size / 2 + 1), Size / 2);
                tk.ClipCircle(new Point(Size / 2, Size / 2), Size / 2);
            }
            else
            {
                tk.Clip(new Area(new Point(0, 0), Size, Size));
            }

            /* Background */
            tk.FillColor = PlayerBackground;
            tk.LineWidth = 0;
            tk.DrawRectangle(zero, Size, Size);

            /* Image */
            if (Player.Photo != null)
            {
                tk.DrawImage(zero, Size, Size, Player.Photo, ScaleMode.AspectFit);
            }
            else
            {
                tk.DrawSurface(zero, Size, Size, DefaultPhoto, ScaleMode.AspectFit);
            }

            var numberY = Size * PlayerNumberRelativePosition;

            /* Draw number rectangle */
            var numberStart = new Point(0, numberY);
            var color       = Color.Copy();

            color.SetAlpha(PlayerNumberAlpha);
            tk.FillColor = color;
            tk.DrawRectangle(numberStart, Size, Size / 2);

            /* Draw number */
            tk.FillColor     = Color.White;
            tk.StrokeColor   = Color.White;
            tk.FontAlignment = FontAlignment.Center;
            tk.FontWeight    = FontWeight.Bold;
            if (ViewModel.Number >= 100)
            {
                tk.FontSize = PlayerSmallFontSize;
            }
            else
            {
                tk.FontSize = PlayerFontSize;
            }
            tk.DrawText(numberStart, Size, Size - numberY, ViewModel.Number.ToString());

            if (Player.Tagged)
            {
                Color selColor = Color.Copy();
                selColor.SetAlpha(PlayerSelectionAlpha);
                tk.FillColor = selColor;
                tk.DrawRectangle(zero, Size, Size);
            }

            /* Draw Arrow */
            if (SubstitutionMode && (Highlighted || ViewModel.Tagged))
            {
                var arrowSize = Size * PlayerArrowRelativeSize;
                /* Arrow shadow */
                tk.FillColor = Color.White;
                tk.DrawSurface(new Point(arrowLocation.X + 1, arrowLocation.Y + 1), arrowSize, arrowSize, arrow, ScaleMode.AspectFit, true);
                tk.FillColor = Color;
                tk.DrawSurface(arrowLocation, arrowSize, arrowSize, arrow, ScaleMode.AspectFit, true);
            }

            tk.End();
        }
예제 #24
0
        public override void Draw(IDrawingToolkit tk, Area area)
        {
            Color fillColor, strokeColor;
            double relSize;

            relSize = Math.Max (1, (double)Width / 200);

            if (!UpdateDrawArea (tk, area, GetArea (relSize))) {
                return;
            }

            tk.Begin ();
            if (Play != null) {
                fillColor = Play.Color;
                strokeColor = fillColor;
                if (Project != null) {
                    TeamType team = Project.EventTaggedTeam (Play);
                    if (team == TeamType.LOCAL) {
                        strokeColor = Project.LocalTeamTemplate.Color;
                    } else if (team == TeamType.VISITOR) {
                        strokeColor = Project.VisitorTeamTemplate.Color;
                    }
                }
            } else {
                fillColor = strokeColor = Constants.TAGGER_POINT_COLOR;
            }

            if (Selected) {
                fillColor = Constants.TAGGER_SELECTION_COLOR;
            } else if (Highlighted) {
                fillColor = Config.Style.PaletteActive;
            }

             			tk.FillColor = fillColor;
            tk.StrokeColor = strokeColor;
            tk.LineWidth = (int)relSize;
            tk.DrawCircle (Start, relSize * 1.5);
            if (Points.Count == 2) {
                tk.StrokeColor = fillColor;
                tk.LineWidth = (int)relSize;
                tk.DrawLine (Start, Stop);
                tk.DrawArrow (Start, Stop, 10, 0.3, true);
            }
            tk.End ();
        }