[longomatch] Refactor Timeline constructors to use Dragging.



commit 4f61e33d9ae7c5ce7c157e0ac0c373a389e74c6c
Author: Julien Moutte <julien fluendo com>
Date:   Wed Mar 11 17:39:53 2015 +0100

    Refactor Timeline constructors to use Dragging.
    
    It's more useful to configure dragging mode than selection mode. The cameras timeline does not need to be 
configurable on that aspect.

 LongoMatch.Drawing/CanvasObjects/TimelineObject.cs |   18 ++++++------------
 LongoMatch.Drawing/Widgets/PlaysTimeline.cs        |    4 ++--
 LongoMatch.Drawing/Widgets/TimersTimeline.cs       |    2 +-
 3 files changed, 9 insertions(+), 15 deletions(-)
---
diff --git a/LongoMatch.Drawing/CanvasObjects/TimelineObject.cs 
b/LongoMatch.Drawing/CanvasObjects/TimelineObject.cs
index 170de19..8124b71 100644
--- a/LongoMatch.Drawing/CanvasObjects/TimelineObject.cs
+++ b/LongoMatch.Drawing/CanvasObjects/TimelineObject.cs
@@ -265,13 +265,13 @@ namespace LongoMatch.Drawing.CanvasObjects
 
                List<Timer> timers;
 
-               public TimerTimeline (List<Timer> timers, bool showName, NodeSelectionMode selectionMode, 
bool showLine,
+               public TimerTimeline (List<Timer> timers, bool showName, NodeDraggingMode draggingMode, bool 
showLine,
                                      Time maxTime, double offsetY, Color background, Color lineColor):
                        base (maxTime, offsetY, background)
                {
                        this.timers = timers;
                        ShowName = showName;
-                       SelectionMode = selectionMode;
+                       DraggingMode = draggingMode;
                        ShowLine = showLine;
                        LineColor = lineColor;
        
@@ -293,7 +293,7 @@ namespace LongoMatch.Drawing.CanvasObjects
                        set;
                }
                
-               NodeSelectionMode SelectionMode {
+               NodeDraggingMode DraggingMode {
                        get;
                        set;
                }
@@ -337,7 +337,7 @@ namespace LongoMatch.Drawing.CanvasObjects
                        to.OffsetY = OffsetY;
                        to.SecondsPerPixel = SecondsPerPixel;
                        to.MaxTime = maxTime;
-                       to.SelectionMode = SelectionMode;
+                       to.DraggingMode = DraggingMode;
                        to.ShowName = ShowName;
                        to.LineColor = LineColor;
                        AddNode (to);
@@ -369,12 +369,11 @@ namespace LongoMatch.Drawing.CanvasObjects
 
        public class CameraTimeline: TimelineObject
        {
-               public CameraTimeline (MediaFile mediaFile, bool showName, NodeSelectionMode selectionMode, 
bool showLine,
+               public CameraTimeline (MediaFile mediaFile, bool showName, bool showLine,
                        Time maxTime, double offsetY, Color background, Color lineColor):
                base (maxTime, offsetY, background)
                {
                        ShowName = showName;
-                       SelectionMode = selectionMode;
                        ShowLine = showLine;
                        LineColor = lineColor;
 
@@ -396,18 +395,13 @@ namespace LongoMatch.Drawing.CanvasObjects
                        set;
                }
 
-               NodeSelectionMode SelectionMode {
-                       get;
-                       set;
-               }
-
                public void AddMediaFile (MediaFile mediaFile)
                {
                        CameraObject co = new CameraObject (mediaFile);
                        co.OffsetY = OffsetY;
                        co.SecondsPerPixel = SecondsPerPixel;
+                       co.DraggingMode = NodeDraggingMode.Segment;
                        co.MaxTime = maxTime;
-                       co.SelectionMode = SelectionMode;
                        co.ShowName = ShowName;
                        co.LineColor = LineColor;
                        AddNode (co);
diff --git a/LongoMatch.Drawing/Widgets/PlaysTimeline.cs b/LongoMatch.Drawing/Widgets/PlaysTimeline.cs
index 816f439..d97ea9f 100644
--- a/LongoMatch.Drawing/Widgets/PlaysTimeline.cs
+++ b/LongoMatch.Drawing/Widgets/PlaysTimeline.cs
@@ -186,7 +186,7 @@ namespace LongoMatch.Drawing.Widgets
                        int i = 0;
 
                        tl = new TimerTimeline (project.Periods.Select (p => p as Timer).ToList (),
-                               true, NodeSelectionMode.All, false, duration,
+                               true, NodeDraggingMode.All, false, duration,
                                                i * StyleConf.TimelineCategoryHeight,
                                                Utils.ColorForRow (i), Config.Style.PaletteBackgroundDark);
                        AddTimeline (tl, null);
@@ -194,7 +194,7 @@ namespace LongoMatch.Drawing.Widgets
                        i++;
 
                        foreach (Timer t in project.Timers) {
-                               tl = new TimerTimeline (new List<Timer> { t }, false, NodeSelectionMode.All, 
false, duration,
+                               tl = new TimerTimeline (new List<Timer> { t }, false, NodeDraggingMode.All, 
false, duration,
                                                        i * StyleConf.TimelineCategoryHeight,
                                                        Utils.ColorForRow (i), 
Config.Style.PaletteBackgroundDark);
                                AddTimeline (tl, t);
diff --git a/LongoMatch.Drawing/Widgets/TimersTimeline.cs b/LongoMatch.Drawing/Widgets/TimersTimeline.cs
index 86ad978..2d8a1f6 100644
--- a/LongoMatch.Drawing/Widgets/TimersTimeline.cs
+++ b/LongoMatch.Drawing/Widgets/TimersTimeline.cs
@@ -99,7 +99,7 @@ namespace LongoMatch.Drawing.Widgets
                void FillCanvas (List<Timer> timers)
                {
                        widget.Height = Constants.TIMER_HEIGHT;
-                       timertimeline = new TimerTimeline (timers, true, NodeSelectionMode.All, true, 
duration, 0,
+                       timertimeline = new TimerTimeline (timers, true, NodeDraggingMode.All, true, 
duration, 0,
                                                           Config.Style.PaletteBackground,
                                                           Config.Style.PaletteBackgroundLight);
                        foreach (Timer t in timers) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]