예제 #1
0
        public static void RenderAnalysisCategory(EventType cat, int count, bool isExpanded, IDrawingToolkit tk,
		                                           IContext context, Area backgroundArea, Area cellArea)
        {
            Point textP = new Point (StyleConf.ListTextOffset, cellArea.Start.Y);
            tk.Context = context;
            tk.Begin ();
            RenderBackgroundAndText (isExpanded, tk, backgroundArea, textP, cellArea.Width - textP.X, cat.Name);
            RenderCount (isExpanded, cat.Color, count, tk, backgroundArea, cellArea);
            RenderSeparationLine (tk, context, backgroundArea);
            tk.End ();
        }
예제 #2
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 ();
        }
예제 #3
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 ();
        }
예제 #4
0
        public override void Draw(IDrawingToolkit tk, Area area)
        {
            Color color;
            double hs, vs, to, rectSize;
            double y;

            if (Even) {
                color = Config.Style.PaletteBackground;
            } else {
                color = Config.Style.PaletteBackgroundLight;
            }

            hs = StyleConf.TimelineLabelHSpacing;
            vs = StyleConf.TimelineLabelVSpacing;
            rectSize = Height - vs * 2;
            to = hs + rectSize + hs;

            y = OffsetY - Math.Floor (Scroll);
            tk.Begin ();
            tk.FillColor = color;
            tk.StrokeColor = color;
            tk.LineWidth = 0;
            tk.DrawRectangle (new Point (0, y), width, Height);

            /* Draw a rectangle with the color */
            tk.FillColor = Color;
            tk.StrokeColor = Color;
            tk.DrawRectangle (new Point (hs, y + vs), rectSize, rectSize);

            /* Draw the name */
            tk.FontSlant = FontSlant.Normal;
            tk.FontWeight = FontWeight.Bold;
            tk.FontSize = 12;
            tk.FillColor = Config.Style.PaletteWidgets;
            tk.FontAlignment = FontAlignment.Left;
            tk.StrokeColor = Config.Style.PaletteWidgets;
            tk.DrawText (new Point (to, y), width - to, Height, Name);
            tk.End ();
        }
예제 #5
0
 public override void Draw(IDrawingToolkit tk, Area area)
 {
     tk.Begin ();
     tk.TranslateAndScale (Position, new Point (1, 1));
     if (background != null) {
         tk.DrawImage (background);
     }
     if (HomePlayingPlayers != null) {
         foreach (PlayerObject po in HomePlayingPlayers) {
             po.Playing = true;
             po.SubstitutionMode = SubstitutionMode;
             po.Size = playerSize;
             po.Draw (tk, area);
         }
     }
     if (AwayPlayingPlayers != null) {
         foreach (PlayerObject po in AwayPlayingPlayers) {
             po.Playing = true;
             po.SubstitutionMode = SubstitutionMode;
             po.Size = playerSize;
             po.Draw (tk, area);
         }
     }
     tk.End ();
 }
예제 #6
0
        public override void Draw(IDrawingToolkit tk, Area area)
        {
            ISurface linkIn, linkOut;

            if (Highlighted) {
                linkIn = InPrelightIcon;
                linkOut = OutPrelightIcon;
            } else {
                linkIn = InIcon;
                linkOut = OutIcon;
            }

            tk.Begin ();
            tk.DrawSurface (linkIn, new Point (In.X - iconWidth / 2,
                In.Y - iconHeight / 2));
            tk.DrawSurface (linkOut, new Point (Out.X - iconWidth / 2,
                In.Y - iconHeight / 2));
            tk.End ();
        }
예제 #7
0
        public override void Draw(IDrawingToolkit tk, Area area)
        {
            IContext ctx = tk.Context;

            if (!UpdateDrawArea (tk, area, Area)) {
                return;
            }
            if (backBufferSurface == null) {
                CreateBackBufferSurface ();
            }
            tk.Context = ctx;
            tk.Begin ();
            tk.DrawSurface (backBufferSurface, Position);
            DrawSelectionArea (tk);
            tk.End ();
        }
예제 #8
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 ();
        }
예제 #9
0
        public static void RenderPlayer(Player player, int count, bool isExpanded, IDrawingToolkit tk,
		                                 IContext context, Area backgroundArea, Area cellArea)
        {
            Point image, text;
            double textWidth;

            image = new Point (StyleConf.ListTextOffset, cellArea.Start.Y);
            text = new Point (image.X + StyleConf.ListRowSeparator + StyleConf.ListImageWidth,
                cellArea.Start.Y);
            textWidth = cellArea.Start.X + cellArea.Width - text.X;

            tk.Context = context;
            tk.Begin ();
            RenderBackgroundAndText (isExpanded, tk, backgroundArea, text, textWidth, player.ToString ());
            /* Photo */
            RenderPlayer (tk, player, image);
            RenderCount (isExpanded, player.Color, count, tk, backgroundArea, cellArea);
            RenderSeparationLine (tk, context, backgroundArea);
            tk.End ();
        }
예제 #10
0
        public static void RenderSubstitution(Color color, Time evt, Player playerIn, Player playerOut, bool selected,
		                                       bool isExpanded, IDrawingToolkit tk, IContext context, Area backgroundArea,
		                                       Area cellArea, CellState state)
        {
            Point selectPoint, textPoint, imagePoint, circlePoint;
            Point inPoint, imgPoint, outPoint, timePoint;
            double textWidth;

            if (subsImage == null) {
                subsImage = new Image (Path.Combine (Config.IconsDir, StyleConf.SubsIcon));
            }
            tk.Context = context;
            tk.Begin ();

            RenderTimelineEventBase (color, null, selected, null, tk, context, backgroundArea, cellArea, state,
                out selectPoint, out textPoint, out imagePoint, out circlePoint, out textWidth);
            inPoint = textPoint;
            imgPoint = new Point (textPoint.X + StyleConf.ListImageWidth + StyleConf.ListRowSeparator, textPoint.Y);
            outPoint = new Point (imgPoint.X + 20 + StyleConf.ListRowSeparator, imgPoint.Y);
            RenderPlayer (tk, playerIn, inPoint);
            tk.DrawImage (imgPoint, 20, cellArea.Height, subsImage, true);
            RenderPlayer (tk, playerOut, outPoint);

            timePoint = new Point (outPoint.X + StyleConf.ListImageWidth + StyleConf.ListRowSeparator, textPoint.Y);
            tk.FontSize = 10;
            tk.FontWeight = FontWeight.Normal;
            tk.StrokeColor = Config.Style.PaletteSelected;
            tk.FontAlignment = FontAlignment.Left;
            tk.DrawText (timePoint, 100, cellArea.Height, evt.ToSecondsString ());
            RenderSeparationLine (tk, context, backgroundArea);
            tk.End ();
        }
예제 #11
0
        public override void Draw(IDrawingToolkit tk, Area area)
        {
            if (!UpdateDrawArea (tk, area, Area)) {
                return;
            }

            base.Draw (tk, area);

            tk.Begin ();

            cancelRect = new Rectangle (
                new Point ((Position.X + Width) - StyleConf.ButtonRecWidth, Position.Y),
                StyleConf.ButtonRecWidth, HeaderHeight);

            if (Active && Mode != DashboardMode.Edit) {
                tk.LineWidth = StyleConf.ButtonLineWidth;
                tk.StrokeColor = Button.BackgroundColor;
                tk.FillColor = Button.BackgroundColor;
                tk.FontWeight = FontWeight.Normal;
                tk.FontSize = StyleConf.ButtonHeaderFontSize;
                tk.FontAlignment = FontAlignment.Left;
                tk.DrawText (new Point (Position.X + TextHeaderX, Position.Y),
                    Button.Width - TextHeaderX, iconImage.Height, Button.Timer.Name);
                tk.FontWeight = FontWeight.Bold;
                tk.FontSize = StyleConf.ButtonTimerFontSize;
                tk.FontAlignment = FontAlignment.Center;
                tk.DrawText (new Point (Position.X, Position.Y + iconImage.Height),
                    Button.Width, Button.Height - iconImage.Height,
                    PartialTime.ToSecondsString (), false, true);

                tk.FillColor = tk.StrokeColor = BackgroundColor;
                tk.DrawRectangle (cancelRect.TopLeft, cancelRect.Width, cancelRect.Height);
                tk.StrokeColor = TextColor;
                tk.FillColor = TextColor;
                tk.DrawImage (new Point (cancelRect.TopLeft.X, cancelRect.TopLeft.Y + 5),
                    cancelRect.Width, cancelRect.Height - 10, cancelImage, true, true);
            } else {
                Text = Button.Name;
                DrawText (tk);
                Text = null;
            }

            if (TeamImage != null) {
                tk.DrawImage (new Point (Position.X + Width - 40, Position.Y + 5), 40,
                    iconImage.Height, TeamImage, true);
            }
            tk.End ();
        }
예제 #12
0
        public override void Draw(IDrawingToolkit tk, Area area)
        {
            double position;
            List<TimeNodeObject> selected;

            selected = new List<TimeNodeObject> ();

            if (!UpdateDrawArea (tk, area, new Area (new Point (0, OffsetY), Width, Height))) {
                return;
            }
            ;

            tk.Begin ();
            DrawBackground (tk, area);
            foreach (TimeNodeObject p in nodes) {
                if (!TimeNodeObjectIsVisible (p))
                    continue;
                if (p.Selected) {
                    selected.Add (p);
                    continue;
                }
                p.OffsetY = OffsetY;
                p.Draw (tk, area);
            }
            foreach (TimeNodeObject p in selected) {
                p.OffsetY = OffsetY;
                p.Draw (tk, area);
            }

            tk.FillColor = Config.Style.PaletteTool;
            tk.StrokeColor = Config.Style.PaletteTool;
            tk.LineWidth = Constants.TIMELINE_LINE_WIDTH;
            position = Utils.TimeToPos (CurrentTime, secondsPerPixel);
            tk.DrawLine (new Point (position, OffsetY),
                new Point (position, OffsetY + Height));

            tk.End ();
        }
예제 #13
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 (ViewModel.Model.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, (ViewModel.CurrentTime - Start).ToSecondsString());
            }
            else
            {
                tk.DrawText(Position, Button.Width, Button.Height, ViewModel.Model.Name);
            }
            DrawSelectionArea(tk);
            if (ShowLinks)
            {
                GetAnchor(null).Draw(tk, area);
            }
            tk.End();
        }
예제 #14
0
        public override void Draw(IDrawingToolkit tk, Area area)
        {
            double linepos;

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

            tk.Begin ();
            if (needle == null) {
                string path = Path.Combine (Config.IconsDir, StyleConf.TimelineNeedleUP);
                Image img = Image.LoadFromFile (path);
                needle = tk.CreateSurface (img.Width, img.Height, img);
            }

            if (Selected) {
                tk.FillColor = Config.Style.PaletteActive;
                tk.StrokeColor = Config.Style.PaletteActive;
            } else {
                tk.FillColor = LineColor;
                tk.StrokeColor = LineColor;
            }
            tk.LineWidth = StyleConf.TimelineLineSize;

            linepos = OffsetY + Height / 2 + StyleConf.TimelineLineSize / 2;

            if (StopX - StartX <= needle.Width / 2) {
                double c = movingPos == SelectionPosition.Left ? StopX : StartX;
                tk.DrawSurface (needle, new Point (c - needle.Width / 2, linepos - 9));
            } else {
                tk.DrawLine (new Point (StartX, linepos),
                    new Point (StopX, linepos));
                tk.DrawSurface (needle, new Point (StartX - needle.Width / 2, linepos - 9));
                tk.DrawSurface (needle, new Point (StopX - needle.Width / 2, linepos - 9));
            }

            if (ShowName) {
                tk.FontSize = StyleConf.TimelineFontSize;
                tk.FontWeight = FontWeight.Bold;
                tk.FillColor = Config.Style.PaletteActive;
                tk.StrokeColor = Config.Style.PaletteActive;
                tk.DrawText (new Point (StartX, OffsetY), StopX - StartX, Height / 2, TimeNode.Name);
            }
            tk.End ();
        }
예제 #15
0
        public override void Draw(IDrawingToolkit tk, Area area)
        {
            if (!UpdateDrawArea (tk, area, Area)) {
                return;
            }

            tk.Begin ();

            tk.StrokeColor = Config.Style.PaletteBackgroundDark;
            if (Selected) {
                tk.FillColor = Config.Style.PaletteActive;
            } else {
                tk.FillColor = LineColor;
            }
            tk.LineWidth = 1;

            tk.DrawRoundedRectangle (new Point (StartX, OffsetY), StopX - StartX, Height, 5);

            if (ShowName) {
                tk.FontSize = 16;
                tk.FontWeight = FontWeight.Bold;
                tk.FillColor = Config.Style.PaletteActive;
                tk.StrokeColor = Config.Style.PaletteActive;
                tk.DrawText (new Point (StartX, OffsetY), StopX - StartX,
                    Height - StyleConf.TimelineLineSize,
                    TimeNode.Name);
            }
            tk.End ();
        }
예제 #16
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 ();
        }
예제 #17
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 ();
        }
예제 #18
0
        public override void Draw(IDrawingToolkit tk, Area area)
        {
            if (BenchPlayers == null || Position == null) {
                return;
            }
            tk.Begin ();
            tk.TranslateAndScale (Position, new Point (1, 1));
            tk.LineStyle = LineStyle.Dashed;
            tk.LineWidth = App.Current.Style.BenchLineWidth;
            tk.StrokeColor = App.Current.Style.PaletteActive;
            tk.FillColor = null;
            tk.DrawRectangle (new Point (0, 0), Width, Height);
            tk.LineStyle = LineStyle.Normal;

            foreach (SportsPlayerObject po in BenchPlayers) {
                po.Playing = false;
                po.SubstitutionMode = SubstitutionMode;
                po.Size = PlayersSize;
                po.Draw (tk, area);
            }

            tk.End ();
        }
예제 #19
0
        public override void Draw(IDrawingToolkit tk, Area area)
        {
            Point    zero, p;
            double   size, scale;
            ISurface arrowin, arrowout;

            if (Player == null)
            {
                return;
            }

            zero  = new Point(0, 0);
            size  = StyleConf.PlayerSize;
            scale = (double)Width / size;

            if (Team == TeamType.LOCAL)
            {
                arrowin  = ArrowIn;
                arrowout = ArrowOut;
            }
            else
            {
                arrowin  = ArrowOut;
                arrowout = ArrowIn;
            }

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

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

            /* Background */
            tk.FillColor = App.Current.Style.PaletteBackgroundDark;
            tk.LineWidth = 0;
            tk.DrawRectangle(zero, StyleConf.PlayerSize, StyleConf.PlayerSize);

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

            /* Bottom line */
            p            = new Point(0, size - StyleConf.PlayerLineWidth);
            tk.FillColor = Color;
            tk.DrawRectangle(p, size, 3);

            /* Draw Arrow */
            if (SubstitutionMode && (Highlighted || Player.Tagged))
            {
                ISurface arrow;
                Point    ap;

                if (ViewModel.Playing)
                {
                    arrow = arrowout;
                }
                else
                {
                    arrow = arrowin;
                }
                ap = new Point(StyleConf.PlayerArrowX, StyleConf.PlayerArrowY);
                tk.DrawRectangle(ap, StyleConf.PlayerArrowSize, StyleConf.PlayerArrowSize);
                tk.DrawSurface(arrow, ap);
            }

            /* Draw number */
            p            = new Point(StyleConf.PlayerNumberX, StyleConf.PlayerNumberY);
            tk.FillColor = Color;
            tk.DrawRectangle(p, StyleConf.PlayerNumberSize, StyleConf.PlayerNumberSize);

            tk.FillColor     = Color.White;
            tk.StrokeColor   = Color.White;
            tk.FontAlignment = FontAlignment.Center;
            tk.FontWeight    = FontWeight.Normal;
            if (ViewModel.Number >= 100)
            {
                tk.FontSize = 12;
            }
            else
            {
                tk.FontSize = 16;
            }
            tk.DrawText(p, StyleConf.PlayerNumberSize, StyleConf.PlayerNumberSize,
                        ViewModel.Number.ToString());

            if (Player.Tagged && !SubstitutionMode)
            {
                Color c = Color.Copy();
                c.A          = (byte)(c.A * 60 / 100);
                tk.FillColor = c;
                tk.DrawRectangle(zero, size, size);
            }

            tk.End();
        }
예제 #20
0
        public override void Draw(IDrawingToolkit tk, LongoMatch.Core.Common.Area area)
        {
            if (!UpdateDrawArea (tk, area, Area)) {
                return;
            }
            ;

            tk.Begin ();
            tk.DrawSurface (needle, TopLeft);
            tk.End ();
        }
예제 #21
0
        public override void Draw(IDrawingToolkit tk, Area area)
        {
            double start, stop;
            int lineWidth = StyleConf.TimelineLineSize;

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

            tk.Begin ();

            start = StartX;
            stop = StopX;

            if (stop - start <= lineWidth) {
                DrawBorders (tk, start, stop, lineWidth);
                DrawLine (tk, start, stop, lineWidth);
            } else {
                DrawLine (tk, start, stop, lineWidth);
                DrawBorders (tk, start, stop, lineWidth);
            }
            if (Selected) {
                tk.DrawSurface (SelectionLeft, new Point (start - SelectionLeft.Width / 2, OffsetY));
                tk.DrawSurface (SelectionRight, new Point (stop - SelectionRight.Width / 2, OffsetY));
            }
            tk.End ();
        }
예제 #22
0
        public static void RenderPlaylist(Playlist playlist, int count, bool isExpanded, IDrawingToolkit tk,
		                                   IContext context, Area backgroundArea, Area cellArea)
        {
            Point textP = new Point (StyleConf.ListTextOffset, cellArea.Start.Y);
            tk.Context = context;
            tk.Begin ();
            RenderBackgroundAndText (isExpanded, tk, backgroundArea, textP, cellArea.Width - textP.X, playlist.Name);
            RenderCount (isExpanded, Config.Style.PaletteActive, count, tk, backgroundArea, cellArea);
            RenderSeparationLine (tk, context, backgroundArea);
            tk.End ();
        }
예제 #23
0
        public override void Draw(IDrawingToolkit tk, Area area)
        {
            Point zero, start, p;
            double size, scale;
            ISurface arrowin, arrowout;

            if (Player == null)
                return;

            zero = new Point (0, 0);
            size = StyleConf.PlayerSize;
            scale = (double)Width / size;

            if (Team == TeamType.LOCAL) {
                arrowin = ArrowIn;
                arrowout = ArrowOut;
            } else {
                arrowin = ArrowOut;
                arrowout = ArrowIn;
            }

            tk.Begin ();
            start = new Point (Size / 2, Size / 2);
            tk.TranslateAndScale (Center - start, new Point (scale, scale));

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

            /* Background */
            tk.FillColor = App.Current.Style.PaletteBackgroundDark;
            tk.LineWidth = 0;
            tk.DrawRectangle (zero, StyleConf.PlayerSize, StyleConf.PlayerSize);

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

            /* Bottom line */
            p = new Point (0, size - StyleConf.PlayerLineWidth);
            tk.FillColor = Color;
            tk.DrawRectangle (p, size, 3);

            /* Draw Arrow */
            if (SubstitutionMode && (Highlighted || Active)) {
                ISurface arrow;
                Point ap;

                if (Playing) {
                    arrow = arrowout;
                } else {
                    arrow = arrowin;
                }
                ap = new Point (StyleConf.PlayerArrowX, StyleConf.PlayerArrowY);
                tk.DrawRectangle (ap, StyleConf.PlayerArrowSize, StyleConf.PlayerArrowSize);
                tk.DrawSurface (arrow, ap);
            }

            /* Draw number */
            p = new Point (StyleConf.PlayerNumberX, StyleConf.PlayerNumberY);
            tk.FillColor = Color;
            tk.DrawRectangle (p, StyleConf.PlayerNumberSize, StyleConf.PlayerNumberSize);

            tk.FillColor = Color.White;
            tk.StrokeColor = Color.White;
            tk.FontAlignment = FontAlignment.Center;
            tk.FontWeight = FontWeight.Normal;
            if (Player.Number >= 100) {
                tk.FontSize = 12;
            } else {
                tk.FontSize = 16;
            }
            tk.DrawText (p, StyleConf.PlayerNumberSize, StyleConf.PlayerNumberSize,
                Player.Number.ToString ());

            if (Active) {
                Color c = Color.Copy ();
                c.A = (byte)(c.A * 60 / 100);
                tk.FillColor = c;
                tk.DrawRectangle (zero, size, size);
            }

            tk.End ();
        }
예제 #24
0
 static void RenderPlayer(IDrawingToolkit tk, Player p, Point imagePoint)
 {
     PlayerObject po = new PlayerObject (p);
     po.Position = new Point (imagePoint.X + StyleConf.ListImageWidth / 2, imagePoint.Y + StyleConf.ListImageWidth / 2);
     po.Size = StyleConf.ListImageWidth - 2;
     tk.End ();
     po.Draw (tk, null);
     tk.Begin ();
     po.Dispose ();
 }
예제 #25
0
        public override void Draw(IDrawingToolkit tk, Area area)
        {
            double width, height;

            /* Compute how we should scale and translate to fit the widget
             * in the designated area */
            width = homeBench.Width * NTeams + field.Width +
            2 * NTeams * App.Current.Style.TeamTaggerBenchBorder;
            height = field.Height;
            Image.ScaleFactor ((int)width, (int)height, (int)Width,
                (int)Height - BUTTONS_HEIGHT, ScaleMode.AspectFit,
                out scaleX, out scaleY, out offset);
            offset.Y += BUTTONS_HEIGHT;
            tk.Begin ();
            tk.Clear (BackgroundColor);

            /* Draw substitution buttons */
            if (subPlayers.Visible) {
                subPlayers.Position = new Point (Width / 2 - BUTTONS_WIDTH / 2,
                    offset.Y - BUTTONS_HEIGHT);
                subPlayers.Width = BUTTONS_WIDTH;
                subPlayers.Height = BUTTONS_HEIGHT;
                subPlayers.Draw (tk, area);
            }
            if (homeButton.Visible) {
                /* Draw local team button */
                double x = Position.X + App.Current.Style.TeamTaggerBenchBorder * scaleX + offset.X;
                homeButton.Position = new Point (x, offset.Y - homeButton.Height);
                homeButton.Draw (tk, area);
            }
            if (awayButton.Visible) {
                double x = (Position.X + Width - offset.X - App.Current.Style.TeamTaggerBenchBorder * scaleX) - awayButton.Width;
                awayButton.Position = new Point (x, offset.Y - awayButton.Height);
                awayButton.Draw (tk, area);
            }

            tk.TranslateAndScale (Position + offset, new Point (scaleX, scaleY));
            homeBench.Draw (tk, area);
            awayBench.Draw (tk, area);
            field.Draw (tk, area);
            tk.End ();
        }
예제 #26
0
        public static void RenderPlay(Color color, Image ss, List<Player> players, bool selected, string desc,
		                               int count, bool isExpanded, IDrawingToolkit tk,
		                               IContext context, Area backgroundArea, Area cellArea, CellState state)
        {
            Point selectPoint, textPoint, imagePoint, circlePoint;
            double textWidth;

            tk.Context = context;
            tk.Begin ();

            RenderTimelineEventBase (color, ss, selected, desc, tk, context, backgroundArea, cellArea, state,
                out selectPoint, out textPoint, out imagePoint, out circlePoint, out textWidth);

            imagePoint.X += StyleConf.ListImageWidth + StyleConf.ListRowSeparator;
            if (players != null && players.Count > 0) {
                foreach (Player p in players) {
                    RenderPlayer (tk, p, imagePoint);
                    imagePoint.X += StyleConf.ListImageWidth + StyleConf.ListRowSeparator;
                }
            }
            RenderSeparationLine (tk, context, backgroundArea);
            tk.End ();
        }
예제 #27
0
        void DrawBackbuffer(IDrawingToolkit tk)
        {
            Point pos;
            double yptr = 0;

            rects.Clear ();
            buttonsRects.Clear ();
            UpdateGroups ();
            UpdateRows ();
            heightPerRow = (Height - HeaderHeight) / nrows;
            catWidth = Width;
            pos = Position;

            tk.Begin ();
            tk.TranslateAndScale (new Point (-Position.X, -Position.Y),
                new Point (1, 1));
            tk.FontWeight = FontWeight.Bold;

            /* Draw Rectangle */
            DrawButton (tk);
            DrawImage (tk);
            DrawHeader (tk);
            DrawRecordButton (tk);

            foreach (List<Tag> tags in tagsByGroup.Values) {
                DrawTagsGroup (tk, tags, ref yptr);
            }

            /* Remove anchor object that where not reused
                 * eg: after removinga a subcategory tag */
            foreach (Tag tag in subcatAnchors.Keys.ToList ()) {
                if (!Button.AnalysisEventType.Tags.Contains (tag)) {
                    RemoveAnchor (subcatAnchors [tag]);
                }
            }
            if (!ShowLinks) {
                DrawEditButton (tk);
            }
            if (Button.ShowSubcategories) {
            }
            tk.End ();
        }