コード例 #1
0
        public static void Render(object item, int count, bool isExpanded, IDrawingToolkit tk,
		                           IContext context, Area backgroundArea, Area cellArea, CellState state)
        {
            if (item is EventType) {
                RenderAnalysisCategory (item as EventType, count, isExpanded, tk,
                    context, backgroundArea, cellArea);
            } else if (item is SubstitutionEvent) {
                SubstitutionEvent s = item as SubstitutionEvent;
                RenderSubstitution (s.Color, s.EventTime, s.In, s.Out, s.Selected, isExpanded, tk, context,
                    backgroundArea, cellArea, state);
            } else if (item is TimelineEvent) {
                TimelineEvent p = item as TimelineEvent;
                RenderPlay (p.Color, p.Miniature, p.Players, p.Selected, p.Description, count, isExpanded, tk,
                    context, backgroundArea, cellArea, state);
            } else if (item is Player) {
                RenderPlayer (item as Player, count, isExpanded, tk, context, backgroundArea, cellArea);
            } else if (item is Playlist) {
                RenderPlaylist (item as Playlist, count, isExpanded, tk, context, backgroundArea, cellArea);
            } else if (item is PlaylistPlayElement) {
                PlaylistPlayElement p = item as PlaylistPlayElement;
                RenderPlay (p.Play.EventType.Color, p.Miniature, null, p.Selected, p.Description, count, isExpanded, tk,
                    context, backgroundArea, cellArea, state);
            } else if (item is IPlaylistElement) {
                IPlaylistElement p = item as IPlaylistElement;
                RenderPlay (Config.Style.PaletteActive, p.Miniature, null, p.Selected, p.Description,
                    count, isExpanded, tk, context, backgroundArea, cellArea, state);
            } else {
                Log.Error ("No renderer for type " + item.GetType ());
            }
        }
コード例 #2
0
ファイル: Utils.cs プロジェクト: GNOME/longomatch
 public static Image RenderFrameDrawingToImage(IDrawingToolkit tk, Image image, FrameDrawing fd)
 {
     Area area = fd.RegionOfInterest;
     if (area == null || area.Empty)
         area = new Area (0, 0, image.Width, image.Height);
     return RenderFrameDrawing (tk, area, fd, image);
 }
コード例 #3
0
ファイル: CameraObject.cs プロジェクト: GNOME/longomatch
        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 ();
        }
コード例 #4
0
ファイル: CamerasLabels.cs プロジェクト: GNOME/longomatch
        public override void Draw(IContext context, Area area)
        {
            tk.Context = context;
            tk.Begin ();
            tk.Clear (Config.Style.PaletteBackground);
            tk.End ();

            base.Draw (context, area);
        }
コード例 #5
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 ();
        }
コード例 #6
0
ファイル: NeedleObject.cs プロジェクト: kuggaa/longomatch
        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();
        }
コード例 #7
0
ファイル: TimelineObject.cs プロジェクト: GNOME/longomatch
        protected override void DrawBackground(IDrawingToolkit tk, Area area)
        {
            base.DrawBackground (tk, area);

            if (ShowLine) {
                // We want the background line and overlay to use the same starting point although they have different sizes.
                double linepos = OffsetY + Height / 2 + StyleConf.TimelineLineSize / 2;
                tk.FillColor = Config.Style.PaletteBackgroundDark;
                tk.StrokeColor = Config.Style.PaletteBackgroundDark;
                tk.LineWidth = StyleConf.TimelineBackgroundLineSize;
                tk.DrawLine (new Point (0, linepos),
                    new Point (Width, linepos));
            }
        }
コード例 #8
0
ファイル: TimelineObject.cs プロジェクト: GNOME/longomatch
 protected override void DrawBackground(IDrawingToolkit tk, Area area)
 {
     // We want to have a slight border in our background.
     tk.FillColor = BackgroundColor;
     tk.StrokeColor = Config.Style.PaletteBackgroundDark;
     tk.LineWidth = 1;
     tk.DrawRectangle (new Point (area.Start.X, OffsetY), area.Width, Height);
 }
コード例 #9
0
ファイル: Canvas.cs プロジェクト: GNOME/longomatch
 public override void Draw(IContext context, Area area)
 {
     if (Background != null) {
         Begin (context);
         tk.DrawImage (Background);
         End ();
     }
     base.Draw (context, area);
 }
コード例 #10
0
ファイル: TimelineObject.cs プロジェクト: GNOME/longomatch
 void HandleRedrawEvent(ICanvasObject co, Area area)
 {
     EmitRedrawEvent (co as CanvasObject, area);
 }
コード例 #11
0
        static void RenderBackgroundAndText(bool isExpanded, IDrawingToolkit tk, Area backgroundArea, Point textP, double textW, string text)
        {
            Color textColor, backgroundColor;

            /* Background */
            tk.LineWidth = 0;
            if (isExpanded) {
                backgroundColor = Config.Style.PaletteBackgroundLight;
                textColor = Config.Style.PaletteSelected;
            } else {
                backgroundColor = Config.Style.PaletteBackground;
                textColor = Config.Style.PaletteWidgets;
            }
            tk.FillColor = backgroundColor;
            tk.DrawRectangle (backgroundArea.Start, backgroundArea.Width, backgroundArea.Height);

            /* Text */
            tk.StrokeColor = textColor;
            tk.FontSize = 14;
            tk.FontWeight = FontWeight.Bold;
            tk.FontAlignment = FontAlignment.Left;
            tk.DrawText (textP, textW, backgroundArea.Height, text);
        }
コード例 #12
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);
            }
        }
コード例 #13
0
ファイル: TimerObject.cs プロジェクト: GNOME/longomatch
        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 ();
        }
コード例 #14
0
        public static void RenderSeparationLine(IDrawingToolkit tk, IContext context, Area backgroundArea)
        {
            double x1, x2, y;

            x1 = backgroundArea.Start.X;
            x2 = x1 + backgroundArea.Width;
            y = backgroundArea.Start.Y + backgroundArea.Height;
            tk.LineWidth = 1;
            tk.StrokeColor = Config.Style.PaletteBackgroundLight;
            tk.DrawLine (new Point (x1, y), new Point (x2, y));
        }
コード例 #15
0
ファイル: FieldObject.cs プロジェクト: GNOME/longomatch
 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 ();
 }
コード例 #16
0
ファイル: LinkAnchorObject.cs プロジェクト: GNOME/longomatch
        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 ();
        }
コード例 #17
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 ();
        }
コード例 #18
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 ();
        }
コード例 #19
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 ();
        }
コード例 #20
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 ();
        }
コード例 #21
0
ファイル: Canvas.cs プロジェクト: GNOME/longomatch
 /// <summary>
 /// Draws the canvas objects the specified context and area.
 /// Object are drawn in the following order:
 ///  1) Regular objects
 ///  2) Selected objects
 ///  3) Highlithed objects
 /// </summary>
 /// <param name="context">The context where the canvas is drawn.</param>
 /// <param name="area">The affected area.</param>
 public virtual void Draw(IContext context, Area area)
 {
     List<CanvasObject> highlighted = new List<CanvasObject> ();
     Begin (context);
     foreach (ICanvasObject co in Objects) {
         if (co.Visible) {
             if (co is ICanvasSelectableObject) {
                 if ((co as ICanvasSelectableObject).Selected) {
                     continue;
                 }
                 if ((co as CanvasObject).Highlighted) {
                     highlighted.Add (co as CanvasObject);
                     continue;
                 }
             }
             co.Draw (tk, area);
         }
     }
     foreach (ICanvasSelectableObject co in Objects.OfType<ICanvasSelectableObject>()) {
         if (co.Selected && co.Visible) {
             co.Draw (tk, area);
         }
     }
     foreach (CanvasObject co in highlighted) {
         co.Draw (tk, area);
     }
     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
ファイル: Canvas.cs プロジェクト: GNOME/longomatch
        protected override void HandleSizeChangedEvent()
        {
            if (background != null) {
                double scaleX, scaleY;
                Point translation;

                /* Add black borders to the canvas to keep the DAR of the background image */
                background.ScaleFactor ((int)widget.Width, (int)widget.Height, out scaleX,
                    out scaleY, out translation);
                ClipRegion = new Area (new Point (translation.X, translation.Y),
                    background.Width * scaleX, background.Height * scaleY);
                ScaleX = scaleX;
                ScaleY = scaleY;
                Translation = translation;

                /* If there is a region of interest set, combine the transformation */
                if (RegionOfInterest != null && !RegionOfInterest.Empty) {
                    ScaleX *= background.Width / RegionOfInterest.Width;
                    ScaleY *= background.Height / RegionOfInterest.Height;
                    Translation -= new Point (RegionOfInterest.Start.X * ScaleX,
                        RegionOfInterest.Start.Y * ScaleY);
                }
            }
            base.HandleSizeChangedEvent ();
        }
コード例 #24
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 ();
        }
コード例 #25
0
ファイル: TimelineObject.cs プロジェクト: GNOME/longomatch
        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 ();
        }
コード例 #26
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 ());
        }
コード例 #27
0
ファイル: TimelineObject.cs プロジェクト: GNOME/longomatch
        protected virtual void DrawBackground(IDrawingToolkit tk, Area area)
        {
            tk.FillColor = BackgroundColor;
            tk.StrokeColor = BackgroundColor;
            tk.LineWidth = 0;

            tk.DrawRectangle (new Point (area.Start.X, OffsetY), area.Width, Height);
        }
コード例 #28
0
ファイル: CircleImage.cs プロジェクト: LongoMatch/longomatch
 public void Draw(IContext context, Area area)
 {
     throw new NotImplementedException ();
 }
コード例 #29
0
ファイル: Canvas.cs プロジェクト: GNOME/longomatch
 void HandleRedrawEvent(ICanvasObject co, Area area)
 {
     if (!IgnoreRedraws) {
         widget.ReDraw (area);
     }
 }
コード例 #30
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 ();
        }
コード例 #31
0
ファイル: ListTreeViewBase.cs プロジェクト: GNOME/longomatch
        protected override void Render(Drawable window, Widget widget, Rectangle backgroundArea,
		                                Rectangle cellArea, Rectangle exposeArea, CellRendererState flags)
        {
            CellState state = (CellState)flags;

            using (IContext context = new CairoContext (window)) {
                Area bkg = new Area (new Point (backgroundArea.X, backgroundArea.Y),
                               backgroundArea.Width, backgroundArea.Height);
                Area cell = new Area (new Point (cellArea.X, cellArea.Y),
                                cellArea.Width, cellArea.Height);
                PlayslistCellRenderer.Render (Item, Count, IsExpanded, Config.DrawingToolkit,
                    context, bkg, cell, state);
            }
        }