[longomatch] Rename Categories to EventType and split them from dashboard buttons
- From: Andoni Morales Alastruey <amorales src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [longomatch] Rename Categories to EventType and split them from dashboard buttons
- Date: Wed, 24 Sep 2014 20:23:17 +0000 (UTC)
commit 76a5bb48d387433282f5e97dba8fcea872c45f44
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date: Thu Sep 4 11:12:03 2014 +0200
Rename Categories to EventType and split them from dashboard buttons
LongoMatch.Core/Common/Constants.cs | 3 +
LongoMatch.Core/Common/EventsBroker.cs | 28 +-
LongoMatch.Core/Common/PlaysFilter.cs | 52 ++--
LongoMatch.Core/Handlers/Handlers.cs | 37 +-
LongoMatch.Core/Handlers/Multimedia.cs | 2 +-
LongoMatch.Core/Interfaces/GUI/IAnalysisWindow.cs | 4 +-
LongoMatch.Core/Interfaces/GUI/IGUIToolkit.cs | 6 +-
LongoMatch.Core/Interfaces/GUI/IPlayerBin.cs | 2 +-
LongoMatch.Core/Interfaces/ITemplates.cs | 14 +-
LongoMatch.Core/Interfaces/ITemplatesService.cs | 2 +-
LongoMatch.Core/LongoMatch.Core.mdp | 11 +-
LongoMatch.Core/Makefile.am | 11 +-
LongoMatch.Core/Stats/CategoryStats.cs | 6 +-
LongoMatch.Core/Stats/ProjectStats.cs | 76 ++--
LongoMatch.Core/Store/Category.cs | 79 ----
LongoMatch.Core/Store/DashboardButton.cs | 270 ++++++++++++
.../Store/{TaggerButton.cs => EventType.cs} | 168 ++++-----
LongoMatch.Core/Store/PenaltyCard.cs | 15 +-
LongoMatch.Core/Store/PenaltyCardEvent.cs | 34 --
.../Store/Playlists/PlaylistPlayElement.cs | 4 +-
LongoMatch.Core/Store/Project.cs | 131 +++----
LongoMatch.Core/Store/Score.cs | 11 +-
LongoMatch.Core/Store/ScoreEvent.cs | 2 +-
LongoMatch.Core/Store/TagButton.cs | 40 --
.../{CategoriesTemplate.cs => Dashboard.cs} | 125 +++---
LongoMatch.Core/Store/Templates/TeamTemplate.cs | 2 +-
.../Store/{Play.cs => TimelineEvent.cs} | 41 ++-
LongoMatch.Core/Store/Timer.cs | 10 +-
LongoMatch.Drawing/CanvasObjects/CardObject.cs | 22 +-
LongoMatch.Drawing/CanvasObjects/CategoryLabel.cs | 13 +-
LongoMatch.Drawing/CanvasObjects/CategoryObject.cs | 50 ++--
LongoMatch.Drawing/CanvasObjects/PlayObject.cs | 10 +-
LongoMatch.Drawing/CanvasObjects/PositionObject.cs | 4 +-
LongoMatch.Drawing/CanvasObjects/ScoreObject.cs | 12 +-
LongoMatch.Drawing/CanvasObjects/TagObject.cs | 2 +-
LongoMatch.Drawing/CanvasObjects/TaggerObject.cs | 10 +-
LongoMatch.Drawing/CanvasObjects/TimelineObject.cs | 6 +-
LongoMatch.Drawing/CanvasObjects/TimerLabel.cs | 110 +++++
LongoMatch.Drawing/CanvasObjects/TimerObject.cs | 24 +-
LongoMatch.Drawing/LongoMatch.Drawing.mdp | 2 +-
LongoMatch.Drawing/PlayslistCellRenderer.cs | 24 +-
LongoMatch.Drawing/Widgets/CategoriesLabels.cs | 58 +--
.../Widgets/{Dashboard.cs => DashboardCanvas.cs} | 63 ++--
LongoMatch.Drawing/Widgets/PlaysTimeline.cs | 106 ++----
LongoMatch.Drawing/Widgets/PositionTagger.cs | 18 +-
LongoMatch.GUI.Multimedia/Gui/PlayerBin.cs | 6 +-
LongoMatch.GUI.Multimedia/Gui/PlayerCapturerBin.cs | 2 +-
LongoMatch.GUI/Gui/Component/AnalysisComponent.cs | 6 +-
LongoMatch.GUI/Gui/Component/CategoryProperties.cs | 165 ++++----
LongoMatch.GUI/Gui/Component/CodingWidget.cs | 32 +-
LongoMatch.GUI/Gui/Component/DashboardWidget.cs | 58 ++--
LongoMatch.GUI/Gui/Component/NotesWidget.cs | 6 +-
.../Gui/Component/PlayersListTreeWidget.cs | 4 +-
.../Gui/Component/PlaysCoordinatesTagger.cs | 21 +-
.../Gui/Component/PlaysListTreeWidget.cs | 68 +--
.../Gui/Component/PlaysPositionViewer.cs | 8 +-
.../Gui/Component/PlaysSelectionWidget.cs | 22 +-
LongoMatch.GUI/Gui/Component/ProjectPeriods.cs | 4 +-
.../Gui/Component/Stats/CategoriesViewer.cs | 2 +-
.../Gui/Component/Stats/PlayerCategoriesViewer.cs | 2 +-
.../Gui/Component/Stats/PlayersViewer.cs | 6 +-
LongoMatch.GUI/Gui/Component/Timeline.cs | 8 +-
LongoMatch.GUI/Gui/Dialog/DrawingTool.cs | 4 +-
LongoMatch.GUI/Gui/Dialog/EditCategoryDialog.cs | 26 +-
LongoMatch.GUI/Gui/Dialog/PlayEditor.cs | 12 +-
LongoMatch.GUI/Gui/GUIToolkit.cs | 6 +-
LongoMatch.GUI/Gui/Menu/PlaysMenu.cs | 40 +-
LongoMatch.GUI/Gui/Panel/NewProjectPanel.cs | 8 +-
LongoMatch.GUI/Gui/Panel/ProjectsManagerPanel.cs | 2 +-
LongoMatch.GUI/Gui/Panel/SportsTemplatesPanel.cs | 8 +-
.../Gui/TreeView/CategoriesFilterTreeView.cs | 49 ++-
LongoMatch.GUI/Gui/TreeView/FilterBaseView.cs | 2 +-
LongoMatch.GUI/Gui/TreeView/ListTreeViewBase.cs | 12 +-
LongoMatch.GUI/Gui/TreeView/PlayListTreeView.cs | 4 +-
.../Gui/TreeView/PlayersFilterTreeView.cs | 12 +-
LongoMatch.GUI/Gui/TreeView/PlayersTreeView.cs | 4 +-
LongoMatch.GUI/Gui/TreeView/PlaysTreeView.cs | 41 +-
.../LongoMatch.Gui.Component.CategoryProperties.cs | 442 ++++++++++----------
...ongoMatch.Gui.Component.PlaysSelectionWidget.cs | 60 +---
.../LongoMatch.Gui.Panel.ProjectsManagerPanel.cs | 1 -
LongoMatch.GUI/gtk-gui/gui.stetic | 278 ++++++-------
LongoMatch.Plugins/CSVExporter.cs | 8 +-
LongoMatch.Services/Services/EventsManager.cs | 50 ++--
LongoMatch.Services/Services/HotKeysManager.cs | 12 +-
LongoMatch.Services/Services/PlaylistManager.cs | 14 +-
.../Services/RenderingJobsManager.cs | 2 +-
LongoMatch.Services/Services/TemplatesService.cs | 20 +-
LongoMatch.Services/Services/ToolsManager.cs | 2 +-
Tests/Core/TestCategoriesTemplate.cs | 10 +-
Tests/Core/TestCategory.cs | 6 +-
Tests/Core/TestPlay.cs | 14 +-
Tests/Core/TestPlaysFilter.cs | 50 ++--
Tests/Core/TestProject.cs | 108 +++---
93 files changed, 1741 insertions(+), 1706 deletions(-)
---
diff --git a/LongoMatch.Core/Common/Constants.cs b/LongoMatch.Core/Common/Constants.cs
index 6c9e250..df4c131 100644
--- a/LongoMatch.Core/Common/Constants.cs
+++ b/LongoMatch.Core/Common/Constants.cs
@@ -123,5 +123,8 @@ Xavier Queralt Mateu (ca)";
public static Color HOME_COLOR = Color.Red1;
public static Color AWAY_COLOR = Color.Blue1;
+
+ public static Guid PenaltyCardID = new Guid ("da4df338-3392-11e4-be8d-0811963e3880");
+ public static Guid ScoreID = new Guid ("dc4df338-3392-11e4-be8d-0811963e3880");
}
}
diff --git a/LongoMatch.Core/Common/EventsBroker.cs b/LongoMatch.Core/Common/EventsBroker.cs
index 8ca846c..bc43918 100644
--- a/LongoMatch.Core/Common/EventsBroker.cs
+++ b/LongoMatch.Core/Common/EventsBroker.cs
@@ -87,36 +87,37 @@ namespace LongoMatch.Common
public event DetachPlayerHandler Detach;
public event PlaybackRateChangedHandler PlaybackRateChanged;
- public void EmitNewTag (TaggerButton tagger, List<Player> players = null,
- List<Tag> tags = null, Time start = null, Time stop = null) {
+ public void EmitNewTag (EventType eventType, List<Player> players = null,
+ List<Tag> tags = null, Time start = null, Time stop = null,
+ Score score = null, PenaltyCard card = null) {
if (NewTagEvent != null)
- NewTagEvent (tagger, players, tags, start, stop);
+ NewTagEvent (eventType, players, tags, start, stop, score, card);
}
- public void EmitNewPlay (Play play) {
+ public void EmitNewPlay (TimelineEvent play) {
if (NewPlayEvent != null)
NewPlayEvent (play);
}
- public void EmitPlaysDeleted(List<Play> plays)
+ public void EmitPlaysDeleted(List<TimelineEvent> plays)
{
if (PlaysDeleted != null)
PlaysDeleted(plays);
}
- public void EmitLoadPlay (Play play)
+ public void EmitLoadPlay (TimelineEvent play)
{
if (LoadPlayEvent != null)
LoadPlayEvent (play);
}
- public void EmitPlayLoaded (Play play)
+ public void EmitPlayLoaded (TimelineEvent play)
{
if (PlayLoadedEvent != null)
PlayLoadedEvent (play);
}
- public void EmitSnapshotSeries(Play play)
+ public void EmitSnapshotSeries(TimelineEvent play)
{
if (SnapshotSeries != null)
SnapshotSeries(play);
@@ -152,18 +153,18 @@ namespace LongoMatch.Common
TimeNodeChanged(tn, val);
}
- public virtual void EmitPlayCategoryChanged(Play play, Category cat)
+ public virtual void EmitPlayCategoryChanged(TimelineEvent play, EventType cat)
{
if(PlayCategoryChanged != null)
PlayCategoryChanged(play, cat);
}
- public void EmitTagPlay(Play play) {
+ public void EmitTagPlay(TimelineEvent play) {
if (TagPlay != null)
TagPlay (play);
}
- public void EmitDuplicatePlay (List<Play> plays)
+ public void EmitDuplicatePlay (List<TimelineEvent> plays)
{
if (DuplicatePlays != null)
DuplicatePlays (plays);
@@ -349,7 +350,7 @@ namespace LongoMatch.Common
}
}
- public void EmitDrawFrame (Play play, int drawingIndex)
+ public void EmitDrawFrame (TimelineEvent play, int drawingIndex)
{
if (DrawFrame != null) {
DrawFrame (play, drawingIndex);
@@ -373,6 +374,9 @@ namespace LongoMatch.Common
if (PlaylistsChangedEvent != null)
PlaylistsChangedEvent (sender);
}
+
+ public void EmitPressButton (DashboardButton button) {
+ }
}
}
diff --git a/LongoMatch.Core/Common/PlaysFilter.cs b/LongoMatch.Core/Common/PlaysFilter.cs
index bc8e5b1..3504666 100644
--- a/LongoMatch.Core/Common/PlaysFilter.cs
+++ b/LongoMatch.Core/Common/PlaysFilter.cs
@@ -19,10 +19,8 @@ using System;
using System.Collections.Generic;
using System.Linq;
-using LongoMatch.Interfaces;
using LongoMatch.Handlers;
using LongoMatch.Store;
-using LongoMatch.Store.Templates;
namespace LongoMatch.Common
{
@@ -31,20 +29,20 @@ namespace LongoMatch.Common
public event FilterUpdatedHandler FilterUpdated;
- Dictionary<TaggerButton, List<Tag>> categoriesFilter;
+ Dictionary<EventType, List<Tag>> eventsFilter;
List<Player> playersFilter;
Project project;
public PlaysFilter (Project project)
{
this.project = project;
- categoriesFilter = new Dictionary<TaggerButton, List<Tag>>();
+ eventsFilter = new Dictionary<EventType, List<Tag>>();
playersFilter = new List<Player>();
ClearAll();
UpdateFilters();
}
- public List<TaggerButton> VisibleCategories {
+ public List<EventType> VisibleEventTypes {
get;
protected set;
}
@@ -54,13 +52,13 @@ namespace LongoMatch.Common
protected set;
}
- public List<Play> VisiblePlays {
+ public List<TimelineEvent> VisiblePlays {
get;
protected set;
}
public void ClearCategoriesFilter (bool update=true) {
- categoriesFilter.Clear();
+ eventsFilter.Clear();
if (update)
Update ();
}
@@ -89,28 +87,28 @@ namespace LongoMatch.Common
Update();
}
- public void FilterCategory (TaggerButton cat, bool visible) {
+ public void FilterEventType (EventType evType, bool visible) {
if (visible) {
- if (!categoriesFilter.ContainsKey (cat))
- categoriesFilter[cat] = new List<Tag> ();
+ if (!eventsFilter.ContainsKey (evType))
+ eventsFilter[evType] = new List<Tag> ();
} else {
- if (categoriesFilter.ContainsKey (cat))
- categoriesFilter.Remove (cat);
+ if (eventsFilter.ContainsKey (evType))
+ eventsFilter.Remove (evType);
}
Update();
}
- public void FilterCategoryTag (TaggerButton cat, Tag tag, bool visible) {
+ public void FilterCategoryTag (EventType evType, Tag tag, bool visible) {
List<Tag> tags;
if (visible) {
- FilterCategory (cat, true);
- tags = categoriesFilter[cat];
+ FilterEventType (evType, true);
+ tags = eventsFilter[evType];
if (!tags.Contains (tag))
tags.Add (tag);
} else {
- if (categoriesFilter.ContainsKey(cat)) {
- tags = categoriesFilter[cat];
+ if (eventsFilter.ContainsKey(evType)) {
+ tags = eventsFilter[evType];
if (tags.Contains (tag))
tags.Remove (tag);
}
@@ -121,8 +119,8 @@ namespace LongoMatch.Common
public bool IsVisible(object o) {
if (o is Player) {
return VisiblePlayers.Contains(o as Player);
- } else if (o is Play) {
- return VisiblePlays.Contains (o as Play);
+ } else if (o is TimelineEvent) {
+ return VisiblePlays.Contains (o as TimelineEvent);
}
return true;
}
@@ -147,23 +145,23 @@ namespace LongoMatch.Common
}
void UpdateVisibleCategories () {
- if (categoriesFilter.Count == 0) {
- VisibleCategories = project.Categories.List;
+ if (eventsFilter.Count == 0) {
+ VisibleEventTypes = project.EventTypes;
} else {
- VisibleCategories = categoriesFilter.Keys.ToList();
+ VisibleEventTypes = eventsFilter.Keys.ToList();
}
}
void UpdateVisiblePlays () {
bool cat_match=true, player_match=true;
- VisiblePlays = new List<Play>();
+ VisiblePlays = new List<TimelineEvent>();
- foreach (Play play in project.Timeline) {
+ foreach (TimelineEvent play in project.Timeline) {
cat_match = false;
- if (VisibleCategories.Contains (play.Category)) {
+ if (VisibleEventTypes.Contains (play.EventType)) {
cat_match = true;
- if (categoriesFilter.ContainsKey (play.Category)) {
- List<Tag> tags = categoriesFilter[play.Category];
+ if (eventsFilter.ContainsKey (play.EventType)) {
+ List<Tag> tags = eventsFilter[play.EventType];
if (tags.Count == 0 || tags.Intersect (play.Tags).Count() >
0) {
cat_match = true;
} else {
diff --git a/LongoMatch.Core/Handlers/Handlers.cs b/LongoMatch.Core/Handlers/Handlers.cs
index 324d2a7..0b831c7 100644
--- a/LongoMatch.Core/Handlers/Handlers.cs
+++ b/LongoMatch.Core/Handlers/Handlers.cs
@@ -33,28 +33,31 @@ namespace LongoMatch.Handlers
/*Tagging Events*/
/* A Play needs to be loaded */
- public delegate void LoadPlayHandler(Play play);
+ public delegate void LoadPlayHandler(TimelineEvent play);
/* A Play was loaded */
- public delegate void PlayLoadedHandler(Play play);
+ public delegate void PlayLoadedHandler(TimelineEvent play);
/* A new play needs to be create for a specific category at the current play time */
- public delegate void NewTagHandler (TaggerButton tagger, List<Player> plays, List<Tag> tags, Time
start, Time stop);
+ public delegate void NewTagHandler (EventType eventType, List<Player> players,
+ List<Tag> tags, Time start, Time stop, Score score,
+ PenaltyCard card);
/* Add a new play to the current project */
- public delegate void NewPlayHandler (Play play);
+ public delegate void NewPlayHandler (TimelineEvent play);
//A play was edited
public delegate void TimeNodeChangedHandler(TimeNode tNode, object val);
- public delegate void CategoryChangedHandler(AnalysisCategory cat);
+ public delegate void CategoryChangedHandler(EventType cat);
+
/* A list of plays needs to be deleted */
- public delegate void PlaysDeletedHandler(List<Play> plays);
+ public delegate void PlaysDeletedHandler(List<TimelineEvent> plays);
/* Tag a play */
- public delegate void TagPlayHandler(Play play);
+ public delegate void TagPlayHandler(TimelineEvent play);
/* Change the Play's category */
- public delegate void PlayCategoryChangedHandler(Play play, Category cat);
+ public delegate void PlayCategoryChangedHandler(TimelineEvent play, EventType cat);
/* DUplicate play */
- public delegate void DuplicatePlaysHandler (List<Play> plays);
+ public delegate void DuplicatePlaysHandler (List<TimelineEvent> plays);
/* Category Selected */
- public delegate void TaggersSelectedHandler (List<TaggerButton> taggerbuttons);
- public delegate void TaggerSelectedHandler (TaggerButton taggerbutton);
- public delegate void ShowButtonsTaggerMenuHandler (TaggerButton taggerbutton, Tag tag);
+ public delegate void TaggersSelectedHandler (List<DashboardButton> taggerbuttons);
+ public delegate void TaggerSelectedHandler (DashboardButton taggerbutton);
+ public delegate void ShowButtonsTaggerMenuHandler (DashboardButton taggerbutton, Tag tag);
/* Penalty Card */
public delegate void PenaltyCardHandler (PenaltyCard card);
@@ -103,7 +106,7 @@ namespace LongoMatch.Handlers
public delegate void PlaylistsChangedHandler (object sender);
/* Create snapshots for a play */
- public delegate void SnapshotSeriesHandler(Play tNode);
+ public delegate void SnapshotSeriesHandler(TimelineEvent tNode);
/* Convert a video file */
public delegate void ConvertVideoFilesHandler (List<MediaFile> inputFiles, EncodingSettings
encSettings);
@@ -115,8 +118,8 @@ namespace LongoMatch.Handlers
public delegate void NewVersionHandler(Version version, string URL);
/* Edit Category */
- public delegate void CategoryHandler(Category category);
- public delegate void CategoriesHandler(List<Category> categoriesList);
+ public delegate void CategoryHandler(DashboardButton button);
+ public delegate void CategoriesHandler(List<DashboardButton> buttonsList);
/* Edit player properties */
public delegate void PlayerPropertiesHandler(Player player);
@@ -146,8 +149,8 @@ namespace LongoMatch.Handlers
public delegate void AnalysisModeChangedHandler (VideoAnalysisMode mode);
public delegate void TagSubcategoriesChangedHandler (bool tagsubcategories);
- public delegate void ShowTimelineMenuHandler (List<Play> plays, AnalysisCategory cat, Time time);
- public delegate void ShowTaggerMenuHandler (List<Play> plays);
+ public delegate void ShowTimelineMenuHandler (List<TimelineEvent> plays, EventType cat, Time time);
+ public delegate void ShowTaggerMenuHandler (List<TimelineEvent> plays);
public delegate void ShowDrawToolMenuHandler (IBlackboardObject drawable);
public delegate void ConfigureDrawingObjectHandler (IBlackboardObject drawable);
public delegate void DrawableChangedHandler (IBlackboardObject drawable);
diff --git a/LongoMatch.Core/Handlers/Multimedia.cs b/LongoMatch.Core/Handlers/Multimedia.cs
index d4bfac1..a418bfb 100644
--- a/LongoMatch.Core/Handlers/Multimedia.cs
+++ b/LongoMatch.Core/Handlers/Multimedia.cs
@@ -32,7 +32,7 @@ namespace LongoMatch.Handlers
public delegate void PrevButtonClickedHandler();
public delegate void ProgressHandler(float progress);
public delegate void FramesProgressHandler(int actual, int total, Image frame);
- public delegate void DrawFrameHandler (Play play, int drawingIndex);
+ public delegate void DrawFrameHandler (TimelineEvent play, int drawingIndex);
public delegate void EllpasedTimeHandler(Time ellapsedTime);
public delegate void PlaybackRateChangedHandler (float rate);
diff --git a/LongoMatch.Core/Interfaces/GUI/IAnalysisWindow.cs
b/LongoMatch.Core/Interfaces/GUI/IAnalysisWindow.cs
index 7e2936e..372d36a 100644
--- a/LongoMatch.Core/Interfaces/GUI/IAnalysisWindow.cs
+++ b/LongoMatch.Core/Interfaces/GUI/IAnalysisWindow.cs
@@ -29,9 +29,9 @@ namespace LongoMatch.Interfaces.GUI
{
void SetProject(Project project, ProjectType projectType, CaptureSettings props, PlaysFilter
filter);
void CloseOpenedProject ();
- void AddPlay(Play play);
+ void AddPlay(TimelineEvent play);
void UpdateCategories ();
- void DeletePlays (List<Play> plays);
+ void DeletePlays (List<TimelineEvent> plays);
void DetachPlayer ();
IPlayerBin Player{get;}
diff --git a/LongoMatch.Core/Interfaces/GUI/IGUIToolkit.cs b/LongoMatch.Core/Interfaces/GUI/IGUIToolkit.cs
index fd494ee..69e433e 100644
--- a/LongoMatch.Core/Interfaces/GUI/IGUIToolkit.cs
+++ b/LongoMatch.Core/Interfaces/GUI/IGUIToolkit.cs
@@ -58,7 +58,7 @@ namespace LongoMatch.Interfaces.GUI
IBusyDialog BusyDialog(string message, object parent=null);
List<EditionJob> ConfigureRenderingJob (Playlist playlist);
- void ExportFrameSeries(Project openenedProject, Play play, string snapshotDir);
+ void ExportFrameSeries(Project openenedProject, TimelineEvent play, string snapshotDir);
void OpenProject (Project project, ProjectType projectType,
CaptureSettings props, PlaysFilter filter,
@@ -79,9 +79,9 @@ namespace LongoMatch.Interfaces.GUI
void ManageJobs ();
- void EditPlay (Play play, Project project, bool editTags, bool editPositions, bool
editPlayers, bool editNotes);
+ void EditPlay (TimelineEvent play, Project project, bool editTags, bool editPositions, bool
editPlayers, bool editNotes);
- void DrawingTool(Image pixbuf, Play play, FrameDrawing drawing);
+ void DrawingTool(Image pixbuf, TimelineEvent play, FrameDrawing drawing);
string RemuxFile (string filePath, string outputFile, VideoMuxerType muxer);
diff --git a/LongoMatch.Core/Interfaces/GUI/IPlayerBin.cs b/LongoMatch.Core/Interfaces/GUI/IPlayerBin.cs
index 6ad523f..eb8a544 100644
--- a/LongoMatch.Core/Interfaces/GUI/IPlayerBin.cs
+++ b/LongoMatch.Core/Interfaces/GUI/IPlayerBin.cs
@@ -48,7 +48,7 @@ namespace LongoMatch.Interfaces.GUI
void SeekToPreviousFrame();
void FramerateUp();
void FramerateDown();
- void LoadPlay (MediaFile file, Play play, Time seekTime, bool playing);
+ void LoadPlay (MediaFile file, TimelineEvent play, Time seekTime, bool playing);
void LoadPlayListPlay (Playlist playlist, IPlaylistElement play);
void CloseSegment();
}
diff --git a/LongoMatch.Core/Interfaces/ITemplates.cs b/LongoMatch.Core/Interfaces/ITemplates.cs
index c5be324..18f36bb 100644
--- a/LongoMatch.Core/Interfaces/ITemplates.cs
+++ b/LongoMatch.Core/Interfaces/ITemplates.cs
@@ -28,10 +28,6 @@ namespace LongoMatch.Interfaces
string Name {get; set;}
}
- public interface ITemplate<T>: ITemplate {
- List<T> List {get;set;}
- }
-
public interface ITemplateProvider
{
void CheckDefaultTemplate();
@@ -42,15 +38,15 @@ namespace LongoMatch.Interfaces
void Create (string templateName, params object [] list);
}
- public interface ITemplateProvider<T, U>: ITemplateProvider where T: ITemplate<U>
+ public interface ITemplateProvider<T>: ITemplateProvider where T: ITemplate
{
List<T> Templates {get;}
T Load (string name);
- void Save (ITemplate<U> template);
- void Update (ITemplate<U> template);
+ void Save (ITemplate template);
+ void Update (ITemplate template);
}
- public interface ICategoriesTemplatesProvider: ITemplateProvider<Categories, TaggerButton> {}
- public interface ITeamTemplatesProvider: ITemplateProvider<TeamTemplate, Player> {}
+ public interface ICategoriesTemplatesProvider: ITemplateProvider<Dashboard> {}
+ public interface ITeamTemplatesProvider: ITemplateProvider<TeamTemplate> {}
}
diff --git a/LongoMatch.Core/Interfaces/ITemplatesService.cs b/LongoMatch.Core/Interfaces/ITemplatesService.cs
index 1178f5e..a8aecc6 100644
--- a/LongoMatch.Core/Interfaces/ITemplatesService.cs
+++ b/LongoMatch.Core/Interfaces/ITemplatesService.cs
@@ -24,7 +24,7 @@ namespace LongoMatch.Interfaces
{
public interface ITemplatesService
{
- ITemplateProvider<T, U> GetTemplateProvider<T, U>() where T: ITemplate<U>;
+ ITemplateProvider<T> GetTemplateProvider<T>() where T: ITemplate;
ITeamTemplatesProvider TeamTemplateProvider {get;}
diff --git a/LongoMatch.Core/LongoMatch.Core.mdp b/LongoMatch.Core/LongoMatch.Core.mdp
index bb2f800..bc8ad56 100644
--- a/LongoMatch.Core/LongoMatch.Core.mdp
+++ b/LongoMatch.Core/LongoMatch.Core.mdp
@@ -19,16 +19,14 @@
<File subtype="Code" buildaction="Compile" name="Common/Constants.cs" />
<File subtype="Code" buildaction="Compile" name="Common/Enums.cs" />
<File subtype="Code" buildaction="Compile" name="Common/Log.cs" />
- <File subtype="Code" buildaction="Compile" name="Store/Category.cs" />
<File subtype="Code" buildaction="Compile" name="Store/HotKey.cs" />
<File subtype="Code" buildaction="Compile" name="Store/PixbufTimeNode.cs" />
- <File subtype="Code" buildaction="Compile" name="Store/Play.cs" />
<File subtype="Code" buildaction="Compile" name="Store/Player.cs" />
<File subtype="Code" buildaction="Compile" name="Store/Project.cs" />
<File subtype="Code" buildaction="Compile" name="Store/ProjectDescription.cs" />
<File subtype="Code" buildaction="Compile" name="Store/Time.cs" />
<File subtype="Code" buildaction="Compile" name="Store/TimeNode.cs" />
- <File subtype="Code" buildaction="Compile" name="Store/Templates/CategoriesTemplate.cs" />
+ <File subtype="Code" buildaction="Compile" name="Store/Templates/Dashboard.cs" />
<File subtype="Code" buildaction="Compile" name="Store/Templates/TeamTemplate.cs" />
<File subtype="Code" buildaction="Compile" name="Interfaces/ITemplates.cs" />
<File subtype="Directory" buildaction="Compile" name="." />
@@ -127,14 +125,11 @@
<File subtype="Directory" buildaction="Compile" name="Interfaces" />
<File subtype="Code" buildaction="Compile" name="Interfaces/IProjectsImporter.cs" />
<File subtype="Code" buildaction="Compile" name="Store/Score.cs" />
- <File subtype="Code" buildaction="Compile" name="Store/ScoreEvent.cs" />
<File subtype="Code" buildaction="Compile" name="Store/PenaltyCard.cs" />
- <File subtype="Code" buildaction="Compile" name="Store/PenaltyCardEvent.cs" />
<File subtype="Code" buildaction="Compile" name="Store/Tag.cs" />
<File subtype="Code" buildaction="Compile" name="Stats/SubCategoryStat.cs" />
<File subtype="Code" buildaction="Compile" name="Interfaces/Multimedia/IDiscoverer.cs" />
- <File subtype="Code" buildaction="Compile" name="Store/TaggerButton.cs" />
- <File subtype="Code" buildaction="Compile" name="Store/TagButton.cs" />
+ <File subtype="Code" buildaction="Compile" name="Store/DashboardButton.cs" />
<File subtype="Directory" buildaction="Compile" name="Common" />
<File subtype="Directory" buildaction="Compile" name="Common" />
<File subtype="Directory" buildaction="Compile" name="Common" />
@@ -146,6 +141,8 @@
<File subtype="Code" buildaction="Compile" name="Store/Playlists/PlaylistDrawing.cs" />
<File subtype="Code" buildaction="Compile" name="Store/Playlists/PlaylistImage.cs" />
<File subtype="Code" buildaction="Compile" name="StyleConf.cs" />
+ <File subtype="Code" buildaction="Compile" name="Store/EventType.cs" />
+ <File subtype="Code" buildaction="Compile" name="Store/TimelineEvent.cs" />
</Contents>
<References>
<ProjectReference type="Package" localcopy="True" refto="System, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089" />
diff --git a/LongoMatch.Core/Makefile.am b/LongoMatch.Core/Makefile.am
index 154999b..6c5b659 100644
--- a/LongoMatch.Core/Makefile.am
+++ b/LongoMatch.Core/Makefile.am
@@ -63,8 +63,8 @@ SOURCES = Common/Area.cs \
Stats/ProjectStats.cs \
Stats/Stat.cs \
Stats/SubCategoryStat.cs \
- Store/Category.cs \
Store/Coordinates.cs \
+ Store/DashboardButton.cs \
Store/Drawables/Angle.cs \
Store/Drawables/Counter.cs \
Store/Drawables/Cross.cs \
@@ -76,14 +76,14 @@ SOURCES = Common/Area.cs \
Store/Drawables/Rectangle.cs \
Store/Drawables/Selection.cs \
Store/Drawables/Text.cs \
+ Store/Event.cs \
+ Store/EventType.cs \
Store/FrameDrawing.cs \
Store/HotKey.cs \
Store/MediaFile.cs \
Store/PenaltyCard.cs \
- Store/PenaltyCardEvent.cs \
Store/Period.cs \
Store/PixbufTimeNode.cs \
- Store/Play.cs \
Store/Player.cs \
Store/Playlists/Playlist.cs \
Store/Playlists/PlaylistDrawing.cs \
@@ -93,11 +93,8 @@ SOURCES = Common/Area.cs \
Store/Project.cs \
Store/ProjectDescription.cs \
Store/Score.cs \
- Store/ScoreEvent.cs \
Store/Tag.cs \
- Store/TagButton.cs \
- Store/TaggerButton.cs \
- Store/Templates/CategoriesTemplate.cs \
+ Store/Templates/Dashboard.cs \
Store/Templates/TeamTemplate.cs \
Store/Time.cs \
Store/TimeNode.cs \
diff --git a/LongoMatch.Core/Stats/CategoryStats.cs b/LongoMatch.Core/Stats/CategoryStats.cs
index c25971f..6abf1d3 100644
--- a/LongoMatch.Core/Stats/CategoryStats.cs
+++ b/LongoMatch.Core/Stats/CategoryStats.cs
@@ -27,9 +27,9 @@ namespace LongoMatch.Stats
public class CategoryStats: Stat
{
List <SubCategoryStat> subcatStats;
- Category cat;
+ EventType cat;
- public CategoryStats (Category cat, int totalCount, int localTeamCount, int visitorTeamCount):
+ public CategoryStats (EventType cat, int totalCount, int localTeamCount, int
visitorTeamCount):
base (cat.Name, totalCount, localTeamCount, visitorTeamCount)
{
subcatStats = new List<SubCategoryStat>();
@@ -42,7 +42,7 @@ namespace LongoMatch.Stats
}
}
- public Category Category {
+ public EventType Category {
get {
return cat;
}
diff --git a/LongoMatch.Core/Stats/ProjectStats.cs b/LongoMatch.Core/Stats/ProjectStats.cs
index 488f3bb..0427daa 100644
--- a/LongoMatch.Core/Stats/ProjectStats.cs
+++ b/LongoMatch.Core/Stats/ProjectStats.cs
@@ -121,7 +121,7 @@ namespace LongoMatch.Stats
void UpdateGameUnitsStats () {
}
- void CountPlaysInTeam (List<Play> plays, out int localTeamCount, out int visitorTeamCount) {
+ void CountPlaysInTeam (List<TimelineEvent> plays, out int localTeamCount, out int
visitorTeamCount) {
localTeamCount = plays.Where(p => p.Team == Team.LOCAL || p.Team ==
Team.BOTH).Count();
visitorTeamCount = plays.Where(p => p.Team == Team.VISITOR || p.Team ==
Team.BOTH).Count();
}
@@ -129,44 +129,44 @@ namespace LongoMatch.Stats
public void UpdateStats () {
catStats.Clear();
- Field = project.Categories.FieldBackground;
- HalfField = project.Categories.HalfFieldBackground;
- Goal = project.Categories.GoalBackground;
+ Field = project.Dashboard.FieldBackground;
+ HalfField = project.Dashboard.HalfFieldBackground;
+ Goal = project.Dashboard.GoalBackground;
- foreach (Category cat in project.Categories.List) {
- CategoryStats stats;
- List<Play> plays, homePlays, awayPlays, untagged;
- int localTeamCount, visitorTeamCount;
-
- plays = project.PlaysInCategory (cat);
- if (filter != null) {
- plays = plays.Where(p => filter.IsVisible (p)).ToList();
- }
- homePlays =plays.Where(p => p.Team == Team.LOCAL || p.Team ==
Team.BOTH).ToList();
- awayPlays =plays.Where(p => p.Team == Team.VISITOR || p.Team ==
Team.BOTH).ToList();
-
- /* Get the plays where the team is not tagged but we have at least one player
from a team tagged */
- untagged = plays.Where (p=> p.Team == Team.NONE).ToList();
- homePlays.AddRange (untagged.Where (p => p.Players.Where (pt =>
project.LocalTeamTemplate.List.Contains(pt)).Count() != 0).ToList());
- awayPlays.AddRange (untagged.Where (p => p.Players.Where (pt =>
project.VisitorTeamTemplate.List.Contains(pt)).Count() != 0).ToList());
-
- stats = new CategoryStats(cat, plays.Count, homePlays.Count(),
awayPlays.Count());
-
- /* Fill zonal tagging stats */
- stats.FieldCoordinates = plays.Select (p => p.FieldPosition).Where(p =>p !=
null).ToList();
- stats.HalfFieldCoordinates = plays.Select (p => p.HalfFieldPosition).Where(p
=>p != null).ToList();
- stats.GoalCoordinates = plays.Select (p => p.GoalPosition).Where(p =>p !=
null).ToList();
- stats.HomeFieldCoordinates = homePlays.Select (p => p.FieldPosition).Where(p
=>p != null).ToList();
- stats.HomeHalfFieldCoordinates = homePlays.Select (p =>
p.HalfFieldPosition).Where(p =>p != null).ToList();
- stats.HomeGoalCoordinates = homePlays.Select (p => p.GoalPosition).Where(p
=>p != null).ToList();
- stats.AwayFieldCoordinates = awayPlays.Select (p => p.FieldPosition).Where(p
=>p != null).ToList();
- stats.AwayHalfFieldCoordinates = awayPlays.Select (p =>
p.HalfFieldPosition).Where(p =>p != null).ToList();
- stats.AwayGoalCoordinates = awayPlays.Select (p => p.GoalPosition).Where(p
=>p != null).ToList();
- catStats.Add (stats);
+ foreach (AnalysisEventType evt in project.EventTypes.OfType<AnalysisEventType> ()) {
+// CategoryStats stats;
+// List<Event> plays, homePlays, awayPlays, untagged;
+// int localTeamCount, visitorTeamCount;
+//
+// plays = project.PlaysInCategory (cat);
+// if (filter != null) {
+// plays = plays.Where(p => filter.IsVisible (p)).ToList();
+// }
+// homePlays =plays.Where(p => p.Team == Team.LOCAL || p.Team ==
Team.BOTH).ToList();
+// awayPlays =plays.Where(p => p.Team == Team.VISITOR || p.Team ==
Team.BOTH).ToList();
+//
+// /* Get the plays where the team is not tagged but we have at least one player
from a team tagged */
+// untagged = plays.Where (p=> p.Team == Team.NONE).ToList();
+// homePlays.AddRange (untagged.Where (p => p.Players.Where (pt =>
project.LocalTeamTemplate.List.Contains(pt)).Count() != 0).ToList());
+// awayPlays.AddRange (untagged.Where (p => p.Players.Where (pt =>
project.VisitorTeamTemplate.List.Contains(pt)).Count() != 0).ToList());
+//
+// stats = new CategoryStats(cat, plays.Count, homePlays.Count(),
awayPlays.Count());
+//
+// /* Fill zonal tagging stats */
+// stats.FieldCoordinates = plays.Select (p => p.FieldPosition).Where(p =>p !=
null).ToList();
+// stats.HalfFieldCoordinates = plays.Select (p => p.HalfFieldPosition).Where(p
=>p != null).ToList();
+// stats.GoalCoordinates = plays.Select (p => p.GoalPosition).Where(p =>p !=
null).ToList();
+// stats.HomeFieldCoordinates = homePlays.Select (p => p.FieldPosition).Where(p
=>p != null).ToList();
+// stats.HomeHalfFieldCoordinates = homePlays.Select (p =>
p.HalfFieldPosition).Where(p =>p != null).ToList();
+// stats.HomeGoalCoordinates = homePlays.Select (p => p.GoalPosition).Where(p
=>p != null).ToList();
+// stats.AwayFieldCoordinates = awayPlays.Select (p => p.FieldPosition).Where(p
=>p != null).ToList();
+// stats.AwayHalfFieldCoordinates = awayPlays.Select (p =>
p.HalfFieldPosition).Where(p =>p != null).ToList();
+// stats.AwayGoalCoordinates = awayPlays.Select (p => p.GoalPosition).Where(p
=>p != null).ToList();
+// catStats.Add (stats);
}
}
- void GetSubcategoryStats (List<Play> subcatPlays, SubCategoryStat subcatStat, string desc,
+ void GetSubcategoryStats (List<TimelineEvent> subcatPlays, SubCategoryStat subcatStat, string
desc,
int totalCount, out int localTeamCount, out int visitorTeamCount)
{
int count;
@@ -178,8 +178,8 @@ namespace LongoMatch.Stats
subcatStat.AddOptionStat(pStat);
}
- void GetPlayersStats (Project project, List<Play> subcatPlays, string optionName,
- SubCategoryStat subcatStat, Category cat)
+ void GetPlayersStats (Project project, List<TimelineEvent> subcatPlays, string optionName,
+ SubCategoryStat subcatStat, EventType cat)
{
// foreach (SubCategory subcat in cat.SubCategories) {
// Dictionary<Player, int> localPlayerCount = new Dictionary<Player, int>();
@@ -206,7 +206,7 @@ namespace LongoMatch.Stats
// }
}
- int GetPlayerCount(List<Play> plays, Player player)
+ int GetPlayerCount(List<TimelineEvent> plays, Player player)
{
return plays.Where(p => p.Players.Contains(player)).Count();
}
diff --git a/LongoMatch.Core/Store/DashboardButton.cs b/LongoMatch.Core/Store/DashboardButton.cs
new file mode 100644
index 0000000..e89d300
--- /dev/null
+++ b/LongoMatch.Core/Store/DashboardButton.cs
@@ -0,0 +1,270 @@
+//
+// Copyright (C) 2014 Andoni Morales Alastruey
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+using System;
+using LongoMatch.Common;
+using Newtonsoft.Json;
+
+namespace LongoMatch.Store
+{
+ [Serializable]
+ public class DashboardButton
+ {
+
+ public DashboardButton ()
+ {
+ Name = "";
+ Position = new Point (0, 0);
+ Width = Constants.BUTTON_WIDTH;
+ Height = Constants.BUTTON_HEIGHT;
+ BackgroundColor = Color.Red;
+ TextColor = Color.Grey2;
+ HotKey = new HotKey ();
+ }
+
+ public virtual string Name {
+ get;
+ set;
+ }
+
+ public Point Position {
+ get;
+ set;
+ }
+
+ public int Width {
+ get;
+ set;
+ }
+
+ public int Height {
+ get;
+ set;
+ }
+
+ public virtual Color BackgroundColor {
+ get;
+ set;
+ }
+
+ public Color TextColor {
+ get;
+ set;
+ }
+
+ public HotKey HotKey {
+ get;
+ set;
+ }
+
+ [JsonIgnore]
+ public Color LightColor {
+ get {
+ YCbCrColor c = YCbCrColor.YCbCrFromColor (BackgroundColor);
+ byte y = c.Y;
+ c.Y = (byte)(Math.Min (y + 50, 255));
+ return YCbCrColor.ColorFromYCbCr (c);
+ }
+ }
+
+ [JsonIgnore]
+ public Color DarkColor {
+ get {
+ YCbCrColor c = YCbCrColor.YCbCrFromColor (BackgroundColor);
+ byte y = c.Y;
+ c.Y = (byte)(Math.Max (y - 50, 0));
+ return YCbCrColor.ColorFromYCbCr (c);
+ }
+ }
+ }
+
+ [Serializable]
+ public class TimedDashboardButton: DashboardButton
+ {
+ public TimedDashboardButton () {
+ TagMode = TagMode.Predefined;
+ Start = new Time {Seconds = 10};
+ Stop = new Time {Seconds = 10};
+ }
+
+ public TagMode TagMode {
+ get;
+ set;
+ }
+
+ public Time Start {
+ get;
+ set;
+ }
+
+ public Time Stop {
+ get;
+ set;
+ }
+ }
+
+ [Serializable]
+ public class TagButton: DashboardButton
+ {
+ public Tag Tag {
+ get;
+ set;
+ }
+ }
+
+ [Serializable]
+ public class TimerButton: DashboardButton
+ {
+ public Timer Timer {
+ get;
+ set;
+ }
+ }
+
+ [Serializable]
+ public class EventButton: TimedDashboardButton
+ {
+ public EventType EventType {
+ get;
+ set;
+ }
+
+ public override string Name {
+ get {
+ return EventType != null ? EventType.Name : null;
+ }
+ set {
+ if (EventType != null) {
+ EventType.Name = value;
+ }
+ }
+ }
+
+ public override Color BackgroundColor {
+ get {
+ return EventType != null ? EventType.Color : null;
+ }
+ set {
+ if (EventType != null) {
+ EventType.Color = value;
+ }
+ }
+ }
+ }
+
+ [Serializable]
+ public class AnalysisEventButton: EventButton
+ {
+ public AnalysisEventButton () {
+ TagsPerRow = 2;
+ }
+
+ public bool ShowSubcategories {
+ get;
+ set;
+ }
+
+ public int TagsPerRow {
+ get;
+ set;
+ }
+
+ [JsonIgnore]
+ public AnalysisEventType AnalysisEventType {
+ get {
+ return EventType as AnalysisEventType;
+ }
+ }
+ }
+
+ [Serializable]
+ public class PenaltyCardButton: EventButton
+ {
+ public PenaltyCardButton ()
+ {
+ EventType = new PenaltyCardEventType ();
+ }
+
+ public PenaltyCard PenaltyCard {
+ get;
+ set;
+ }
+
+ public override Color BackgroundColor {
+ get {
+ return PenaltyCard != null ? PenaltyCard.Color : null;
+ }
+ set {
+ if (PenaltyCard != null) {
+ PenaltyCard.Color = value;
+ }
+ }
+ }
+
+ public override string Name {
+ get {
+ return PenaltyCard != null ? PenaltyCard.Name : null;
+ }
+ set {
+ if (PenaltyCard != null) {
+ PenaltyCard.Name = value;
+ }
+ }
+ }
+
+ [JsonIgnore]
+ public PenaltyCardEventType PenaltyCardEventType {
+ get {
+ return EventType as PenaltyCardEventType;
+ }
+ }
+ }
+
+ [Serializable]
+ public class ScoreButton: EventButton
+ {
+
+ public ScoreButton ()
+ {
+ EventType = new ScoreEventType ();
+ }
+
+ public Score Score {
+ get;
+ set;
+ }
+
+ public override string Name {
+ get {
+ return Score != null ? Score.Name : null;
+ }
+ set {
+ if (Score != null) {
+ Score.Name = value;
+ }
+ }
+ }
+
+ [JsonIgnore]
+ public ScoreEventType ScoreEventType {
+ get {
+ return EventType as ScoreEventType;
+ }
+ }
+ }
+}
+
diff --git a/LongoMatch.Core/Store/TaggerButton.cs b/LongoMatch.Core/Store/EventType.cs
similarity index 53%
rename from LongoMatch.Core/Store/TaggerButton.cs
rename to LongoMatch.Core/Store/EventType.cs
index 37ce073..e73a4c9 100644
--- a/LongoMatch.Core/Store/TaggerButton.cs
+++ b/LongoMatch.Core/Store/EventType.cs
@@ -16,135 +16,90 @@
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
//
using System;
+using System.Collections.Generic;
using LongoMatch.Common;
-using Newtonsoft.Json;
using Mono.Unix;
+using Newtonsoft.Json;
namespace LongoMatch.Store
{
[Serializable]
- public class TaggerButton
+ public class EventType
{
- Color color;
-
- public TaggerButton () {
- Position = new Point (0, 0);
- Width = Constants.BUTTON_WIDTH;
- Height = Constants.BUTTON_HEIGHT;
+
+ public EventType ()
+ {
+ ID = Guid.NewGuid ();
Color = Color.Red;
- TextColor = Color.Grey2;
- Start = new Time {Seconds = 10};
- Stop = new Time {Seconds = 10};
- HotKey = new HotKey();
- ID = new Guid();
}
-
+
public Guid ID {
get;
set;
}
-
+
public string Name {
get;
set;
}
-
- public Point Position {
- get;
- set;
- }
-
- public int Width {
- get;
- set;
- }
-
- public int Height {
- get;
- set;
- }
-
+
public Color Color {
- get {
- return color;
- }
- set {
- byte y;
- YCbCrColor c = YCbCrColor.YCbCrFromColor (value);
- y = c.Y;
- c.Y = (byte) (Math.Min (y + 50, 255));
- LightColor = YCbCrColor.ColorFromYCbCr (c);
- c.Y = (byte) (Math.Max (y - 50, 0));
- DarkColor = YCbCrColor.ColorFromYCbCr (c);
- color = value;
- }
- }
-
- public Color TextColor {
get;
set;
}
- public TagMode TagMode {
- get;
- set;
- }
-
- public Time Start {
+ public bool TagGoalPosition {
get;
set;
}
- public Time Stop {
+ public bool TagFieldPosition {
get;
set;
}
- public HotKey HotKey {
+ public bool TagHalfFieldPosition {
get;
set;
}
- public SortMethodType SortMethod {
+ public bool FieldPositionIsDistance {
get;
set;
}
-
- [JsonIgnore]
- public Color LightColor {
+ public bool HalfFieldPositionIsDistance {
get;
set;
}
-
- [JsonIgnore]
- public Color DarkColor {
+
+ public SortMethodType SortMethod {
get;
set;
}
-
+
[JsonIgnore]
public string SortMethodString {
get {
- switch(SortMethod) {
+ switch (SortMethod) {
case SortMethodType.SortByName:
- return Catalog.GetString("Sort by name");
+ return Catalog.GetString ("Sort by name");
case SortMethodType.SortByStartTime:
- return Catalog.GetString("Sort by start time");
+ return Catalog.GetString ("Sort by start time");
case SortMethodType.SortByStopTime:
- return Catalog.GetString("Sort by stop time");
+ return Catalog.GetString ("Sort by stop time");
case SortMethodType.SortByDuration:
- return Catalog.GetString("Sort by duration");
+ return Catalog.GetString ("Sort by duration");
default:
- return Catalog.GetString("Sort by name");
+ return Catalog.GetString ("Sort by name");
}
}
set {
- if(value == Catalog.GetString("Sort by start time"))
+ if (value == Catalog.GetString ("Sort by start time"))
SortMethod = SortMethodType.SortByStartTime;
- else if(value == Catalog.GetString("Sort by stop time"))
+ else if (value == Catalog.GetString ("Sort by stop time"))
SortMethod = SortMethodType.SortByStopTime;
- else if(value == Catalog.GetString("Sort by duration"))
+ else if (value == Catalog.GetString ("Sort by duration"))
SortMethod = SortMethodType.SortByDuration;
else
SortMethod = SortMethodType.SortByName;
@@ -153,40 +108,63 @@ namespace LongoMatch.Store
}
[Serializable]
- public class AnalysisCategory: TaggerButton {
- public bool TagGoalPosition {
- get;
- set;
+ public class AnalysisEventType: EventType
+ {
+ public AnalysisEventType ()
+ {
+ Tags = new List<Tag> ();
}
-
- public bool TagFieldPosition {
+
+ public List<Tag> Tags {
get;
set;
}
-
- public bool TagHalfFieldPosition {
- get;
- set;
+ }
+
+ [Serializable]
+ public class PenaltyCardEventType: EventType
+ {
+ public PenaltyCardEventType ()
+ {
+ ID = Constants.PenaltyCardID;
+ Name = Catalog.GetString ("Penalty card");
}
-
- public bool FieldPositionIsDistance {
- get;
- set;
+
+ public override bool Equals (object obj)
+ {
+ PenaltyCardEventType pc = obj as PenaltyCardEventType;
+ if (pc == null)
+ return false;
+ return pc.ID == ID;
}
- public bool HalfFieldPositionIsDistance {
- get;
- set;
+ public override int GetHashCode ()
+ {
+ return ID.GetHashCode ();
}
}
-
+
[Serializable]
- public class AnalysisEventCategory: AnalysisCategory {
- public Time EventTime {
- get;
- set;
+ public class ScoreEventType: EventType
+ {
+ public ScoreEventType ()
+ {
+ ID = Constants.ScoreID;
+ Name = Catalog.GetString ("Score");
+ }
+
+ public override bool Equals (object obj)
+ {
+ ScoreEventType sc = obj as ScoreEventType;
+ if (sc == null)
+ return false;
+ return sc.ID == ID;
+ }
+
+ public override int GetHashCode ()
+ {
+ return ID.GetHashCode ();
}
}
-
}
diff --git a/LongoMatch.Core/Store/PenaltyCard.cs b/LongoMatch.Core/Store/PenaltyCard.cs
index 95c116a..8a993d4 100644
--- a/LongoMatch.Core/Store/PenaltyCard.cs
+++ b/LongoMatch.Core/Store/PenaltyCard.cs
@@ -17,17 +17,16 @@
//
using System;
using LongoMatch.Common;
-using LongoMatch.Interfaces;
namespace LongoMatch.Store
{
[Serializable]
- public class PenaltyCard: AnalysisEventCategory
+ public class PenaltyCard
{
public PenaltyCard ()
{
}
-
+
public PenaltyCard (string name, Color color, CardShape shape)
{
Name = name;
@@ -35,6 +34,16 @@ namespace LongoMatch.Store
Shape = shape;
}
+ public string Name {
+ get;
+ set;
+ }
+
+ public Color Color {
+ get;
+ set;
+ }
+
public CardShape Shape {
get;
set;
diff --git a/LongoMatch.Core/Store/Playlists/PlaylistPlayElement.cs
b/LongoMatch.Core/Store/Playlists/PlaylistPlayElement.cs
index 0e5c2f8..188b2e4 100644
--- a/LongoMatch.Core/Store/Playlists/PlaylistPlayElement.cs
+++ b/LongoMatch.Core/Store/Playlists/PlaylistPlayElement.cs
@@ -25,7 +25,7 @@ namespace LongoMatch.Store.Playlists
[Serializable]
public class PlaylistPlayElement: IPlaylistElement
{
- public PlaylistPlayElement (Play play, MediaFile file=null)
+ public PlaylistPlayElement (TimelineEvent play, MediaFile file=null)
{
Play = play;
Title = play.Name;
@@ -33,7 +33,7 @@ namespace LongoMatch.Store.Playlists
File = file;
}
- public Play Play {
+ public TimelineEvent Play {
get;
set;
}
diff --git a/LongoMatch.Core/Store/Project.cs b/LongoMatch.Core/Store/Project.cs
index 51e3fcc..4ed46c0 100644
--- a/LongoMatch.Core/Store/Project.cs
+++ b/LongoMatch.Core/Store/Project.cs
@@ -53,13 +53,14 @@ namespace LongoMatch.Store
#region Constructors
public Project() {
ID = System.Guid.NewGuid();
- Timeline = new List<Play>();
- Categories = new Categories();
+ Timeline = new List<TimelineEvent>();
+ Dashboard = new Dashboard();
LocalTeamTemplate = new TeamTemplate();
VisitorTeamTemplate = new TeamTemplate();
Timers = new List<Timer> ();
Periods = new List<Period> ();
Playlists = new List<Playlist> ();
+ EventTypes = new List<EventType> ();
}
#endregion
@@ -73,7 +74,7 @@ namespace LongoMatch.Store
set;
}
- public List<Play> Timeline {
+ public List<TimelineEvent> Timeline {
get;
set;
}
@@ -90,11 +91,17 @@ namespace LongoMatch.Store
}
}
+ [JsonProperty(Order = -7)]
+ public List<EventType> EventTypes {
+ get;
+ set;
+ }
+
/// <value>
/// Categories template
/// </value>
[JsonProperty(Order = -10)]
- public Categories Categories {
+ public Dashboard Dashboard {
get;
set;
}
@@ -133,25 +140,26 @@ namespace LongoMatch.Store
}
[JsonIgnore]
- public List<Play> ScorePlays {
+ public List<TimelineEvent> ScorePlays {
get {
- return Timeline.OfType<ScoreEvent>().Select (t => (Play) t).ToList();
+ return Timeline.OfType<ScoreEvent>().Select (t => (TimelineEvent) t).ToList();
}
}
[JsonIgnore]
- public List<Play> PenaltyCardsPlays {
+ public List<TimelineEvent> PenaltyCardsPlays {
get {
- return Timeline.OfType<PenaltyCardEvent>().Select (t => (Play) t).ToList();
+ return Timeline.OfType<PenaltyCardEvent>().Select (t => (TimelineEvent)
t).ToList();
}
}
[JsonIgnore]
- public IEnumerable<IGrouping<TaggerButton, Play>> PlaysGroupedByCategory {
+ public IEnumerable<IGrouping<EventType, TimelineEvent>> PlaysGroupedByEventType {
get {
- return Timeline.GroupBy(play => play.Category);
+ return Timeline.GroupBy(play => play.EventType);
}
}
+
#endregion
#region Public Methods
@@ -160,49 +168,42 @@ namespace LongoMatch.Store
/// </summary>
public void Clear() {
Timeline.Clear();
- Categories.List.Clear();
+ Dashboard.List.Clear();
VisitorTeamTemplate.List.Clear();
LocalTeamTemplate.List.Clear();
Periods.Clear();
Timers.Clear();
}
+ public TimelineEvent AddEvent (EventType type, Time start, Time stop, Image miniature,
+ Score score, PenaltyCard card, bool addToTimeline=true)
+ {
+ TimelineEvent evt;
+ string count = String.Format ("{0:000}", EventsByType (type).Count + 1);
+ string name = String.Format ("{0} {1}", type.Name, count);
- /// <summary>
- /// Adds a new play to a given category
- /// </summary>
- /// <param name="dataSection">
- /// A <see cref="System.Int32"/>: category index
- /// </param>
- /// <param name="start">
- /// A <see cref="Time"/>: start time of the play
- /// </param>
- /// <param name="stop">
- /// A <see cref="Time"/>: stop time of the play
- /// </param>
- /// <param name="thumbnail">
- /// A <see cref="Pixbuf"/>: snapshot of the play
- /// </param>
- /// <returns>
- /// A <see cref="MediaTimeNode"/>: created play
- /// </returns>
- public Play AddPlay(AnalysisCategory category, Time start, Time stop, Image miniature) {
- string count= String.Format("{0:000}", PlaysInCategory (category).Count + 1);
- string name = String.Format("{0} {1}",category.Name, count);
+ if (type is PenaltyCardEventType) {
+ evt = new PenaltyCardEvent { PenaltyCard = card };
+ } else if (type is ScoreEventType) {
+ evt = new ScoreEvent { Score = score };
+ } else {
+ evt = new TimelineEvent ();
+ }
+
+ evt.Name = name;
+ evt.Start = start;
+ evt.Stop = stop;
+ evt.EventType = type;
+ evt.Notes = "";
+ evt.Miniature = miniature;
- var play = new Play {
- Name = name,
- Start = start,
- Stop = stop,
- Category = category,
- Notes = "",
- Miniature = miniature,
- };
- Timeline.Add(play);
- return play;
+ if (addToTimeline) {
+ Timeline.Add(evt);
+ }
+ return evt;
}
- public void AddPlay (Play play) {
+ public void AddEvent (TimelineEvent play) {
Timeline.Add(play);
}
@@ -215,42 +216,28 @@ namespace LongoMatch.Store
/// <param name="section">
/// A <see cref="System.Int32"/>: category the play belongs to
/// </param>
- public void RemovePlays(List<Play> plays) {
- foreach(Play play in plays)
+ public void RemovePlays(List<TimelineEvent> plays) {
+ foreach(TimelineEvent play in plays)
Timeline.Remove(play);
}
- /// <summary>
- /// Delete a category
- /// </summary>
- /// <param name="sectionIndex">
- /// A <see cref="System.Int32"/>: category index
- /// </param>
- public void RemoveCategory(Category category) {
- if(Categories.CategoriesList.Count == 1)
- throw new Exception("You can't remove the last Category");
- Categories.List.Remove(category);
- Timeline.RemoveAll(p => p.Category.ID == category.ID);
- }
-
- public void RemovePlayer(TeamTemplate template, Player player) {
- if(template.List.Count == 1)
- throw new Exception("You can't remove the last Player");
- template.List.Remove(player);
- foreach (var play in Timeline) {
- play.Players.RemoveAll (p => p == player);
- }
+ public void UpdateEventTypes ()
+ {
+ IEnumerable<EventType> types = Dashboard.List.OfType<EventButton>().Select(b =>
b.EventType);
+ EventTypes.AddRange (types.Except (EventTypes));
+ types = Timeline.Select (t => t.EventType).Distinct().Except (EventTypes);
+ EventTypes.AddRange (types.Except (EventTypes));
}
-
- public List<Play> PlaysInCategory(TaggerButton category) {
- return Timeline.Where(p => p.Category.ID == category.ID).ToList();
+
+ public List<TimelineEvent> EventsByType (EventType evType) {
+ return Timeline.Where(p => p.EventType.ID == evType.ID).ToList();
}
public int GetScore (Team team) {
return Timeline.OfType<ScoreEvent>().Where (s => PlayTaggedTeam (s) == team).Sum(s =>
s.Score.Points);
}
- public Team PlayTaggedTeam (Play play) {
+ public Team PlayTaggedTeam (TimelineEvent play) {
bool home=false, away=false;
if (play.Team == Team.LOCAL || play.Team == Team.BOTH ||
@@ -276,11 +263,11 @@ namespace LongoMatch.Store
public Image GetBackground (FieldPositionType pos) {
switch (pos) {
case FieldPositionType.Field:
- return Categories.FieldBackground;
+ return Dashboard.FieldBackground;
case FieldPositionType.HalfField:
- return Categories.HalfFieldBackground;
+ return Dashboard.HalfFieldBackground;
case FieldPositionType.Goal:
- return Categories.GoalBackground;
+ return Dashboard.GoalBackground;
}
return null;
}
diff --git a/LongoMatch.Core/Store/Score.cs b/LongoMatch.Core/Store/Score.cs
index 72f1ab5..6bb7d81 100644
--- a/LongoMatch.Core/Store/Score.cs
+++ b/LongoMatch.Core/Store/Score.cs
@@ -16,13 +16,11 @@
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
//
using System;
-using LongoMatch.Interfaces;
-using LongoMatch.Common;
namespace LongoMatch.Store
{
[Serializable]
- public class Score: AnalysisEventCategory
+ public class Score
{
public Score ()
{
@@ -33,7 +31,12 @@ namespace LongoMatch.Store
Name = name;
Points = points;
}
-
+
+ public string Name {
+ get;
+ set;
+ }
+
public int Points {
get;
set;
diff --git a/LongoMatch.Core/Store/ScoreEvent.cs b/LongoMatch.Core/Store/ScoreEvent.cs
index b9c6bac..d25fa5c 100644
--- a/LongoMatch.Core/Store/ScoreEvent.cs
+++ b/LongoMatch.Core/Store/ScoreEvent.cs
@@ -20,7 +20,7 @@ using System;
namespace LongoMatch.Store
{
[Serializable]
- public class ScoreEvent: Play
+ public class ScoreEvent: Event
{
public ScoreEvent ()
{
diff --git a/LongoMatch.Core/Store/Templates/CategoriesTemplate.cs
b/LongoMatch.Core/Store/Templates/Dashboard.cs
similarity index 58%
rename from LongoMatch.Core/Store/Templates/CategoriesTemplate.cs
rename to LongoMatch.Core/Store/Templates/Dashboard.cs
index 0933f41..fb07978 100644
--- a/LongoMatch.Core/Store/Templates/CategoriesTemplate.cs
+++ b/LongoMatch.Core/Store/Templates/Dashboard.cs
@@ -27,6 +27,7 @@ using LongoMatch.Common;
using LongoMatch.Interfaces;
using Image = LongoMatch.Common.Image;
+using System.Collections.ObjectModel;
namespace LongoMatch.Store.Templates
{
@@ -40,7 +41,7 @@ namespace LongoMatch.Store.Templates
/// The <see cref="LongoMatch.DB.Project"/> must handle all the changes
/// </summary>
[Serializable]
- public class Categories: ITemplate<TaggerButton>
+ public class Dashboard: ITemplate
{
const int CAT_WIDTH = 120;
@@ -49,12 +50,12 @@ namespace LongoMatch.Store.Templates
/// <summary>
/// Creates a new template
/// </summary>
- public Categories() {
+ public Dashboard() {
FieldBackground = Config.FieldBackground;
HalfFieldBackground = Config.HalfFieldBackground;
GoalBackground = Config.GoalBackground;
ID = Guid.NewGuid ();
- List = new List<TaggerButton>();
+ List = new ObservableCollection<DashboardButton>();
}
public Guid ID {
@@ -62,7 +63,7 @@ namespace LongoMatch.Store.Templates
set;
}
- public List<TaggerButton> List {
+ public ObservableCollection<DashboardButton> List {
get;
set;
}
@@ -119,20 +120,6 @@ namespace LongoMatch.Store.Templates
}
[JsonIgnore]
- public List<Category> CategoriesList {
- get {
- return List.OfType<Category>().ToList();
- }
- }
-
- [JsonIgnore]
- public List<TagButton> CommonTags {
- get {
- return List.OfType<TagButton>().ToList();
- }
- }
-
- [JsonIgnore]
public int CanvasWidth {
get {
return (int) List.Max (c => c.Position.X + c.Width);
@@ -150,21 +137,30 @@ namespace LongoMatch.Store.Templates
Serializer.Save(this, filePath);
}
- public void AddDefaultTags (Category cat) {
- cat.Tags.Add (new Tag (Catalog.GetString ("Good")));
- cat.Tags.Add (new Tag (Catalog.GetString ("Bad")));
+ public void AddDefaultTags (AnalysisEventType ev) {
+ ev.Tags.Add (new Tag (Catalog.GetString ("Success"),
+ Catalog.GetString ("Outcome")));
+ ev.Tags.Add (new Tag (Catalog.GetString ("Failure"),
+ Catalog.GetString ("Outcome")));
}
- public Category AddDefaultItem (int index) {
+ public AnalysisEventButton AddDefaultItem (int index) {
+ AnalysisEventButton button;
+ AnalysisEventType evtype;
Color c = Color.Red;
HotKey h = new HotKey();
- Category cat = new Category {
- Name = "Category " + index,
- Color = c,
+ evtype = new AnalysisEventType {
+ Name = "Event Type " + index,
+ SortMethod = SortMethodType.SortByStartTime,
+ Color = c
+ };
+ AddDefaultTags(evtype);
+
+ button = new AnalysisEventButton {
+ EventType = evtype,
Start = new Time{Seconds = 10},
Stop = new Time {Seconds = 10},
- SortMethod = SortMethodType.SortByStartTime,
HotKey = h,
/* Leave the first row for the timers and score */
Position = new Point (10 + (index % 7) * (CAT_WIDTH + 10),
@@ -172,13 +168,12 @@ namespace LongoMatch.Store.Templates
Width = CAT_WIDTH,
Height = CAT_HEIGHT,
};
- AddDefaultTags(cat);
- List.Insert(index, cat);
- return cat;
+ List.Insert(index, button);
+ return button;
}
- public static Categories Load(string filePath) {
- Categories cat = Serializer.LoadSafe<Categories>(filePath);
+ public static Dashboard Load(string filePath) {
+ Dashboard cat = Serializer.LoadSafe<Dashboard>(filePath);
if (cat.GamePeriods == null) {
cat.GamePeriods = new List<string>();
cat.GamePeriods.Add ("1");
@@ -187,49 +182,55 @@ namespace LongoMatch.Store.Templates
return cat;
}
- public static Categories DefaultTemplate(int count) {
- Score score;
- Timer timer;
- PenaltyCard card;
- TagButton tag;
+ public static Dashboard DefaultTemplate(int count) {
+ TagButton tagbutton;
+ TimerButton timerButton;
+ PenaltyCardButton cardButton;
+ ScoreButton scoreButton;
List<string> periods = new List<string>();
- Categories template = new Categories();
+ Dashboard template = new Dashboard();
template.FillDefaultTemplate(count);
periods.Add ("1");
periods.Add ("2");
template.GamePeriods = periods;
- tag = new TagButton (new Tag (Catalog.GetString ("Attack"),
- Constants.COMMON_TAG));
- tag.Position = new Point (10, 10);
- template.List.Add (tag);
+
+ tagbutton = new TagButton {
+ Tag = new Tag (Catalog.GetString ("Attack"), Constants.COMMON_TAG),
+ Position = new Point (10, 10)};
+ template.List.Add (tagbutton);
- tag = new TagButton (new Tag (Catalog.GetString ("Defense"),
- Constants.COMMON_TAG));
- tag.Position = new Point (10 + (10 + CAT_WIDTH) * 1, 10);
- template.List.Add (tag);
+ tagbutton = new TagButton {
+ Tag = new Tag (Catalog.GetString ("Deffense"), Constants.COMMON_TAG),
+ Position = new Point (10 + (10 + CAT_WIDTH) * 1, 10)};
+ template.List.Add (tagbutton);
- card = new PenaltyCard (Catalog.GetString ("Red"),
- Color.Red, CardShape.Rectangle);
- card.Position = new Point (10 + (10 + CAT_WIDTH) * 2, 10);
- template.List.Add (card);
+ cardButton = new PenaltyCardButton {
+ PenaltyCard = new PenaltyCard (Catalog.GetString ("Red"),
+ Color.Red, CardShape.Rectangle),
+ Position = new Point (10 + (10 + CAT_WIDTH) * 2, 10)};
+ template.List.Add (cardButton);
- card = new PenaltyCard (Catalog.GetString ("Yellow"),
- Color.Yellow, CardShape.Rectangle);
- card.Position = new Point (10 + (10 + CAT_WIDTH) * 3, 10);
- template.List.Add (card);
+ cardButton = new PenaltyCardButton {
+ PenaltyCard = new PenaltyCard (Catalog.GetString ("Yellow"),
+ Color.Yellow, CardShape.Rectangle),
+ Position = new Point (10 + (10 + CAT_WIDTH) * 3, 10)};
+ template.List.Add (cardButton);
- score = new Score (Catalog.GetString ("Field goal"), 1);
- score.Position = new Point (10 + (10 + CAT_WIDTH) * 4, 10);
- template.List.Add (score);
+ scoreButton = new ScoreButton {
+ Score = new Score (Catalog.GetString ("Field goal"), 1),
+ Position = new Point (10 + (10 + CAT_WIDTH) * 4, 10)};
+ template.List.Add (scoreButton);
- score = new Score (Catalog.GetString ("Penalty goal"), 1);
- score.Position = new Point (10 + (10 + CAT_WIDTH) * 5, 10);
- template.List.Add (score);
+ scoreButton = new ScoreButton {
+ Score = new Score (Catalog.GetString ("Penalty goal"), 1),
+ Position = new Point (10 + (10 + CAT_WIDTH) * 5, 10)};
+ template.List.Add (scoreButton);
- timer = new Timer {Name = Catalog.GetString ("Ball playing")};
- timer.Position = new Point (10 + (10 + CAT_WIDTH) * 6, 10);
- template.List.Add (timer);
+ timerButton = new TimerButton {
+ Timer = new Timer {Name = Catalog.GetString ("Ball playing")},
+ Position = new Point (10 + (10 + CAT_WIDTH) * 6, 10)};
+ template.List.Add (timerButton);
return template;
}
diff --git a/LongoMatch.Core/Store/Templates/TeamTemplate.cs b/LongoMatch.Core/Store/Templates/TeamTemplate.cs
index d9513e1..6d3070d 100644
--- a/LongoMatch.Core/Store/Templates/TeamTemplate.cs
+++ b/LongoMatch.Core/Store/Templates/TeamTemplate.cs
@@ -28,7 +28,7 @@ using LongoMatch.Interfaces;
namespace LongoMatch.Store.Templates
{
[Serializable]
- public class TeamTemplate: ITemplate<Player>
+ public class TeamTemplate: ITemplate
{
private const int MAX_WIDTH=100;
private const int MAX_HEIGHT=100;
diff --git a/LongoMatch.Core/Store/Play.cs b/LongoMatch.Core/Store/TimelineEvent.cs
similarity index 86%
rename from LongoMatch.Core/Store/Play.cs
rename to LongoMatch.Core/Store/TimelineEvent.cs
index dc58b0e..056539a 100644
--- a/LongoMatch.Core/Store/Play.cs
+++ b/LongoMatch.Core/Store/TimelineEvent.cs
@@ -22,11 +22,11 @@ using System;
using System.Collections.Generic;
using System.Linq;
using Mono.Unix;
-using LongoMatch.Common;
-using LongoMatch.Interfaces;
+using LongoMatch.LongoMatch.Core.Common;
+using LongoMatch.LongoMatch.Core.Interfaces;
using Newtonsoft.Json;
-namespace LongoMatch.Store
+namespace LongoMatch.Core.Store
{
/// <summary>
@@ -34,11 +34,11 @@ namespace LongoMatch.Store
/// </summary>
[Serializable]
- public class Play : PixbufTimeNode, IIDObject
+ public class TimelineEvent : PixbufTimeNode, IIDObject
{
#region Constructors
- public Play() {
+ public TimelineEvent() {
Drawings = new List<FrameDrawing>();
Players = new List<Player> ();
Tags = new List<Tag>();
@@ -57,7 +57,7 @@ namespace LongoMatch.Store
/// <summary>
/// Category in which this play is tagged
/// </summary>
- public AnalysisCategory Category {
+ public EventType EventType {
get;
set;
}
@@ -160,26 +160,26 @@ namespace LongoMatch.Store
}
public void AddDefaultPositions () {
- if (Category.TagFieldPosition) {
+ if (EventType.TagFieldPosition) {
if (FieldPosition == null) {
FieldPosition = new Coordinates ();
FieldPosition.Points.Add (new Point (0.5, 0.5));
}
- if (Category.FieldPositionIsDistance) {
+ if (EventType.FieldPositionIsDistance) {
FieldPosition.Points.Add (new Point (0.5, 0.1));
}
}
- if (Category.TagHalfFieldPosition) {
+ if (EventType.TagHalfFieldPosition) {
if (HalfFieldPosition == null) {
HalfFieldPosition = new Coordinates ();
HalfFieldPosition.Points.Add (new Point (0.5, 0.5));
}
- if (Category.HalfFieldPositionIsDistance) {
+ if (EventType.HalfFieldPositionIsDistance) {
HalfFieldPosition.Points.Add (new Point (0.5, 0.1));
}
}
- if (Category.TagGoalPosition) {
+ if (EventType.TagGoalPosition) {
if (GoalPosition == null) {
GoalPosition = new Coordinates ();
GoalPosition.Points.Add (new Point (0.5, 0.5));
@@ -222,4 +222,23 @@ namespace LongoMatch.Store
}
#endregion
}
+
+ [Serializable]
+ public class PenaltyCardEvent: TimelineEvent
+ {
+ public PenaltyCard PenaltyCard {
+ get;
+ set;
+ }
+ }
+
+ [Serializable]
+ public class ScoreEvent: TimelineEvent
+ {
+ public Score Score {
+ get;
+ set;
+ }
+ }
+
}
diff --git a/LongoMatch.Core/Store/Timer.cs b/LongoMatch.Core/Store/Timer.cs
index dd4cc21..455493b 100644
--- a/LongoMatch.Core/Store/Timer.cs
+++ b/LongoMatch.Core/Store/Timer.cs
@@ -20,17 +20,21 @@ using System.Linq;
using LongoMatch.Store;
using System.Collections.Generic;
using Newtonsoft.Json;
-using LongoMatch.Interfaces;
-using LongoMatch.Common;
namespace LongoMatch.Store
{
- public class Timer: TaggerButton
+ [Serializable]
+ public class Timer
{
public Timer ()
{
Nodes = new List<TimeNode>();
}
+
+ public string Name {
+ get;
+ set;
+ }
public List<TimeNode> Nodes {
get;
diff --git a/LongoMatch.Drawing/CanvasObjects/CardObject.cs b/LongoMatch.Drawing/CanvasObjects/CardObject.cs
index 223244e..038e0f4 100644
--- a/LongoMatch.Drawing/CanvasObjects/CardObject.cs
+++ b/LongoMatch.Drawing/CanvasObjects/CardObject.cs
@@ -25,12 +25,12 @@ namespace LongoMatch.Drawing.CanvasObjects
public class CardObject: TaggerObject
{
- public CardObject (PenaltyCard card): base (card)
+ public CardObject (PenaltyCardButton card): base (card)
{
- Card = card;
+ Button = card;
}
- public PenaltyCard Card {
+ public PenaltyCardButton Button {
get;
set;
}
@@ -43,18 +43,18 @@ namespace LongoMatch.Drawing.CanvasObjects
tk.FillColor = Color;
tk.StrokeColor = Color;
tk.LineWidth = 0;
- switch (Card.Shape) {
+ switch (Button.PenaltyCard.Shape) {
case CardShape.Rectangle:
- tk.DrawRoundedRectangle (Card.Position, Card.Width, Card.Height, 3);
+ tk.DrawRoundedRectangle (Button.Position, Button.Width, Button.Height, 3);
break;
case CardShape.Circle:
- tk.DrawCircle (new Point (Card.Position.X + Card.Width / 2,
- Card.Position.Y + Card.Height / 2),
- Math.Min (Card.Width, Card.Height) / 2);
+ 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 (Card.Position.X + Card.Width / 2,
Card.Position.Y),
- Card.Width, Card.Height, SelectionPosition.Top);
+ tk.DrawTriangle (new Point (Button.Position.X + Button.Width / 2,
Button.Position.Y),
+ Button.Width, Button.Height, SelectionPosition.Top);
break;
}
@@ -62,7 +62,7 @@ namespace LongoMatch.Drawing.CanvasObjects
tk.LineWidth = 2;
tk.StrokeColor = Color.Grey2;
tk.FillColor = Color.Grey2;
- tk.DrawText (Position, Card.Width, Card.Height, Card.Name);
+ tk.DrawText (Position, Button.Width, Button.Height, Button.PenaltyCard.Name);
DrawSelectionArea (tk);
tk.End ();
}
diff --git a/LongoMatch.Drawing/CanvasObjects/CategoryLabel.cs
b/LongoMatch.Drawing/CanvasObjects/CategoryLabel.cs
index 92a0b09..483ae07 100644
--- a/LongoMatch.Drawing/CanvasObjects/CategoryLabel.cs
+++ b/LongoMatch.Drawing/CanvasObjects/CategoryLabel.cs
@@ -24,13 +24,12 @@ namespace LongoMatch.Drawing.CanvasObjects
{
public class CategoryLabel: CanvasObject, ICanvasObject
{
- TaggerButton category;
+ EventType eventType;
double width;
- public CategoryLabel (TaggerButton category, double width, double height,
- double offsetY)
+ public CategoryLabel (EventType eventType, double width, double height, double offsetY)
{
- this.category = category;
+ this.eventType = eventType;
this.Height = height;
this.width = width;
OffsetY = offsetY;
@@ -81,8 +80,8 @@ namespace LongoMatch.Drawing.CanvasObjects
tk.DrawRectangle (new Point (0, y), width, Height);
/* Draw a rectangle with the category color */
- tk.FillColor = category.Color;
- tk.StrokeColor = category.Color;
+ tk.FillColor = eventType.Color;
+ tk.StrokeColor = eventType.Color;
tk.DrawRectangle (new Point (hs, y + vs), rectSize, rectSize);
/* Draw category name */
@@ -92,7 +91,7 @@ namespace LongoMatch.Drawing.CanvasObjects
tk.FillColor = Config.Style.PaletteWidgets;
tk.FontAlignment = FontAlignment.Left;
tk.StrokeColor = Config.Style.PaletteWidgets;
- tk.DrawText (new Point (to, y), width - to, Height, category.Name);
+ tk.DrawText (new Point (to, y), width - to, Height, eventType.Name);
tk.End ();
}
}
diff --git a/LongoMatch.Drawing/CanvasObjects/CategoryObject.cs
b/LongoMatch.Drawing/CanvasObjects/CategoryObject.cs
index 504f26c..824d11b 100644
--- a/LongoMatch.Drawing/CanvasObjects/CategoryObject.cs
+++ b/LongoMatch.Drawing/CanvasObjects/CategoryObject.cs
@@ -30,14 +30,14 @@ namespace LongoMatch.Drawing.CanvasObjects
Dictionary <Rectangle, object> rects;
bool catSelected;
- public CategoryObject (Category category): base (category)
+ public CategoryObject (AnalysisEventButton category): base (category)
{
- Category = category;
+ Button = category;
rects = new Dictionary <Rectangle, object> ();
SelectedTags = new List<Tag> ();
}
- public Category Category {
+ public AnalysisEventButton Button {
get;
set;
}
@@ -51,10 +51,10 @@ namespace LongoMatch.Drawing.CanvasObjects
get {
/* Header */
int rows = 1;
- int tagsPerRow = Math.Max (1, Category.TagsPerRow);
+ int tagsPerRow = Math.Max (1, Button.TagsPerRow);
/* Recorder */
- if (Category.TagMode == TagMode.Free) {
+ if (Button.TagMode == TagMode.Free) {
rows ++;
}
rows += (int)Math.Ceiling ((float)TagsCount / tagsPerRow);
@@ -64,7 +64,7 @@ namespace LongoMatch.Drawing.CanvasObjects
int TagsCount {
get {
- int tagsCount = Category.Tags.Count;
+ int tagsCount = Button.AnalysisEventType.Tags.Count;
if (Mode == TagMode.Edit) {
tagsCount ++;
}
@@ -102,8 +102,8 @@ namespace LongoMatch.Drawing.CanvasObjects
foreach (Rectangle rect in rects.Keys) {
Selection subsel = rect.GetSelection (p, 0);
if (subsel != null) {
- if (rects [rect] is Category) {
- CategoryClicked (rects [rect] as Category);
+ if (rects [rect] is AnalysisEventButton) {
+ CategoryClicked (rects [rect] as AnalysisEventButton);
} else if (rects [rect] is Tag) {
TagClicked (rects [rect] as Tag);
} else {
@@ -130,11 +130,11 @@ namespace LongoMatch.Drawing.CanvasObjects
int tagsPerRow, tagsCount, row = 0;
rects.Clear ();
- position = Category.Position;
- heightPerRow = Category.Height / NRows;
- catWidth = Category.Width;
+ position = Button.Position;
+ heightPerRow = Button.Height / NRows;
+ catWidth = Button.Width;
tagsCount = TagsCount;
- tagsPerRow = Math.Max (1, Category.TagsPerRow);
+ tagsPerRow = Math.Max (1, Button.TagsPerRow);
rowwidth = catWidth / tagsPerRow;
tk.Begin ();
@@ -147,13 +147,13 @@ namespace LongoMatch.Drawing.CanvasObjects
tk.FillColor = LongoMatch.Common.Color.Grey2;
tk.LineWidth = 2;
if (catSelected && Mode != TagMode.Edit) {
- tk.StrokeColor = Category.DarkColor;
- tk.DrawText (position, catWidth, heightPerRow, Category.Name);
+ tk.StrokeColor = Button.DarkColor;
+ tk.DrawText (position, catWidth, heightPerRow, Button.EventType.Name);
} else {
tk.StrokeColor = LongoMatch.Common.Color.Grey2;
- tk.DrawText (position, catWidth, heightPerRow, Category.Name);
+ tk.DrawText (position, catWidth, heightPerRow, Button.EventType.Name);
}
- rects.Add (new Rectangle (position, catWidth, heightPerRow), Category);
+ rects.Add (new Rectangle (position, catWidth, heightPerRow), Button);
yptr += heightPerRow;
/* Draw tags */
@@ -172,7 +172,7 @@ namespace LongoMatch.Drawing.CanvasObjects
rowwidth = catWidth / (tagsCount - i);
}
}
- tk.StrokeColor = Category.DarkColor;
+ tk.StrokeColor = Button.DarkColor;
tk.LineWidth = 1;
if (col == 0) {
/* Horizontal line */
@@ -181,13 +181,13 @@ namespace LongoMatch.Drawing.CanvasObjects
/* Vertical line */
tk.DrawLine (pos, new Point (pos.X, pos.Y + heightPerRow));
}
- tk.StrokeColor = Category.TextColor;
- if (i < Category.Tags.Count) {
- tag = Category.Tags [i];
+ tk.StrokeColor = Button.TextColor;
+ if (i < Button.AnalysisEventType.Tags.Count) {
+ tag = Button.AnalysisEventType.Tags [i];
if (Mode == TagMode.Edit || !SelectedTags.Contains (tag)) {
tk.DrawText (pos, rowwidth, heightPerRow, tag.Value);
} else {
- tk.StrokeColor = Category.DarkColor;
+ tk.StrokeColor = Button.DarkColor;
tk.DrawText (pos, rowwidth, heightPerRow, tag.Value);
}
} else {
@@ -198,7 +198,7 @@ namespace LongoMatch.Drawing.CanvasObjects
}
yptr += heightPerRow * (row + 1);
- if (Category.TagMode == TagMode.Free) {
+ if (Button.TagMode == TagMode.Free) {
/* Draw Tagger */
tk.DrawLine (new Point (position.X, position.Y + yptr),
new Point (position.X + catWidth, position.Y +
yptr));
@@ -208,9 +208,9 @@ namespace LongoMatch.Drawing.CanvasObjects
tk.End ();
}
- void CategoryClicked (Category category)
+ void CategoryClicked (AnalysisEventButton category)
{
- if (Category.TagMode == TagMode.Predefined) {
+ if (Button.TagMode == TagMode.Predefined) {
catSelected = true;
}
}
@@ -222,7 +222,7 @@ namespace LongoMatch.Drawing.CanvasObjects
} else {
SelectedTags.Clear ();
SelectedTags.Add (tag);
- if (Category.TagMode == TagMode.Predefined) {
+ if (Button.TagMode == TagMode.Predefined) {
catSelected = true;
}
}
diff --git a/LongoMatch.Drawing/CanvasObjects/PlayObject.cs b/LongoMatch.Drawing/CanvasObjects/PlayObject.cs
index bdb3392..370e3a5 100644
--- a/LongoMatch.Drawing/CanvasObjects/PlayObject.cs
+++ b/LongoMatch.Drawing/CanvasObjects/PlayObject.cs
@@ -26,7 +26,7 @@ namespace LongoMatch.Drawing.CanvasObjects
{
public class PlayObject: TimeNodeObject
{
- public PlayObject (Play play):base (play)
+ public PlayObject (TimelineEvent play):base (play)
{
}
@@ -46,9 +46,9 @@ namespace LongoMatch.Drawing.CanvasObjects
}
}
- public Play Play {
+ public TimelineEvent Play {
get {
- return TimeNode as Play;
+ return TimeNode as TimelineEvent;
}
}
@@ -58,8 +58,8 @@ namespace LongoMatch.Drawing.CanvasObjects
y = OffsetY + Height / 2;
tk.LineWidth = lineWidth;
- tk.FillColor = Play.Category.Color;
- tk.StrokeColor = Play.Category.Color;
+ tk.FillColor = Play.EventType.Color;
+ tk.StrokeColor = Play.EventType.Color;
if (stop - start <= lineWidth) {
tk.LineWidth = 0;
tk.DrawCircle (new Point (start + (stop - start) / 2, y), 3);
diff --git a/LongoMatch.Drawing/CanvasObjects/PositionObject.cs
b/LongoMatch.Drawing/CanvasObjects/PositionObject.cs
index 2020388..a6aeed0 100644
--- a/LongoMatch.Drawing/CanvasObjects/PositionObject.cs
+++ b/LongoMatch.Drawing/CanvasObjects/PositionObject.cs
@@ -54,7 +54,7 @@ namespace LongoMatch.Drawing.CanvasObjects
set;
}
- public Play Play {
+ public TimelineEvent Play {
get;
set;
}
@@ -115,7 +115,7 @@ namespace LongoMatch.Drawing.CanvasObjects
tk.Begin ();
if (Play != null) {
- color = Play.Category.Color;
+ color = Play.EventType.Color;
} else {
color = Constants.TAGGER_POINT_COLOR;
}
diff --git a/LongoMatch.Drawing/CanvasObjects/ScoreObject.cs b/LongoMatch.Drawing/CanvasObjects/ScoreObject.cs
index d75a567..72cb9b8 100644
--- a/LongoMatch.Drawing/CanvasObjects/ScoreObject.cs
+++ b/LongoMatch.Drawing/CanvasObjects/ScoreObject.cs
@@ -25,12 +25,12 @@ namespace LongoMatch.Drawing.CanvasObjects
{
public class ScoreObject: TaggerObject
{
- public ScoreObject (Score score): base (score)
+ public ScoreObject (ScoreButton score): base (score)
{
- Score = score;
+ Button = score;
}
- public Score Score {
+ public ScoreButton Button {
get;
set;
}
@@ -44,9 +44,9 @@ namespace LongoMatch.Drawing.CanvasObjects
/* Draw header */
tk.LineWidth = 2;
- tk.StrokeColor = Score.TextColor;
- tk.FillColor = Score.TextColor;
- tk.DrawText (Position, Score.Width, Score.Height, Score.Name);
+ tk.StrokeColor = Button.TextColor;
+ tk.FillColor = Button.TextColor;
+ tk.DrawText (Position, Button.Width, Button.Height, Button.Score.Name);
DrawSelectionArea (tk);
tk.End ();
}
diff --git a/LongoMatch.Drawing/CanvasObjects/TagObject.cs b/LongoMatch.Drawing/CanvasObjects/TagObject.cs
index a4acc37..96c6698 100644
--- a/LongoMatch.Drawing/CanvasObjects/TagObject.cs
+++ b/LongoMatch.Drawing/CanvasObjects/TagObject.cs
@@ -47,7 +47,7 @@ namespace LongoMatch.Drawing.CanvasObjects
tk.LineWidth = 2;
tk.StrokeColor = TagButton.TextColor;
tk.FillColor = TagButton.TextColor;
- tk.DrawText (Position, TagButton.Width, TagButton.Height, TagButton.Name);
+ tk.DrawText (Position, TagButton.Width, TagButton.Height, TagButton.Tag.Value);
DrawSelectionArea (tk);
tk.End ();
}
diff --git a/LongoMatch.Drawing/CanvasObjects/TaggerObject.cs
b/LongoMatch.Drawing/CanvasObjects/TaggerObject.cs
index 1a6fabe..0737e44 100644
--- a/LongoMatch.Drawing/CanvasObjects/TaggerObject.cs
+++ b/LongoMatch.Drawing/CanvasObjects/TaggerObject.cs
@@ -28,12 +28,12 @@ namespace LongoMatch.Drawing.CanvasObjects
public abstract class TaggerObject: CanvasButtonObject, ICanvasSelectableObject
{
- public TaggerObject (TaggerButton tagger)
+ public TaggerObject (DashboardButton tagger)
{
Tagger = tagger;
}
- public TaggerButton Tagger {
+ public DashboardButton Tagger {
get;
set;
}
@@ -51,7 +51,7 @@ namespace LongoMatch.Drawing.CanvasObjects
public Color Color {
get {
if (!Active) {
- return Tagger.Color;
+ return Tagger.BackgroundColor;
} else {
return Tagger.DarkColor;
}
@@ -145,9 +145,9 @@ namespace LongoMatch.Drawing.CanvasObjects
{
tk.LineWidth = 0;
if (Active && !ignoreActive) {
- tk.DrawButton (Tagger.Position, Tagger.Width, Tagger.Height, 3, Tagger.Color,
Tagger.DarkColor);
+ tk.DrawButton (Tagger.Position, Tagger.Width, Tagger.Height, 3,
Tagger.BackgroundColor, Tagger.DarkColor);
} else {
- tk.DrawButton (Tagger.Position, Tagger.Width, Tagger.Height, 3,
Tagger.LightColor, Tagger.Color);
+ tk.DrawButton (Tagger.Position, Tagger.Width, Tagger.Height, 3,
Tagger.BackgroundColor, Tagger.BackgroundColor);
}
}
diff --git a/LongoMatch.Drawing/CanvasObjects/TimelineObject.cs
b/LongoMatch.Drawing/CanvasObjects/TimelineObject.cs
index debb449..5851999 100644
--- a/LongoMatch.Drawing/CanvasObjects/TimelineObject.cs
+++ b/LongoMatch.Drawing/CanvasObjects/TimelineObject.cs
@@ -179,15 +179,15 @@ namespace LongoMatch.Drawing.CanvasObjects
public class CategoryTimeline: TimelineObject
{
- public CategoryTimeline (List<Play> plays, Time maxTime, double offsetY, Color background):
+ public CategoryTimeline (List<TimelineEvent> plays, Time maxTime, double offsetY, Color
background):
base (maxTime, offsetY, background)
{
- foreach (Play p in plays) {
+ foreach (TimelineEvent p in plays) {
AddPlay (p);
}
}
- public void AddPlay (Play play)
+ public void AddPlay (TimelineEvent play)
{
PlayObject po = new PlayObject (play);
po.SelectionLeft = selectionBorderL;
diff --git a/LongoMatch.Drawing/CanvasObjects/TimerLabel.cs b/LongoMatch.Drawing/CanvasObjects/TimerLabel.cs
new file mode 100644
index 0000000..0977ff1
--- /dev/null
+++ b/LongoMatch.Drawing/CanvasObjects/TimerLabel.cs
@@ -0,0 +1,110 @@
+//
+// Copyright (C) 2014 Andoni Morales Alastruey
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+using LongoMatch.Store;
+using LongoMatch.Interfaces.Drawing;
+using LongoMatch.Common;
+using System;
+
+namespace LongoMatch.Drawing.CanvasObjects
+{
+ public class TimerLabel: CanvasObject, ICanvasObject
+ {
+ double width;
+
+ public TimerLabel (string name, Color color, double width, double height,
+ double offsetY)
+ {
+ Name = name;
+ Color = color;
+ this.Height = height;
+ this.width = width;
+ OffsetY = offsetY;
+ }
+
+ public double Height {
+ get;
+ set;
+ }
+
+ public double Scroll {
+ get;
+ set;
+ }
+
+ public bool Even {
+ get;
+ set;
+ }
+
+ public double OffsetY {
+ set;
+ get;
+ }
+
+ public string Name {
+ get;
+ set;
+ }
+
+ public Color Color {
+ get;
+ set;
+ }
+
+ 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 ();
+ }
+ }
+}
+
diff --git a/LongoMatch.Drawing/CanvasObjects/TimerObject.cs b/LongoMatch.Drawing/CanvasObjects/TimerObject.cs
index a74b9bd..cccb0e5 100644
--- a/LongoMatch.Drawing/CanvasObjects/TimerObject.cs
+++ b/LongoMatch.Drawing/CanvasObjects/TimerObject.cs
@@ -28,14 +28,14 @@ namespace LongoMatch.Drawing.CanvasObjects
{
Time currentTime;
- public TimerObject (Timer timer): base (timer)
+ public TimerObject (TimerButton timer): base (timer)
{
- Timer = timer;
+ Button = timer;
Toggle = true;
CurrentTime = new Time (0);
}
- public Timer Timer {
+ public TimerButton Button {
get;
set;
}
@@ -44,7 +44,7 @@ namespace LongoMatch.Drawing.CanvasObjects
set {
if (CurrentTimeNode != null) {
if (value < CurrentTimeNode.Start) {
- Timer.CancelTimer ();
+ Button.Timer.CancelTimer ();
CurrentTimeNode = null;
}
}
@@ -78,10 +78,10 @@ namespace LongoMatch.Drawing.CanvasObjects
tn = CurrentTimeNode;
if (tn == null) {
Log.Debug ("Start timer at " + CurrentTime.ToMSecondsString ());
- CurrentTimeNode = Timer.StartTimer (CurrentTime);
+ CurrentTimeNode = Button.Timer.StartTimer (CurrentTime);
} else {
Log.Debug ("Stop timer at " + CurrentTime.ToMSecondsString ());
- Timer.StopTimer (CurrentTime);
+ Button.Timer.StopTimer (CurrentTime);
tn.Stop = CurrentTime;
CurrentTimeNode = null;
}
@@ -92,9 +92,9 @@ namespace LongoMatch.Drawing.CanvasObjects
double h;
if (CurrentTimeNode == null || Mode == TagMode.Edit) {
- h = Timer.Height;
+ h = Button.Height;
} else {
- h = Timer.Height / 2;
+ h = Button.Height / 2;
}
tk.Begin ();
@@ -104,12 +104,12 @@ namespace LongoMatch.Drawing.CanvasObjects
/* Draw header */
tk.LineWidth = 2;
- tk.StrokeColor = Timer.TextColor;
- tk.FillColor = Timer.TextColor;
+ tk.StrokeColor = Button.TextColor;
+ tk.FillColor = Button.TextColor;
tk.FontWeight = FontWeight.Bold;
- tk.DrawText (Position, Timer.Width, h, Timer.Name);
+ tk.DrawText (Position, Button.Width, h, Button.Timer.Name);
if (CurrentTimeNode != null && Mode != TagMode.Edit) {
- tk.DrawText (new Point (Position.X, Position.Y + h), Timer.Width, h,
+ tk.DrawText (new Point (Position.X, Position.Y + h), Button.Width, h,
PartialTime.ToSecondsString ());
}
DrawSelectionArea (tk);
diff --git a/LongoMatch.Drawing/LongoMatch.Drawing.mdp b/LongoMatch.Drawing/LongoMatch.Drawing.mdp
index 30c9257..1befc1c 100644
--- a/LongoMatch.Drawing/LongoMatch.Drawing.mdp
+++ b/LongoMatch.Drawing/LongoMatch.Drawing.mdp
@@ -51,8 +51,8 @@
<File subtype="Code" buildaction="Compile" name="CanvasObjects/BenchObject.cs" />
<File subtype="Code" buildaction="Compile" name="CanvasObjects/FieldObject.cs" />
<File subtype="Code" buildaction="Compile" name="CanvasObjects/PlayersTaggerObject.cs" />
- <File subtype="Code" buildaction="Compile" name="Widgets/Dashboard.cs" />
<File subtype="Code" buildaction="Compile" name="PlayslistCellRenderer.cs" />
+ <File subtype="Code" buildaction="Compile" name="Widgets/DashboardCanvas.cs" />
</Contents>
<References>
<ProjectReference type="Package" localcopy="True" refto="System, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089" />
diff --git a/LongoMatch.Drawing/PlayslistCellRenderer.cs b/LongoMatch.Drawing/PlayslistCellRenderer.cs
index 9d54c31..1eff4f8 100644
--- a/LongoMatch.Drawing/PlayslistCellRenderer.cs
+++ b/LongoMatch.Drawing/PlayslistCellRenderer.cs
@@ -118,7 +118,7 @@ namespace LongoMatch.Drawing
tk.End ();
}
- public static void RenderAnalysisCategory (AnalysisCategory cat, int count, bool isExpanded,
IDrawingToolkit tk,
+ public static void RenderAnalysisCategory (EventType cat, int count, bool isExpanded,
IDrawingToolkit tk,
IContext context, Area backgroundArea, Area
cellArea)
{
tk.Context = context;
@@ -191,14 +191,20 @@ namespace LongoMatch.Drawing
}
public static void Render (object item, int count, bool isExpanded, IDrawingToolkit tk,
- IContext context, Area backgroundArea, Area cellArea, CellState
state)
+ IContext context, Area backgroundArea, Area cellArea, CellState
state)
{
- if (item is AnalysisCategory) {
- RenderAnalysisCategory (item as AnalysisCategory, count, isExpanded, tk,
+ if (item is EventType) {
+ RenderAnalysisCategory (item as EventType, count, isExpanded, tk,
context, backgroundArea, cellArea);
- } else if (item is Play) {
- Play p = item as Play;
- RenderPlay (p.Category.Color, p.Miniature, p.Selected, p.Description, count,
isExpanded, tk,
+ } else if (item is TimelineEvent) {
+ Color color;
+ TimelineEvent p = item as TimelineEvent;
+ if (p is PenaltyCardEvent) {
+ color = (p as PenaltyCardEvent).PenaltyCard.Color;
+ } else {
+ color = p.EventType.Color;
+ }
+ RenderPlay (color, p.Miniature, 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);
@@ -206,8 +212,10 @@ namespace LongoMatch.Drawing
RenderPlaylist (item as Playlist, count, isExpanded, tk, context,
backgroundArea, cellArea);
} else if (item is PlaylistPlayElement) {
PlaylistPlayElement p = item as PlaylistPlayElement;
- RenderPlay (p.Play.Category.Color, p.Miniature, p.Selected, p.Description,
count, isExpanded, tk,
+ RenderPlay (p.Play.EventType.Color, p.Miniature, p.Selected, p.Description,
count, isExpanded, tk,
context, backgroundArea, cellArea, state);
+ } else {
+ Log.Error ("No renderer for type " + item.GetType());
}
}
}
diff --git a/LongoMatch.Drawing/Widgets/CategoriesLabels.cs b/LongoMatch.Drawing/Widgets/CategoriesLabels.cs
index 3de8762..3da3a3c 100644
--- a/LongoMatch.Drawing/Widgets/CategoriesLabels.cs
+++ b/LongoMatch.Drawing/Widgets/CategoriesLabels.cs
@@ -29,11 +29,11 @@ namespace LongoMatch.Drawing.Widgets
{
Project project;
PlaysFilter filter;
- Dictionary<TaggerButton, CategoryLabel> categories;
+ Dictionary<EventType, CategoryLabel> eventsLabels;
public CategoriesLabels (IWidget widget): base (widget)
{
- categories = new Dictionary<TaggerButton, CategoryLabel> ();
+ eventsLabels = new Dictionary<EventType, CategoryLabel> ();
}
public double Scroll {
@@ -66,60 +66,28 @@ namespace LongoMatch.Drawing.Widgets
h = StyleConf.TimelineCategoryHeight;
widget.Width = w;
- /* Add the scores label */
- if (project.Categories.Scores.Count > 0) {
- l = new CategoryLabel (new TaggerButton { Name = Catalog.GetString ("Score")
},
- w, h, i * h);
- Objects.Add (l);
- i++;
- foreach (Score s in project.Categories.Scores) {
- categories [s] = l;
- }
- }
-
- /* Add the penalty cards label */
- if (project.Categories.PenaltyCards.Count > 0) {
- l = new CategoryLabel (new TaggerButton {Name = Catalog.GetString ("Penalty
cards")},
- w, h, i * h);
- Objects.Add (l);
- i++;
- foreach (PenaltyCard pc in project.Categories.PenaltyCards) {
- categories [pc] = l;
- }
- }
-
- /* Start from bottom to top with categories */
- foreach (TaggerButton cat in project.Categories.CategoriesList) {
+ foreach (EventType eventType in project.EventTypes) {
/* Add the category label */
- l = new CategoryLabel (cat, w, h, i * h);
- categories [cat] = l;
+ l = new CategoryLabel (eventType, w, h, i * h);
+ eventsLabels [eventType] = l;
Objects.Add (l);
i++;
}
-
}
void UpdateVisibleCategories ()
{
int i = 0;
- foreach (CategoryLabel ct in categories.Values) {
- ct.Visible = false;
- ct.OffsetY = -1;
- }
-
- foreach (TaggerButton cat in categories.Keys) {
- CategoryLabel label = categories [cat];
-
- if (filter.VisibleCategories.Contains (cat)) {
- label.Visible |= true;
- if (label.OffsetY == -1) {
- label.OffsetY = i * label.Height;
- if (i % 2 == 0) {
- label.Even = true;
- }
- i++;
+ foreach (EventType type in project.EventTypes) {
+ CategoryLabel label = eventsLabels [type];
+ if (filter.VisibleEventTypes.Contains (type)) {
+ label.OffsetY = i * label.Height;
+ label.Visible = true;
+ if (i % 2 == 0) {
+ label.Even = true;
}
+ i++;
} else {
label.Visible = false;
}
diff --git a/LongoMatch.Drawing/Widgets/Dashboard.cs b/LongoMatch.Drawing/Widgets/DashboardCanvas.cs
similarity index 79%
rename from LongoMatch.Drawing/Widgets/Dashboard.cs
rename to LongoMatch.Drawing/Widgets/DashboardCanvas.cs
index d2c7bde..5cd3e7a 100644
--- a/LongoMatch.Drawing/Widgets/Dashboard.cs
+++ b/LongoMatch.Drawing/Widgets/DashboardCanvas.cs
@@ -17,19 +17,19 @@
//
using System;
using System.Linq;
-using LongoMatch.Store.Templates;
+using LongoMatch.LongoMatch.Core.Store.Templates;
using System.Collections.Generic;
-using LongoMatch.Common;
+using LongoMatch.LongoMatch.Core.Common;
using LongoMatch.Drawing.CanvasObjects;
-using LongoMatch.Handlers;
-using LongoMatch.Store;
-using LongoMatch.Store.Drawables;
-using LongoMatch.Interfaces.Drawing;
-using LongoMatch.Interfaces;
+using LongoMatch.LongoMatch.Core.Handlers;
+using LongoMatch.LongoMatch.Core.Store;
+using LongoMatch.LongoMatch.Core.Store.Drawables;
+using LongoMatch.LongoMatch.Core.Interfaces.LongoMatch.Core.Interfaces.Drawing;
+using LongoMatch.LongoMatch.Core.Interfaces;
namespace LongoMatch.Drawing.Widgets
{
- public class Dashboard: SelectionCanvas
+ public class DashboardCanvas: SelectionCanvas
{
public event TaggersSelectedHandler TaggersSelectedEvent;
@@ -37,12 +37,12 @@ namespace LongoMatch.Drawing.Widgets
public event ShowButtonsTaggerMenuHandler ShowMenuEvent;
public event NewTagHandler NewTagEvent;
- Categories template;
+ LongoMatch.LongoMatch.Core.Store.Templates.Dashboard template;
TagMode tagMode;
Time currentTime;
int templateWidth, templateHeight;
- public Dashboard (IWidget widget): base (widget)
+ public DashboardCanvas (IWidget widget): base (widget)
{
Accuracy = 5;
TagMode = TagMode.Edit;
@@ -52,7 +52,7 @@ namespace LongoMatch.Drawing.Widgets
AddTag = new Tag ("", "");
}
- public Categories Template {
+ public LongoMatch.LongoMatch.Core.Store.Templates.Dashboard Template {
set {
template = value;
LoadTemplate ();
@@ -99,7 +99,7 @@ namespace LongoMatch.Drawing.Widgets
get;
}
- public void Refresh (TaggerButton b = null)
+ public void Refresh (DashboardButton b = null)
{
TaggerObject to;
@@ -141,7 +141,7 @@ namespace LongoMatch.Drawing.Widgets
protected override void SelectionChanged (List<Selection> sel)
{
- List<TaggerButton> taggers;
+ List<DashboardButton> taggers;
taggers = sel.Select (s => (s.Drawable as TaggerObject).Tagger).ToList ();
if (TagMode == TagMode.Edit) {
@@ -158,7 +158,7 @@ namespace LongoMatch.Drawing.Widgets
if (sel != null) {
int i = Constants.CATEGORY_TPL_GRID;
- TaggerButton tb = (sel.Drawable as TaggerObject).Tagger;
+ DashboardButton tb = (sel.Drawable as TaggerObject).Tagger;
tb.Position.X = Utils.Round (tb.Position.X, i);
tb.Position.Y = Utils.Round (tb.Position.Y, i);
tb.Width = (int)Utils.Round (tb.Width, i);
@@ -197,14 +197,14 @@ namespace LongoMatch.Drawing.Widgets
void LoadTemplate ()
{
ClearObjects ();
- foreach (TagButton tag in template.CommonTags) {
+ foreach (TagButton tag in template.List.OfType<TagButton>()) {
TagObject to = new TagObject (tag);
to.ClickedEvent += HandleTaggerClickedEvent;
to.Mode = TagMode;
Objects.Add (to);
}
- foreach (Category cat in template.CategoriesList) {
+ foreach (AnalysisEventButton cat in template.List.OfType<AnalysisEventButton>()) {
CategoryObject co = new CategoryObject (cat);
co.ClickedEvent += HandleTaggerClickedEvent;
co.Mode = TagMode;
@@ -212,20 +212,20 @@ namespace LongoMatch.Drawing.Widgets
Objects.Add (co);
}
- foreach (PenaltyCard c in template.PenaltyCards) {
+ foreach (PenaltyCardButton c in template.List.OfType<PenaltyCardButton>()) {
CardObject co = new CardObject (c);
co.ClickedEvent += HandleTaggerClickedEvent;
co.Mode = TagMode;
Objects.Add (co);
}
- foreach (Score s in template.Scores) {
+ foreach (ScoreButton s in template.List.OfType<ScoreButton>()) {
ScoreObject co = new ScoreObject (s);
co.ClickedEvent += HandleTaggerClickedEvent;
co.Mode = TagMode;
Objects.Add (co);
}
- foreach (Timer t in template.Timers) {
+ foreach (TimerButton t in template.List.OfType<TimerButton>()) {
TimerObject to = new TimerObject (t);
to.ClickedEvent += HandleTaggerClickedEvent;
to.Mode = TagMode;
@@ -259,14 +259,18 @@ namespace LongoMatch.Drawing.Widgets
void HandleTaggerClickedEvent (CanvasObject co)
{
TaggerObject tagger;
+ EventButton button;
Time start = null, stop = null;
List<Tag> tags = null;
+ PenaltyCard card = null;
+ Score score = null;
tagger = co as TaggerObject;
- if (NewTagEvent == null || tagger is TimerObject ||
- tagger is TagObject) {
+ if (NewTagEvent == null || !(tagger.Tagger is EventButton)) {
return;
}
+
+ button = tagger.Tagger as EventButton;
if (TagMode == TagMode.Edit) {
if (tagger is CategoryObject) {
@@ -277,12 +281,12 @@ namespace LongoMatch.Drawing.Widgets
return;
}
- if (tagger.Tagger.TagMode == TagMode.Predefined) {
- stop = CurrentTime + tagger.Tagger.Stop;
- start = CurrentTime - tagger.Tagger.Start;
+ if (button.TagMode == TagMode.Predefined) {
+ stop = CurrentTime + button.Stop;
+ start = CurrentTime - button.Start;
} else {
stop = CurrentTime;
- start = tagger.Start - tagger.Tagger.Start;
+ start = tagger.Start - button.Start;
}
if (tagger is CategoryObject) {
@@ -295,7 +299,14 @@ namespace LongoMatch.Drawing.Widgets
to.Active = false;
}
}
- NewTagEvent (tagger.Tagger, null, tags, start, stop);
+ if (button is PenaltyCardButton) {
+ card = (button as PenaltyCardButton).PenaltyCard;
+ }
+ if (button is ScoreButton) {
+ score = (button as ScoreButton).Score;
+ }
+
+ NewTagEvent (button.EventType, null, tags, start, stop, score, card);
}
}
}
diff --git a/LongoMatch.Drawing/Widgets/PlaysTimeline.cs b/LongoMatch.Drawing/Widgets/PlaysTimeline.cs
index fa737f3..01bd1cb 100644
--- a/LongoMatch.Drawing/Widgets/PlaysTimeline.cs
+++ b/LongoMatch.Drawing/Widgets/PlaysTimeline.cs
@@ -36,11 +36,11 @@ namespace LongoMatch.Drawing.Widgets
PlaysFilter playsFilter;
double secondsPerPixel;
Time duration;
- Dictionary<AnalysisCategory, CategoryTimeline> categories;
+ Dictionary<EventType, CategoryTimeline> eventsTimelines;
public PlaysTimeline (IWidget widget): base(widget)
{
- categories = new Dictionary<AnalysisCategory, CategoryTimeline> ();
+ eventsTimelines = new Dictionary<EventType, CategoryTimeline> ();
secondsPerPixel = 0.1;
Accuracy = Constants.TIMELINE_ACCURACY;
SelectionMode = MultiSelectionMode.MultipleWithModifier;
@@ -48,7 +48,7 @@ namespace LongoMatch.Drawing.Widgets
protected override void Dispose (bool disposing)
{
- foreach (CategoryTimeline ct in categories.Values) {
+ foreach (CategoryTimeline ct in eventsTimelines.Values) {
ct.Dispose ();
}
base.Dispose (disposing);
@@ -60,13 +60,13 @@ namespace LongoMatch.Drawing.Widgets
this.project = project;
ClearObjects ();
- categories.Clear ();
+ eventsTimelines.Clear ();
duration = project.Description.File.Duration;
- height = project.Categories.CategoriesList.Count * StyleConf.TimelineCategoryHeight;
- if (project.Categories.Scores.Count > 0) {
+ height = project.EventTypes.Count * StyleConf.TimelineCategoryHeight;
+ if (project.Dashboard.Scores.Count > 0) {
height += StyleConf.TimelineCategoryHeight;
}
- if (project.Categories.PenaltyCards.Count > 0) {
+ if (project.Dashboard.PenaltyCards.Count > 0) {
height += StyleConf.TimelineCategoryHeight;
}
widget.Height = height;
@@ -77,7 +77,7 @@ namespace LongoMatch.Drawing.Widgets
public Time CurrentTime {
set {
- foreach (CategoryTimeline tl in categories.Values) {
+ foreach (CategoryTimeline tl in eventsTimelines.Values) {
tl.CurrentTime = value;
}
}
@@ -93,15 +93,15 @@ namespace LongoMatch.Drawing.Widgets
}
}
- public void AddPlay (Play play)
+ public void AddPlay (TimelineEvent play)
{
- categories [play.Category].AddPlay (play);
+ eventsTimelines [play.EventType].AddPlay (play);
}
- public void RemovePlays (List<Play> plays)
+ public void RemovePlays (List<TimelineEvent> plays)
{
- foreach (Play p in plays) {
- categories [p.Category].RemoveNode (p);
+ foreach (TimelineEvent p in plays) {
+ eventsTimelines [p.EventType].RemoveNode (p);
Selections.RemoveAll (s => (s.Drawable as PlayObject).Play == p);
}
}
@@ -110,7 +110,7 @@ namespace LongoMatch.Drawing.Widgets
{
double width = duration.Seconds / SecondsPerPixel;
widget.Width = width + 10;
- foreach (TimelineObject tl in categories.Values) {
+ foreach (TimelineObject tl in eventsTimelines.Values) {
tl.Width = width + 10;
tl.SecondsPerPixel = SecondsPerPixel;
}
@@ -133,43 +133,14 @@ namespace LongoMatch.Drawing.Widgets
CategoryTimeline tl;
int i = 0;
- List<Category> cats = project.Categories.CategoriesList;
- List<Score> scores = project.Categories.Scores;
- List<PenaltyCard> cards = project.Categories.PenaltyCards;
-
- if (scores.Count > 0) {
- tl = new CategoryTimeline (project.ScorePlays, duration,
- i * StyleConf.TimelineCategoryHeight,
- ColorForRow (i));
- Objects.Add (tl);
- i++;
- foreach (Score s in scores) {
- categories [s] = tl;
- }
- }
-
- if (cards.Count > 0) {
- tl = new CategoryTimeline (project.PenaltyCardsPlays, duration,
+ foreach (EventType type in project.EventTypes) {
+ tl = new CategoryTimeline (project.EventsByType (type), duration,
i * StyleConf.TimelineCategoryHeight,
ColorForRow (i));
+ eventsTimelines [type] = tl;
Objects.Add (tl);
i++;
- foreach (PenaltyCard pc in cards) {
- categories [pc] = tl;
- }
}
-
- for (int j = 0; j < cats.Count; j++) {
- AnalysisCategory cat;
- cat = cats [j];
- tl = new CategoryTimeline (project.PlaysInCategory (cat), duration,
- i * StyleConf.TimelineCategoryHeight,
- ColorForRow (i));
- categories [cat] = tl;
- Objects.Add (tl);
- i++;
- }
-
UpdateVisibleCategories ();
Update ();
}
@@ -177,21 +148,14 @@ namespace LongoMatch.Drawing.Widgets
void UpdateVisibleCategories ()
{
int i = 0;
- foreach (CategoryTimeline ct in categories.Values) {
- ct.Visible = false;
- ct.OffsetY = -1;
- }
-
- foreach (AnalysisCategory cat in categories.Keys) {
- TimelineObject timeline = categories [cat];
- if (playsFilter.VisibleCategories.Contains (cat)) {
- if (timeline.OffsetY == -1) {
- timeline.OffsetY = i * timeline.Height;
- i++;
- }
- timeline.Visible |= true;
+ foreach (EventType type in project.EventTypes) {
+ CategoryTimeline timeline = eventsTimelines [type];
+ if (playsFilter.VisibleEventTypes.Contains (type)) {
+ timeline.OffsetY = i * timeline.Height;
+ timeline.Visible = true;
+ i++;
} else {
- timeline.Visible |= false;
+ timeline.Visible = false;
}
}
widget.ReDraw ();
@@ -200,7 +164,7 @@ namespace LongoMatch.Drawing.Widgets
void RedrawSelection (Selection sel)
{
PlayObject po = sel.Drawable as PlayObject;
- widget.ReDraw (categories [po.Play.Category]);
+ widget.ReDraw (eventsTimelines [po.Play.EventType]);
}
protected override void SelectionChanged (List<Selection> selections)
@@ -228,34 +192,30 @@ namespace LongoMatch.Drawing.Widgets
protected override void ShowMenu (Point coords)
{
- AnalysisCategory cat = null;
- List<Play> plays = Selections.Select (p => (p.Drawable as PlayObject).Play).ToList ();
+ EventType ev = null;
+ List<TimelineEvent> plays = Selections.Select (p => (p.Drawable as
PlayObject).Play).ToList ();
- foreach (AnalysisCategory ac in categories.Keys) {
+ foreach (EventType evType in eventsTimelines.Keys) {
TimelineObject tl;
- Category c = ac as Category;
- if (c == null)
- continue;
- tl = categories [c];
+ tl = eventsTimelines [evType];
if (!tl.Visible)
continue;
if (coords.Y >= tl.OffsetY && coords.Y < tl.OffsetY + tl.Height) {
- cat = c;
+ ev = evType;
break;
}
}
- if ((cat != null || plays.Count > 0) && ShowMenuEvent != null) {
- ShowMenuEvent (plays, cat,
- Utils.PosToTime (coords, SecondsPerPixel));
+ if ((ev != null || plays.Count > 0) && ShowMenuEvent != null) {
+ ShowMenuEvent (plays, ev, Utils.PosToTime (coords, SecondsPerPixel));
}
}
protected override void SelectionMoved (Selection sel)
{
Time moveTime;
- Play play = (sel.Drawable as PlayObject).Play;
+ TimelineEvent play = (sel.Drawable as PlayObject).Play;
if (sel.Position == SelectionPosition.Right) {
moveTime = play.Stop;
diff --git a/LongoMatch.Drawing/Widgets/PositionTagger.cs b/LongoMatch.Drawing/Widgets/PositionTagger.cs
index 31e003d..ca1b4e5 100644
--- a/LongoMatch.Drawing/Widgets/PositionTagger.cs
+++ b/LongoMatch.Drawing/Widgets/PositionTagger.cs
@@ -32,7 +32,7 @@ namespace LongoMatch.Drawing.Widgets
public event ShowTaggerMenuHandler ShowMenuEvent;
- Play playSelected;
+ TimelineEvent playSelected;
public PositionTagger (IWidget widget): base (widget)
{
@@ -41,7 +41,7 @@ namespace LongoMatch.Drawing.Widgets
SelectionMode = MultiSelectionMode.MultipleWithModifier;
}
- public PositionTagger (IWidget widget, List<Play> plays, Image background, FieldPositionType
position): base (widget)
+ public PositionTagger (IWidget widget, List<TimelineEvent> plays, Image background,
FieldPositionType position): base (widget)
{
Background = background;
Plays = plays;
@@ -58,7 +58,7 @@ namespace LongoMatch.Drawing.Widgets
set;
}
- public void SelectPlay (Play play)
+ public void SelectPlay (TimelineEvent play)
{
PositionObject po;
@@ -83,16 +83,16 @@ namespace LongoMatch.Drawing.Widgets
}
}
- public List<Play> Plays {
+ public List<TimelineEvent> Plays {
set {
ClearObjects ();
- foreach (Play p in value) {
+ foreach (TimelineEvent p in value) {
AddPlay (p);
}
}
}
- public void AddPlay (Play play)
+ public void AddPlay (TimelineEvent play)
{
PositionObject po;
Coordinates coords;
@@ -107,7 +107,7 @@ namespace LongoMatch.Drawing.Widgets
Objects.Add (po);
}
- public void RemovePlays (List<Play> plays)
+ public void RemovePlays (List<TimelineEvent> plays)
{
Objects.RemoveAll (o => plays.Contains ((o as PositionObject).Play));
}
@@ -115,7 +115,7 @@ namespace LongoMatch.Drawing.Widgets
protected override void SelectionChanged (List<Selection> selections)
{
if (selections.Count > 0) {
- Play p = (selections.Last ().Drawable as PositionObject).Play;
+ TimelineEvent p = (selections.Last ().Drawable as PositionObject).Play;
playSelected = p;
if (EmitSignals) {
Config.EventsBroker.EmitLoadPlay (p);
@@ -126,7 +126,7 @@ namespace LongoMatch.Drawing.Widgets
protected override void ShowMenu (Point coords)
{
if (ShowMenuEvent != null) {
- List<Play> plays = Selections.Select (p => (p.Drawable as
PositionObject).Play).ToList ();
+ List<TimelineEvent> plays = Selections.Select (p => (p.Drawable as
PositionObject).Play).ToList ();
ShowMenuEvent (plays);
}
}
diff --git a/LongoMatch.GUI.Multimedia/Gui/PlayerBin.cs b/LongoMatch.GUI.Multimedia/Gui/PlayerBin.cs
index a7b9fe0..a83fc66 100644
--- a/LongoMatch.GUI.Multimedia/Gui/PlayerBin.cs
+++ b/LongoMatch.GUI.Multimedia/Gui/PlayerBin.cs
@@ -53,7 +53,7 @@ namespace LongoMatch.Gui
const int THUMBNAIL_MAX_WIDTH = 100;
const int SCALE_FPS = 25;
IPlayer player;
- Play loadedPlay;
+ TimelineEvent loadedPlay;
IPlaylistElement loadedPlaylistElement;
Playlist loadedPlaylist;
Time length, lastTime;
@@ -216,7 +216,7 @@ namespace LongoMatch.Gui
if (element is PlaylistPlayElement) {
PlaylistPlayElement ple = element as PlaylistPlayElement;
- Play play = ple.Play;
+ TimelineEvent play = ple.Play;
LoadSegment (ple.File, play.Start, play.Stop, play.Start, true, play.Rate);
} else if (element is PlaylistImage) {
//LoadStillImage (element as PlaylistImage);
@@ -225,7 +225,7 @@ namespace LongoMatch.Gui
}
}
- public void LoadPlay (MediaFile file, Play play, Time seekTime, bool playing)
+ public void LoadPlay (MediaFile file, TimelineEvent play, Time seekTime, bool playing)
{
loadedPlaylist = null;
loadedPlaylistElement = null;
diff --git a/LongoMatch.GUI.Multimedia/Gui/PlayerCapturerBin.cs
b/LongoMatch.GUI.Multimedia/Gui/PlayerCapturerBin.cs
index 9fb82b3..32783e6 100644
--- a/LongoMatch.GUI.Multimedia/Gui/PlayerCapturerBin.cs
+++ b/LongoMatch.GUI.Multimedia/Gui/PlayerCapturerBin.cs
@@ -214,7 +214,7 @@ namespace LongoMatch.Gui
playerbin.LoadPlayListPlay (playlist, play);
}
- public void LoadPlay (MediaFile file, Play play, Time seekTime, bool playing) {
+ public void LoadPlay (MediaFile file, TimelineEvent play, Time seekTime, bool playing) {
if (mode == PlayerOperationMode.PreviewCapturer) {
backtolivebutton.Visible = true;
ShowPlayer ();
diff --git a/LongoMatch.GUI/Gui/Component/AnalysisComponent.cs
b/LongoMatch.GUI/Gui/Component/AnalysisComponent.cs
index 1789530..6b0c8b5 100644
--- a/LongoMatch.GUI/Gui/Component/AnalysisComponent.cs
+++ b/LongoMatch.GUI/Gui/Component/AnalysisComponent.cs
@@ -63,7 +63,7 @@ namespace LongoMatch.Gui.Component
}
}
- public void AddPlay(Play play) {
+ public void AddPlay(TimelineEvent play) {
playsSelection.AddPlay(play);
codingwidget.AddPlay (play);
}
@@ -72,7 +72,7 @@ namespace LongoMatch.Gui.Component
codingwidget.UpdateCategories ();
}
- public void DeletePlays (List<Play> plays) {
+ public void DeletePlays (List<TimelineEvent> plays) {
playsSelection.RemovePlays(plays);
codingwidget.DeletePlays (plays);
}
@@ -149,7 +149,7 @@ namespace LongoMatch.Gui.Component
} else {
playercapturer.Mode =
PlayerCapturerBin.PlayerOperationMode.PreviewCapturer;
}
- playercapturer.PeriodsNames = openedProject.Categories.GamePeriods;
+ playercapturer.PeriodsNames = openedProject.Dashboard.GamePeriods;
playercapturer.PeriodsTimers = openedProject.Periods;
}
backgroundBox.Show ();
diff --git a/LongoMatch.GUI/Gui/Component/CategoryProperties.cs
b/LongoMatch.GUI/Gui/Component/CategoryProperties.cs
index b2a30e4..ff21c0e 100644
--- a/LongoMatch.GUI/Gui/Component/CategoryProperties.cs
+++ b/LongoMatch.GUI/Gui/Component/CategoryProperties.cs
@@ -19,24 +19,18 @@
//
using System;
-using System.Collections.Generic;
-using Gdk;
using Gtk;
using Mono.Unix;
using LongoMatch.Common;
-using LongoMatch.Interfaces;
using LongoMatch.Store;
-using LongoMatch.Store.Templates;
using LongoMatch.Gui.Dialog;
-using LongoMatch.Gui.Popup;
-using LongoMatch.Gui.Helpers;
using Point = LongoMatch.Common.Point;
namespace LongoMatch.Gui.Component
{
- public delegate void HotKeyChangeHandler(HotKey prevHotKey, Category newSection);
+ public delegate void HotKeyChangeHandler(HotKey prevHotKey, DashboardButton button);
[System.ComponentModel.Category("LongoMatch")]
[System.ComponentModel.ToolboxItem(true)]
@@ -47,11 +41,13 @@ namespace LongoMatch.Gui.Component
public event EventHandler EditedEvent;
SizeGroup sizegroup;
- TaggerButton tagger;
- AnalysisCategory posTagger;
- Category cat;
- PenaltyCard card;
- Score score;
+ DashboardButton button;
+ TimedDashboardButton timedButton;
+ EventButton eventButton;
+ AnalysisEventButton catButton;
+ PenaltyCardButton cardButton;
+ ScoreButton scoreButton;
+ TagButton tagButton;
Time lastLeadTime;
bool edited, ignore;
@@ -114,17 +110,19 @@ namespace LongoMatch.Gui.Component
}
}
- public TaggerButton Tagger {
+ public DashboardButton Tagger {
set {
- tagger = value;
- posTagger = value as AnalysisCategory;
- cat = value as Category;
- card = value as PenaltyCard;
- score = value as Score;
+ button = value;
+ eventButton = value as EventButton;
+ timedButton = value as TimedDashboardButton;
+ catButton = value as AnalysisEventButton;
+ cardButton = value as PenaltyCardButton;
+ scoreButton = value as ScoreButton;
+ tagButton = value as TagButton;
UpdateGui();
}
get {
- return cat;
+ return catButton;
}
}
@@ -161,28 +159,24 @@ namespace LongoMatch.Gui.Component
{
ignore = true;
- cattable.Visible = cat != null;
- postable.Visible = posTagger != null;
- scoretable.Visible = score != null;
- cardtable.Visible = card != null;
-
- if (tagger != null) {
- nameentry.Text = tagger.Name;
- colorbutton1.Color = Helpers.Misc.ToGdkColor (tagger.Color);
- colorbutton2.Color = Helpers.Misc.ToGdkColor (tagger.TextColor);
- lastLeadTime = tagger.Start;
- tagmodecombobox.Active = (int)tagger.TagMode;
- leadtimebutton.Value = tagger.Start.Seconds;
- lagtimebutton.Value = tagger.Stop.Seconds;
- sortmethodcombobox.Active = (int)tagger.SortMethod;
- if (tagger.HotKey != null && tagger.HotKey.Defined)
- hotKeyLabel.Text = tagger.HotKey.ToString ();
+ cattable.Visible = catButton != null;
+ timetable.Visible = timedButton != null;
+ postable.Visible = eventButton != null;
+ scoretable.Visible = scoreButton != null;
+ cardtable.Visible = cardButton != null;
+
+ if (button != null) {
+ nameentry.Text = button.Name;
+ colorbutton1.Color = Helpers.Misc.ToGdkColor (button.BackgroundColor);
+ colorbutton2.Color = Helpers.Misc.ToGdkColor (button.TextColor);
+ if (button.HotKey != null && button.HotKey.Defined)
+ hotKeyLabel.Text = button.HotKey.ToString ();
else
hotKeyLabel.Text = Catalog.GetString ("none");
} else {
nameentry.Text = "";
- colorbutton1.Color = new Gdk.Color(0,0,0);
- colorbutton2.Color = new Gdk.Color(0,0,0);
+ colorbutton1.Color = new Gdk.Color (0, 0, 0);
+ colorbutton2.Color = new Gdk.Color (0, 0, 0);
lastLeadTime = new Time ();
tagmodecombobox.Active = 0;
leadtimebutton.Value = 0;
@@ -190,22 +184,29 @@ namespace LongoMatch.Gui.Component
sortmethodcombobox.Active = 0;
hotKeyLabel.Text = Catalog.GetString ("none");
}
- if (posTagger != null) {
- SetPositionCombo (fieldcombobox, posTagger.TagFieldPosition,
- posTagger.FieldPositionIsDistance);
- SetPositionCombo (hfieldcombobox, posTagger.TagHalfFieldPosition,
- posTagger.HalfFieldPositionIsDistance);
- SetPositionCombo (goalcombobox, posTagger.TagGoalPosition, false);
+ if (timedButton != null) {
+ lastLeadTime = timedButton.Start;
+ tagmodecombobox.Active = (int)timedButton.TagMode;
+ leadtimebutton.Value = timedButton.Start.Seconds;
+ lagtimebutton.Value = timedButton.Stop.Seconds;
}
- if(cat != null) {
- tagscheckbutton.Active = cat.ShowSubcategories;
- tprbutton.Value = cat.TagsPerRow;
+ if (eventButton != null) {
+ SetPositionCombo (fieldcombobox, eventButton.EventType.TagFieldPosition,
+ eventButton.EventType.FieldPositionIsDistance);
+ SetPositionCombo (hfieldcombobox, eventButton.EventType.TagHalfFieldPosition,
+ eventButton.EventType.HalfFieldPositionIsDistance);
+ SetPositionCombo (goalcombobox, eventButton.EventType.TagGoalPosition, false);
}
- if (score != null) {
- pointsbutton.Value = score.Points;
+ if (catButton != null) {
+ sortmethodcombobox.Active = (int)catButton.AnalysisEventType.SortMethod;
+ tagscheckbutton.Active = catButton.ShowSubcategories;
+ tprbutton.Value = catButton.TagsPerRow;
}
- if (card != null) {
- shapecombobox.Active = (int) card.Shape;
+ if (scoreButton != null) {
+ pointsbutton.Value = scoreButton.Score.Points;
+ }
+ if (cardButton != null) {
+ shapecombobox.Active = (int)cardButton.PenaltyCard.Shape;
}
ignore = false;
Edited = false;
@@ -213,19 +214,19 @@ namespace LongoMatch.Gui.Component
void HandleChangeHotkey(object sender, System.EventArgs e)
{
- if (ignore == true)
+ if (ignore)
return;
HotKeySelectorDialog dialog = new HotKeySelectorDialog();
dialog.TransientFor=(Gtk.Window)this.Toplevel;
- HotKey prevHotKey = cat.HotKey;
+ HotKey prevHotKey = catButton.HotKey;
if(dialog.Run() == (int)ResponseType.Ok) {
- cat.HotKey=dialog.HotKey;
+ catButton.HotKey=dialog.HotKey;
UpdateGui();
}
dialog.Destroy();
if(HotKeyChanged != null)
- HotKeyChanged(prevHotKey,cat);
+ HotKeyChanged(prevHotKey,catButton);
Edited = true;
}
@@ -238,47 +239,47 @@ namespace LongoMatch.Gui.Component
ReadPositionCombo (sender as ComboBox, out tag, out trayectory);
if (sender == fieldcombobox) {
- posTagger.TagFieldPosition = tag;
- posTagger.FieldPositionIsDistance = trayectory;
+ eventButton.EventType.TagFieldPosition = tag;
+ eventButton.EventType.FieldPositionIsDistance = trayectory;
} else if (sender == hfieldcombobox) {
- posTagger.TagHalfFieldPosition = tag;
- posTagger.HalfFieldPositionIsDistance = trayectory;
+ eventButton.EventType.TagHalfFieldPosition = tag;
+ eventButton.EventType.HalfFieldPositionIsDistance = trayectory;
} else {
- posTagger.TagGoalPosition = tag;
+ eventButton.EventType.TagGoalPosition = tag;
}
Edited = true;
}
void HandleTagsPerRowValueChanged (object sender, EventArgs e)
{
- if (ignore == true)
+ if (ignore)
return;
- cat.TagsPerRow = tprbutton.ValueAsInt;
+ catButton.TagsPerRow = tprbutton.ValueAsInt;
Edited = true;
}
void HandleTagsToggled (object sender, EventArgs e)
{
- if (ignore == true)
+ if (ignore)
return;
- cat.ShowSubcategories = tagscheckbutton.Active;
+ catButton.ShowSubcategories = tagscheckbutton.Active;
Edited = true;
}
void HandleTagModeChanged (object sender, EventArgs e)
{
- if (ignore == true)
+ if (ignore)
return;
- tagger.TagMode = (TagMode) tagmodecombobox.Active;
- if (tagger.TagMode == TagMode.Predefined) {
+ timedButton.TagMode = (TagMode) tagmodecombobox.Active;
+ if (timedButton.TagMode == TagMode.Predefined) {
lagtimebutton.Sensitive = true;
leadtimebutton.Value = lastLeadTime.Seconds;
} else {
lagtimebutton.Sensitive = false;
- lastLeadTime = tagger.Start;
+ lastLeadTime = timedButton.Start;
leadtimebutton.Value = 0;
}
Edited = true;
@@ -286,69 +287,69 @@ namespace LongoMatch.Gui.Component
void HandleColorSet (object sender, EventArgs e)
{
- if (ignore == true)
+ if (ignore)
return;
LongoMatch.Common.Color c = Helpers.Misc.ToLgmColor((sender as ColorButton).Color);
if (sender == colorbutton1) {
- tagger.Color = c;
+ button.BackgroundColor = c;
} else {
- tagger.TextColor = c;
+ button.TextColor = c;
}
Edited = true;
}
void HandleLeadTimeChanged(object sender, System.EventArgs e)
{
- if (ignore == true)
+ if (ignore)
return;
- tagger.Start = new Time{Seconds=(int)leadtimebutton.Value};
+ timedButton.Start = new Time{Seconds=(int)leadtimebutton.Value};
Edited = true;
}
void HandleLagTimeChanged(object sender, System.EventArgs e)
{
- if (ignore == true)
+ if (ignore)
return;
- tagger.Stop = new Time{Seconds=(int)lagtimebutton.Value};
+ timedButton.Stop = new Time{Seconds=(int)lagtimebutton.Value};
Edited = true;
}
void HandleNameentryChanged(object sender, System.EventArgs e)
{
- if (ignore == true)
+ if (ignore)
return;
- tagger.Name = nameentry.Text;
+ button.Name = nameentry.Text;
Edited = true;
}
void HandleSortMethodChanged(object sender, System.EventArgs e)
{
- if (ignore == true)
+ if (ignore)
return;
- tagger.SortMethodString = sortmethodcombobox.ActiveText;
+ catButton.EventType.SortMethodString = sortmethodcombobox.ActiveText;
Edited = true;
}
void HandleShapeChanged (object sender, EventArgs e)
{
- if (ignore == true)
+ if (ignore)
return;
- card.Shape = (CardShape) shapecombobox.Active;
+ cardButton.PenaltyCard.Shape = (CardShape) shapecombobox.Active;
Edited = true;
}
void HandlePointsChanged (object sender, EventArgs e)
{
- if (ignore == true)
+ if (ignore)
return;
- score.Points = pointsbutton.ValueAsInt;
+ scoreButton.Score.Points = pointsbutton.ValueAsInt;
Edited = true;
}
diff --git a/LongoMatch.GUI/Gui/Component/CodingWidget.cs b/LongoMatch.GUI/Gui/Component/CodingWidget.cs
index b7dee63..270ff31 100644
--- a/LongoMatch.GUI/Gui/Component/CodingWidget.cs
+++ b/LongoMatch.GUI/Gui/Component/CodingWidget.cs
@@ -36,7 +36,7 @@ namespace LongoMatch.Gui.Component
ProjectType projectType;
Project project;
List<Player> selectedPlayers;
- Play loadedPlay;
+ TimelineEvent loadedPlay;
List<Window> activeWindows;
int currentPage;
Gdk.Pixbuf timelineIco, timelineActiveIco;
@@ -108,17 +108,17 @@ namespace LongoMatch.Gui.Component
this.project = project;
buttonswidget.Visible = true;
if (project != null) {
- buttonswidget.Template = project.Categories;
+ buttonswidget.Template = project.Dashboard;
}
teamtagger.LoadTeams (project.LocalTeamTemplate, project.VisitorTeamTemplate,
- project.Categories.FieldBackground);
+ project.Dashboard.FieldBackground);
if (projectType == ProjectType.FileProject) {
timeline.SetProject (project, filter);
}
playspositionviewer1.LoadProject (project);
}
- public void AddPlay (Play play)
+ public void AddPlay (TimelineEvent play)
{
if (projectType == ProjectType.FileProject) {
timeline.AddPlay (play);
@@ -126,7 +126,7 @@ namespace LongoMatch.Gui.Component
playspositionviewer1.AddPlay (play);
}
- public void DeletePlays (List<Play> plays)
+ public void DeletePlays (List<TimelineEvent> plays)
{
if (projectType == ProjectType.FileProject) {
timeline.RemovePlays (plays);
@@ -218,7 +218,7 @@ namespace LongoMatch.Gui.Component
currentPage = (int)args.PageNum;
}
- void HandlePlayLoaded (Play play)
+ void HandlePlayLoaded (TimelineEvent play)
{
loadedPlay = play;
timeline.SelectedTimeNode = play;
@@ -245,19 +245,17 @@ namespace LongoMatch.Gui.Component
selectedPlayers = players.ToList();
}
- void HandleNewTagEvent (TaggerButton tagger, List<Player> players, List<Tag> tags, Time
start, Time stop)
+ void HandleNewTagEvent (EventType eventType, List<Player> players, List<Tag> tags,
+ Time start, Time stop, Score score, PenaltyCard card)
{
- if (tagger is AnalysisCategory) {
- AnalysisCategory cat = tagger as AnalysisCategory;
- Play play = project.AddPlay (cat, start, stop, null);
- play.Players = selectedPlayers ?? new List<Player> ();
- play.Tags = tags ?? new List<Tag> ();
- if (cat.TagFieldPosition || cat.TagGoalPosition || cat.TagHalfFieldPosition) {
- Config.GUIToolkit.EditPlay (play, project, false, true, false, false);
- }
- teamtagger.ClearSelection ();
- Config.EventsBroker.EmitNewPlay (play);
+ TimelineEvent play = project.AddEvent (eventType, start, stop, null, score, card,
false);
+ play.Players = selectedPlayers ?? new List<Player> ();
+ play.Tags = tags ?? new List<Tag> ();
+ if (eventType.TagFieldPosition || eventType.TagGoalPosition ||
eventType.TagHalfFieldPosition) {
+ Config.GUIToolkit.EditPlay (play, project, false, true, false, false);
}
+ teamtagger.ClearSelection ();
+ Config.EventsBroker.EmitNewPlay (play);
}
}
diff --git a/LongoMatch.GUI/Gui/Component/DashboardWidget.cs b/LongoMatch.GUI/Gui/Component/DashboardWidget.cs
index 299c61a..0df571b 100644
--- a/LongoMatch.GUI/Gui/Component/DashboardWidget.cs
+++ b/LongoMatch.GUI/Gui/Component/DashboardWidget.cs
@@ -42,9 +42,9 @@ namespace LongoMatch.Gui.Component
public event NewTagHandler NewTagEvent;
TagMode tagMode;
- Dashboard tagger;
- Categories template;
- TaggerButton selected;
+ DashboardCanvas tagger;
+ Dashboard template;
+ DashboardButton selected;
Gtk.Image editimage;
ToggleToolButton editbutton;
RadioToolButton d11button, fillbutton, fitbutton;
@@ -53,7 +53,7 @@ namespace LongoMatch.Gui.Component
public DashboardWidget()
{
this.Build();
- tagger = new Dashboard (new WidgetWrapper (drawingarea));
+ tagger = new DashboardCanvas (new WidgetWrapper (drawingarea));
tagger.TaggersSelectedEvent += HandleTaggersSelectedEvent;
tagger.ShowMenuEvent += HandleShowMenuEvent;
tagger.NewTagEvent += HandleNewTagEvent;
@@ -126,7 +126,7 @@ namespace LongoMatch.Gui.Component
}
}
- public Categories Template {
+ public Dashboard Template {
set {
template = value;
tagger.Template = value;
@@ -171,35 +171,37 @@ namespace LongoMatch.Gui.Component
}
}
- public void Refresh (TaggerButton b = null) {
+ public void Refresh (DashboardButton b = null) {
tagger.Refresh (b);
}
public void AddButton (string buttontype) {
- TaggerButton tagger = null;
+ DashboardButton button = null;
if (buttontype == "Card") {
- tagger = new PenaltyCard ("Red", Color.Red, CardShape.Rectangle);
+ button = new PenaltyCardButton {
+ PenaltyCard = new PenaltyCard ("Red", Color.Red,
CardShape.Rectangle)};
} else if (buttontype == "Score") {
- tagger = new Score ("Score", 1);
+ button = new ScoreButton {
+ Score = new Score ("Score", 1)};
} else if (buttontype == "Timer") {
- tagger = new Timer {Name = "Timer"};
+ button = new TimerButton {Timer = new Timer {Name = "Timer"}};
} else if (buttontype == "Tag") {
- tagger = new TagButton {Name = "Tag"};
+ button = new TagButton {Tag = new Tag ("Tag", Constants.COMMON_TAG)};
} else if (buttontype == "Category") {
- tagger = template.AddDefaultItem (template.List.Count);
+ button = template.AddDefaultItem (template.List.Count);
} else {
return;
}
- if (!(tagger is Category)) {
- template.List.Add (tagger);
+ if (buttontype != "Category") {
+ template.List.Add (button);
}
- tagger.Position = new Point (template.CanvasWidth, 0);
- Refresh (tagger);
+ button.Position = new Point (template.CanvasWidth, 0);
+ Refresh (button);
}
- void RemoveButton (TaggerButton button) {
+ void RemoveButton (DashboardButton button) {
string msg = Catalog.GetString ("Do you want to delete: ") +
button.Name + "?";
if (Config.GUIToolkit.QuestionMessage (msg, null, this)) {
@@ -265,7 +267,7 @@ namespace LongoMatch.Gui.Component
}
}
- void HandleTaggersSelectedEvent (List<TaggerButton> taggers)
+ void HandleTaggersSelectedEvent (List<DashboardButton> taggers)
{
if (taggers.Count == 1) {
selected = taggers[0];
@@ -313,7 +315,7 @@ namespace LongoMatch.Gui.Component
}
}
- void HandleShowMenuEvent (TaggerButton taggerbutton, Tag tag)
+ void HandleShowMenuEvent (DashboardButton taggerbutton, Tag tag)
{
Menu menu;
MenuItem delbut, deltag;
@@ -332,7 +334,7 @@ namespace LongoMatch.Gui.Component
Catalog.GetString ("Delete tag:"),
tag.Value));
deltag.Activated += (sender, e) => {
- (taggerbutton as Category).Tags.Remove (tag);
+ (taggerbutton as AnalysisEventButton).AnalysisEventType.Tags.Remove
(tag);
Edited = true;
tagger.Refresh (taggerbutton);
};
@@ -359,26 +361,22 @@ namespace LongoMatch.Gui.Component
}
}
- void HandleNewTagEvent (TaggerButton button, List<Player> players,
- List<Tag> tags, Time start, Time stop)
+ void HandleNewTagEvent (EventType evntType, List<Player> players, List<Tag> tags,
+ Time start, Time stop, Score score, PenaltyCard card)
{
- if (button is TagButton || button is Timer) {
- return;
- }
-
/* Forward event until we have players integrted in the dashboard layout */
if (NewTagEvent != null) {
- NewTagEvent (button , players, tags, start, stop);
+ NewTagEvent (evntType , players, tags, start, stop, score, card);
}
//Config.EventsBroker.EmitNewTag (button, players, tags, start, stop);
}
- void HandleAddNewTagEvent (TaggerButton taggerbutton)
+ void HandleAddNewTagEvent (DashboardButton taggerbutton)
{
string res = MessagesHelpers.QueryMessage (this, Catalog.GetString ("Name"),
Catalog.GetString ("New tag"));
- if (res != null && res != "") {
- (taggerbutton as Category).Tags.Add (new Tag (res));
+ if (!string.IsNullOrEmpty (res)) {
+ (taggerbutton as AnalysisEventButton).AnalysisEventType.Tags.Add (new Tag
(res));
tagger.Refresh (null);
}
}
diff --git a/LongoMatch.GUI/Gui/Component/NotesWidget.cs b/LongoMatch.GUI/Gui/Component/NotesWidget.cs
index 39d144b..6051050 100644
--- a/LongoMatch.GUI/Gui/Component/NotesWidget.cs
+++ b/LongoMatch.GUI/Gui/Component/NotesWidget.cs
@@ -31,7 +31,7 @@ namespace LongoMatch.Gui.Component
public partial class NotesWidget : Gtk.Bin
{
TextBuffer buf;
- Play play;
+ TimelineEvent play;
public NotesWidget()
{
@@ -47,7 +47,7 @@ namespace LongoMatch.Gui.Component
base.OnDestroyed ();
}
- public Play Play {
+ public TimelineEvent Play {
set {
play = value;
Notes = play.Notes;
@@ -70,7 +70,7 @@ namespace LongoMatch.Gui.Component
}
}
- void HandlePlayLoaded (Play play)
+ void HandlePlayLoaded (TimelineEvent play)
{
Play = play;
}
diff --git a/LongoMatch.GUI/Gui/Component/PlayersListTreeWidget.cs
b/LongoMatch.GUI/Gui/Component/PlayersListTreeWidget.cs
index 361567a..50338b7 100644
--- a/LongoMatch.GUI/Gui/Component/PlayersListTreeWidget.cs
+++ b/LongoMatch.GUI/Gui/Component/PlayersListTreeWidget.cs
@@ -57,7 +57,7 @@ namespace LongoMatch.Gui.Component
}
}
- public void SetTeam(TeamTemplate template, List<Play> plays) {
+ public void SetTeam(TeamTemplate template, List<TimelineEvent> plays) {
TreeStore team;
Dictionary<Player, TreeIter> playersDict = new Dictionary<Player, TreeIter>();
@@ -98,7 +98,7 @@ namespace LongoMatch.Gui.Component
PlaylistPlayElement element;
playerstreeview.Model.GetIter(out iter, path);
- element = new PlaylistPlayElement (playerstreeview.Model.GetValue(iter, 0) as
Play,
+ element = new PlaylistPlayElement (playerstreeview.Model.GetValue(iter, 0) as
TimelineEvent,
Project.Description.File);
playlist.Elements.Add (element);
}
diff --git a/LongoMatch.GUI/Gui/Component/PlaysCoordinatesTagger.cs
b/LongoMatch.GUI/Gui/Component/PlaysCoordinatesTagger.cs
index 0a32113..c6141a0 100644
--- a/LongoMatch.GUI/Gui/Component/PlaysCoordinatesTagger.cs
+++ b/LongoMatch.GUI/Gui/Component/PlaysCoordinatesTagger.cs
@@ -15,18 +15,11 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
//
-using System;
-using System.Collections.Generic;
-using Gtk;
-using Gdk;
-
-using LongoMatch.Store;
-using LongoMatch.Store.Templates;
using LongoMatch.Common;
-
-using Point = LongoMatch.Common.Point;
-using Image = LongoMatch.Common.Image;
using LongoMatch.Stats;
+using LongoMatch.Store;
+using Image = LongoMatch.Common.Image;
+using Point = LongoMatch.Common.Point;
namespace LongoMatch.Gui.Component
{
@@ -56,10 +49,10 @@ namespace LongoMatch.Gui.Component
public void LoadStats (CategoryStats stats) {
}
- public void LoadPlay (Play play) {
- field.Visible = play.Category.TagFieldPosition;
- hfield.Visible = play.Category.TagHalfFieldPosition;
- goal.Visible = play.Category.TagGoalPosition;
+ public void LoadPlay (TimelineEvent play) {
+ field.Visible = play.EventType.TagFieldPosition;
+ hfield.Visible = play.EventType.TagHalfFieldPosition;
+ goal.Visible = play.EventType.TagGoalPosition;
play.AddDefaultPositions ();
diff --git a/LongoMatch.GUI/Gui/Component/PlaysListTreeWidget.cs
b/LongoMatch.GUI/Gui/Component/PlaysListTreeWidget.cs
index d9d42d6..6b8e1cf 100644
--- a/LongoMatch.GUI/Gui/Component/PlaysListTreeWidget.cs
+++ b/LongoMatch.GUI/Gui/Component/PlaysListTreeWidget.cs
@@ -21,14 +21,10 @@
using System;
using System.Collections.Generic;
using Gtk;
-using Mono.Unix;
-using LongoMatch.Gui.Dialog;
-using LongoMatch.Handlers;
-using LongoMatch.Interfaces;
-using LongoMatch.Store;
-using LongoMatch.Store.Templates;
using LongoMatch.Common;
+using LongoMatch.Store;
using LongoMatch.Store.Playlists;
+using LongoMatch.Gui.Dialog;
namespace LongoMatch.Gui.Component
{
@@ -40,13 +36,14 @@ namespace LongoMatch.Gui.Component
{
Project project;
- Dictionary<TaggerButton, TreeIter> itersDic = new Dictionary<TaggerButton, TreeIter> ();
+ Dictionary<EventType, TreeIter> itersDic;
public PlaysListTreeWidget()
{
this.Build();
treeview.EditProperties += OnEditProperties;
treeview.NewRenderingJob += OnNewRenderingJob;
+ itersDic = new Dictionary<EventType, TreeIter> ();
Config.EventsBroker.PlayLoadedEvent += HandlePlayLoaded;
}
@@ -62,7 +59,7 @@ namespace LongoMatch.Gui.Component
}
}
- public void RemovePlays(List<Play> plays) {
+ public void RemovePlays(List<TimelineEvent> plays) {
TreeIter iter, child;
TreeStore model;
List<TreeIter> removeIters;
@@ -82,7 +79,7 @@ namespace LongoMatch.Gui.Component
model.IterChildren(out child, iter);
do {
- Play play = (Play) model.GetValue(child,0);
+ TimelineEvent play = (TimelineEvent) model.GetValue(child,0);
if(plays.Contains(play)) {
removeIters.Add(child);
}
@@ -96,13 +93,13 @@ namespace LongoMatch.Gui.Component
}
}
- public void AddPlay(Play play) {
+ public void AddPlay(TimelineEvent play) {
TreeIter categoryIter;
if(project == null)
return;
- var cat = play.Category;
+ var cat = play.EventType;
var model = (TreeStore)treeview.Model;
categoryIter = itersDic[cat];
var playIter = model.AppendValues(categoryIter,play);
@@ -134,50 +131,29 @@ namespace LongoMatch.Gui.Component
Gtk.TreeIter iter;
Gtk.TreeStore dataFileListStore = new Gtk.TreeStore (typeof(object));
- itersDic = new Dictionary<TaggerButton, TreeIter> ();
- /* Add scores */
- if (project.Categories.Scores.Count > 0) {
- iter = dataFileListStore.AppendValues (
- new Score { Name = Catalog.GetString ("Score"),
- SortMethod = SortMethodType.SortByStartTime,
- Color = Config.Style.PaletteActive}, null);
- foreach (Score s in project.Categories.Scores) {
- itersDic.Add(s, iter);
- }
- }
-
- /* Add penalty cards*/
- if (project.Categories.PenaltyCards.Count > 0) {
- iter = dataFileListStore.AppendValues (
- new PenaltyCard { Name = Catalog.GetString ("Penalty Cards"),
- SortMethod = SortMethodType.SortByStartTime,
- Color = Config.Style.PaletteActive}, null);
- foreach (PenaltyCard pc in project.Categories.PenaltyCards) {
- itersDic.Add(pc, iter);
- }
- }
-
- foreach(TaggerButton cat in project.Categories.CategoriesList) {
- iter = dataFileListStore.AppendValues(cat);
- itersDic.Add(cat, iter);
+ itersDic.Clear ();
+
+ foreach(EventType evType in project.EventTypes) {
+ iter = dataFileListStore.AppendValues(evType);
+ itersDic.Add(evType, iter);
}
- var queryPlaysByCategory = project.PlaysGroupedByCategory;
+ var queryPlaysByCategory = project.PlaysGroupedByEventType;
foreach(var playsGroup in queryPlaysByCategory) {
- TaggerButton cat = playsGroup.Key;
+ EventType cat = playsGroup.Key;
if(!itersDic.ContainsKey(cat))
continue;
- foreach(Play play in playsGroup) {
+ foreach(TimelineEvent play in playsGroup) {
dataFileListStore.AppendValues(itersDic[cat], play);
}
}
return dataFileListStore;
}
- protected virtual void OnEditProperties(AnalysisCategory cat) {
- EditCategoryDialog dialog = new EditCategoryDialog(project, cat);
- dialog.Run();
- dialog.Destroy();
+ protected virtual void OnEditProperties(EventType eventType) {
+ //EditCategoryDialog dialog = new EditCategoryDialog (project, eventType);
+ //dialog.Run();
+ //dialog.Destroy();
}
protected virtual void OnNewRenderingJob (object sender, EventArgs args)
@@ -193,7 +169,7 @@ namespace LongoMatch.Gui.Component
PlaylistPlayElement element;
treeview.Model.GetIter(out iter, path);
- element = new PlaylistPlayElement (treeview.Model.GetValue(iter, 0) as Play,
+ element = new PlaylistPlayElement (treeview.Model.GetValue(iter, 0) as
TimelineEvent,
project.Description.File);
playlist.Elements.Add (element);
}
@@ -201,7 +177,7 @@ namespace LongoMatch.Gui.Component
Config.EventsBroker.EmitRenderPlaylist (playlist);
}
- void HandlePlayLoaded (Play play) {
+ void HandlePlayLoaded (TimelineEvent play) {
treeview.QueueDraw ();
}
}
diff --git a/LongoMatch.GUI/Gui/Component/PlaysPositionViewer.cs
b/LongoMatch.GUI/Gui/Component/PlaysPositionViewer.cs
index 2966574..ba303d7 100644
--- a/LongoMatch.GUI/Gui/Component/PlaysPositionViewer.cs
+++ b/LongoMatch.GUI/Gui/Component/PlaysPositionViewer.cs
@@ -55,21 +55,21 @@ namespace LongoMatch.Gui.Component
}
}
- public void AddPlay (Play play) {
+ public void AddPlay (TimelineEvent play) {
field.Tagger.AddPlay (play);
hfield.Tagger.AddPlay (play);
goal.Tagger.AddPlay (play);
QueueDraw ();
}
- public void RemovePlays (List<Play> plays) {
+ public void RemovePlays (List<TimelineEvent> plays) {
field.Tagger.RemovePlays (plays);
hfield.Tagger.RemovePlays (plays);
goal.Tagger.RemovePlays (plays);
QueueDraw ();
}
- void HandlePlayLoaded (Play play)
+ void HandlePlayLoaded (TimelineEvent play)
{
if (play != null) {
field.Tagger.SelectPlay (play);
@@ -82,7 +82,7 @@ namespace LongoMatch.Gui.Component
}
}
- void HandleShowMenuEvent (List<Play> plays)
+ void HandleShowMenuEvent (List<TimelineEvent> plays)
{
if (plays == null || plays.Count == 0) {
return;
diff --git a/LongoMatch.GUI/Gui/Component/PlaysSelectionWidget.cs
b/LongoMatch.GUI/Gui/Component/PlaysSelectionWidget.cs
index 35455c9..960e1a2 100644
--- a/LongoMatch.GUI/Gui/Component/PlaysSelectionWidget.cs
+++ b/LongoMatch.GUI/Gui/Component/PlaysSelectionWidget.cs
@@ -92,12 +92,12 @@ namespace LongoMatch.Gui.Component
UpdateTeamsModels();
}
- public void AddPlay(Play play) {
+ public void AddPlay(TimelineEvent play) {
playsList.AddPlay(play);
UpdateTeamsModels();
}
- public void RemovePlays (List<Play> plays) {
+ public void RemovePlays (List<TimelineEvent> plays) {
playsList.RemovePlays(plays);
UpdateTeamsModels();
}
@@ -168,24 +168,6 @@ namespace LongoMatch.Gui.Component
localPlayersList.SetTeam(project.LocalTeamTemplate, project.Timeline);
visitorPlayersList.SetTeam(project.VisitorTeamTemplate, project.Timeline);
}
-
- protected void OnCategoriesFiltersbuttonClicked (object sender, System.EventArgs e)
- {
- if (catfiltersbutton.Active) {
- catfiltersbutton.Label = Catalog.GetString("Disable categories filters");
- } else {
- catfiltersbutton.Label = Catalog.GetString("Enable categories filters");
- }
- }
-
- protected void OnPlayersFiltersbuttonClicked (object sender, System.EventArgs e)
- {
- if (playersfiltersbutton.Active) {
- playersfiltersbutton.Label = Catalog.GetString("Disable players filters");
- } else {
- playersfiltersbutton.Label = Catalog.GetString("Enable players filters");
- }
- }
}
}
diff --git a/LongoMatch.GUI/Gui/Component/ProjectPeriods.cs b/LongoMatch.GUI/Gui/Component/ProjectPeriods.cs
index 75db06e..a10926c 100644
--- a/LongoMatch.GUI/Gui/Component/ProjectPeriods.cs
+++ b/LongoMatch.GUI/Gui/Component/ProjectPeriods.cs
@@ -66,13 +66,13 @@ namespace LongoMatch.Gui.Component
playerbin2.ShowControls = false;
- gamePeriods = value.Categories.GamePeriods;
+ gamePeriods = value.Dashboard.GamePeriods;
start = new Time (0);
duration = value.Description.File.Duration;
pDuration = new Time (duration.MSeconds / gamePeriods.Count);
List<Period> periods = new List<Period> ();
- gamePeriods = value.Categories.GamePeriods;
+ gamePeriods = value.Dashboard.GamePeriods;
timerule.Duration = duration;
SetZoom ();
diff --git a/LongoMatch.GUI/Gui/Component/Stats/CategoriesViewer.cs
b/LongoMatch.GUI/Gui/Component/Stats/CategoriesViewer.cs
index 786acea..8a40156 100644
--- a/LongoMatch.GUI/Gui/Component/Stats/CategoriesViewer.cs
+++ b/LongoMatch.GUI/Gui/Component/Stats/CategoriesViewer.cs
@@ -33,7 +33,7 @@ namespace LongoMatch.Gui.Component.Stats
public CategoriesViewer ()
{
this.Build ();
- store = new ListStore(typeof(Category), typeof(string));
+ store = new ListStore(typeof(EventType), typeof(string));
treeview.AppendColumn ("Desc", new Gtk.CellRendererText (), "text", 1);
treeview.CursorChanged += HandleCursorChanged;
treeview.Model = store;
diff --git a/LongoMatch.GUI/Gui/Component/Stats/PlayerCategoriesViewer.cs
b/LongoMatch.GUI/Gui/Component/Stats/PlayerCategoriesViewer.cs
index b38b1a6..268539f 100644
--- a/LongoMatch.GUI/Gui/Component/Stats/PlayerCategoriesViewer.cs
+++ b/LongoMatch.GUI/Gui/Component/Stats/PlayerCategoriesViewer.cs
@@ -31,7 +31,7 @@ namespace LongoMatch.Gui.Component.Stats
public PlayerCategoriesViewer ()
{
this.Build ();
- store = new ListStore(typeof(Category), typeof(string));
+ store = new ListStore(typeof(EventType), typeof(string));
treeview.AppendColumn ("Desc", new Gtk.CellRendererText (), "text", 1);
treeview.CursorChanged += HandleCursorChanged;
treeview.Model = store;
diff --git a/LongoMatch.GUI/Gui/Component/Stats/PlayersViewer.cs
b/LongoMatch.GUI/Gui/Component/Stats/PlayersViewer.cs
index e2de753..eb41c9d 100644
--- a/LongoMatch.GUI/Gui/Component/Stats/PlayersViewer.cs
+++ b/LongoMatch.GUI/Gui/Component/Stats/PlayersViewer.cs
@@ -54,14 +54,14 @@ namespace LongoMatch.Gui.Component.Stats
filter = new PlaysFilter (project);
pstats.Filter = filter;
categoriesviewer.LoadStats (pstats, project);
- AddTeam (project.LocalTeamTemplate, project.Categories);
- AddTeam (project.VisitorTeamTemplate, project.Categories);
+ AddTeam (project.LocalTeamTemplate, project.Dashboard);
+ AddTeam (project.VisitorTeamTemplate, project.Dashboard);
filter.Update();
store.GetIter (out first, new TreePath ("0:0"));
treeview1.Selection.SelectIter (first);
}
- void AddTeam (TeamTemplate tpl, Categories cats) {
+ void AddTeam (TeamTemplate tpl, Dashboard cats) {
TreeIter teamIter;
teamIter = store.AppendValues (tpl.TeamName, null);
diff --git a/LongoMatch.GUI/Gui/Component/Timeline.cs b/LongoMatch.GUI/Gui/Component/Timeline.cs
index b076284..4020f84 100644
--- a/LongoMatch.GUI/Gui/Component/Timeline.cs
+++ b/LongoMatch.GUI/Gui/Component/Timeline.cs
@@ -111,12 +111,12 @@ namespace LongoMatch.Gui.Component
QueueDraw ();
}
- public void AddPlay(Play play) {
+ public void AddPlay(TimelineEvent play) {
timeline.AddPlay (play);
QueueDraw ();
}
- public void RemovePlays(List<Play> plays) {
+ public void RemovePlays(List<TimelineEvent> plays) {
timeline.RemovePlays (plays);
QueueDraw ();
}
@@ -168,9 +168,9 @@ namespace LongoMatch.Gui.Component
QueueDraw ();
}
- void HandleShowMenu (List<Play> plays, AnalysisCategory cat, Time time)
+ void HandleShowMenu (List<TimelineEvent> plays, EventType eventType, Time time)
{
- menu.ShowTimelineMenu (project, plays, cat, time);
+ menu.ShowTimelineMenu (project, plays, eventType, time);
}
}
}
diff --git a/LongoMatch.GUI/Gui/Dialog/DrawingTool.cs b/LongoMatch.GUI/Gui/Dialog/DrawingTool.cs
index 97d2c72..c0e1013 100644
--- a/LongoMatch.GUI/Gui/Dialog/DrawingTool.cs
+++ b/LongoMatch.GUI/Gui/Dialog/DrawingTool.cs
@@ -38,7 +38,7 @@ namespace LongoMatch.Gui.Dialog
public partial class DrawingTool : Gtk.Dialog
{
- Play play;
+ TimelineEvent play;
Blackboard blackboard;
FrameDrawing drawing;
Drawable selectedDrawable;
@@ -289,7 +289,7 @@ namespace LongoMatch.Gui.Dialog
}
}
- public void LoadPlay (Play play, Image frame, FrameDrawing drawing) {
+ public void LoadPlay (TimelineEvent play, Image frame, FrameDrawing drawing) {
this.play = play;
this.drawing = drawing;
blackboard.Background = frame;
diff --git a/LongoMatch.GUI/Gui/Dialog/EditCategoryDialog.cs b/LongoMatch.GUI/Gui/Dialog/EditCategoryDialog.cs
index 4280e4f..bb33f63 100644
--- a/LongoMatch.GUI/Gui/Dialog/EditCategoryDialog.cs
+++ b/LongoMatch.GUI/Gui/Dialog/EditCategoryDialog.cs
@@ -18,26 +18,18 @@
using System;
using System.Collections.Generic;
-using Gtk;
-using Mono.Unix;
-
-using LongoMatch.Handlers;
-using LongoMatch.Gui;
-using LongoMatch.Gui.Component;
using LongoMatch.Gui.Helpers;
using LongoMatch.Store;
-using LongoMatch.Store.Templates;
-using LongoMatch.Interfaces;
+using Mono.Unix;
namespace LongoMatch.Gui.Dialog
{
-
public partial class EditCategoryDialog : Gtk.Dialog
{
- private List<HotKey> hkList;
+ List<HotKey> hkList;
- public EditCategoryDialog(Project project, TaggerButton tagger)
+ public EditCategoryDialog(Project project, DashboardButton tagger)
{
this.Build();
timenodeproperties2.Tagger = tagger;
@@ -52,16 +44,16 @@ namespace LongoMatch.Gui.Dialog
}
}
- protected virtual void OnHotKeyChanged(HotKey prevHotKey, Category category) {
- if(hkList.Contains(category.HotKey)) {
+ protected virtual void OnHotKeyChanged(HotKey prevHotKey, DashboardButton button) {
+ if(hkList.Contains(button.HotKey)) {
MessagesHelpers.WarningMessage(this,
Catalog.GetString("This hotkey is already in
use."));
- category.HotKey=prevHotKey;
- timenodeproperties2.Tagger = category; //Update Gui
+ button.HotKey=prevHotKey;
+ timenodeproperties2.Tagger = button; //Update Gui
}
- else if(category.HotKey.Defined) {
+ else if(button.HotKey.Defined) {
hkList.Remove(prevHotKey);
- hkList.Add(category.HotKey);
+ hkList.Add(button.HotKey);
}
}
}
diff --git a/LongoMatch.GUI/Gui/Dialog/PlayEditor.cs b/LongoMatch.GUI/Gui/Dialog/PlayEditor.cs
index cb581cd..bb23929 100644
--- a/LongoMatch.GUI/Gui/Dialog/PlayEditor.cs
+++ b/LongoMatch.GUI/Gui/Dialog/PlayEditor.cs
@@ -28,7 +28,7 @@ namespace LongoMatch.Gui.Dialog
public partial class PlayEditor : Gtk.Dialog
{
TeamTagger teamtagger;
- Play play;
+ TimelineEvent play;
public PlayEditor ()
{
@@ -46,13 +46,13 @@ namespace LongoMatch.Gui.Dialog
base.OnDestroyed ();
}
- public void LoadPlay (Play play, Project project, bool editTags, bool editPos, bool
editPlayers, bool editNotes)
+ public void LoadPlay (TimelineEvent play, Project project, bool editTags, bool editPos, bool
editPlayers, bool editNotes)
{
this.play = play;
notesframe.Visible = editNotes;
- tagger.Visible = editPos && (play.Category.TagFieldPosition ||
- play.Category.TagHalfFieldPosition ||
- play.Category.TagGoalPosition);
+ tagger.Visible = editPos && (play.EventType.TagFieldPosition ||
+ play.EventType.TagHalfFieldPosition ||
+ play.EventType.TagGoalPosition);
drawingarea3.Visible = editPlayers;
nameframe.Visible = editTags;
@@ -67,7 +67,7 @@ namespace LongoMatch.Gui.Dialog
}
if (editPlayers) {
teamtagger.LoadTeams (project.LocalTeamTemplate, project.VisitorTeamTemplate,
- project.Categories.FieldBackground);
+ project.Dashboard.FieldBackground);
teamtagger.Select (play.Players);
}
}
diff --git a/LongoMatch.GUI/Gui/GUIToolkit.cs b/LongoMatch.GUI/Gui/GUIToolkit.cs
index 1aaed9c..6c635ae 100644
--- a/LongoMatch.GUI/Gui/GUIToolkit.cs
+++ b/LongoMatch.GUI/Gui/GUIToolkit.cs
@@ -199,7 +199,7 @@ namespace LongoMatch.Gui
return jobs;
}
- public void ExportFrameSeries(Project openedProject, Play play, string snapshotsDir) {
+ public void ExportFrameSeries(Project openedProject, TimelineEvent play, string snapshotsDir)
{
SnapshotsDialog sd;
uint interval;
string seriesName;
@@ -226,14 +226,14 @@ namespace LongoMatch.Gui
sd.Destroy();
}
- public void EditPlay (Play play, Project project, bool editTags, bool editPos, bool
editPlayers, bool editNotes) {
+ public void EditPlay (TimelineEvent play, Project project, bool editTags, bool editPos, bool
editPlayers, bool editNotes) {
PlayEditor dialog = new PlayEditor ();
dialog.LoadPlay (play, project, editTags, editPos, editPlayers, editNotes);
dialog.Run();
dialog.Destroy();
}
- public void DrawingTool (Image image, Play play, FrameDrawing drawing) {
+ public void DrawingTool (Image image, TimelineEvent play, FrameDrawing drawing) {
DrawingTool dialog = new DrawingTool();
dialog.Show ();
diff --git a/LongoMatch.GUI/Gui/Menu/PlaysMenu.cs b/LongoMatch.GUI/Gui/Menu/PlaysMenu.cs
index 34b1da5..9b063cc 100644
--- a/LongoMatch.GUI/Gui/Menu/PlaysMenu.cs
+++ b/LongoMatch.GUI/Gui/Menu/PlaysMenu.cs
@@ -33,8 +33,8 @@ namespace LongoMatch.Gui.Menus
MenuItem edit, newPlay, del, addPLN, snapshot, render;
MenuItem duplicate, moveCat, drawings;
- List<Play> plays;
- AnalysisCategory cat;
+ List<TimelineEvent> plays;
+ EventType eventType;
Time time;
Project project;
@@ -44,29 +44,29 @@ namespace LongoMatch.Gui.Menus
CreateMenu ();
}
- public void ShowListMenu (Project project, List<Play> plays) {
- ShowMenu (project, plays, null, null, project.Categories.CategoriesList, true);
+ public void ShowListMenu (Project project, List<TimelineEvent> plays) {
+ ShowMenu (project, plays, null, null, project.EventTypes, true);
}
- public void ShowMenu (Project project, List<Play> plays) {
+ public void ShowMenu (Project project, List<TimelineEvent> plays) {
ShowMenu (project, plays, null, null, null, false);
}
- public void ShowTimelineMenu (Project project, List<Play> plays, AnalysisCategory cat, Time
time)
+ public void ShowTimelineMenu (Project project, List<TimelineEvent> plays, EventType
eventType, Time time)
{
- ShowMenu (project, plays, cat, time, null, false);
+ ShowMenu (project, plays, eventType, time, null, false);
}
- private void ShowMenu (Project project, List<Play> plays, AnalysisCategory cat, Time time,
- List<Category> categories, bool editableName)
+ private void ShowMenu (Project project, List<TimelineEvent> plays, EventType eventType, Time
time,
+ List<EventType> eventTypes, bool editableName)
{
this.plays = plays;
- this.cat = cat;
+ this.eventType = eventType;
this.time = time;
this.project = project;
- if (cat != null) {
- string label = String.Format ("{0} in {1}", Catalog.GetString ("Add new
play"), cat.Name);
+ if (eventType != null) {
+ string label = String.Format ("{0} in {1}", Catalog.GetString ("Add new
play"), eventType.Name);
GtkGlue.MenuItemSetLabel (newPlay, label);
newPlay.Visible = true;
} else {
@@ -74,11 +74,11 @@ namespace LongoMatch.Gui.Menus
}
if (plays == null)
- plays = new List<Play> ();
+ plays = new List<TimelineEvent> ();
edit.Visible = editableName;
snapshot.Visible = plays.Count == 1;
- moveCat.Visible = plays.Count == 1 && categories != null;
+ moveCat.Visible = plays.Count == 1 && eventTypes != null;
drawings.Visible = plays.Count == 1 && plays [0].Drawings.Count > 0;
del.Visible = plays.Count > 0;
addPLN.Visible = plays.Count > 0;
@@ -98,8 +98,8 @@ namespace LongoMatch.Gui.Menus
if (moveCat.Visible) {
Menu catMenu = new Menu ();
- foreach (Category c in categories) {
- if (plays [0].Category == c)
+ foreach (EventType c in eventTypes) {
+ if (plays [0].EventType == c)
continue;
var item = new MenuItem (c.Name);
catMenu.Append (item);
@@ -209,13 +209,15 @@ namespace LongoMatch.Gui.Menus
void HandleNePlayActivated (object sender, EventArgs e)
{
- Config.EventsBroker.EmitNewTag (cat, null, null, time - cat.Start, time + cat.Stop);
+ Config.EventsBroker.EmitNewTag (eventType, null, null,
+ time - new Time {Seconds = 10},
+ time + new Time {Seconds = 10});
}
- void EmitRenderPlaylist (List<Play> plays)
+ void EmitRenderPlaylist (List<TimelineEvent> plays)
{
Playlist pl = new Playlist();
- foreach (Play p in plays) {
+ foreach (TimelineEvent p in plays) {
pl.Elements.Add (new PlaylistPlayElement (p, project.Description.File));
}
Config.EventsBroker.EmitRenderPlaylist (pl);
diff --git a/LongoMatch.GUI/Gui/Panel/NewProjectPanel.cs b/LongoMatch.GUI/Gui/Panel/NewProjectPanel.cs
index e65c5cb..9f6cb27 100644
--- a/LongoMatch.GUI/Gui/Panel/NewProjectPanel.cs
+++ b/LongoMatch.GUI/Gui/Panel/NewProjectPanel.cs
@@ -16,6 +16,7 @@
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
//
using System;
+using System.Linq;
using System.Collections.Generic;
using Gtk;
using Gdk;
@@ -54,7 +55,7 @@ namespace LongoMatch.Gui.Panel
IGUIToolkit gtoolkit;
Color red;
TeamTemplate hometemplate, awaytemplate;
- Categories analysisTemplate;
+ Dashboard analysisTemplate;
TeamTagger teamtagger;
public NewProjectPanel (Project project)
@@ -171,7 +172,7 @@ namespace LongoMatch.Gui.Panel
tagscombobox.Visible = false;
analysislabel.Visible = false;
filetable.Visible = true;
- analysisTemplate = project.Categories;
+ analysisTemplate = project.Dashboard;
LoadTemplate (project.LocalTeamTemplate, Team.LOCAL);
LoadTemplate (project.VisitorTeamTemplate, Team.VISITOR);
}
@@ -305,7 +306,7 @@ namespace LongoMatch.Gui.Panel
}
}
project = new Project ();
- project.Categories = analysisTemplate;
+ project.Dashboard = analysisTemplate;
project.LocalTeamTemplate = hometemplate;
project.VisitorTeamTemplate = awaytemplate;
project.Description = new ProjectDescription ();
@@ -315,6 +316,7 @@ namespace LongoMatch.Gui.Panel
project.Description.Season = seasonentry.Text;
project.Description.LocalName = project.LocalTeamTemplate.TeamName;
project.Description.VisitorName = project.VisitorTeamTemplate.TeamName;
+ project.UpdateEventTypes ();
encSettings = new EncodingSettings ();
captureSettings = new CaptureSettings ();
diff --git a/LongoMatch.GUI/Gui/Panel/ProjectsManagerPanel.cs
b/LongoMatch.GUI/Gui/Panel/ProjectsManagerPanel.cs
index 16ee74f..0323a06 100644
--- a/LongoMatch.GUI/Gui/Panel/ProjectsManagerPanel.cs
+++ b/LongoMatch.GUI/Gui/Panel/ProjectsManagerPanel.cs
@@ -79,7 +79,7 @@ namespace LongoMatch.Gui.Panel
localSpinButton.Value = pd.LocalGoals;
visitorSpinButton.Value = pd.VisitorGoals;
datelabel.Text = pd.MatchDate.ToShortDateString ();
- templatelabel.Text = project.Categories.Name;
+ templatelabel.Text = project.Dashboard.Name;
if (f.Preview != null) {
fileimage.Pixbuf = f.Preview.Value;
diff --git a/LongoMatch.GUI/Gui/Panel/SportsTemplatesPanel.cs
b/LongoMatch.GUI/Gui/Panel/SportsTemplatesPanel.cs
index 9c7039c..712775a 100644
--- a/LongoMatch.GUI/Gui/Panel/SportsTemplatesPanel.cs
+++ b/LongoMatch.GUI/Gui/Panel/SportsTemplatesPanel.cs
@@ -37,7 +37,7 @@ namespace LongoMatch.Gui.Panel
ListStore templates;
List<string> selectedTemplate;
- Categories loadedTemplate;
+ Dashboard loadedTemplate;
ICategoriesTemplatesProvider provider;
@@ -127,7 +127,7 @@ namespace LongoMatch.Gui.Panel
bool first = true;
templates.Clear ();
- foreach (Categories template in provider.Templates) {
+ foreach (Dashboard template in provider.Templates) {
Pixbuf img;
TreeIter iter;
@@ -278,8 +278,8 @@ namespace LongoMatch.Gui.Panel
if (dialog.SelectedTemplate != null) {
provider.Copy (dialog.SelectedTemplate, dialog.Text);
} else {
- Categories template;
- template = Categories.DefaultTemplate (dialog.Count);
+ Dashboard template;
+ template = Dashboard.DefaultTemplate (dialog.Count);
template.Name = dialog.Text;
provider.Save (template);
}
diff --git a/LongoMatch.GUI/Gui/TreeView/CategoriesFilterTreeView.cs
b/LongoMatch.GUI/Gui/TreeView/CategoriesFilterTreeView.cs
index 2ee1df9..8b2e835 100644
--- a/LongoMatch.GUI/Gui/TreeView/CategoriesFilterTreeView.cs
+++ b/LongoMatch.GUI/Gui/TreeView/CategoriesFilterTreeView.cs
@@ -31,7 +31,8 @@ namespace LongoMatch.Gui.Component
[System.ComponentModel.ToolboxItem(true)]
public class CategoriesFilterTreeView: FilterTreeViewBase
{
- Categories categories;
+ Dashboard categories;
+ Project project;
public CategoriesFilterTreeView (): base()
{
@@ -40,17 +41,25 @@ namespace LongoMatch.Gui.Component
}
public override void SetFilter (PlaysFilter filter, Project project) {
- this.categories = project.Categories;
+ this.project = project;
+ this.categories = project.Dashboard;
base.SetFilter(filter, project);
}
- protected override void FillTree () {
- store = new TreeStore (typeof (object), typeof (bool));
+ protected override void FillTree ()
+ {
+ store = new TreeStore (typeof(object), typeof(bool));
- foreach (Category cat in categories.CategoriesList) {
+ foreach (EventType evType in project.EventTypes) {
TreeIter catIter;
- catIter = store.AppendValues(cat, filter.VisibleCategories.Contains(cat));
+ catIter = store.AppendValues (evType, true);
+
+ if (evType is AnalysisEventType) {
+ foreach (Tag tag in (evType as AnalysisEventType).Tags) {
+ store.AppendValues(catIter, tag, true);
+ }
+ }
}
Model = store;
}
@@ -59,19 +68,19 @@ namespace LongoMatch.Gui.Component
TreeIter child, parent;
object o = store.GetValue(iter, 0);
+ store.IterParent (out parent, iter);
- if (o is StringObject) {
- StringObject so = o as StringObject;
+ if (o is Tag) {
+ EventType evType = store.GetValue (parent, 0) as EventType;
+ filter.FilterCategoryTag (evType, o as Tag, active);
} else {
/* don't do anything here and let the children do the filtering */
}
store.SetValue(iter, 1, active);
/* Check its parents */
- if (active && checkParents) {
- if (store.IterParent(out parent, iter)) {
- UpdateSelectionPriv (parent, active, true, false);
- }
+ if (active && checkParents && store.IterIsValid (parent)) {
+ UpdateSelectionPriv (parent, active, true, false);
}
/* Check/Uncheck all children */
@@ -96,12 +105,12 @@ namespace LongoMatch.Gui.Component
object obj = store.GetValue(iter, 0);
string text = "";
- if (obj is Category) {
- Category cat = obj as Category;
- text = cat.Name;
+ if (obj is EventType) {
+ EventType evType = obj as EventType;
+ text = evType.Name;
}
- else if (obj is StringObject){
- text = (obj as StringObject).Value;
+ else if (obj is Tag){
+ text = (obj as Tag).Value;
}
(cell as CellRendererText).Text = text;
@@ -117,11 +126,5 @@ namespace LongoMatch.Gui.Component
}
}
}
-
- class StringObject
- {
- public string Value {get;set;}
- public Category Category {get;set;}
- }
}
diff --git a/LongoMatch.GUI/Gui/TreeView/FilterBaseView.cs b/LongoMatch.GUI/Gui/TreeView/FilterBaseView.cs
index 8937ba5..156ee27 100644
--- a/LongoMatch.GUI/Gui/TreeView/FilterBaseView.cs
+++ b/LongoMatch.GUI/Gui/TreeView/FilterBaseView.cs
@@ -107,7 +107,7 @@ namespace LongoMatch.Gui.Component
protected override bool OnButtonPressEvent (Gdk.EventButton evnt)
{
- if((evnt.Type == EventType.ButtonPress) && (evnt.Button == 3))
+ if((evnt.Type == Gdk.EventType.ButtonPress) && (evnt.Button == 3))
playersMenu.Popup();
return base.OnButtonPressEvent (evnt);
}
diff --git a/LongoMatch.GUI/Gui/TreeView/ListTreeViewBase.cs b/LongoMatch.GUI/Gui/TreeView/ListTreeViewBase.cs
index 717e715..941fda0 100644
--- a/LongoMatch.GUI/Gui/TreeView/ListTreeViewBase.cs
+++ b/LongoMatch.GUI/Gui/TreeView/ListTreeViewBase.cs
@@ -109,16 +109,16 @@ namespace LongoMatch.Gui.Component
}
}
- protected Play SelectedPlay {
+ protected TimelineEvent SelectedPlay {
get {
- return GetValueFromPath(Selection.GetSelectedRows()[0]) as Play;
+ return GetValueFromPath(Selection.GetSelectedRows()[0]) as TimelineEvent;
}
}
- protected List<Play> SelectedPlays {
+ protected List<TimelineEvent> SelectedPlays {
get {
return Selection.GetSelectedRows().Select (
- p => GetValueFromPath(p) as Play).ToList ();
+ p => GetValueFromPath(p) as TimelineEvent).ToList ();
}
}
@@ -144,10 +144,10 @@ namespace LongoMatch.Gui.Component
Gtk.TreeIter iter;
modelFilter.GetIter(out iter, args.Path);
object item = modelFilter.GetValue(iter, 0);
- if(!(item is Play))
+ if(!(item is TimelineEvent))
return;
- Config.EventsBroker.EmitLoadPlay (item as Play);
+ Config.EventsBroker.EmitLoadPlay (item as TimelineEvent);
}
void HandleEditPlayEvent (object sender, EventArgs e)
diff --git a/LongoMatch.GUI/Gui/TreeView/PlayListTreeView.cs b/LongoMatch.GUI/Gui/TreeView/PlayListTreeView.cs
index 05b8d2a..03ee024 100644
--- a/LongoMatch.GUI/Gui/TreeView/PlayListTreeView.cs
+++ b/LongoMatch.GUI/Gui/TreeView/PlayListTreeView.cs
@@ -21,8 +21,6 @@ using System;
using Gtk;
using Gdk;
using Mono.Unix;
-using LongoMatch.Common;
-using LongoMatch.Handlers;
using LongoMatch.Store.Playlists;
using LongoMatch.Interfaces;
using LongoMatch.Gui.Dialog;
@@ -147,7 +145,7 @@ namespace LongoMatch.Gui.Component
protected override bool OnButtonPressEvent (Gdk.EventButton evnt)
{
- if ((evnt.Type == EventType.ButtonPress) && (evnt.Button == 3)) {
+ if ((evnt.Type == Gdk.EventType.ButtonPress) && (evnt.Button == 3)) {
TreePath path;
GetPathAtPos ((int)evnt.X, (int)evnt.Y, out path);
if (path != null) {
diff --git a/LongoMatch.GUI/Gui/TreeView/PlayersFilterTreeView.cs
b/LongoMatch.GUI/Gui/TreeView/PlayersFilterTreeView.cs
index 0d5df5a..8269869 100644
--- a/LongoMatch.GUI/Gui/TreeView/PlayersFilterTreeView.cs
+++ b/LongoMatch.GUI/Gui/TreeView/PlayersFilterTreeView.cs
@@ -80,19 +80,14 @@ namespace LongoMatch.Gui.Component
while (store.IterIsValid(child)) {
Player childPlayer = (Player) store.GetValue(child, 0);
-// if (active)
-// filter.UnFilterPlayer(childPlayer);
-// else
-// filter.FilterPlayer(childPlayer);
+ filter.FilterPlayer (childPlayer, active);
store.SetValue(child, 1, active);
store.IterNext(ref child);
}
} else {
- if (active) {
- //filter.UnFilterPlayer(player);
- } else {
+ filter.FilterPlayer (player, active);
+ if (!active) {
TreeIter team;
- //filter.FilterPlayer(player);
/* Uncheck the team check button */
if (local.List.Contains(player))
team = localIter;
@@ -116,7 +111,6 @@ namespace LongoMatch.Gui.Component
(cell as CellRendererText).Text = name;
}
-
protected override void Select(bool select_all) {
UpdateSelection(localIter, select_all);
UpdateSelection(visitorIter, select_all);
diff --git a/LongoMatch.GUI/Gui/TreeView/PlayersTreeView.cs b/LongoMatch.GUI/Gui/TreeView/PlayersTreeView.cs
index 610e12d..00b8327 100644
--- a/LongoMatch.GUI/Gui/TreeView/PlayersTreeView.cs
+++ b/LongoMatch.GUI/Gui/TreeView/PlayersTreeView.cs
@@ -64,7 +64,7 @@ namespace LongoMatch.Gui.Component
{
TreePath[] paths = Selection.GetSelectedRows();
- if((evnt.Type == EventType.ButtonPress) && (evnt.Button == 3))
+ if((evnt.Type == Gdk.EventType.ButtonPress) && (evnt.Button == 3))
{
// We don't want to unselect the play when several
// plays are selected and we clik the right button
@@ -76,7 +76,7 @@ namespace LongoMatch.Gui.Component
if(paths.Length == 1) {
TimeNode selectedTimeNode = GetValueFromPath(paths[0]) as TimeNode;
- if(selectedTimeNode is Play) {
+ if(selectedTimeNode is TimelineEvent) {
ShowMenu ();
}
}
diff --git a/LongoMatch.GUI/Gui/TreeView/PlaysTreeView.cs b/LongoMatch.GUI/Gui/TreeView/PlaysTreeView.cs
index 1f0f584..bb2e8ad 100644
--- a/LongoMatch.GUI/Gui/TreeView/PlaysTreeView.cs
+++ b/LongoMatch.GUI/Gui/TreeView/PlaysTreeView.cs
@@ -18,13 +18,12 @@
//
//
-using Gdk;
+using System;
using Gtk;
using LongoMatch.Common;
using LongoMatch.Handlers;
-using LongoMatch.Gui.Dialog;
using LongoMatch.Store;
-using System;
+using EventType = LongoMatch.Store.EventType;
namespace LongoMatch.Gui.Component
{
@@ -39,7 +38,7 @@ namespace LongoMatch.Gui.Component
//Categories menu
Menu categoriesMenu;
- private RadioAction sortByName, sortByStart, sortByStop, sortByDuration;
+ RadioAction sortByName, sortByStart, sortByStop, sortByDuration;
public PlaysTreeView() {
enableCategoryMove = true;
@@ -111,7 +110,7 @@ namespace LongoMatch.Gui.Component
sortByStop.Activated += OnSortActivated;
sortByDuration.Activated += OnSortActivated;
editProp.Activated += delegate(object sender, EventArgs e) {
- EditProperties(GetValueFromPath(Selection.GetSelectedRows()[0]) as
AnalysisCategory);
+ EditProperties(GetValueFromPath(Selection.GetSelectedRows()[0]) as EventType);
};
}
@@ -137,7 +136,7 @@ namespace LongoMatch.Gui.Component
TimeNode tna, tnb;
TreeIter parent;
int depth;
- AnalysisCategory category;
+ EventType eventType;
if(model == null)
return 0;
@@ -161,11 +160,11 @@ namespace LongoMatch.Gui.Component
return int.Parse(model.GetPath(a).ToString())
- int.Parse(model.GetPath(b).ToString());
- category = model.GetValue(parent,0) as AnalysisCategory;
+ eventType = model.GetValue(parent,0) as EventType;
tna = model.GetValue(a, 0)as TimeNode;
tnb = model.GetValue(b, 0) as TimeNode;
- switch(category.SortMethod) {
+ switch(eventType.SortMethod) {
case(SortMethodType.SortByName):
return String.Compare(tna.Name, tnb.Name);
case(SortMethodType.SortByStartTime):
@@ -180,20 +179,20 @@ namespace LongoMatch.Gui.Component
}
private void OnSortActivated(object o, EventArgs args) {
- AnalysisCategory category;
+ EventType eventType;
RadioAction sender;
sender = o as RadioAction;
- category = GetValueFromPath(Selection.GetSelectedRows()[0]) as AnalysisCategory;
+ eventType = GetValueFromPath(Selection.GetSelectedRows()[0]) as EventType;
if(sender == sortByName)
- category.SortMethod = SortMethodType.SortByName;
+ eventType.SortMethod = SortMethodType.SortByName;
else if(sender == sortByStart)
- category.SortMethod = SortMethodType.SortByStartTime;
+ eventType.SortMethod = SortMethodType.SortByStartTime;
else if(sender == sortByStop)
- category.SortMethod = SortMethodType.SortByStopTime;
+ eventType.SortMethod = SortMethodType.SortByStopTime;
else
- category.SortMethod = SortMethodType.SortByDuration;
+ eventType.SortMethod = SortMethodType.SortByDuration;
// Redorder plays
Model.SetSortFunc(0, SortFunction);
}
@@ -202,9 +201,9 @@ namespace LongoMatch.Gui.Component
// Don't allow multiselect for categories
if(!selected && selection.GetSelectedRows().Length > 0) {
if(selection.GetSelectedRows().Length == 1 &&
- GetValueFromPath(selection.GetSelectedRows()[0]) is
AnalysisCategory)
+ GetValueFromPath(selection.GetSelectedRows()[0]) is EventType)
return false;
- return !(GetValueFromPath(path) is AnalysisCategory);
+ return !(GetValueFromPath(path) is EventType);
}
// Always unselect
else
@@ -215,7 +214,7 @@ namespace LongoMatch.Gui.Component
{
TreePath[] paths = Selection.GetSelectedRows();
- if((evnt.Type == EventType.ButtonPress) && (evnt.Button == 3))
+ if((evnt.Type == Gdk.EventType.ButtonPress) && (evnt.Button == 3))
{
// We don't want to unselect the play when several
// plays are selected and we clik the right button
@@ -231,11 +230,9 @@ namespace LongoMatch.Gui.Component
if (selectedTimeNode != null) {
ShowMenu ();
} else {
- AnalysisCategory cat = GetValueFromPath(paths[0]) as
AnalysisCategory;
- if (!(cat is Score) && !(cat is PenaltyCard)) {
- SetupSortMenu(cat.SortMethod);
- categoriesMenu.Popup();
- }
+ EventType eventType = GetValueFromPath(paths[0]) as EventType;
+ SetupSortMenu(eventType.SortMethod);
+ categoriesMenu.Popup();
}
}
else if(paths.Length > 1) {
diff --git a/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Component.CategoryProperties.cs
b/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Component.CategoryProperties.cs
index 1270bcd..99fc01a 100644
--- a/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Component.CategoryProperties.cs
+++ b/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Component.CategoryProperties.cs
@@ -8,14 +8,19 @@ namespace LongoMatch.Gui.Component
private global::Gtk.Table table2;
private global::Gtk.ColorButton colorbutton1;
private global::Gtk.ColorButton colorbutton2;
+ private global::Gtk.HBox hbox5;
+ private global::Gtk.Label hotKeyLabel;
+ private global::Gtk.Button changebuton;
private global::Gtk.Label label1;
private global::Gtk.Label label13;
private global::Gtk.Label label4;
+ private global::Gtk.Label label6;
+ private global::Gtk.Entry nameentry;
+ private global::Gtk.Table timetable;
private global::Gtk.Label label7;
private global::Gtk.Label label8;
private global::Gtk.SpinButton lagtimebutton;
private global::Gtk.SpinButton leadtimebutton;
- private global::Gtk.Entry nameentry;
private global::Gtk.Label taglabel;
private global::Gtk.ComboBox tagmodecombobox;
private global::Gtk.Table postable;
@@ -26,12 +31,8 @@ namespace LongoMatch.Gui.Component
private global::Gtk.Label label11;
private global::Gtk.Label label12;
private global::Gtk.Table cattable;
- private global::Gtk.HBox hbox5;
- private global::Gtk.Label hotKeyLabel;
- private global::Gtk.Button changebuton;
private global::Gtk.Label label14;
private global::Gtk.Label label15;
- private global::Gtk.Label label6;
private global::Gtk.Label label9;
private global::Gtk.ComboBox sortmethodcombobox;
private global::Gtk.CheckButton tagscheckbutton;
@@ -54,8 +55,7 @@ namespace LongoMatch.Gui.Component
this.vbox3.Name = "vbox3";
this.vbox3.Spacing = 6;
// Container child vbox3.Gtk.Box+BoxChild
- this.table2 = new global::Gtk.Table (((uint)(6)), ((uint)(2)), true);
- this.table2.Name = "table2";
+ this.table2 = new global::Gtk.Table (((uint)(4)), ((uint)(2)), true);
this.table2.RowSpacing = ((uint)(6));
this.table2.ColumnSpacing = ((uint)(6));
// Container child table2.Gtk.Table+TableChild
@@ -85,15 +85,48 @@ namespace LongoMatch.Gui.Component
w2.XOptions = ((global::Gtk.AttachOptions)(4));
w2.YOptions = ((global::Gtk.AttachOptions)(4));
// Container child table2.Gtk.Table+TableChild
+ this.hbox5 = new global::Gtk.HBox ();
+ this.hbox5.Name = "hbox5";
+ this.hbox5.Spacing = 6;
+ // Container child hbox5.Gtk.Box+BoxChild
+ this.hotKeyLabel = new global::Gtk.Label ();
+ this.hotKeyLabel.Name = "hotKeyLabel";
+ this.hotKeyLabel.LabelProp = global::Mono.Unix.Catalog.GetString ("none");
+ this.hbox5.Add (this.hotKeyLabel);
+ global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.hbox5
[this.hotKeyLabel]));
+ w3.Position = 0;
+ w3.Expand = false;
+ w3.Fill = false;
+ // Container child hbox5.Gtk.Box+BoxChild
+ this.changebuton = new global::Gtk.Button ();
+ this.changebuton.Sensitive = false;
+ this.changebuton.CanFocus = true;
+ this.changebuton.Name = "changebuton";
+ this.changebuton.UseUnderline = true;
+ this.changebuton.Label = global::Mono.Unix.Catalog.GetString ("Change");
+ this.hbox5.Add (this.changebuton);
+ global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.hbox5
[this.changebuton]));
+ w4.Position = 1;
+ w4.Expand = false;
+ w4.Fill = false;
+ this.table2.Add (this.hbox5);
+ global::Gtk.Table.TableChild w5 = ((global::Gtk.Table.TableChild)(this.table2
[this.hbox5]));
+ w5.TopAttach = ((uint)(3));
+ w5.BottomAttach = ((uint)(4));
+ w5.LeftAttach = ((uint)(1));
+ w5.RightAttach = ((uint)(2));
+ w5.XOptions = ((global::Gtk.AttachOptions)(4));
+ w5.YOptions = ((global::Gtk.AttachOptions)(4));
+ // Container child table2.Gtk.Table+TableChild
this.label1 = new global::Gtk.Label ();
this.label1.Name = "label1";
this.label1.Xalign = 1F;
this.label1.LabelProp = global::Mono.Unix.Catalog.GetString ("<span
font_desc=\"10\">Name</span>");
this.label1.UseMarkup = true;
this.table2.Add (this.label1);
- global::Gtk.Table.TableChild w3 = ((global::Gtk.Table.TableChild)(this.table2
[this.label1]));
- w3.XOptions = ((global::Gtk.AttachOptions)(4));
- w3.YOptions = ((global::Gtk.AttachOptions)(4));
+ global::Gtk.Table.TableChild w6 = ((global::Gtk.Table.TableChild)(this.table2
[this.label1]));
+ w6.XOptions = ((global::Gtk.AttachOptions)(4));
+ w6.YOptions = ((global::Gtk.AttachOptions)(4));
// Container child table2.Gtk.Table+TableChild
this.label13 = new global::Gtk.Label ();
this.label13.Name = "label13";
@@ -101,10 +134,10 @@ namespace LongoMatch.Gui.Component
this.label13.LabelProp = global::Mono.Unix.Catalog.GetString ("<span
font_desc=\"10\">Text color</span>");
this.label13.UseMarkup = true;
this.table2.Add (this.label13);
- global::Gtk.Table.TableChild w4 = ((global::Gtk.Table.TableChild)(this.table2
[this.label13]));
- w4.TopAttach = ((uint)(2));
- w4.BottomAttach = ((uint)(3));
- w4.YOptions = ((global::Gtk.AttachOptions)(4));
+ global::Gtk.Table.TableChild w7 = ((global::Gtk.Table.TableChild)(this.table2
[this.label13]));
+ w7.TopAttach = ((uint)(2));
+ w7.BottomAttach = ((uint)(3));
+ w7.YOptions = ((global::Gtk.AttachOptions)(4));
// Container child table2.Gtk.Table+TableChild
this.label4 = new global::Gtk.Label ();
this.label4.Name = "label4";
@@ -112,108 +145,125 @@ namespace LongoMatch.Gui.Component
this.label4.LabelProp = global::Mono.Unix.Catalog.GetString ("<span
font_desc=\"10\">Color</span>");
this.label4.UseMarkup = true;
this.table2.Add (this.label4);
- global::Gtk.Table.TableChild w5 = ((global::Gtk.Table.TableChild)(this.table2
[this.label4]));
- w5.TopAttach = ((uint)(1));
- w5.BottomAttach = ((uint)(2));
- w5.XOptions = ((global::Gtk.AttachOptions)(4));
- w5.YOptions = ((global::Gtk.AttachOptions)(4));
+ global::Gtk.Table.TableChild w8 = ((global::Gtk.Table.TableChild)(this.table2
[this.label4]));
+ w8.TopAttach = ((uint)(1));
+ w8.BottomAttach = ((uint)(2));
+ w8.XOptions = ((global::Gtk.AttachOptions)(4));
+ w8.YOptions = ((global::Gtk.AttachOptions)(4));
// Container child table2.Gtk.Table+TableChild
+ this.label6 = new global::Gtk.Label ();
+ this.label6.Name = "label6";
+ this.label6.Xalign = 1F;
+ this.label6.LabelProp = global::Mono.Unix.Catalog.GetString ("<span
font_desc=\"10\">HotKey</span>");
+ this.label6.UseMarkup = true;
+ this.table2.Add (this.label6);
+ global::Gtk.Table.TableChild w9 = ((global::Gtk.Table.TableChild)(this.table2
[this.label6]));
+ w9.TopAttach = ((uint)(3));
+ w9.BottomAttach = ((uint)(4));
+ w9.XOptions = ((global::Gtk.AttachOptions)(4));
+ w9.YOptions = ((global::Gtk.AttachOptions)(4));
+ // Container child table2.Gtk.Table+TableChild
+ this.nameentry = new global::Gtk.Entry ();
+ this.nameentry.WidthRequest = 76;
+ this.nameentry.CanFocus = true;
+ this.nameentry.Name = "nameentry";
+ this.nameentry.IsEditable = true;
+ this.nameentry.InvisibleChar = '●';
+ this.table2.Add (this.nameentry);
+ global::Gtk.Table.TableChild w10 = ((global::Gtk.Table.TableChild)(this.table2
[this.nameentry]));
+ w10.LeftAttach = ((uint)(1));
+ w10.RightAttach = ((uint)(2));
+ w10.YOptions = ((global::Gtk.AttachOptions)(4));
+ this.vbox3.Add (this.table2);
+ global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.table2]));
+ w11.Position = 0;
+ w11.Expand = false;
+ w11.Fill = false;
+ // Container child vbox3.Gtk.Box+BoxChild
+ this.timetable = new global::Gtk.Table (((uint)(3)), ((uint)(2)), true);
+ this.timetable.Name = "timetable";
+ this.timetable.RowSpacing = ((uint)(6));
+ this.timetable.ColumnSpacing = ((uint)(6));
+ // Container child timetable.Gtk.Table+TableChild
this.label7 = new global::Gtk.Label ();
this.label7.Name = "label7";
this.label7.Xalign = 1F;
this.label7.LabelProp = global::Mono.Unix.Catalog.GetString ("<span
font_desc=\"10\">Lead time (s)</span>");
this.label7.UseMarkup = true;
- this.table2.Add (this.label7);
- global::Gtk.Table.TableChild w6 = ((global::Gtk.Table.TableChild)(this.table2
[this.label7]));
- w6.TopAttach = ((uint)(4));
- w6.BottomAttach = ((uint)(5));
- w6.XOptions = ((global::Gtk.AttachOptions)(4));
- w6.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table2.Gtk.Table+TableChild
+ this.timetable.Add (this.label7);
+ global::Gtk.Table.TableChild w12 = ((global::Gtk.Table.TableChild)(this.timetable
[this.label7]));
+ w12.TopAttach = ((uint)(1));
+ w12.BottomAttach = ((uint)(2));
+ w12.XOptions = ((global::Gtk.AttachOptions)(4));
+ w12.YOptions = ((global::Gtk.AttachOptions)(4));
+ // Container child timetable.Gtk.Table+TableChild
this.label8 = new global::Gtk.Label ();
this.label8.Name = "label8";
this.label8.Xalign = 1F;
this.label8.LabelProp = global::Mono.Unix.Catalog.GetString ("<span
font_desc=\"10\">Lag time (s)</span>");
this.label8.UseMarkup = true;
- this.table2.Add (this.label8);
- global::Gtk.Table.TableChild w7 = ((global::Gtk.Table.TableChild)(this.table2
[this.label8]));
- w7.TopAttach = ((uint)(5));
- w7.BottomAttach = ((uint)(6));
- w7.XOptions = ((global::Gtk.AttachOptions)(4));
- w7.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table2.Gtk.Table+TableChild
+ this.timetable.Add (this.label8);
+ global::Gtk.Table.TableChild w13 = ((global::Gtk.Table.TableChild)(this.timetable
[this.label8]));
+ w13.TopAttach = ((uint)(2));
+ w13.BottomAttach = ((uint)(3));
+ w13.XOptions = ((global::Gtk.AttachOptions)(4));
+ w13.YOptions = ((global::Gtk.AttachOptions)(4));
+ // Container child timetable.Gtk.Table+TableChild
this.lagtimebutton = new global::Gtk.SpinButton (0, 1000, 1);
this.lagtimebutton.CanFocus = true;
this.lagtimebutton.Name = "lagtimebutton";
this.lagtimebutton.Adjustment.PageIncrement = 1;
this.lagtimebutton.ClimbRate = 1;
this.lagtimebutton.Numeric = true;
- this.table2.Add (this.lagtimebutton);
- global::Gtk.Table.TableChild w8 = ((global::Gtk.Table.TableChild)(this.table2
[this.lagtimebutton]));
- w8.TopAttach = ((uint)(5));
- w8.BottomAttach = ((uint)(6));
- w8.LeftAttach = ((uint)(1));
- w8.RightAttach = ((uint)(2));
- w8.XOptions = ((global::Gtk.AttachOptions)(4));
- w8.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table2.Gtk.Table+TableChild
+ this.timetable.Add (this.lagtimebutton);
+ global::Gtk.Table.TableChild w14 = ((global::Gtk.Table.TableChild)(this.timetable
[this.lagtimebutton]));
+ w14.TopAttach = ((uint)(2));
+ w14.BottomAttach = ((uint)(3));
+ w14.LeftAttach = ((uint)(1));
+ w14.RightAttach = ((uint)(2));
+ w14.XOptions = ((global::Gtk.AttachOptions)(4));
+ w14.YOptions = ((global::Gtk.AttachOptions)(4));
+ // Container child timetable.Gtk.Table+TableChild
this.leadtimebutton = new global::Gtk.SpinButton (0, 1000, 1);
this.leadtimebutton.CanFocus = true;
this.leadtimebutton.Name = "leadtimebutton";
this.leadtimebutton.Adjustment.PageIncrement = 1;
this.leadtimebutton.ClimbRate = 1;
this.leadtimebutton.Numeric = true;
- this.table2.Add (this.leadtimebutton);
- global::Gtk.Table.TableChild w9 = ((global::Gtk.Table.TableChild)(this.table2
[this.leadtimebutton]));
- w9.TopAttach = ((uint)(4));
- w9.BottomAttach = ((uint)(5));
- w9.LeftAttach = ((uint)(1));
- w9.RightAttach = ((uint)(2));
- w9.XOptions = ((global::Gtk.AttachOptions)(4));
- w9.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table2.Gtk.Table+TableChild
- this.nameentry = new global::Gtk.Entry ();
- this.nameentry.WidthRequest = 76;
- this.nameentry.CanFocus = true;
- this.nameentry.Name = "nameentry";
- this.nameentry.IsEditable = true;
- this.nameentry.InvisibleChar = '●';
- this.table2.Add (this.nameentry);
- global::Gtk.Table.TableChild w10 = ((global::Gtk.Table.TableChild)(this.table2
[this.nameentry]));
- w10.LeftAttach = ((uint)(1));
- w10.RightAttach = ((uint)(2));
- w10.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table2.Gtk.Table+TableChild
+ this.timetable.Add (this.leadtimebutton);
+ global::Gtk.Table.TableChild w15 = ((global::Gtk.Table.TableChild)(this.timetable
[this.leadtimebutton]));
+ w15.TopAttach = ((uint)(1));
+ w15.BottomAttach = ((uint)(2));
+ w15.LeftAttach = ((uint)(1));
+ w15.RightAttach = ((uint)(2));
+ w15.XOptions = ((global::Gtk.AttachOptions)(4));
+ w15.YOptions = ((global::Gtk.AttachOptions)(4));
+ // Container child timetable.Gtk.Table+TableChild
this.taglabel = new global::Gtk.Label ();
this.taglabel.Name = "taglabel";
this.taglabel.Xalign = 1F;
this.taglabel.LabelProp = global::Mono.Unix.Catalog.GetString ("<span
font_desc=\"10\">Tag mode</span>");
this.taglabel.UseMarkup = true;
- this.table2.Add (this.taglabel);
- global::Gtk.Table.TableChild w11 = ((global::Gtk.Table.TableChild)(this.table2
[this.taglabel]));
- w11.TopAttach = ((uint)(3));
- w11.BottomAttach = ((uint)(4));
- w11.XOptions = ((global::Gtk.AttachOptions)(4));
- w11.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table2.Gtk.Table+TableChild
+ this.timetable.Add (this.taglabel);
+ global::Gtk.Table.TableChild w16 = ((global::Gtk.Table.TableChild)(this.timetable
[this.taglabel]));
+ w16.XOptions = ((global::Gtk.AttachOptions)(4));
+ w16.YOptions = ((global::Gtk.AttachOptions)(4));
+ // Container child timetable.Gtk.Table+TableChild
this.tagmodecombobox = global::Gtk.ComboBox.NewText ();
this.tagmodecombobox.AppendText (global::Mono.Unix.Catalog.GetString ("Automatic"));
this.tagmodecombobox.AppendText (global::Mono.Unix.Catalog.GetString ("Manual"));
this.tagmodecombobox.Name = "tagmodecombobox";
this.tagmodecombobox.Active = 0;
- this.table2.Add (this.tagmodecombobox);
- global::Gtk.Table.TableChild w12 = ((global::Gtk.Table.TableChild)(this.table2
[this.tagmodecombobox]));
- w12.TopAttach = ((uint)(3));
- w12.BottomAttach = ((uint)(4));
- w12.LeftAttach = ((uint)(1));
- w12.RightAttach = ((uint)(2));
- w12.XOptions = ((global::Gtk.AttachOptions)(4));
- w12.YOptions = ((global::Gtk.AttachOptions)(4));
- this.vbox3.Add (this.table2);
- global::Gtk.Box.BoxChild w13 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.table2]));
- w13.Position = 0;
- w13.Expand = false;
- w13.Fill = false;
+ this.timetable.Add (this.tagmodecombobox);
+ global::Gtk.Table.TableChild w17 = ((global::Gtk.Table.TableChild)(this.timetable
[this.tagmodecombobox]));
+ w17.LeftAttach = ((uint)(1));
+ w17.RightAttach = ((uint)(2));
+ w17.YOptions = ((global::Gtk.AttachOptions)(4));
+ this.vbox3.Add (this.timetable);
+ global::Gtk.Box.BoxChild w18 = ((global::Gtk.Box.BoxChild)(this.vbox3
[this.timetable]));
+ w18.Position = 1;
+ w18.Expand = false;
+ w18.Fill = false;
// Container child vbox3.Gtk.Box+BoxChild
this.postable = new global::Gtk.Table (((uint)(3)), ((uint)(2)), true);
this.postable.Name = "postable";
@@ -227,11 +277,11 @@ namespace LongoMatch.Gui.Component
this.fieldcombobox.Name = "fieldcombobox";
this.fieldcombobox.Active = 0;
this.postable.Add (this.fieldcombobox);
- global::Gtk.Table.TableChild w14 = ((global::Gtk.Table.TableChild)(this.postable
[this.fieldcombobox]));
- w14.LeftAttach = ((uint)(1));
- w14.RightAttach = ((uint)(2));
- w14.XOptions = ((global::Gtk.AttachOptions)(4));
- w14.YOptions = ((global::Gtk.AttachOptions)(4));
+ global::Gtk.Table.TableChild w19 = ((global::Gtk.Table.TableChild)(this.postable
[this.fieldcombobox]));
+ w19.LeftAttach = ((uint)(1));
+ w19.RightAttach = ((uint)(2));
+ w19.XOptions = ((global::Gtk.AttachOptions)(4));
+ w19.YOptions = ((global::Gtk.AttachOptions)(4));
// Container child postable.Gtk.Table+TableChild
this.goalcombobox = global::Gtk.ComboBox.NewText ();
this.goalcombobox.AppendText (global::Mono.Unix.Catalog.GetString ("Not tagged"));
@@ -239,13 +289,13 @@ namespace LongoMatch.Gui.Component
this.goalcombobox.Name = "goalcombobox";
this.goalcombobox.Active = 0;
this.postable.Add (this.goalcombobox);
- global::Gtk.Table.TableChild w15 = ((global::Gtk.Table.TableChild)(this.postable
[this.goalcombobox]));
- w15.TopAttach = ((uint)(2));
- w15.BottomAttach = ((uint)(3));
- w15.LeftAttach = ((uint)(1));
- w15.RightAttach = ((uint)(2));
- w15.XOptions = ((global::Gtk.AttachOptions)(4));
- w15.YOptions = ((global::Gtk.AttachOptions)(4));
+ global::Gtk.Table.TableChild w20 = ((global::Gtk.Table.TableChild)(this.postable
[this.goalcombobox]));
+ w20.TopAttach = ((uint)(2));
+ w20.BottomAttach = ((uint)(3));
+ w20.LeftAttach = ((uint)(1));
+ w20.RightAttach = ((uint)(2));
+ w20.XOptions = ((global::Gtk.AttachOptions)(4));
+ w20.YOptions = ((global::Gtk.AttachOptions)(4));
// Container child postable.Gtk.Table+TableChild
this.hfieldcombobox = global::Gtk.ComboBox.NewText ();
this.hfieldcombobox.AppendText (global::Mono.Unix.Catalog.GetString ("Not tagged"));
@@ -254,13 +304,13 @@ namespace LongoMatch.Gui.Component
this.hfieldcombobox.Name = "hfieldcombobox";
this.hfieldcombobox.Active = 0;
this.postable.Add (this.hfieldcombobox);
- global::Gtk.Table.TableChild w16 = ((global::Gtk.Table.TableChild)(this.postable
[this.hfieldcombobox]));
- w16.TopAttach = ((uint)(1));
- w16.BottomAttach = ((uint)(2));
- w16.LeftAttach = ((uint)(1));
- w16.RightAttach = ((uint)(2));
- w16.XOptions = ((global::Gtk.AttachOptions)(4));
- w16.YOptions = ((global::Gtk.AttachOptions)(4));
+ global::Gtk.Table.TableChild w21 = ((global::Gtk.Table.TableChild)(this.postable
[this.hfieldcombobox]));
+ w21.TopAttach = ((uint)(1));
+ w21.BottomAttach = ((uint)(2));
+ w21.LeftAttach = ((uint)(1));
+ w21.RightAttach = ((uint)(2));
+ w21.XOptions = ((global::Gtk.AttachOptions)(4));
+ w21.YOptions = ((global::Gtk.AttachOptions)(4));
// Container child postable.Gtk.Table+TableChild
this.label10 = new global::Gtk.Label ();
this.label10.Name = "label10";
@@ -268,8 +318,8 @@ namespace LongoMatch.Gui.Component
this.label10.LabelProp = global::Mono.Unix.Catalog.GetString ("<span
font_desc=\"10\">Field position</span>");
this.label10.UseMarkup = true;
this.postable.Add (this.label10);
- global::Gtk.Table.TableChild w17 = ((global::Gtk.Table.TableChild)(this.postable
[this.label10]));
- w17.YOptions = ((global::Gtk.AttachOptions)(4));
+ global::Gtk.Table.TableChild w22 = ((global::Gtk.Table.TableChild)(this.postable
[this.label10]));
+ w22.YOptions = ((global::Gtk.AttachOptions)(4));
// Container child postable.Gtk.Table+TableChild
this.label11 = new global::Gtk.Label ();
this.label11.Name = "label11";
@@ -277,11 +327,11 @@ namespace LongoMatch.Gui.Component
this.label11.LabelProp = global::Mono.Unix.Catalog.GetString ("<span
font_desc=\"10\">Half field position</span>");
this.label11.UseMarkup = true;
this.postable.Add (this.label11);
- global::Gtk.Table.TableChild w18 = ((global::Gtk.Table.TableChild)(this.postable
[this.label11]));
- w18.TopAttach = ((uint)(1));
- w18.BottomAttach = ((uint)(2));
- w18.XOptions = ((global::Gtk.AttachOptions)(4));
- w18.YOptions = ((global::Gtk.AttachOptions)(4));
+ global::Gtk.Table.TableChild w23 = ((global::Gtk.Table.TableChild)(this.postable
[this.label11]));
+ w23.TopAttach = ((uint)(1));
+ w23.BottomAttach = ((uint)(2));
+ w23.XOptions = ((global::Gtk.AttachOptions)(4));
+ w23.YOptions = ((global::Gtk.AttachOptions)(4));
// Container child postable.Gtk.Table+TableChild
this.label12 = new global::Gtk.Label ();
this.label12.Name = "label12";
@@ -289,63 +339,31 @@ namespace LongoMatch.Gui.Component
this.label12.LabelProp = global::Mono.Unix.Catalog.GetString ("<span
font_desc=\"10\">Goal position</span>");
this.label12.UseMarkup = true;
this.postable.Add (this.label12);
- global::Gtk.Table.TableChild w19 = ((global::Gtk.Table.TableChild)(this.postable
[this.label12]));
- w19.TopAttach = ((uint)(2));
- w19.BottomAttach = ((uint)(3));
- w19.XOptions = ((global::Gtk.AttachOptions)(4));
- w19.YOptions = ((global::Gtk.AttachOptions)(4));
+ global::Gtk.Table.TableChild w24 = ((global::Gtk.Table.TableChild)(this.postable
[this.label12]));
+ w24.TopAttach = ((uint)(2));
+ w24.BottomAttach = ((uint)(3));
+ w24.XOptions = ((global::Gtk.AttachOptions)(4));
+ w24.YOptions = ((global::Gtk.AttachOptions)(4));
this.vbox3.Add (this.postable);
- global::Gtk.Box.BoxChild w20 = ((global::Gtk.Box.BoxChild)(this.vbox3
[this.postable]));
- w20.Position = 1;
- w20.Expand = false;
- w20.Fill = false;
+ global::Gtk.Box.BoxChild w25 = ((global::Gtk.Box.BoxChild)(this.vbox3
[this.postable]));
+ w25.Position = 2;
+ w25.Expand = false;
+ w25.Fill = false;
// Container child vbox3.Gtk.Box+BoxChild
- this.cattable = new global::Gtk.Table (((uint)(4)), ((uint)(2)), true);
+ this.cattable = new global::Gtk.Table (((uint)(3)), ((uint)(2)), true);
this.cattable.Name = "cattable";
this.cattable.RowSpacing = ((uint)(6));
this.cattable.ColumnSpacing = ((uint)(6));
// Container child cattable.Gtk.Table+TableChild
- this.hbox5 = new global::Gtk.HBox ();
- this.hbox5.Name = "hbox5";
- this.hbox5.Spacing = 6;
- // Container child hbox5.Gtk.Box+BoxChild
- this.hotKeyLabel = new global::Gtk.Label ();
- this.hotKeyLabel.Name = "hotKeyLabel";
- this.hotKeyLabel.LabelProp = global::Mono.Unix.Catalog.GetString ("none");
- this.hbox5.Add (this.hotKeyLabel);
- global::Gtk.Box.BoxChild w21 = ((global::Gtk.Box.BoxChild)(this.hbox5
[this.hotKeyLabel]));
- w21.Position = 0;
- w21.Expand = false;
- w21.Fill = false;
- // Container child hbox5.Gtk.Box+BoxChild
- this.changebuton = new global::Gtk.Button ();
- this.changebuton.Sensitive = false;
- this.changebuton.CanFocus = true;
- this.changebuton.Name = "changebuton";
- this.changebuton.UseUnderline = true;
- this.changebuton.Label = global::Mono.Unix.Catalog.GetString ("Change");
- this.hbox5.Add (this.changebuton);
- global::Gtk.Box.BoxChild w22 = ((global::Gtk.Box.BoxChild)(this.hbox5
[this.changebuton]));
- w22.Position = 1;
- w22.Expand = false;
- w22.Fill = false;
- this.cattable.Add (this.hbox5);
- global::Gtk.Table.TableChild w23 = ((global::Gtk.Table.TableChild)(this.cattable
[this.hbox5]));
- w23.TopAttach = ((uint)(2));
- w23.BottomAttach = ((uint)(3));
- w23.LeftAttach = ((uint)(1));
- w23.RightAttach = ((uint)(2));
- w23.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child cattable.Gtk.Table+TableChild
this.label14 = new global::Gtk.Label ();
this.label14.Name = "label14";
this.label14.Xalign = 1F;
this.label14.LabelProp = global::Mono.Unix.Catalog.GetString ("<span
font_desc=\"10\">Show tags</span>");
this.label14.UseMarkup = true;
this.cattable.Add (this.label14);
- global::Gtk.Table.TableChild w24 = ((global::Gtk.Table.TableChild)(this.cattable
[this.label14]));
- w24.XOptions = ((global::Gtk.AttachOptions)(4));
- w24.YOptions = ((global::Gtk.AttachOptions)(4));
+ global::Gtk.Table.TableChild w26 = ((global::Gtk.Table.TableChild)(this.cattable
[this.label14]));
+ w26.XOptions = ((global::Gtk.AttachOptions)(4));
+ w26.YOptions = ((global::Gtk.AttachOptions)(4));
// Container child cattable.Gtk.Table+TableChild
this.label15 = new global::Gtk.Label ();
this.label15.Name = "label15";
@@ -353,22 +371,10 @@ namespace LongoMatch.Gui.Component
this.label15.LabelProp = global::Mono.Unix.Catalog.GetString ("<span
font_desc=\"10\">Tags per row</span>");
this.label15.UseMarkup = true;
this.cattable.Add (this.label15);
- global::Gtk.Table.TableChild w25 = ((global::Gtk.Table.TableChild)(this.cattable
[this.label15]));
- w25.TopAttach = ((uint)(1));
- w25.BottomAttach = ((uint)(2));
- w25.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child cattable.Gtk.Table+TableChild
- this.label6 = new global::Gtk.Label ();
- this.label6.Name = "label6";
- this.label6.Xalign = 1F;
- this.label6.LabelProp = global::Mono.Unix.Catalog.GetString ("<span
font_desc=\"10\">HotKey</span>");
- this.label6.UseMarkup = true;
- this.cattable.Add (this.label6);
- global::Gtk.Table.TableChild w26 = ((global::Gtk.Table.TableChild)(this.cattable
[this.label6]));
- w26.TopAttach = ((uint)(2));
- w26.BottomAttach = ((uint)(3));
- w26.XOptions = ((global::Gtk.AttachOptions)(4));
- w26.YOptions = ((global::Gtk.AttachOptions)(4));
+ global::Gtk.Table.TableChild w27 = ((global::Gtk.Table.TableChild)(this.cattable
[this.label15]));
+ w27.TopAttach = ((uint)(1));
+ w27.BottomAttach = ((uint)(2));
+ w27.YOptions = ((global::Gtk.AttachOptions)(4));
// Container child cattable.Gtk.Table+TableChild
this.label9 = new global::Gtk.Label ();
this.label9.Name = "label9";
@@ -376,11 +382,11 @@ namespace LongoMatch.Gui.Component
this.label9.LabelProp = global::Mono.Unix.Catalog.GetString ("<span
font_desc=\"10\">Sort Method</span>");
this.label9.UseMarkup = true;
this.cattable.Add (this.label9);
- global::Gtk.Table.TableChild w27 = ((global::Gtk.Table.TableChild)(this.cattable
[this.label9]));
- w27.TopAttach = ((uint)(3));
- w27.BottomAttach = ((uint)(4));
- w27.XOptions = ((global::Gtk.AttachOptions)(4));
- w27.YOptions = ((global::Gtk.AttachOptions)(4));
+ global::Gtk.Table.TableChild w28 = ((global::Gtk.Table.TableChild)(this.cattable
[this.label9]));
+ w28.TopAttach = ((uint)(2));
+ w28.BottomAttach = ((uint)(3));
+ w28.XOptions = ((global::Gtk.AttachOptions)(4));
+ w28.YOptions = ((global::Gtk.AttachOptions)(4));
// Container child cattable.Gtk.Table+TableChild
this.sortmethodcombobox = global::Gtk.ComboBox.NewText ();
this.sortmethodcombobox.AppendText (global::Mono.Unix.Catalog.GetString ("Sort by
name"));
@@ -390,13 +396,13 @@ namespace LongoMatch.Gui.Component
this.sortmethodcombobox.Name = "sortmethodcombobox";
this.sortmethodcombobox.Active = 0;
this.cattable.Add (this.sortmethodcombobox);
- global::Gtk.Table.TableChild w28 = ((global::Gtk.Table.TableChild)(this.cattable
[this.sortmethodcombobox]));
- w28.TopAttach = ((uint)(3));
- w28.BottomAttach = ((uint)(4));
- w28.LeftAttach = ((uint)(1));
- w28.RightAttach = ((uint)(2));
- w28.XOptions = ((global::Gtk.AttachOptions)(4));
- w28.YOptions = ((global::Gtk.AttachOptions)(4));
+ global::Gtk.Table.TableChild w29 = ((global::Gtk.Table.TableChild)(this.cattable
[this.sortmethodcombobox]));
+ w29.TopAttach = ((uint)(2));
+ w29.BottomAttach = ((uint)(3));
+ w29.LeftAttach = ((uint)(1));
+ w29.RightAttach = ((uint)(2));
+ w29.XOptions = ((global::Gtk.AttachOptions)(4));
+ w29.YOptions = ((global::Gtk.AttachOptions)(4));
// Container child cattable.Gtk.Table+TableChild
this.tagscheckbutton = new global::Gtk.CheckButton ();
this.tagscheckbutton.CanFocus = true;
@@ -405,11 +411,11 @@ namespace LongoMatch.Gui.Component
this.tagscheckbutton.Active = true;
this.tagscheckbutton.DrawIndicator = true;
this.cattable.Add (this.tagscheckbutton);
- global::Gtk.Table.TableChild w29 = ((global::Gtk.Table.TableChild)(this.cattable
[this.tagscheckbutton]));
- w29.LeftAttach = ((uint)(1));
- w29.RightAttach = ((uint)(2));
- w29.XOptions = ((global::Gtk.AttachOptions)(4));
- w29.YOptions = ((global::Gtk.AttachOptions)(4));
+ global::Gtk.Table.TableChild w30 = ((global::Gtk.Table.TableChild)(this.cattable
[this.tagscheckbutton]));
+ w30.LeftAttach = ((uint)(1));
+ w30.RightAttach = ((uint)(2));
+ w30.XOptions = ((global::Gtk.AttachOptions)(4));
+ w30.YOptions = ((global::Gtk.AttachOptions)(4));
// Container child cattable.Gtk.Table+TableChild
this.tprbutton = new global::Gtk.SpinButton (1, 10, 1);
this.tprbutton.CanFocus = true;
@@ -419,17 +425,17 @@ namespace LongoMatch.Gui.Component
this.tprbutton.Numeric = true;
this.tprbutton.Value = 2;
this.cattable.Add (this.tprbutton);
- global::Gtk.Table.TableChild w30 = ((global::Gtk.Table.TableChild)(this.cattable
[this.tprbutton]));
- w30.TopAttach = ((uint)(1));
- w30.BottomAttach = ((uint)(2));
- w30.LeftAttach = ((uint)(1));
- w30.RightAttach = ((uint)(2));
- w30.YOptions = ((global::Gtk.AttachOptions)(4));
+ global::Gtk.Table.TableChild w31 = ((global::Gtk.Table.TableChild)(this.cattable
[this.tprbutton]));
+ w31.TopAttach = ((uint)(1));
+ w31.BottomAttach = ((uint)(2));
+ w31.LeftAttach = ((uint)(1));
+ w31.RightAttach = ((uint)(2));
+ w31.YOptions = ((global::Gtk.AttachOptions)(4));
this.vbox3.Add (this.cattable);
- global::Gtk.Box.BoxChild w31 = ((global::Gtk.Box.BoxChild)(this.vbox3
[this.cattable]));
- w31.Position = 2;
- w31.Expand = false;
- w31.Fill = false;
+ global::Gtk.Box.BoxChild w32 = ((global::Gtk.Box.BoxChild)(this.vbox3
[this.cattable]));
+ w32.Position = 3;
+ w32.Expand = false;
+ w32.Fill = false;
// Container child vbox3.Gtk.Box+BoxChild
this.cardtable = new global::Gtk.Table (((uint)(1)), ((uint)(2)), true);
this.cardtable.Name = "cardtable";
@@ -442,8 +448,8 @@ namespace LongoMatch.Gui.Component
this.label16.LabelProp = global::Mono.Unix.Catalog.GetString ("<span
font_desc=\"10\">Shape</span>");
this.label16.UseMarkup = true;
this.cardtable.Add (this.label16);
- global::Gtk.Table.TableChild w32 = ((global::Gtk.Table.TableChild)(this.cardtable
[this.label16]));
- w32.YOptions = ((global::Gtk.AttachOptions)(4));
+ global::Gtk.Table.TableChild w33 = ((global::Gtk.Table.TableChild)(this.cardtable
[this.label16]));
+ w33.YOptions = ((global::Gtk.AttachOptions)(4));
// Container child cardtable.Gtk.Table+TableChild
this.shapecombobox = global::Gtk.ComboBox.NewText ();
this.shapecombobox.AppendText (global::Mono.Unix.Catalog.GetString ("Rectangle"));
@@ -452,15 +458,15 @@ namespace LongoMatch.Gui.Component
this.shapecombobox.Name = "shapecombobox";
this.shapecombobox.Active = 0;
this.cardtable.Add (this.shapecombobox);
- global::Gtk.Table.TableChild w33 = ((global::Gtk.Table.TableChild)(this.cardtable
[this.shapecombobox]));
- w33.LeftAttach = ((uint)(1));
- w33.RightAttach = ((uint)(2));
- w33.YOptions = ((global::Gtk.AttachOptions)(4));
+ global::Gtk.Table.TableChild w34 = ((global::Gtk.Table.TableChild)(this.cardtable
[this.shapecombobox]));
+ w34.LeftAttach = ((uint)(1));
+ w34.RightAttach = ((uint)(2));
+ w34.YOptions = ((global::Gtk.AttachOptions)(4));
this.vbox3.Add (this.cardtable);
- global::Gtk.Box.BoxChild w34 = ((global::Gtk.Box.BoxChild)(this.vbox3
[this.cardtable]));
- w34.Position = 3;
- w34.Expand = false;
- w34.Fill = false;
+ global::Gtk.Box.BoxChild w35 = ((global::Gtk.Box.BoxChild)(this.vbox3
[this.cardtable]));
+ w35.Position = 4;
+ w35.Expand = false;
+ w35.Fill = false;
// Container child vbox3.Gtk.Box+BoxChild
this.scoretable = new global::Gtk.Table (((uint)(1)), ((uint)(2)), true);
this.scoretable.Name = "scoretable";
@@ -473,8 +479,8 @@ namespace LongoMatch.Gui.Component
this.label17.LabelProp = global::Mono.Unix.Catalog.GetString ("<span
font_desc=\"10\">Points</span>");
this.label17.UseMarkup = true;
this.scoretable.Add (this.label17);
- global::Gtk.Table.TableChild w35 = ((global::Gtk.Table.TableChild)(this.scoretable
[this.label17]));
- w35.YOptions = ((global::Gtk.AttachOptions)(4));
+ global::Gtk.Table.TableChild w36 = ((global::Gtk.Table.TableChild)(this.scoretable
[this.label17]));
+ w36.YOptions = ((global::Gtk.AttachOptions)(4));
// Container child scoretable.Gtk.Table+TableChild
this.pointsbutton = new global::Gtk.SpinButton (0, 1000, 1);
this.pointsbutton.CanFocus = true;
@@ -483,16 +489,16 @@ namespace LongoMatch.Gui.Component
this.pointsbutton.ClimbRate = 1;
this.pointsbutton.Numeric = true;
this.scoretable.Add (this.pointsbutton);
- global::Gtk.Table.TableChild w36 = ((global::Gtk.Table.TableChild)(this.scoretable
[this.pointsbutton]));
- w36.LeftAttach = ((uint)(1));
- w36.RightAttach = ((uint)(2));
- w36.XOptions = ((global::Gtk.AttachOptions)(4));
- w36.YOptions = ((global::Gtk.AttachOptions)(4));
+ global::Gtk.Table.TableChild w37 = ((global::Gtk.Table.TableChild)(this.scoretable
[this.pointsbutton]));
+ w37.LeftAttach = ((uint)(1));
+ w37.RightAttach = ((uint)(2));
+ w37.XOptions = ((global::Gtk.AttachOptions)(4));
+ w37.YOptions = ((global::Gtk.AttachOptions)(4));
this.vbox3.Add (this.scoretable);
- global::Gtk.Box.BoxChild w37 = ((global::Gtk.Box.BoxChild)(this.vbox3
[this.scoretable]));
- w37.Position = 4;
- w37.Expand = false;
- w37.Fill = false;
+ global::Gtk.Box.BoxChild w38 = ((global::Gtk.Box.BoxChild)(this.vbox3
[this.scoretable]));
+ w38.Position = 5;
+ w38.Expand = false;
+ w38.Fill = false;
this.Add (this.vbox3);
if ((this.Child != null)) {
this.Child.ShowAll ();
diff --git a/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Component.PlaysSelectionWidget.cs
b/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Component.PlaysSelectionWidget.cs
index a77dd95..29eeff2 100644
--- a/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Component.PlaysSelectionWidget.cs
+++ b/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Component.PlaysSelectionWidget.cs
@@ -17,8 +17,6 @@ namespace LongoMatch.Gui.Component
private global::Gtk.Label label3;
private global::Gtk.VBox filtersvbox;
private global::Gtk.Notebook filtersnotebook;
- private global::Gtk.ToggleButton catfiltersbutton;
- private global::Gtk.ToggleButton playersfiltersbutton;
private global::Gtk.Label label2;
protected virtual void Build ()
@@ -111,61 +109,9 @@ namespace LongoMatch.Gui.Component
this.filtersvbox.Add (this.filtersnotebook);
global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.filtersvbox
[this.filtersnotebook]));
w6.Position = 0;
- // Container child filtersvbox.Gtk.Box+BoxChild
- this.catfiltersbutton = new global::Gtk.ToggleButton ();
- this.catfiltersbutton.CanFocus = true;
- this.catfiltersbutton.Name = "catfiltersbutton";
- this.catfiltersbutton.UseUnderline = true;
- // Container child catfiltersbutton.Gtk.Container+ContainerChild
- global::Gtk.Alignment w7 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F);
- // Container child GtkAlignment.Gtk.Container+ContainerChild
- global::Gtk.HBox w8 = new global::Gtk.HBox ();
- w8.Spacing = 2;
- // Container child GtkHBox.Gtk.Container+ContainerChild
- global::Gtk.Image w9 = new global::Gtk.Image ();
- w9.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-find",
global::Gtk.IconSize.Menu);
- w8.Add (w9);
- // Container child GtkHBox.Gtk.Container+ContainerChild
- global::Gtk.Label w11 = new global::Gtk.Label ();
- w11.LabelProp = global::Mono.Unix.Catalog.GetString ("Activate categories filters");
- w11.UseUnderline = true;
- w8.Add (w11);
- w7.Add (w8);
- this.catfiltersbutton.Add (w7);
- this.filtersvbox.Add (this.catfiltersbutton);
- global::Gtk.Box.BoxChild w15 = ((global::Gtk.Box.BoxChild)(this.filtersvbox
[this.catfiltersbutton]));
- w15.Position = 1;
- w15.Expand = false;
- w15.Fill = false;
- // Container child filtersvbox.Gtk.Box+BoxChild
- this.playersfiltersbutton = new global::Gtk.ToggleButton ();
- this.playersfiltersbutton.CanFocus = true;
- this.playersfiltersbutton.Name = "playersfiltersbutton";
- this.playersfiltersbutton.UseUnderline = true;
- // Container child playersfiltersbutton.Gtk.Container+ContainerChild
- global::Gtk.Alignment w16 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F);
- // Container child GtkAlignment.Gtk.Container+ContainerChild
- global::Gtk.HBox w17 = new global::Gtk.HBox ();
- w17.Spacing = 2;
- // Container child GtkHBox.Gtk.Container+ContainerChild
- global::Gtk.Image w18 = new global::Gtk.Image ();
- w18.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-find",
global::Gtk.IconSize.Menu);
- w17.Add (w18);
- // Container child GtkHBox.Gtk.Container+ContainerChild
- global::Gtk.Label w20 = new global::Gtk.Label ();
- w20.LabelProp = global::Mono.Unix.Catalog.GetString ("Activate players filters");
- w20.UseUnderline = true;
- w17.Add (w20);
- w16.Add (w17);
- this.playersfiltersbutton.Add (w16);
- this.filtersvbox.Add (this.playersfiltersbutton);
- global::Gtk.Box.BoxChild w24 = ((global::Gtk.Box.BoxChild)(this.filtersvbox
[this.playersfiltersbutton]));
- w24.Position = 2;
- w24.Expand = false;
- w24.Fill = false;
this.notebook.Add (this.filtersvbox);
- global::Gtk.Notebook.NotebookChild w25 =
((global::Gtk.Notebook.NotebookChild)(this.notebook [this.filtersvbox]));
- w25.Position = 2;
+ global::Gtk.Notebook.NotebookChild w7 =
((global::Gtk.Notebook.NotebookChild)(this.notebook [this.filtersvbox]));
+ w7.Position = 2;
// Notebook tab
this.label2 = new global::Gtk.Label ();
this.label2.Name = "label2";
@@ -178,8 +124,6 @@ namespace LongoMatch.Gui.Component
this.Child.ShowAll ();
}
this.Hide ();
- this.catfiltersbutton.Clicked += new global::System.EventHandler
(this.OnCategoriesFiltersbuttonClicked);
- this.playersfiltersbutton.Clicked += new global::System.EventHandler
(this.OnPlayersFiltersbuttonClicked);
}
}
}
diff --git a/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Panel.ProjectsManagerPanel.cs
b/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Panel.ProjectsManagerPanel.cs
index e2a47ec..13dde2c 100644
--- a/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Panel.ProjectsManagerPanel.cs
+++ b/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Panel.ProjectsManagerPanel.cs
@@ -471,7 +471,6 @@ namespace LongoMatch.Gui.Panel
w62.Position = 0;
// Container child rbox.Gtk.Box+BoxChild
this.hbuttonbox1 = new global::Gtk.HButtonBox ();
- this.hbuttonbox1.Name = "hbuttonbox1";
// Container child hbuttonbox1.Gtk.ButtonBox+ButtonBoxChild
this.savebutton = new global::Gtk.Button ();
this.savebutton.Sensitive = false;
diff --git a/LongoMatch.GUI/gtk-gui/gui.stetic b/LongoMatch.GUI/gtk-gui/gui.stetic
index 7bdd42e..fb9efc0 100644
--- a/LongoMatch.GUI/gtk-gui/gui.stetic
+++ b/LongoMatch.GUI/gtk-gui/gui.stetic
@@ -891,7 +891,7 @@
</widget>
</child>
</widget>
- <widget class="Gtk.Bin" id="LongoMatch.Gui.Component.CategoryProperties" design-size="380 632">
+ <widget class="Gtk.Bin" id="LongoMatch.Gui.Component.CategoryProperties" design-size="380 668">
<property name="MemberName" />
<child>
<widget class="Gtk.VBox" id="vbox3">
@@ -900,7 +900,7 @@
<child>
<widget class="Gtk.Table" id="table2">
<property name="MemberName" />
- <property name="NRows">6</property>
+ <property name="NRows">4</property>
<property name="NColumns">2</property>
<property name="Homogeneous">True</property>
<property name="RowSpacing">6</property>
@@ -952,6 +952,55 @@
</packing>
</child>
<child>
+ <widget class="Gtk.HBox" id="hbox5">
+ <property name="MemberName" />
+ <property name="Spacing">6</property>
+ <child>
+ <widget class="Gtk.Label" id="hotKeyLabel">
+ <property name="MemberName" />
+ <property name="LabelProp" translatable="yes">none</property>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Button" id="changebuton">
+ <property name="MemberName" />
+ <property name="Sensitive">False</property>
+ <property name="CanFocus">True</property>
+ <property name="Type">TextOnly</property>
+ <property name="Label" translatable="yes">Change</property>
+ <property name="UseUnderline">True</property>
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="AutoSize">False</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="TopAttach">3</property>
+ <property name="BottomAttach">4</property>
+ <property name="LeftAttach">1</property>
+ <property name="RightAttach">2</property>
+ <property name="AutoSize">True</property>
+ <property name="XOptions">Fill</property>
+ <property name="YOptions">Fill</property>
+ <property name="XExpand">False</property>
+ <property name="XFill">True</property>
+ <property name="XShrink">False</property>
+ <property name="YExpand">False</property>
+ <property name="YFill">True</property>
+ <property name="YShrink">False</property>
+ </packing>
+ </child>
+ <child>
<widget class="Gtk.Label" id="label1">
<property name="MemberName" />
<property name="Xalign">1</property>
@@ -1012,15 +1061,15 @@
</packing>
</child>
<child>
- <widget class="Gtk.Label" id="label7">
+ <widget class="Gtk.Label" id="label6">
<property name="MemberName" />
<property name="Xalign">1</property>
- <property name="LabelProp" translatable="yes"><span font_desc="10">Lead time
(s)</span></property>
+ <property name="LabelProp" translatable="yes"><span
font_desc="10">HotKey</span></property>
<property name="UseMarkup">True</property>
</widget>
<packing>
- <property name="TopAttach">4</property>
- <property name="BottomAttach">5</property>
+ <property name="TopAttach">3</property>
+ <property name="BottomAttach">4</property>
<property name="AutoSize">True</property>
<property name="XOptions">Fill</property>
<property name="YOptions">Fill</property>
@@ -1033,15 +1082,52 @@
</packing>
</child>
<child>
- <widget class="Gtk.Label" id="label8">
+ <widget class="Gtk.Entry" id="nameentry">
+ <property name="MemberName" />
+ <property name="WidthRequest">76</property>
+ <property name="CanFocus">True</property>
+ <property name="IsEditable">True</property>
+ <property name="InvisibleChar">●</property>
+ </widget>
+ <packing>
+ <property name="LeftAttach">1</property>
+ <property name="RightAttach">2</property>
+ <property name="AutoSize">False</property>
+ <property name="YOptions">Fill</property>
+ <property name="XExpand">True</property>
+ <property name="XFill">True</property>
+ <property name="XShrink">False</property>
+ <property name="YExpand">False</property>
+ <property name="YFill">True</property>
+ <property name="YShrink">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Table" id="timetable">
+ <property name="MemberName" />
+ <property name="NRows">3</property>
+ <property name="NColumns">2</property>
+ <property name="Homogeneous">True</property>
+ <property name="RowSpacing">6</property>
+ <property name="ColumnSpacing">6</property>
+ <child>
+ <widget class="Gtk.Label" id="label7">
<property name="MemberName" />
<property name="Xalign">1</property>
- <property name="LabelProp" translatable="yes"><span font_desc="10">Lag time
(s)</span></property>
+ <property name="LabelProp" translatable="yes"><span font_desc="10">Lead time
(s)</span></property>
<property name="UseMarkup">True</property>
</widget>
<packing>
- <property name="TopAttach">5</property>
- <property name="BottomAttach">6</property>
+ <property name="TopAttach">1</property>
+ <property name="BottomAttach">2</property>
<property name="AutoSize">True</property>
<property name="XOptions">Fill</property>
<property name="YOptions">Fill</property>
@@ -1054,20 +1140,15 @@
</packing>
</child>
<child>
- <widget class="Gtk.SpinButton" id="lagtimebutton">
+ <widget class="Gtk.Label" id="label8">
<property name="MemberName" />
- <property name="CanFocus">True</property>
- <property name="Upper">1000</property>
- <property name="PageIncrement">1</property>
- <property name="StepIncrement">1</property>
- <property name="ClimbRate">1</property>
- <property name="Numeric">True</property>
+ <property name="Xalign">1</property>
+ <property name="LabelProp" translatable="yes"><span font_desc="10">Lag time
(s)</span></property>
+ <property name="UseMarkup">True</property>
</widget>
<packing>
- <property name="TopAttach">5</property>
- <property name="BottomAttach">6</property>
- <property name="LeftAttach">1</property>
- <property name="RightAttach">2</property>
+ <property name="TopAttach">2</property>
+ <property name="BottomAttach">3</property>
<property name="AutoSize">True</property>
<property name="XOptions">Fill</property>
<property name="YOptions">Fill</property>
@@ -1080,7 +1161,7 @@
</packing>
</child>
<child>
- <widget class="Gtk.SpinButton" id="leadtimebutton">
+ <widget class="Gtk.SpinButton" id="lagtimebutton">
<property name="MemberName" />
<property name="CanFocus">True</property>
<property name="Upper">1000</property>
@@ -1090,8 +1171,8 @@
<property name="Numeric">True</property>
</widget>
<packing>
- <property name="TopAttach">4</property>
- <property name="BottomAttach">5</property>
+ <property name="TopAttach">2</property>
+ <property name="BottomAttach">3</property>
<property name="LeftAttach">1</property>
<property name="RightAttach">2</property>
<property name="AutoSize">True</property>
@@ -1106,19 +1187,24 @@
</packing>
</child>
<child>
- <widget class="Gtk.Entry" id="nameentry">
+ <widget class="Gtk.SpinButton" id="leadtimebutton">
<property name="MemberName" />
- <property name="WidthRequest">76</property>
<property name="CanFocus">True</property>
- <property name="IsEditable">True</property>
- <property name="InvisibleChar">●</property>
+ <property name="Upper">1000</property>
+ <property name="PageIncrement">1</property>
+ <property name="StepIncrement">1</property>
+ <property name="ClimbRate">1</property>
+ <property name="Numeric">True</property>
</widget>
<packing>
+ <property name="TopAttach">1</property>
+ <property name="BottomAttach">2</property>
<property name="LeftAttach">1</property>
<property name="RightAttach">2</property>
- <property name="AutoSize">False</property>
+ <property name="AutoSize">True</property>
+ <property name="XOptions">Fill</property>
<property name="YOptions">Fill</property>
- <property name="XExpand">True</property>
+ <property name="XExpand">False</property>
<property name="XFill">True</property>
<property name="XShrink">False</property>
<property name="YExpand">False</property>
@@ -1134,8 +1220,6 @@
<property name="UseMarkup">True</property>
</widget>
<packing>
- <property name="TopAttach">3</property>
- <property name="BottomAttach">4</property>
<property name="AutoSize">True</property>
<property name="XOptions">Fill</property>
<property name="YOptions">Fill</property>
@@ -1156,14 +1240,11 @@ Manual</property>
<property name="Active">0</property>
</widget>
<packing>
- <property name="TopAttach">3</property>
- <property name="BottomAttach">4</property>
<property name="LeftAttach">1</property>
<property name="RightAttach">2</property>
- <property name="AutoSize">True</property>
- <property name="XOptions">Fill</property>
+ <property name="AutoSize">False</property>
<property name="YOptions">Fill</property>
- <property name="XExpand">False</property>
+ <property name="XExpand">True</property>
<property name="XFill">True</property>
<property name="XShrink">False</property>
<property name="YExpand">False</property>
@@ -1173,7 +1254,7 @@ Manual</property>
</child>
</widget>
<packing>
- <property name="Position">0</property>
+ <property name="Position">1</property>
<property name="AutoSize">True</property>
<property name="Expand">False</property>
<property name="Fill">False</property>
@@ -1321,7 +1402,7 @@ Tag as trayectory</property>
</child>
</widget>
<packing>
- <property name="Position">1</property>
+ <property name="Position">2</property>
<property name="AutoSize">True</property>
<property name="Expand">False</property>
<property name="Fill">False</property>
@@ -1331,60 +1412,12 @@ Tag as trayectory</property>
<widget class="Gtk.Table" id="cattable">
<property name="MemberName" />
<property name="Visible">False</property>
- <property name="NRows">4</property>
+ <property name="NRows">3</property>
<property name="NColumns">2</property>
<property name="Homogeneous">True</property>
<property name="RowSpacing">6</property>
<property name="ColumnSpacing">6</property>
<child>
- <widget class="Gtk.HBox" id="hbox5">
- <property name="MemberName" />
- <property name="Spacing">6</property>
- <child>
- <widget class="Gtk.Label" id="hotKeyLabel">
- <property name="MemberName" />
- <property name="LabelProp" translatable="yes">none</property>
- </widget>
- <packing>
- <property name="Position">0</property>
- <property name="AutoSize">True</property>
- <property name="Expand">False</property>
- <property name="Fill">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.Button" id="changebuton">
- <property name="MemberName" />
- <property name="Sensitive">False</property>
- <property name="CanFocus">True</property>
- <property name="Type">TextOnly</property>
- <property name="Label" translatable="yes">Change</property>
- <property name="UseUnderline">True</property>
- </widget>
- <packing>
- <property name="Position">1</property>
- <property name="AutoSize">False</property>
- <property name="Expand">False</property>
- <property name="Fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="TopAttach">2</property>
- <property name="BottomAttach">3</property>
- <property name="LeftAttach">1</property>
- <property name="RightAttach">2</property>
- <property name="AutoSize">False</property>
- <property name="YOptions">Fill</property>
- <property name="XExpand">True</property>
- <property name="XFill">True</property>
- <property name="XShrink">False</property>
- <property name="YExpand">False</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- <child>
<widget class="Gtk.Label" id="label14">
<property name="MemberName" />
<property name="Xalign">1</property>
@@ -1424,27 +1457,6 @@ Tag as trayectory</property>
</packing>
</child>
<child>
- <widget class="Gtk.Label" id="label6">
- <property name="MemberName" />
- <property name="Xalign">1</property>
- <property name="LabelProp" translatable="yes"><span
font_desc="10">HotKey</span></property>
- <property name="UseMarkup">True</property>
- </widget>
- <packing>
- <property name="TopAttach">2</property>
- <property name="BottomAttach">3</property>
- <property name="AutoSize">True</property>
- <property name="XOptions">Fill</property>
- <property name="YOptions">Fill</property>
- <property name="XExpand">False</property>
- <property name="XFill">True</property>
- <property name="XShrink">False</property>
- <property name="YExpand">False</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- <child>
<widget class="Gtk.Label" id="label9">
<property name="MemberName" />
<property name="Xalign">1</property>
@@ -1452,8 +1464,8 @@ Tag as trayectory</property>
<property name="UseMarkup">True</property>
</widget>
<packing>
- <property name="TopAttach">3</property>
- <property name="BottomAttach">4</property>
+ <property name="TopAttach">2</property>
+ <property name="BottomAttach">3</property>
<property name="AutoSize">True</property>
<property name="XOptions">Fill</property>
<property name="YOptions">Fill</property>
@@ -1476,8 +1488,8 @@ Sort by duration</property>
<property name="Active">0</property>
</widget>
<packing>
- <property name="TopAttach">3</property>
- <property name="BottomAttach">4</property>
+ <property name="TopAttach">2</property>
+ <property name="BottomAttach">3</property>
<property name="LeftAttach">1</property>
<property name="RightAttach">2</property>
<property name="AutoSize">True</property>
@@ -1543,7 +1555,7 @@ Sort by duration</property>
</child>
</widget>
<packing>
- <property name="Position">2</property>
+ <property name="Position">3</property>
<property name="AutoSize">True</property>
<property name="Expand">False</property>
<property name="Fill">False</property>
@@ -1599,7 +1611,7 @@ Circle</property>
</child>
</widget>
<packing>
- <property name="Position">3</property>
+ <property name="Position">4</property>
<property name="AutoSize">False</property>
<property name="Expand">False</property>
<property name="Fill">False</property>
@@ -1657,7 +1669,7 @@ Circle</property>
</child>
</widget>
<packing>
- <property name="Position">4</property>
+ <property name="Position">5</property>
<property name="AutoSize">True</property>
<property name="Expand">False</property>
<property name="Fill">False</property>
@@ -4366,40 +4378,6 @@ You can continue with the current capture, cancel it or save your project.
<property name="AutoSize">True</property>
</packing>
</child>
- <child>
- <widget class="Gtk.ToggleButton" id="catfiltersbutton">
- <property name="MemberName" />
- <property name="CanFocus">True</property>
- <property name="Type">TextAndIcon</property>
- <property name="Icon">stock:gtk-find Menu</property>
- <property name="Label" translatable="yes">Activate categories filters</property>
- <property name="UseUnderline">True</property>
- <signal name="Clicked" handler="OnCategoriesFiltersbuttonClicked" />
- </widget>
- <packing>
- <property name="Position">1</property>
- <property name="AutoSize">True</property>
- <property name="Expand">False</property>
- <property name="Fill">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.ToggleButton" id="playersfiltersbutton">
- <property name="MemberName" />
- <property name="CanFocus">True</property>
- <property name="Type">TextAndIcon</property>
- <property name="Icon">stock:gtk-find Menu</property>
- <property name="Label" translatable="yes">Activate players filters</property>
- <property name="UseUnderline">True</property>
- <signal name="Clicked" handler="OnPlayersFiltersbuttonClicked" />
- </widget>
- <packing>
- <property name="Position">2</property>
- <property name="AutoSize">True</property>
- <property name="Expand">False</property>
- <property name="Fill">False</property>
- </packing>
- </child>
</widget>
<packing>
<property name="Position">2</property>
diff --git a/LongoMatch.Plugins/CSVExporter.cs b/LongoMatch.Plugins/CSVExporter.cs
index 3f4145e..a212697 100644
--- a/LongoMatch.Plugins/CSVExporter.cs
+++ b/LongoMatch.Plugins/CSVExporter.cs
@@ -79,16 +79,16 @@ namespace LongoMatch.Plugins
public void Export ()
{
- foreach (Category cat in project.Categories.List) {
+ foreach (Categoryoutton cat in project.Dashboard.List) {
ExportCategory (cat);
}
File.WriteAllLines (filename, output);
}
- void ExportCategory (Category cat)
+ void ExportCategory (CategoryButton cat)
{
string headers;
- List<Play> plays;
+ List<TimelineEvent> plays;
output.Add ("CATEGORY: " + cat.Name);
plays = project.PlaysInCategory (cat);
@@ -99,7 +99,7 @@ namespace LongoMatch.Plugins
headers += String.Format (";{0}", tag.Value);
}
- foreach (Play play in plays.OrderBy(p=>p.Start)) {
+ foreach (TimelineEvent play in plays.OrderBy(p=>p.Start)) {
string line;
line = String.Format ("{0};{1};{2};{3}", play.Name,
diff --git a/LongoMatch.Services/Services/EventsManager.cs b/LongoMatch.Services/Services/EventsManager.cs
index c6ae55b..47a3849 100644
--- a/LongoMatch.Services/Services/EventsManager.cs
+++ b/LongoMatch.Services/Services/EventsManager.cs
@@ -33,7 +33,7 @@ namespace LongoMatch.Services
public class EventsManager
{
/* Current play loaded. null if no play is loaded */
- Play loadedPlay = null;
+ TimelineEvent loadedPlay = null;
/* current project in use */
Project openedProject;
ProjectType projectType;
@@ -104,7 +104,7 @@ namespace LongoMatch.Services
guiToolkit.FullScreen = fullscreen;
}
- void HandlePlayLoaded (Play play)
+ void HandlePlayLoaded (TimelineEvent play)
{
loadedPlay = play;
}
@@ -124,14 +124,14 @@ namespace LongoMatch.Services
guiToolkit.ShowProjectStats (project);
}
- void HandleDrawFrame (Play play, int drawingIndex)
+ void HandleDrawFrame (TimelineEvent play, int drawingIndex)
{
Image pixbuf;
FrameDrawing drawing = null;
player.Pause ();
if (play == null) {
- play = loadedPlay as Play;
+ play = loadedPlay as TimelineEvent;
}
if (play != null) {
if (drawingIndex == -1) {
@@ -146,7 +146,7 @@ namespace LongoMatch.Services
guiToolkit.DrawingTool (pixbuf, play, drawing);
}
- void RenderPlay (Project project, Play play, MediaFile file)
+ void RenderPlay (Project project, TimelineEvent play, MediaFile file)
{
Playlist playlist;
EncodingSettings settings;
@@ -160,7 +160,7 @@ namespace LongoMatch.Services
outputDir = Config.AutoRenderDir;
}
- outputFile = String.Format ("{0}-{1}.mp4", play.Category.Name, play.Name);
+ outputFile = String.Format ("{0}-{1}.mp4", play.EventType.Name, play.Name);
outputFile = Path.Combine (outputDir, project.Description.Title, outputFile);
try {
PlaylistPlayElement element;
@@ -194,7 +194,7 @@ namespace LongoMatch.Services
return frame;
}
- private void AddNewPlay (Play play)
+ private void AddNewPlay (TimelineEvent play)
{
/* Clip play boundaries */
play.Start.MSeconds = Math.Max (0, play.Start.MSeconds);
@@ -217,14 +217,14 @@ namespace LongoMatch.Services
}
}
- public void OnNewTag (TaggerButton tagger, List<Player> players, List<Tag> tags,
- Time start, Time stop)
+ public void OnNewTag (EventType evType, List<Player> players, List<Tag> tags,
+ Time start, Time stop, Score score, PenaltyCard card)
{
Image frame;
- if (player == null || openedProject == null || !(tagger is AnalysisCategory))
+ if (player == null || openedProject == null)
return;
-
+
if (projectType == ProjectType.CaptureProject ||
projectType == ProjectType.URICaptureProject) {
if (!capturer.Capturing) {
@@ -235,9 +235,9 @@ namespace LongoMatch.Services
frame = CaptureFrame (start);
Log.Debug (String.Format ("New play created start:{0} stop:{1} category:{2}",
start.ToMSecondsString(), stop.ToMSecondsString(),
- tagger.Name));
+ evType.Name));
/* Add the new created play to the project and update the GUI*/
- var play = openedProject.AddPlay (tagger as AnalysisCategory, start, stop, frame);
+ var play = openedProject.AddEvent (evType, start, stop, frame, score, card);
if (players != null) {
play.Players = players;
}
@@ -247,7 +247,7 @@ namespace LongoMatch.Services
AddNewPlay (play);
}
- public void HandleNewPlay (Play play)
+ public void HandleNewPlay (TimelineEvent play)
{
if (player == null || openedProject == null)
return;
@@ -262,12 +262,12 @@ namespace LongoMatch.Services
play.Miniature = CaptureFrame (play.Start);
Log.Debug (String.Format ("New play created start:{0} stop:{1} category:{2}",
play.Start.ToMSecondsString(), play.Stop.ToMSecondsString(),
- play.Category.Name));
+ play.EventType.Name));
openedProject.Timeline.Add (play);
AddNewPlay (play);
}
- protected virtual void OnPlaysDeleted (List<Play> plays)
+ protected virtual void OnPlaysDeleted (List<TimelineEvent> plays)
{
Log.Debug (plays.Count + " plays deleted");
analysisWindow.DeletePlays (plays);
@@ -280,31 +280,31 @@ namespace LongoMatch.Services
filter.Update ();
}
- void OnDuplicatePlays (List<Play> plays)
+ void OnDuplicatePlays (List<TimelineEvent> plays)
{
- foreach (Play play in plays) {
- Play copy = Cloner.Clone (play);
+ foreach (TimelineEvent play in plays) {
+ TimelineEvent copy = Cloner.Clone (play);
copy.ID = Guid.NewGuid ();
/* The category is also serialized and desarialized */
- copy.Category = play.Category;
- openedProject.AddPlay (copy);
+ copy.EventType = play.EventType;
+ openedProject.AddEvent (copy);
analysisWindow.AddPlay (copy);
}
filter.Update ();
}
- protected virtual void OnSnapshotSeries (Play play)
+ protected virtual void OnSnapshotSeries (TimelineEvent play)
{
player.Pause ();
guiToolkit.ExportFrameSeries (openedProject, play, Config.SnapshotsDir);
}
- protected virtual void OnPlayCategoryChanged (Play play, Category cat)
+ protected virtual void OnPlayCategoryChanged (TimelineEvent play, EventType evType)
{
- List<Play> plays = new List<Play> ();
+ List<TimelineEvent> plays = new List<TimelineEvent> ();
plays.Add (play);
OnPlaysDeleted (plays);
- var newplay = openedProject.AddPlay (cat, play.Start, play.Stop, play.Miniature);
+ var newplay = openedProject.AddEvent (evType, play.Start, play.Stop, play.Miniature,
null, null);
newplay.Name = play.Name;
newplay.Notes = play.Notes;
newplay.Drawings = play.Drawings;
diff --git a/LongoMatch.Services/Services/HotKeysManager.cs b/LongoMatch.Services/Services/HotKeysManager.cs
index 4616c70..2664e51 100644
--- a/LongoMatch.Services/Services/HotKeysManager.cs
+++ b/LongoMatch.Services/Services/HotKeysManager.cs
@@ -32,12 +32,12 @@ namespace LongoMatch.Services
{
public class HotKeysManager
{
- Dictionary<HotKey, TaggerButton> dic;
+ Dictionary<HotKey, DashboardButton> dic;
bool ignoreKeys;
public HotKeysManager ()
{
- dic = new Dictionary<HotKey,TaggerButton> ();
+ dic = new Dictionary<HotKey,DashboardButton> ();
Config.EventsBroker.OpenedProjectChanged += HandleOpenedProjectChanged;
Config.EventsBroker.KeyPressed += KeyListener;
}
@@ -52,7 +52,7 @@ namespace LongoMatch.Services
dic.Clear ();
ignoreKeys = false;
- foreach (TaggerButton cat in project.Categories.List) {
+ foreach (DashboardButton cat in project.Dashboard.List) {
if (cat.HotKey.Defined &&
!dic.ContainsKey (cat.HotKey))
dic.Add (cat.HotKey, cat);
@@ -65,13 +65,13 @@ namespace LongoMatch.Services
return;
#if HAVE_GTK
- TaggerButton cat = null;
+ DashboardButton button = null;
HotKey hotkey = new HotKey ();
hotkey.Key = key;
hotkey.Modifier = (int)((ModifierType)state & (ModifierType.Mod1Mask |
ModifierType.Mod5Mask | ModifierType.ShiftMask));
- if (dic.TryGetValue (hotkey, out cat)) {
- Config.EventsBroker.EmitNewTag (cat);
+ if (dic.TryGetValue (hotkey, out button)) {
+ Config.EventsBroker.EmitPressButton (button);
#endif
}
}
diff --git a/LongoMatch.Services/Services/PlaylistManager.cs b/LongoMatch.Services/Services/PlaylistManager.cs
index 375cb9c..4ef4adf 100644
--- a/LongoMatch.Services/Services/PlaylistManager.cs
+++ b/LongoMatch.Services/Services/PlaylistManager.cs
@@ -35,7 +35,7 @@ namespace LongoMatch.Services
Project openedProject;
IPlaylistElement loadedElement;
Playlist loadedPlaylist;
- Play loadedPlay;
+ TimelineEvent loadedPlay;
PlaysFilter filter;
public PlaylistManager (IGUIToolkit guiToolkit, IRenderingJobsManager videoRenderer)
@@ -59,7 +59,7 @@ namespace LongoMatch.Services
Config.EventsBroker.TimeNodeChanged += HandlePlayChanged;
}
- void LoadPlay (Play play, Time seekTime, bool playing)
+ void LoadPlay (TimelineEvent play, Time seekTime, bool playing)
{
play.Selected = true;
player.LoadPlay (openedProject.Description.File, play,
@@ -70,7 +70,7 @@ namespace LongoMatch.Services
}
}
- void Switch (Play play, Playlist playlist, IPlaylistElement element)
+ void Switch (TimelineEvent play, Playlist playlist, IPlaylistElement element)
{
if (loadedElement != null) {
loadedElement.Selected = false;
@@ -94,8 +94,8 @@ namespace LongoMatch.Services
void HandlePlayChanged (TimeNode tNode, object val)
{
/* FIXME: Tricky, create a new handler for categories */
- if (tNode is Play && val is Time) {
- LoadPlay (tNode as Play, val as Time, false);
+ if (tNode is TimelineEvent && val is Time) {
+ LoadPlay (tNode as TimelineEvent, val as Time, false);
}
filter.Update ();
}
@@ -119,7 +119,7 @@ namespace LongoMatch.Services
player.LoadPlayListPlay (playlist, element);
}
- void HandleLoadPlayEvent (Play play)
+ void HandleLoadPlayEvent (TimelineEvent play)
{
Switch (play, null, null);
if (play != null) {
@@ -146,7 +146,7 @@ namespace LongoMatch.Services
if (loadedElement != null) {
/* Select the previous element if we haven't played 500ms */
if (loadedElement is PlaylistPlayElement) {
- Play play = (loadedElement as PlaylistPlayElement).Play;
+ TimelineEvent play = (loadedElement as PlaylistPlayElement).Play;
if ((player.CurrentTime - play.Start).MSeconds > 500) {
player.Seek (play.Start, true);
return;
diff --git a/LongoMatch.Services/Services/RenderingJobsManager.cs
b/LongoMatch.Services/Services/RenderingJobsManager.cs
index 3d50a8d..25d8a47 100644
--- a/LongoMatch.Services/Services/RenderingJobsManager.cs
+++ b/LongoMatch.Services/Services/RenderingJobsManager.cs
@@ -225,7 +225,7 @@ namespace LongoMatch.Services
bool ProcessPlay (PlaylistPlayElement element)
{
Time lastTS;
- Play play;
+ TimelineEvent play;
play = element.Play;
Log.Debug (String.Format ("Adding segment with {0} drawings", play.Drawings.Count));
diff --git a/LongoMatch.Services/Services/TemplatesService.cs
b/LongoMatch.Services/Services/TemplatesService.cs
index 2d880f7..5ba5a3f 100644
--- a/LongoMatch.Services/Services/TemplatesService.cs
+++ b/LongoMatch.Services/Services/TemplatesService.cs
@@ -36,7 +36,7 @@ namespace LongoMatch.Services
dict = new Dictionary<Type, ITemplateProvider> ();
dict.Add (typeof(TeamTemplate),
new TeamTemplatesProvider (Config.TeamsDir));
- dict.Add (typeof(Categories), new CategoriesTemplatesProvider (Config.AnalysisDir));
+ dict.Add (typeof(Dashboard), new CategoriesTemplatesProvider (Config.AnalysisDir));
CheckDefaultTemplates ();
}
@@ -46,10 +46,10 @@ namespace LongoMatch.Services
t.CheckDefaultTemplate ();
}
- public ITemplateProvider<T, U> GetTemplateProvider<T, U> () where T: ITemplate<U>
+ public ITemplateProvider<T> GetTemplateProvider<T> () where T: ITemplate
{
if (dict.ContainsKey (typeof(T)))
- return (ITemplateProvider<T, U>)dict [typeof(T)];
+ return (ITemplateProvider<T>)dict [typeof(T)];
return null;
}
@@ -61,12 +61,12 @@ namespace LongoMatch.Services
public ICategoriesTemplatesProvider CategoriesTemplateProvider {
get {
- return (ICategoriesTemplatesProvider)dict [typeof(Categories)];
+ return (ICategoriesTemplatesProvider)dict [typeof(Dashboard)];
}
}
}
- public class TemplatesProvider<T, U>: ITemplateProvider<T, U> where T: ITemplate<U>
+ public class TemplatesProvider<T>: ITemplateProvider<T> where T: ITemplate
{
readonly string basePath;
readonly string extension;
@@ -134,7 +134,7 @@ namespace LongoMatch.Services
return template;
}
- public void Save (ITemplate<U> template)
+ public void Save (ITemplate template)
{
string filename = GetPath (template.Name);
@@ -153,7 +153,7 @@ namespace LongoMatch.Services
template.Save (filename);
}
- public void Update (ITemplate<U> template)
+ public void Update (ITemplate template)
{
string filename = GetPath (template.Name);
@@ -190,20 +190,20 @@ namespace LongoMatch.Services
if (list.Length == 0)
list = new object[] { 0 };
Log.Information (String.Format ("Creating default {0} template", typeof(T)));
- ITemplate<U> t = (ITemplate<U>)methodDefaultTemplate.Invoke (null, list);
+ ITemplate t = (ITemplate)methodDefaultTemplate.Invoke (null, list);
t.Name = templateName;
Save (t);
}
}
- public class TeamTemplatesProvider: TemplatesProvider<TeamTemplate, Player>, ITeamTemplatesProvider
+ public class TeamTemplatesProvider: TemplatesProvider<TeamTemplate>, ITeamTemplatesProvider
{
public TeamTemplatesProvider (string basePath): base (basePath, Constants.TEAMS_TEMPLATE_EXT)
{
}
}
- public class CategoriesTemplatesProvider : TemplatesProvider<Categories, TaggerButton>,
ICategoriesTemplatesProvider
+ public class CategoriesTemplatesProvider : TemplatesProvider<Dashboard>, ICategoriesTemplatesProvider
{
public CategoriesTemplatesProvider (string basePath): base (basePath,
Constants.CAT_TEMPLATE_EXT)
{
diff --git a/LongoMatch.Services/Services/ToolsManager.cs b/LongoMatch.Services/Services/ToolsManager.cs
index ebfa1e9..7dae754 100644
--- a/LongoMatch.Services/Services/ToolsManager.cs
+++ b/LongoMatch.Services/Services/ToolsManager.cs
@@ -123,7 +123,7 @@ namespace LongoMatch.Services
/* Create all the thumbnails */
capturer = Config.MultimediaToolkit.GetFramesCapturer ();
capturer.Open (project.Description.File.FilePath);
- foreach (Play play in project.Timeline) {
+ foreach (TimelineEvent play in project.Timeline) {
try {
capturer.Seek (play.Start + ((play.Stop - play.Start) / 2),
true);
diff --git a/Tests/Core/TestCategoriesTemplate.cs b/Tests/Core/TestCategoriesTemplate.cs
index 58f39e6..8861986 100644
--- a/Tests/Core/TestCategoriesTemplate.cs
+++ b/Tests/Core/TestCategoriesTemplate.cs
@@ -30,7 +30,7 @@ namespace Tests.Core
[Test()]
public void TestSerialization ()
{
- Categories cat = new Categories ();
+ Dashboard cat = new Dashboard ();
Utils.CheckSerialization (cat);
@@ -38,13 +38,13 @@ namespace Tests.Core
cat.GamePeriods = new List<string> ();
cat.GamePeriods.Add ("1");
cat.GamePeriods.Add ("2");
- cat.List.Add ( new Category {Name = "cat1"});
- cat.List.Add ( new Category {Name = "cat2"});
- cat.List.Add ( new Category {Name = "cat3"});
+ cat.List.Add ( new CategoryButton {Name = "cat1"});
+ cat.List.Add ( new CategoryButton {Name = "cat2"});
+ cat.List.Add ( new CategoryButton {Name = "cat3"});
Utils.CheckSerialization (cat);
- Categories newcat = Utils.SerializeDeserialize (cat);
+ Dashboard newcat = Utils.SerializeDeserialize (cat);
Assert.AreEqual (cat.ID, newcat.ID);
Assert.AreEqual (cat.Name, newcat.Name);
Assert.AreEqual (cat.GamePeriods.Count, newcat.GamePeriods.Count);
diff --git a/Tests/Core/TestCategory.cs b/Tests/Core/TestCategory.cs
index 7886cf1..82ef6f9 100644
--- a/Tests/Core/TestCategory.cs
+++ b/Tests/Core/TestCategory.cs
@@ -33,11 +33,11 @@ namespace Tests.Core
public void TestSerialization ()
{
string jsonString;
- Category cat;
+ CategoryButton cat;
MemoryStream stream;
StreamReader reader;
- cat = new Category();
+ cat = new CategoryButton();
cat.Color = new Color (255, 0, 0);
cat.HotKey = new HotKey {Key=2, Modifier=4};
cat.Name = "test";
@@ -61,7 +61,7 @@ namespace Tests.Core
jsonString = reader.ReadToEnd();
Assert.False (jsonString.Contains ("SortMethodString"));
stream.Seek (0, SeekOrigin.Begin);
- Category newcat = Serializer.Load<Category> (stream, SerializationType.Json);
+ CategoryButton newcat = Serializer.Load<CategoryButton> (stream,
SerializationType.Json);
Assert.AreEqual (cat.ID, newcat.ID);
Assert.AreEqual (cat.Name, newcat.Name);
diff --git a/Tests/Core/TestPlay.cs b/Tests/Core/TestPlay.cs
index 04eb560..dc89637 100644
--- a/Tests/Core/TestPlay.cs
+++ b/Tests/Core/TestPlay.cs
@@ -25,13 +25,13 @@ namespace Tests.Core
[TestFixture()]
public class TestPlay
{
- Category cat1;
+ CategoryButton cat1;
- public Play CreatePlay () {
- Play play = new Play();
- cat1 = new Category {Name="Cat1"};
+ public TimelineEvent CreatePlay () {
+ TimelineEvent play = new TimelineEvent();
+ cat1 = new CategoryButton {Name="Cat1"};
- play.Category = cat1;
+ play.EventType = cat1;
play.Notes = "notes";
play.Selected = true;
play.Team = LongoMatch.Common.Team.LOCAL;
@@ -54,13 +54,13 @@ namespace Tests.Core
[Test()]
public void TestCase ()
{
- Play p = new Play ();
+ TimelineEvent p = new TimelineEvent ();
Utils.CheckSerialization (p);
p = CreatePlay ();
var newp = Utils.SerializeDeserialize (p);
- Assert.AreEqual (p.Category.ID, newp.Category.ID);
+ Assert.AreEqual (p.EventType.ID, newp.EventType.ID);
Assert.AreEqual (p.Notes, newp.Notes);
Assert.AreEqual (p.Team, newp.Team);
Assert.AreEqual (p.FieldPosition, newp.FieldPosition);
diff --git a/Tests/Core/TestPlaysFilter.cs b/Tests/Core/TestPlaysFilter.cs
index 626f20f..79461cc 100644
--- a/Tests/Core/TestPlaysFilter.cs
+++ b/Tests/Core/TestPlaysFilter.cs
@@ -28,9 +28,9 @@ namespace Tests.Core
{
Project CreateProject () {
- Play pl;
+ TimelineEvent pl;
Project p = new Project ();
- p.Categories = Categories.DefaultTemplate (10);
+ p.Dashboard = Dashboard.DefaultTemplate (10);
p.LocalTeamTemplate = TeamTemplate.DefaultTemplate (5);
p.VisitorTeamTemplate = TeamTemplate.DefaultTemplate (5);
MediaFile mf = new MediaFile ("path", 34000, 25, true, true, "mp4", "h264",
@@ -40,15 +40,15 @@ namespace Tests.Core
p.Description = pd;
/* No tags, no players */
- pl = new Play {Category = p.Categories.CategoriesList[0]};
+ pl = new TimelineEvent {EventType = p.Dashboard.CategoriesList[0]};
p.Timeline.Add (pl);
/* tags, but no players */
- pl = new Play {Category = p.Categories.CategoriesList[1]};
- pl.Tags.Add (p.Categories.CategoriesList[1].Tags[0]);
+ pl = new TimelineEvent {EventType = p.Dashboard.CategoriesList[1]};
+ pl.Tags.Add (p.Dashboard.CategoriesList[1].Tags[0]);
p.Timeline.Add (pl);
/* tags and players */
- pl = new Play {Category = p.Categories.CategoriesList[2]};
- pl.Tags.Add (p.Categories.CategoriesList[2].Tags[1]);
+ pl = new TimelineEvent {EventType = p.Dashboard.CategoriesList[2]};
+ pl.Tags.Add (p.Dashboard.CategoriesList[2].Tags[1]);
pl.Players.Add (p.LocalTeamTemplate.List[0]);
p.Timeline.Add (pl);
return p;
@@ -71,31 +71,31 @@ namespace Tests.Core
Project p = CreateProject ();
PlaysFilter filter = new PlaysFilter (p);
- filter.FilterCategory (p.Categories.CategoriesList[0], true);
+ filter.FilterEventType (p.Dashboard.CategoriesList[0], true);
Assert.AreEqual (1, filter.VisibleCategories.Count);
Assert.AreEqual (1, filter.VisiblePlays.Count);
- filter.FilterCategory (p.Categories.CategoriesList[1], true);
+ filter.FilterEventType (p.Dashboard.CategoriesList[1], true);
Assert.AreEqual (2, filter.VisibleCategories.Count);
Assert.AreEqual (2, filter.VisiblePlays.Count);
- filter.FilterCategory (p.Categories.CategoriesList[2], true);
+ filter.FilterEventType (p.Dashboard.CategoriesList[2], true);
Assert.AreEqual (3, filter.VisibleCategories.Count);
Assert.AreEqual (3, filter.VisiblePlays.Count);
- filter.FilterCategory (p.Categories.CategoriesList[0], true);
+ filter.FilterEventType (p.Dashboard.CategoriesList[0], true);
Assert.AreEqual (3, filter.VisibleCategories.Count);
Assert.AreEqual (3, filter.VisiblePlays.Count);
- filter.FilterCategory (p.Categories.CategoriesList[0], false);
+ filter.FilterEventType (p.Dashboard.CategoriesList[0], false);
Assert.AreEqual (2, filter.VisibleCategories.Count);
Assert.AreEqual (2, filter.VisiblePlays.Count);
- filter.FilterCategory (p.Categories.CategoriesList[1], false);
+ filter.FilterEventType (p.Dashboard.CategoriesList[1], false);
Assert.AreEqual (1, filter.VisibleCategories.Count);
Assert.AreEqual (1, filter.VisiblePlays.Count);
- filter.FilterCategory (p.Categories.CategoriesList[2], false);
+ filter.FilterEventType (p.Dashboard.CategoriesList[2], false);
Assert.AreEqual (17, filter.VisibleCategories.Count);
Assert.AreEqual (3, filter.VisiblePlays.Count);
}
@@ -108,36 +108,36 @@ namespace Tests.Core
Assert.AreEqual (3, filter.VisiblePlays.Count);
- filter.FilterCategoryTag (p.Categories.CategoriesList[0],
p.Categories.CategoriesList[0].Tags[0], true);
+ filter.FilterCategoryTag (p.Dashboard.CategoriesList[0],
p.Dashboard.CategoriesList[0].Tags[0], true);
Assert.AreEqual (1, filter.VisibleCategories.Count);
Assert.AreEqual (0, filter.VisiblePlays.Count);
- filter.FilterCategoryTag (p.Categories.CategoriesList[1],
p.Categories.CategoriesList[1].Tags[0], true);
+ filter.FilterCategoryTag (p.Dashboard.CategoriesList[1],
p.Dashboard.CategoriesList[1].Tags[0], true);
Assert.AreEqual (2, filter.VisibleCategories.Count);
Assert.AreEqual (1, filter.VisiblePlays.Count);
- filter.FilterCategoryTag (p.Categories.CategoriesList[2],
p.Categories.CategoriesList[2].Tags[0], true);
+ filter.FilterCategoryTag (p.Dashboard.CategoriesList[2],
p.Dashboard.CategoriesList[2].Tags[0], true);
Assert.AreEqual (3, filter.VisibleCategories.Count);
Assert.AreEqual (1, filter.VisiblePlays.Count);
- filter.FilterCategoryTag (p.Categories.CategoriesList[2],
p.Categories.CategoriesList[2].Tags[1], true);
+ filter.FilterCategoryTag (p.Dashboard.CategoriesList[2],
p.Dashboard.CategoriesList[2].Tags[1], true);
Assert.AreEqual (2, filter.VisiblePlays.Count);
- filter.FilterCategoryTag (p.Categories.CategoriesList[0],
p.Categories.CategoriesList[0].Tags[0], false);
+ filter.FilterCategoryTag (p.Dashboard.CategoriesList[0],
p.Dashboard.CategoriesList[0].Tags[0], false);
Assert.AreEqual (3, filter.VisiblePlays.Count);
- filter.FilterCategoryTag (p.Categories.CategoriesList[1],
p.Categories.CategoriesList[1].Tags[0], false);
- filter.FilterCategoryTag (p.Categories.CategoriesList[1],
p.Categories.CategoriesList[1].Tags[1], true);
+ filter.FilterCategoryTag (p.Dashboard.CategoriesList[1],
p.Dashboard.CategoriesList[1].Tags[0], false);
+ filter.FilterCategoryTag (p.Dashboard.CategoriesList[1],
p.Dashboard.CategoriesList[1].Tags[1], true);
Assert.AreEqual (2, filter.VisiblePlays.Count);
Assert.AreEqual (p.Timeline[0], filter.VisiblePlays[0]);
Assert.AreEqual (p.Timeline[2], filter.VisiblePlays[1]);
/* One tag filtered now, but not the one of this play */
- filter.FilterCategoryTag (p.Categories.CategoriesList[2],
p.Categories.CategoriesList[2].Tags[1], false);
+ filter.FilterCategoryTag (p.Dashboard.CategoriesList[2],
p.Dashboard.CategoriesList[2].Tags[1], false);
Assert.AreEqual (1, filter.VisiblePlays.Count);
Assert.AreEqual (p.Timeline[0], filter.VisiblePlays[0]);
/* No more tags filtered, if the category matches we are ok */
- filter.FilterCategoryTag (p.Categories.CategoriesList[2],
p.Categories.CategoriesList[2].Tags[0], false);
+ filter.FilterCategoryTag (p.Dashboard.CategoriesList[2],
p.Dashboard.CategoriesList[2].Tags[0], false);
Assert.AreEqual (2, filter.VisiblePlays.Count);
Assert.AreEqual (p.Timeline[0], filter.VisiblePlays[0]);
Assert.AreEqual (p.Timeline[2], filter.VisiblePlays[1]);
@@ -184,14 +184,14 @@ namespace Tests.Core
Assert.AreEqual (3, filter.VisiblePlays.Count);
Assert.AreEqual (10, filter.VisiblePlayers.Count);
- filter.FilterCategory (p.Categories.CategoriesList[0], true);
+ filter.FilterEventType (p.Dashboard.CategoriesList[0], true);
Assert.AreEqual (1, filter.VisiblePlays.Count);
Assert.AreEqual (1, filter.VisibleCategories.Count);
filter.ClearCategoriesFilter ();
Assert.AreEqual (3, filter.VisiblePlays.Count);
Assert.AreEqual (17, filter.VisibleCategories.Count);
- filter.FilterCategoryTag (p.Categories.CategoriesList[0],
p.Categories.CategoriesList[0].Tags[0], true);
+ filter.FilterCategoryTag (p.Dashboard.CategoriesList[0],
p.Dashboard.CategoriesList[0].Tags[0], true);
Assert.AreEqual (0, filter.VisiblePlays.Count);
Assert.AreEqual (1, filter.VisibleCategories.Count);
filter.ClearAll ();
diff --git a/Tests/Core/TestProject.cs b/Tests/Core/TestProject.cs
index 97ad91d..6ffa421 100644
--- a/Tests/Core/TestProject.cs
+++ b/Tests/Core/TestProject.cs
@@ -32,7 +32,7 @@ namespace Tests.Core
Project CreateProject () {
Project p = new Project ();
- p.Categories = Categories.DefaultTemplate (10);
+ p.Dashboard = Dashboard.DefaultTemplate (10);
p.LocalTeamTemplate = TeamTemplate.DefaultTemplate (10);
p.VisitorTeamTemplate = TeamTemplate.DefaultTemplate (12);
MediaFile mf = new MediaFile ("path", 34000, 25, true, true, "mp4", "h264",
@@ -52,7 +52,7 @@ namespace Tests.Core
p = CreateProject ();
Utils.CheckSerialization (p);
- p.AddPlay (new Play());
+ p.AddEvent (new TimelineEvent());
Utils.CheckSerialization (p);
Project newp = Utils.SerializeDeserialize (p);
@@ -64,30 +64,30 @@ namespace Tests.Core
[Test ()]
public void TestPlaysGrouping () {
Project p = CreateProject ();
- p.AddPlay (p.Categories.CategoriesList[0], new Time (1000), new Time (2000), null);
- p.AddPlay (p.Categories.CategoriesList[0], new Time (1000), new Time (2000), null);
- p.AddPlay (p.Categories.CategoriesList[1], new Time (1000), new Time (2000), null);
- p.AddPlay (p.Categories.CategoriesList[2], new Time (1000), new Time (2000), null);
- p.AddPlay (p.Categories.CategoriesList[2], new Time (1000), new Time (2000), null);
- p.AddPlay (p.Categories.CategoriesList[2], new Time (1000), new Time (2000), null);
- p.AddPlay (p.Categories.CategoriesList[6], new Time (1000), new Time (2000), null);
+ p.AddPlay (p.Dashboard.CategoriesList[0], new Time (1000), new Time (2000), null);
+ p.AddPlay (p.Dashboard.CategoriesList[0], new Time (1000), new Time (2000), null);
+ p.AddPlay (p.Dashboard.CategoriesList[1], new Time (1000), new Time (2000), null);
+ p.AddPlay (p.Dashboard.CategoriesList[2], new Time (1000), new Time (2000), null);
+ p.AddPlay (p.Dashboard.CategoriesList[2], new Time (1000), new Time (2000), null);
+ p.AddPlay (p.Dashboard.CategoriesList[2], new Time (1000), new Time (2000), null);
+ p.AddPlay (p.Dashboard.CategoriesList[6], new Time (1000), new Time (2000), null);
- IEnumerable<IGrouping<TaggerButton, Play>> g = p.PlaysGroupedByCategory;
+ IEnumerable<IGrouping<DashboardButton, TimelineEvent>> g = p.PlaysGroupedByEventType;
Assert.AreEqual (g.Count(), 4);
- IGrouping<TaggerButton, Play> gr = g.ElementAt (0);
- Assert.AreEqual (gr.Key, p.Categories.List[0]);
+ IGrouping<DashboardButton, TimelineEvent> gr = g.ElementAt (0);
+ Assert.AreEqual (gr.Key, p.Dashboard.List[0]);
Assert.AreEqual (gr.Count(), 2);
gr = g.ElementAt (1);
- Assert.AreEqual (gr.Key, p.Categories.List[1]);
+ Assert.AreEqual (gr.Key, p.Dashboard.List[1]);
Assert.AreEqual (gr.Count(), 1);
gr = g.ElementAt (2);
- Assert.AreEqual (gr.Key, p.Categories.List[2]);
+ Assert.AreEqual (gr.Key, p.Dashboard.List[2]);
Assert.AreEqual (gr.Count(), 3);
gr = g.ElementAt (3);
- Assert.AreEqual (gr.Key, p.Categories.List[6]);
+ Assert.AreEqual (gr.Key, p.Dashboard.List[6]);
Assert.AreEqual (gr.Count(), 1);
}
@@ -99,28 +99,28 @@ namespace Tests.Core
[Test ()]
public void TestAddPlay () {
Project p = CreateProject ();
- p.AddPlay (p.Categories.CategoriesList[0], new Time (1000), new Time (2000), null);
+ p.AddPlay (p.Dashboard.CategoriesList[0], new Time (1000), new Time (2000), null);
Assert.AreEqual (p.Timeline.Count, 1);
- p.AddPlay (p.Categories.CategoriesList[0], new Time (1000), new Time (2000), null);
+ p.AddPlay (p.Dashboard.CategoriesList[0], new Time (1000), new Time (2000), null);
Assert.AreEqual (p.Timeline.Count, 2);
- p.AddPlay (new Play());
+ p.AddEvent (new TimelineEvent());
Assert.AreEqual (p.Timeline.Count, 3);
- p.AddPlay (new Play());
+ p.AddEvent (new TimelineEvent());
Assert.AreEqual (p.Timeline.Count, 4);
}
[Test ()]
public void TestRemovePlays () {
- Play p1, p2, p3;
- List<Play> plays = new List<Play> ();
+ TimelineEvent p1, p2, p3;
+ List<TimelineEvent> plays = new List<TimelineEvent> ();
Project p = CreateProject ();
- p1 = new Play();
- p2 = new Play();
- p3 = new Play();
- p.AddPlay (p1);
- p.AddPlay (p2);
- p.AddPlay (p3);
+ p1 = new TimelineEvent();
+ p2 = new TimelineEvent();
+ p3 = new TimelineEvent();
+ p.AddEvent (p1);
+ p.AddEvent (p2);
+ p.AddEvent (p3);
plays.Add(p1);
plays.Add(p2);
p.RemovePlays (plays);
@@ -131,33 +131,33 @@ namespace Tests.Core
[Test ()]
public void TestRemoveCategory () {
Project p = CreateProject ();
- p.AddPlay (p.Categories.CategoriesList[0], new Time (1000), new Time (2000), null);
- p.AddPlay (p.Categories.CategoriesList[0], new Time (1000), new Time (2000), null);
- p.AddPlay (p.Categories.CategoriesList[0], new Time (1000), new Time (2000), null);
- p.AddPlay (p.Categories.CategoriesList[2], new Time (1000), new Time (2000), null);
- p.AddPlay (p.Categories.CategoriesList[3], new Time (1000), new Time (2000), null);
- p.RemoveCategory(p.Categories.CategoriesList[0]);
+ p.AddPlay (p.Dashboard.CategoriesList[0], new Time (1000), new Time (2000), null);
+ p.AddPlay (p.Dashboard.CategoriesList[0], new Time (1000), new Time (2000), null);
+ p.AddPlay (p.Dashboard.CategoriesList[0], new Time (1000), new Time (2000), null);
+ p.AddPlay (p.Dashboard.CategoriesList[2], new Time (1000), new Time (2000), null);
+ p.AddPlay (p.Dashboard.CategoriesList[3], new Time (1000), new Time (2000), null);
+ p.RemoveCategory(p.Dashboard.CategoriesList[0]);
Assert.AreEqual(p.Timeline.Count, 2);
- Assert.AreEqual(p.Categories.CategoriesList.Count, 9);
- p.RemoveCategory(p.Categories.CategoriesList[0]);
- p.RemoveCategory(p.Categories.CategoriesList[0]);
- p.RemoveCategory(p.Categories.CategoriesList[0]);
- p.RemoveCategory(p.Categories.CategoriesList[0]);
- p.RemoveCategory(p.Categories.CategoriesList[0]);
- p.RemoveCategory(p.Categories.CategoriesList[0]);
- p.RemoveCategory(p.Categories.CategoriesList[0]);
- p.RemoveCategory(p.Categories.CategoriesList[0]);
+ Assert.AreEqual(p.Dashboard.CategoriesList.Count, 9);
+ p.RemoveCategory(p.Dashboard.CategoriesList[0]);
+ p.RemoveCategory(p.Dashboard.CategoriesList[0]);
+ p.RemoveCategory(p.Dashboard.CategoriesList[0]);
+ p.RemoveCategory(p.Dashboard.CategoriesList[0]);
+ p.RemoveCategory(p.Dashboard.CategoriesList[0]);
+ p.RemoveCategory(p.Dashboard.CategoriesList[0]);
+ p.RemoveCategory(p.Dashboard.CategoriesList[0]);
+ p.RemoveCategory(p.Dashboard.CategoriesList[0]);
Assert.Throws<Exception>(
- delegate {p.RemoveCategory(p.Categories.CategoriesList[0]);});
+ delegate {p.RemoveCategory(p.Dashboard.CategoriesList[0]);});
}
[Test ()]
public void TestRemovePlayer () {
- Play play = new Play();
+ TimelineEvent play = new TimelineEvent();
Project project = CreateProject ();
Player player = project.LocalTeamTemplate.List[0];
play.Players.Add (player);
- project.AddPlay (play);
+ project.AddEvent (play);
project.RemovePlayer (project.LocalTeamTemplate, player);
Assert.AreEqual (project.LocalTeamTemplate.List.Count, 9);
Assert.IsFalse (play.Players.Contains (player));
@@ -171,15 +171,15 @@ namespace Tests.Core
[Test ()]
public void TestPlaysInCategory () {
Project p = CreateProject ();
- p.AddPlay (p.Categories.CategoriesList[0], new Time (1000), new Time (2000), null);
- p.AddPlay (p.Categories.CategoriesList[0], new Time (1000), new Time (2000), null);
- p.AddPlay (p.Categories.CategoriesList[0], new Time (1000), new Time (2000), null);
- p.AddPlay (p.Categories.CategoriesList[2], new Time (1000), new Time (2000), null);
- p.AddPlay (p.Categories.CategoriesList[3], new Time (1000), new Time (2000), null);
- Assert.AreEqual (p.PlaysInCategory (p.Categories.CategoriesList[0]).Count, 3);
- Assert.AreEqual (p.PlaysInCategory (p.Categories.CategoriesList[1]).Count, 0);
- Assert.AreEqual (p.PlaysInCategory (p.Categories.CategoriesList[2]).Count, 1);
- Assert.AreEqual (p.PlaysInCategory (p.Categories.CategoriesList[3]).Count, 1);
+ p.AddPlay (p.Dashboard.CategoriesList[0], new Time (1000), new Time (2000), null);
+ p.AddPlay (p.Dashboard.CategoriesList[0], new Time (1000), new Time (2000), null);
+ p.AddPlay (p.Dashboard.CategoriesList[0], new Time (1000), new Time (2000), null);
+ p.AddPlay (p.Dashboard.CategoriesList[2], new Time (1000), new Time (2000), null);
+ p.AddPlay (p.Dashboard.CategoriesList[3], new Time (1000), new Time (2000), null);
+ Assert.AreEqual (p.PlaysInCategory (p.Dashboard.CategoriesList[0]).Count, 3);
+ Assert.AreEqual (p.PlaysInCategory (p.Dashboard.CategoriesList[1]).Count, 0);
+ Assert.AreEqual (p.PlaysInCategory (p.Dashboard.CategoriesList[2]).Count, 1);
+ Assert.AreEqual (p.PlaysInCategory (p.Dashboard.CategoriesList[3]).Count, 1);
}
[Test ()]
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]