mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-30 15:57:11 +00:00
Merge remote-tracking branch 'origin/master' into design2015
Conflicts: java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/regattaoverview/RaceDetailPanel.java
This commit is contained in:
commit
237ae6cdd3
454 files changed
+29339
-209
No files matched your search
+1
-1
@@ -43,7 +43,7 @@ public enum BoatClassMasterdata {
|
||||
NACRA_17 ("Nacra 17", true, 5.25, 2.59, BoatHullType.CATAMARAN, true, "N17", "Nacra-17"),
|
||||
OK ("OK Dinghy", true, 5.25, 2.59, BoatHullType.MONOHULL, false, "OK-Dinghy", "OK-Jolle", "OK"),
|
||||
OPTIMIST ("Optimist", true, 2.34, 1.07, BoatHullType.MONOHULL, false, "Opti", "Optimist Dinghy"),
|
||||
PIRAT ("Pirat", true, 5.00, 1.61, BoatHullType.MONOHULL, false, "Pirate", "Piraten"),
|
||||
PIRATE ("Pirate", true, 5.00, 1.61, BoatHullType.MONOHULL, false, "Pirat", "Piraten"),
|
||||
PLATU_25 ("Platu 25", true, 7.53, 2.62, BoatHullType.MONOHULL, true, "Platu", "Platu-25", "PLA", "B25"),
|
||||
RS_X ("RS:X", true, 2.86, 0.93, BoatHullType.SURFERBOARD, false, "RS-X", "RSX", "RS:X"),
|
||||
SONAR ("Sonar", true, 7.01, 2.39, BoatHullType.MONOHULL, true),
|
||||
|
||||
-2
@@ -11,6 +11,4 @@ public interface RaceStateEventScheduler {
|
||||
void unscheduleStateEvent(RaceStateEvents stateEventName);
|
||||
|
||||
void unscheduleAllEvents();
|
||||
|
||||
|
||||
}
|
||||
+3
-2
@@ -53,6 +53,7 @@ import com.sap.sailing.domain.tracking.impl.MarkPassingImpl;
|
||||
import com.sap.sailing.domain.tracking.impl.TrackedRaceStatusImpl;
|
||||
import com.sap.sse.common.TimePoint;
|
||||
import com.sap.sse.common.Util;
|
||||
import com.sap.sse.common.Util.Pair;
|
||||
import com.sap.sse.common.impl.MillisecondsTimePoint;
|
||||
|
||||
import difflib.PatchFailedException;
|
||||
@@ -294,9 +295,9 @@ public class SwissTimingReplayToDomainAdapter extends SwissTimingReplayAdapter {
|
||||
Course course = race.getCourse();
|
||||
try {
|
||||
// TODO: Does SwissTiming also deliver the passing side for course marks?
|
||||
List<com.sap.sse.common.Util.Pair<ControlPoint, PassingInstruction>> courseToUpdate = new ArrayList<com.sap.sse.common.Util.Pair<ControlPoint, PassingInstruction>>();
|
||||
List<Pair<ControlPoint, PassingInstruction>> courseToUpdate = new ArrayList<>();
|
||||
for (ControlPoint cp : currentCourseDefinition) {
|
||||
courseToUpdate.add(new com.sap.sse.common.Util.Pair<ControlPoint, PassingInstruction>(cp, null));
|
||||
courseToUpdate.add(new Pair<ControlPoint, PassingInstruction>(cp, PassingInstruction.None));
|
||||
}
|
||||
course.update(courseToUpdate, domainFactory.getBaseDomainFactory());
|
||||
} catch (PatchFailedException e) {
|
||||
|
||||
Regular → Executable
File mode changed.
Regular → Executable
File mode changed.
+1
-1
@@ -58,7 +58,7 @@ public class BoatClassImageResolver {
|
||||
boatClassIconsMap.put(BoatClassMasterdata.NACRA_17.getDisplayName(), imageResources.Nacra17Icon());
|
||||
boatClassIconsMap.put(BoatClassMasterdata.OK.getDisplayName(), imageResources.OKIcon());
|
||||
boatClassIconsMap.put(BoatClassMasterdata.OPTIMIST.getDisplayName(), imageResources.OptimistIcon());
|
||||
boatClassIconsMap.put(BoatClassMasterdata.PIRAT.getDisplayName(), imageResources.PiratIcon());
|
||||
boatClassIconsMap.put(BoatClassMasterdata.PIRATE.getDisplayName(), imageResources.PiratIcon());
|
||||
boatClassIconsMap.put(BoatClassMasterdata.PLATU_25.getDisplayName(), imageResources.Platu25Icon());
|
||||
boatClassIconsMap.put(BoatClassMasterdata.RS_X.getDisplayName(), imageResources.RSXIcon());
|
||||
boatClassIconsMap.put(BoatClassMasterdata.SONAR.getDisplayName(), imageResources.SonarIcon());
|
||||
|
||||
-23
@@ -1,13 +1,7 @@
|
||||
package com.sap.sailing.gwt.home.client.place.event.regatta;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import com.sap.sailing.domain.common.DetailType;
|
||||
import com.sap.sailing.domain.common.RegattaAndRaceIdentifier;
|
||||
import com.sap.sailing.domain.common.dto.CompetitorDTO;
|
||||
import com.sap.sailing.gwt.ui.client.CompetitorSelectionChangeListener;
|
||||
import com.sap.sailing.gwt.ui.client.CompetitorSelectionModel;
|
||||
import com.sap.sailing.gwt.ui.client.DebugIdHelper;
|
||||
import com.sap.sailing.gwt.ui.client.SailingServiceAsync;
|
||||
@@ -16,7 +10,6 @@ import com.sap.sailing.gwt.ui.client.shared.charts.MultiCompetitorLeaderboardCha
|
||||
import com.sap.sailing.gwt.ui.client.shared.charts.MultiCompetitorLeaderboardChartSettings;
|
||||
import com.sap.sailing.gwt.ui.leaderboard.LeaderboardPanel;
|
||||
import com.sap.sailing.gwt.ui.leaderboard.LeaderboardSettings;
|
||||
import com.sap.sse.common.Util;
|
||||
import com.sap.sse.common.settings.AbstractSettings;
|
||||
import com.sap.sse.gwt.client.ErrorReporter;
|
||||
import com.sap.sse.gwt.client.async.AsyncActionsExecutor;
|
||||
@@ -40,7 +33,6 @@ public class RegattaAnalyticsDataManager {
|
||||
private final UserAgentDetails userAgent;
|
||||
private final SailingServiceAsync sailingService;
|
||||
private final Timer timer;
|
||||
private final int MAX_COMPETITORS_IN_CHART = 30;
|
||||
|
||||
public RegattaAnalyticsDataManager(final SailingServiceAsync sailingService, AsyncActionsExecutor asyncActionsExecutor, Timer timer, ErrorReporter errorReporter, UserAgentDetails userAgent) {
|
||||
this.competitorSelectionProvider = new CompetitorSelectionModel(/* hasMultiSelection */true);
|
||||
@@ -87,21 +79,6 @@ public class RegattaAnalyticsDataManager {
|
||||
}
|
||||
|
||||
public void showCompetitorChart(DetailType chartDetailType) {
|
||||
// preselect the top N competitors in case there was no selection before and there too many competitors for a chart
|
||||
int competitorsCount = Util.size(competitorSelectionProvider.getAllCompetitors());
|
||||
int selectedCompetitorsCount = Util.size(competitorSelectionProvider.getSelectedCompetitors());
|
||||
|
||||
if(selectedCompetitorsCount == 0 && competitorsCount > MAX_COMPETITORS_IN_CHART) {
|
||||
List<CompetitorDTO> selectedCompetitors = new ArrayList<CompetitorDTO>();
|
||||
Iterator<CompetitorDTO> allCompetitorsIt = competitorSelectionProvider.getAllCompetitors().iterator();
|
||||
int counter = 0;
|
||||
while(counter < MAX_COMPETITORS_IN_CHART) {
|
||||
selectedCompetitors.add(allCompetitorsIt.next());
|
||||
counter++;
|
||||
}
|
||||
competitorSelectionProvider.setSelection(selectedCompetitors, (CompetitorSelectionChangeListener[]) null);
|
||||
}
|
||||
|
||||
MultiCompetitorLeaderboardChart multiCompetitorChart = getMultiCompetitorChart();
|
||||
MultiCompetitorLeaderboardChartSettings settings = new MultiCompetitorLeaderboardChartSettings(chartDetailType);
|
||||
multiCompetitorChart.updateSettings(settings);
|
||||
|
||||
+57
-19
@@ -1,31 +1,45 @@
|
||||
package com.sap.sailing.gwt.home.client.place.event.regatta.tabs;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.uibinder.client.UiBinder;
|
||||
import com.google.gwt.uibinder.client.UiField;
|
||||
import com.google.gwt.user.client.Window;
|
||||
import com.google.gwt.user.client.ui.AcceptsOneWidget;
|
||||
import com.google.gwt.user.client.ui.Composite;
|
||||
import com.google.gwt.user.client.ui.HTMLPanel;
|
||||
import com.sap.sailing.domain.common.DetailType;
|
||||
import com.sap.sailing.domain.common.RaceIdentifier;
|
||||
import com.sap.sailing.domain.common.dto.CompetitorDTO;
|
||||
import com.sap.sailing.domain.common.dto.LeaderboardDTO;
|
||||
import com.sap.sailing.domain.common.dto.RaceColumnDTO;
|
||||
import com.sap.sailing.gwt.common.client.controls.tabbar.TabView;
|
||||
import com.sap.sailing.gwt.home.client.place.event.oldcompetitorcharts.OldCompetitorCharts;
|
||||
import com.sap.sailing.gwt.home.client.place.event.regatta.EventRegattaView;
|
||||
import com.sap.sailing.gwt.home.client.place.event.regatta.EventRegattaView.Presenter;
|
||||
import com.sap.sailing.gwt.home.client.place.event.regatta.RegattaAnalyticsDataManager;
|
||||
import com.sap.sailing.gwt.home.client.place.event.regatta.RegattaTabView;
|
||||
import com.sap.sailing.gwt.home.client.shared.placeholder.Placeholder;
|
||||
import com.sap.sailing.gwt.ui.client.CompetitorSelectionChangeListener;
|
||||
import com.sap.sailing.gwt.ui.client.CompetitorSelectionModel;
|
||||
import com.sap.sse.common.Util;
|
||||
|
||||
/**
|
||||
* Created by pgtaboada on 25.11.14.
|
||||
*/
|
||||
public class RegattaCompetitorAnalyticsTabView extends Composite implements
|
||||
RegattaTabView<RegattaCompetitorAnalyticsPlace> {
|
||||
public class RegattaCompetitorAnalyticsTabView extends SharedLeaderboardRegattaTabView<RegattaCompetitorAnalyticsPlace> {
|
||||
|
||||
interface MyBinder extends UiBinder<HTMLPanel, RegattaCompetitorAnalyticsTabView> {
|
||||
}
|
||||
|
||||
private static MyBinder ourUiBinder = GWT.create(MyBinder.class);
|
||||
private Presenter currentPresenter;
|
||||
|
||||
private final int MAX_COMPETITORS_IN_CHART = 30;
|
||||
|
||||
public RegattaCompetitorAnalyticsTabView() {
|
||||
|
||||
super();
|
||||
}
|
||||
|
||||
@UiField
|
||||
@@ -43,17 +57,15 @@ public class RegattaCompetitorAnalyticsTabView extends Composite implements
|
||||
|
||||
@Override
|
||||
public void start(RegattaCompetitorAnalyticsPlace myPlace, AcceptsOneWidget contentArea) {
|
||||
|
||||
contentArea.setWidget(new Placeholder());
|
||||
|
||||
String regattaId = myPlace.getRegattaId();
|
||||
|
||||
if (regattaId != null && !regattaId.isEmpty()) {
|
||||
|
||||
String leaderboardName = regattaId;
|
||||
|
||||
RegattaAnalyticsDataManager regattaAnalyticsManager = currentPresenter.getCtx()
|
||||
.getRegattaAnalyticsManager();
|
||||
RegattaAnalyticsDataManager regattaAnalyticsManager = currentPresenter.getCtx().getRegattaAnalyticsManager();
|
||||
if(regattaAnalyticsManager.getLeaderboardPanel() == null) {
|
||||
createSharedLeaderboardPanel(leaderboardName, regattaAnalyticsManager);
|
||||
}
|
||||
|
||||
initWidget(ourUiBinder.createAndBindUi(this));
|
||||
|
||||
@@ -78,15 +90,8 @@ public class RegattaCompetitorAnalyticsTabView extends Composite implements
|
||||
|
||||
@Override
|
||||
public void stop() {
|
||||
|
||||
}
|
||||
|
||||
interface MyBinder extends UiBinder<HTMLPanel, RegattaCompetitorAnalyticsTabView> {
|
||||
}
|
||||
|
||||
private static MyBinder ourUiBinder = GWT.create(MyBinder.class);
|
||||
private Presenter currentPresenter;
|
||||
|
||||
@Override
|
||||
public RegattaCompetitorAnalyticsPlace placeToFire() {
|
||||
return new RegattaCompetitorAnalyticsPlace(currentPresenter.getCtx());
|
||||
@@ -95,7 +100,40 @@ public class RegattaCompetitorAnalyticsTabView extends Composite implements
|
||||
@Override
|
||||
public void setPresenter(EventRegattaView.Presenter currentPresenter) {
|
||||
this.currentPresenter = currentPresenter;
|
||||
|
||||
}
|
||||
|
||||
public boolean isSmallWidth() {
|
||||
int width = Window.getClientWidth();
|
||||
return width <= 720;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updatedLeaderboard(LeaderboardDTO leaderboard) {
|
||||
// adjust the competitor selection for the chart in case the leaderboard changed
|
||||
updateCompetitorSelection();
|
||||
}
|
||||
|
||||
private void updateCompetitorSelection() {
|
||||
RegattaAnalyticsDataManager regattaAnalyticsManager = currentPresenter.getCtx().getRegattaAnalyticsManager();
|
||||
CompetitorSelectionModel competitorSelectionProvider = regattaAnalyticsManager.getCompetitorSelectionProvider();
|
||||
|
||||
// preselect the top N competitors in case there was no selection before and there too many competitors for a chart
|
||||
int competitorsCount = Util.size(competitorSelectionProvider.getAllCompetitors());
|
||||
int selectedCompetitorsCount = Util.size(competitorSelectionProvider.getSelectedCompetitors());
|
||||
|
||||
if(selectedCompetitorsCount == 0 && competitorsCount > MAX_COMPETITORS_IN_CHART) {
|
||||
List<CompetitorDTO> selectedCompetitors = new ArrayList<CompetitorDTO>();
|
||||
Iterator<CompetitorDTO> allCompetitorsIt = competitorSelectionProvider.getAllCompetitors().iterator();
|
||||
int counter = 0;
|
||||
while(counter < MAX_COMPETITORS_IN_CHART) {
|
||||
selectedCompetitors.add(allCompetitorsIt.next());
|
||||
counter++;
|
||||
}
|
||||
competitorSelectionProvider.setSelection(selectedCompetitors, (CompetitorSelectionChangeListener[]) null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void currentRaceSelected(RaceIdentifier raceIdentifier, RaceColumnDTO raceColumn) {
|
||||
}
|
||||
}
|
||||
+10
-36
@@ -3,13 +3,10 @@ package com.sap.sailing.gwt.home.client.place.event.regatta.tabs;
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.uibinder.client.UiBinder;
|
||||
import com.google.gwt.uibinder.client.UiField;
|
||||
import com.google.gwt.user.client.Window;
|
||||
import com.google.gwt.user.client.ui.AcceptsOneWidget;
|
||||
import com.google.gwt.user.client.ui.Composite;
|
||||
import com.google.gwt.user.client.ui.HTMLPanel;
|
||||
import com.google.gwt.user.client.ui.Label;
|
||||
import com.sap.sailing.domain.common.RaceIdentifier;
|
||||
import com.sap.sailing.domain.common.RegattaAndRaceIdentifier;
|
||||
import com.sap.sailing.domain.common.dto.LeaderboardDTO;
|
||||
import com.sap.sailing.domain.common.dto.RaceColumnDTO;
|
||||
import com.sap.sailing.gwt.common.client.controls.tabbar.TabView;
|
||||
@@ -17,30 +14,26 @@ import com.sap.sailing.gwt.home.client.place.event.oldleaderboard.OldLeaderboard
|
||||
import com.sap.sailing.gwt.home.client.place.event.regatta.EventRegattaView;
|
||||
import com.sap.sailing.gwt.home.client.place.event.regatta.EventRegattaView.Presenter;
|
||||
import com.sap.sailing.gwt.home.client.place.event.regatta.RegattaAnalyticsDataManager;
|
||||
import com.sap.sailing.gwt.home.client.place.event.regatta.RegattaTabView;
|
||||
import com.sap.sailing.gwt.home.client.place.event.utils.EventParamUtils;
|
||||
import com.sap.sailing.gwt.home.client.shared.placeholder.Placeholder;
|
||||
import com.sap.sailing.gwt.ui.client.LeaderboardUpdateListener;
|
||||
import com.sap.sailing.gwt.ui.leaderboard.LeaderboardPanel;
|
||||
import com.sap.sailing.gwt.ui.leaderboard.LeaderboardSettings;
|
||||
import com.sap.sailing.gwt.ui.leaderboard.LeaderboardUrlSettings;
|
||||
import com.sap.sailing.gwt.ui.shared.general.EventState;
|
||||
import com.sap.sse.gwt.shared.GwtHttpRequestUtils;
|
||||
|
||||
/**
|
||||
* Created by pgtaboada on 25.11.14.
|
||||
*/
|
||||
public class RegattaLeaderboardTabView extends Composite implements RegattaTabView<RegattaLeaderboardPlace>,
|
||||
LeaderboardUpdateListener {
|
||||
public class RegattaLeaderboardTabView extends SharedLeaderboardRegattaTabView<RegattaLeaderboardPlace> {
|
||||
interface MyBinder extends UiBinder<HTMLPanel, RegattaLeaderboardTabView> {
|
||||
}
|
||||
|
||||
private static MyBinder ourUiBinder = GWT.create(MyBinder.class);
|
||||
|
||||
private Presenter currentPresenter;
|
||||
|
||||
@UiField
|
||||
protected OldLeaderboard leaderboard;
|
||||
|
||||
|
||||
public RegattaLeaderboardTabView() {
|
||||
|
||||
super();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -65,23 +58,12 @@ public class RegattaLeaderboardTabView extends Composite implements RegattaTabVi
|
||||
if (regattaId != null && !regattaId.isEmpty()) {
|
||||
String leaderboardName = regattaId;
|
||||
RegattaAnalyticsDataManager regattaAnalyticsManager = currentPresenter.getCtx().getRegattaAnalyticsManager();
|
||||
boolean autoExpandLastRaceColumn = GwtHttpRequestUtils.getBooleanParameter(
|
||||
LeaderboardUrlSettings.PARAM_AUTO_EXPAND_LAST_RACE_COLUMN, false);
|
||||
final LeaderboardSettings leaderboardSettings = EventParamUtils
|
||||
.createLeaderboardSettingsFromURLParameters(Window.Location
|
||||
.getParameterMap());
|
||||
final RegattaAndRaceIdentifier preselectedRace = EventParamUtils
|
||||
.getPreselectedRace(Window.Location.getParameterMap());
|
||||
LeaderboardPanel leaderboardPanel = regattaAnalyticsManager.createLeaderboardPanel( //
|
||||
leaderboardSettings, //
|
||||
preselectedRace, //
|
||||
"leaderboardGroupName", // TODO: keep using magic string? ask frank!
|
||||
leaderboardName, //
|
||||
true,
|
||||
autoExpandLastRaceColumn);
|
||||
LeaderboardPanel leaderboardPanel = regattaAnalyticsManager.getLeaderboardPanel();
|
||||
if(leaderboardPanel == null) {
|
||||
leaderboardPanel = createSharedLeaderboardPanel(leaderboardName, regattaAnalyticsManager);
|
||||
}
|
||||
initWidget(ourUiBinder.createAndBindUi(this));
|
||||
leaderboard.setLeaderboard(leaderboardPanel, currentPresenter.getAutoRefreshTimer());
|
||||
leaderboardPanel.addLeaderboardUpdateListener(this);
|
||||
if (currentPresenter.getCtx().getEventDTO().getState() == EventState.RUNNING) {
|
||||
// TODO: start autorefresh?
|
||||
}
|
||||
@@ -105,22 +87,14 @@ public class RegattaLeaderboardTabView extends Composite implements RegattaTabVi
|
||||
|
||||
@Override
|
||||
public void currentRaceSelected(RaceIdentifier raceIdentifier, RaceColumnDTO raceColumn) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stop() {
|
||||
|
||||
}
|
||||
|
||||
interface MyBinder extends UiBinder<HTMLPanel, RegattaLeaderboardTabView> {
|
||||
}
|
||||
|
||||
private static MyBinder ourUiBinder = GWT.create(MyBinder.class);
|
||||
|
||||
@Override
|
||||
public RegattaLeaderboardPlace placeToFire() {
|
||||
return new RegattaLeaderboardPlace(currentPresenter.getCtx());
|
||||
}
|
||||
|
||||
}
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
package com.sap.sailing.gwt.home.client.place.event.regatta.tabs;
|
||||
|
||||
import com.google.gwt.user.client.Window;
|
||||
import com.google.gwt.user.client.ui.Composite;
|
||||
import com.sap.sailing.domain.common.RegattaAndRaceIdentifier;
|
||||
import com.sap.sailing.gwt.home.client.place.event.regatta.AbstractEventRegattaPlace;
|
||||
import com.sap.sailing.gwt.home.client.place.event.regatta.RegattaAnalyticsDataManager;
|
||||
import com.sap.sailing.gwt.home.client.place.event.regatta.RegattaTabView;
|
||||
import com.sap.sailing.gwt.home.client.place.event.utils.EventParamUtils;
|
||||
import com.sap.sailing.gwt.ui.client.LeaderboardUpdateListener;
|
||||
import com.sap.sailing.gwt.ui.leaderboard.LeaderboardPanel;
|
||||
import com.sap.sailing.gwt.ui.leaderboard.LeaderboardSettings;
|
||||
import com.sap.sailing.gwt.ui.leaderboard.LeaderboardUrlSettings;
|
||||
import com.sap.sse.gwt.shared.GwtHttpRequestUtils;
|
||||
|
||||
/**
|
||||
* An abstract regatta tabView with some shared functions between the leaderboard tab and competitors chart tab
|
||||
*/
|
||||
public abstract class SharedLeaderboardRegattaTabView<T extends AbstractEventRegattaPlace> extends Composite implements RegattaTabView<T>,
|
||||
LeaderboardUpdateListener {
|
||||
|
||||
public SharedLeaderboardRegattaTabView() {
|
||||
}
|
||||
|
||||
public LeaderboardPanel createSharedLeaderboardPanel(String leaderboardName, RegattaAnalyticsDataManager regattaAnalyticsManager) {
|
||||
boolean autoExpandLastRaceColumn = GwtHttpRequestUtils.getBooleanParameter(
|
||||
LeaderboardUrlSettings.PARAM_AUTO_EXPAND_LAST_RACE_COLUMN, false);
|
||||
final LeaderboardSettings leaderboardSettings = EventParamUtils
|
||||
.createLeaderboardSettingsFromURLParameters(Window.Location.getParameterMap());
|
||||
final RegattaAndRaceIdentifier preselectedRace = EventParamUtils.getPreselectedRace(Window.Location.getParameterMap());
|
||||
LeaderboardPanel leaderboardPanel = regattaAnalyticsManager.createLeaderboardPanel( //
|
||||
leaderboardSettings, //
|
||||
preselectedRace, //
|
||||
"leaderboardGroupName", // TODO: keep using magic string? ask frank!
|
||||
leaderboardName, //
|
||||
true,
|
||||
autoExpandLastRaceColumn);
|
||||
leaderboardPanel.addLeaderboardUpdateListener(this);
|
||||
return leaderboardPanel;
|
||||
}
|
||||
}
|
||||
+55
-29
@@ -1,35 +1,47 @@
|
||||
package com.sap.sailing.gwt.home.client.place.fakeseries.tabs;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.uibinder.client.UiBinder;
|
||||
import com.google.gwt.uibinder.client.UiField;
|
||||
import com.google.gwt.user.client.ui.AcceptsOneWidget;
|
||||
import com.google.gwt.user.client.ui.Composite;
|
||||
import com.google.gwt.user.client.ui.HTMLPanel;
|
||||
import com.sap.sailing.domain.common.DetailType;
|
||||
import com.sap.sailing.domain.common.RaceIdentifier;
|
||||
import com.sap.sailing.domain.common.dto.CompetitorDTO;
|
||||
import com.sap.sailing.domain.common.dto.LeaderboardDTO;
|
||||
import com.sap.sailing.domain.common.dto.RaceColumnDTO;
|
||||
import com.sap.sailing.gwt.common.client.controls.tabbar.TabView;
|
||||
import com.sap.sailing.gwt.home.client.place.event.oldcompetitorcharts.OldCompetitorCharts;
|
||||
import com.sap.sailing.gwt.home.client.place.fakeseries.EventSeriesAnalyticsDataManager;
|
||||
import com.sap.sailing.gwt.home.client.place.fakeseries.SeriesTabView;
|
||||
import com.sap.sailing.gwt.home.client.place.fakeseries.SeriesView;
|
||||
import com.sap.sailing.gwt.home.client.shared.placeholder.Placeholder;
|
||||
import com.sap.sailing.gwt.ui.client.CompetitorSelectionChangeListener;
|
||||
import com.sap.sailing.gwt.ui.client.CompetitorSelectionModel;
|
||||
import com.sap.sse.common.Util;
|
||||
|
||||
/**
|
||||
* Created by pgtaboada on 25.11.14.
|
||||
*/
|
||||
public class EventSeriesCompetitorAnalyticsTabView extends Composite implements
|
||||
SeriesTabView<EventSeriesCompetitorAnalyticsPlace> {
|
||||
|
||||
public EventSeriesCompetitorAnalyticsTabView() {
|
||||
|
||||
public class EventSeriesCompetitorAnalyticsTabView extends SharedLeaderboardEventSeriesTabView<EventSeriesCompetitorAnalyticsPlace> {
|
||||
interface MyBinder extends UiBinder<HTMLPanel, EventSeriesCompetitorAnalyticsTabView> {
|
||||
}
|
||||
|
||||
private static MyBinder ourUiBinder = GWT.create(MyBinder.class);
|
||||
private SeriesView.Presenter currentPresenter;
|
||||
|
||||
@UiField
|
||||
protected OldCompetitorCharts competitorCharts;
|
||||
|
||||
private final int MAX_COMPETITORS_IN_CHART = 30;
|
||||
|
||||
public EventSeriesCompetitorAnalyticsTabView() {
|
||||
super();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<EventSeriesCompetitorAnalyticsPlace> getPlaceClassForActivation() {
|
||||
return EventSeriesCompetitorAnalyticsPlace.class;
|
||||
@@ -42,27 +54,21 @@ public class EventSeriesCompetitorAnalyticsTabView extends Composite implements
|
||||
|
||||
@Override
|
||||
public void start(EventSeriesCompetitorAnalyticsPlace myPlace, AcceptsOneWidget contentArea) {
|
||||
|
||||
contentArea.setWidget(new Placeholder());
|
||||
|
||||
String leaderboardName = myPlace.getCtx().getSeriesDTO().getLeaderboardId();
|
||||
|
||||
if (leaderboardName != null && !leaderboardName.isEmpty()) {
|
||||
|
||||
|
||||
EventSeriesAnalyticsDataManager regattaAnalyticsManager = currentPresenter.getCtx()
|
||||
.getAnalyticsManager();
|
||||
|
||||
EventSeriesAnalyticsDataManager eventSeriesAnalyticsManager = currentPresenter.getCtx().getAnalyticsManager();
|
||||
if(eventSeriesAnalyticsManager.getLeaderboardPanel() == null) {
|
||||
createSharedLeaderboardPanel(leaderboardName, eventSeriesAnalyticsManager);
|
||||
}
|
||||
initWidget(ourUiBinder.createAndBindUi(this));
|
||||
|
||||
DetailType initialDetailType = DetailType.OVERALL_RANK;
|
||||
if (regattaAnalyticsManager.getMultiCompetitorChart() == null) {
|
||||
regattaAnalyticsManager.createMultiCompetitorChart(leaderboardName, initialDetailType);
|
||||
if (eventSeriesAnalyticsManager.getMultiCompetitorChart() == null) {
|
||||
eventSeriesAnalyticsManager.createMultiCompetitorChart(leaderboardName, initialDetailType);
|
||||
}
|
||||
competitorCharts.setChart(regattaAnalyticsManager.getMultiCompetitorChart(), getAvailableDetailsTypes(),
|
||||
initialDetailType);
|
||||
|
||||
regattaAnalyticsManager.showCompetitorChart(competitorCharts.getSelectedChartDetailType());
|
||||
competitorCharts.setChart(eventSeriesAnalyticsManager.getMultiCompetitorChart(), getAvailableDetailsTypes(), initialDetailType);
|
||||
eventSeriesAnalyticsManager.showCompetitorChart(competitorCharts.getSelectedChartDetailType());
|
||||
contentArea.setWidget(this);
|
||||
}
|
||||
}
|
||||
@@ -76,15 +82,8 @@ public class EventSeriesCompetitorAnalyticsTabView extends Composite implements
|
||||
|
||||
@Override
|
||||
public void stop() {
|
||||
|
||||
}
|
||||
|
||||
interface MyBinder extends UiBinder<HTMLPanel, EventSeriesCompetitorAnalyticsTabView> {
|
||||
}
|
||||
|
||||
private static MyBinder ourUiBinder = GWT.create(MyBinder.class);
|
||||
private SeriesView.Presenter currentPresenter;
|
||||
|
||||
@Override
|
||||
public EventSeriesCompetitorAnalyticsPlace placeToFire() {
|
||||
return new EventSeriesCompetitorAnalyticsPlace(currentPresenter.getCtx());
|
||||
@@ -93,8 +92,35 @@ public class EventSeriesCompetitorAnalyticsTabView extends Composite implements
|
||||
@Override
|
||||
public void setPresenter(SeriesView.Presenter currentPresenter) {
|
||||
this.currentPresenter = currentPresenter;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updatedLeaderboard(LeaderboardDTO leaderboard) {
|
||||
// adjust the competitor selection for the chart in case the leaderboard changed
|
||||
updateCompetitorSelection();
|
||||
}
|
||||
|
||||
private void updateCompetitorSelection() {
|
||||
EventSeriesAnalyticsDataManager eventSeriesAnalyticsManager = currentPresenter.getCtx().getAnalyticsManager();
|
||||
CompetitorSelectionModel competitorSelectionProvider = eventSeriesAnalyticsManager.getCompetitorSelectionProvider();
|
||||
|
||||
// preselect the top N competitors in case there was no selection before and there too many competitors for a chart
|
||||
int competitorsCount = Util.size(competitorSelectionProvider.getAllCompetitors());
|
||||
int selectedCompetitorsCount = Util.size(competitorSelectionProvider.getSelectedCompetitors());
|
||||
|
||||
if(selectedCompetitorsCount == 0 && competitorsCount > MAX_COMPETITORS_IN_CHART) {
|
||||
List<CompetitorDTO> selectedCompetitors = new ArrayList<CompetitorDTO>();
|
||||
Iterator<CompetitorDTO> allCompetitorsIt = competitorSelectionProvider.getAllCompetitors().iterator();
|
||||
int counter = 0;
|
||||
while(counter < MAX_COMPETITORS_IN_CHART) {
|
||||
selectedCompetitors.add(allCompetitorsIt.next());
|
||||
counter++;
|
||||
}
|
||||
competitorSelectionProvider.setSelection(selectedCompetitors, (CompetitorSelectionChangeListener[]) null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void currentRaceSelected(RaceIdentifier raceIdentifier, RaceColumnDTO raceColumn) {
|
||||
}
|
||||
}
|
||||
+29
-41
@@ -3,42 +3,36 @@ package com.sap.sailing.gwt.home.client.place.fakeseries.tabs;
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.uibinder.client.UiBinder;
|
||||
import com.google.gwt.uibinder.client.UiField;
|
||||
import com.google.gwt.user.client.Window;
|
||||
import com.google.gwt.user.client.ui.AcceptsOneWidget;
|
||||
import com.google.gwt.user.client.ui.Composite;
|
||||
import com.google.gwt.user.client.ui.HTMLPanel;
|
||||
import com.google.gwt.user.client.ui.Label;
|
||||
import com.sap.sailing.domain.common.RaceIdentifier;
|
||||
import com.sap.sailing.domain.common.RegattaAndRaceIdentifier;
|
||||
import com.sap.sailing.domain.common.dto.LeaderboardDTO;
|
||||
import com.sap.sailing.domain.common.dto.RaceColumnDTO;
|
||||
import com.sap.sailing.gwt.common.client.controls.tabbar.TabView;
|
||||
import com.sap.sailing.gwt.home.client.place.event.oldleaderboard.OldLeaderboard;
|
||||
import com.sap.sailing.gwt.home.client.place.event.utils.EventParamUtils;
|
||||
import com.sap.sailing.gwt.home.client.place.fakeseries.EventSeriesAnalyticsDataManager;
|
||||
import com.sap.sailing.gwt.home.client.place.fakeseries.SeriesTabView;
|
||||
import com.sap.sailing.gwt.home.client.place.fakeseries.SeriesView;
|
||||
import com.sap.sailing.gwt.home.client.shared.placeholder.Placeholder;
|
||||
import com.sap.sailing.gwt.ui.client.LeaderboardUpdateListener;
|
||||
import com.sap.sailing.gwt.ui.leaderboard.LeaderboardPanel;
|
||||
import com.sap.sailing.gwt.ui.leaderboard.LeaderboardSettings;
|
||||
import com.sap.sailing.gwt.ui.leaderboard.LeaderboardUrlSettings;
|
||||
import com.sap.sse.gwt.shared.GwtHttpRequestUtils;
|
||||
|
||||
/**
|
||||
* Created by pgtaboada on 25.11.14.
|
||||
*/
|
||||
public class EventSeriesLeaderboardTabView extends Composite implements SeriesTabView<EventSeriesOverallLeaderboardPlace>,
|
||||
LeaderboardUpdateListener {
|
||||
public class EventSeriesLeaderboardTabView extends SharedLeaderboardEventSeriesTabView<EventSeriesOverallLeaderboardPlace> {
|
||||
|
||||
interface MyBinder extends UiBinder<HTMLPanel, EventSeriesLeaderboardTabView> {
|
||||
}
|
||||
|
||||
private static MyBinder ourUiBinder = GWT.create(MyBinder.class);
|
||||
|
||||
private SeriesView.Presenter currentPresenter;
|
||||
|
||||
@UiField
|
||||
protected OldLeaderboard leaderboard;
|
||||
|
||||
|
||||
public EventSeriesLeaderboardTabView() {
|
||||
|
||||
super();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -61,25 +55,30 @@ public class EventSeriesLeaderboardTabView extends Composite implements SeriesTa
|
||||
contentArea.setWidget(new Placeholder());
|
||||
String leaderboardName = myPlace.getCtx().getSeriesDTO().getLeaderboardId();
|
||||
if (leaderboardName != null && !leaderboardName.isEmpty()) {
|
||||
EventSeriesAnalyticsDataManager regattaAnalyticsManager = currentPresenter.getCtx().getAnalyticsManager();
|
||||
boolean autoExpandLastRaceColumn = GwtHttpRequestUtils.getBooleanParameter(
|
||||
LeaderboardUrlSettings.PARAM_AUTO_EXPAND_LAST_RACE_COLUMN, false);
|
||||
final LeaderboardSettings leaderboardSettings = EventParamUtils
|
||||
.createLeaderboardSettingsFromURLParameters(Window.Location
|
||||
.getParameterMap());
|
||||
final RegattaAndRaceIdentifier preselectedRace = EventParamUtils
|
||||
.getPreselectedRace(Window.Location.getParameterMap());
|
||||
LeaderboardPanel leaderboardPanel = regattaAnalyticsManager.createOverallLeaderboardPanel(
|
||||
leaderboardSettings,
|
||||
preselectedRace,
|
||||
"leaderboardGroupName", // TODO: keep using magic string? ask frank!
|
||||
leaderboardName,
|
||||
true, // this information came from place, now hard coded. check with frank
|
||||
autoExpandLastRaceColumn);
|
||||
EventSeriesAnalyticsDataManager eventSeriesAnalyticsManager = currentPresenter.getCtx().getAnalyticsManager();
|
||||
LeaderboardPanel leaderboardPanel = eventSeriesAnalyticsManager.getLeaderboardPanel();
|
||||
if(leaderboardPanel == null) {
|
||||
leaderboardPanel = createSharedLeaderboardPanel(leaderboardName, eventSeriesAnalyticsManager);
|
||||
}
|
||||
//
|
||||
// boolean autoExpandLastRaceColumn = GwtHttpRequestUtils.getBooleanParameter(
|
||||
// LeaderboardUrlSettings.PARAM_AUTO_EXPAND_LAST_RACE_COLUMN, false);
|
||||
// final LeaderboardSettings leaderboardSettings = EventParamUtils
|
||||
// .createLeaderboardSettingsFromURLParameters(Window.Location
|
||||
// .getParameterMap());
|
||||
// final RegattaAndRaceIdentifier preselectedRace = EventParamUtils
|
||||
// .getPreselectedRace(Window.Location.getParameterMap());
|
||||
// LeaderboardPanel leaderboardPanel = regattaAnalyticsManager.createOverallLeaderboardPanel(
|
||||
// leaderboardSettings,
|
||||
// preselectedRace,
|
||||
// "leaderboardGroupName", // TODO: keep using magic string? ask frank!
|
||||
// leaderboardName,
|
||||
// true, // this information came from place, now hard coded. check with frank
|
||||
// autoExpandLastRaceColumn);
|
||||
initWidget(ourUiBinder.createAndBindUi(this));
|
||||
leaderboard.setLeaderboard(leaderboardPanel, currentPresenter.getAutoRefreshTimer());
|
||||
leaderboardPanel.addLeaderboardUpdateListener(this);
|
||||
regattaAnalyticsManager.hideCompetitorChart();
|
||||
// leaderboardPanel.addLeaderboardUpdateListener(this);
|
||||
eventSeriesAnalyticsManager.hideCompetitorChart();
|
||||
contentArea.setWidget(this);
|
||||
} else {
|
||||
contentArea.setWidget(new Label("No leaderboard specified, cannot proceed to leaderboardpage"));
|
||||
@@ -90,7 +89,6 @@ public class EventSeriesLeaderboardTabView extends Composite implements SeriesTa
|
||||
}
|
||||
}.schedule(3000);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -100,24 +98,14 @@ public class EventSeriesLeaderboardTabView extends Composite implements SeriesTa
|
||||
|
||||
@Override
|
||||
public void currentRaceSelected(RaceIdentifier raceIdentifier, RaceColumnDTO raceColumn) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stop() {
|
||||
|
||||
}
|
||||
|
||||
interface MyBinder extends UiBinder<HTMLPanel, EventSeriesLeaderboardTabView> {
|
||||
}
|
||||
|
||||
private static MyBinder ourUiBinder = GWT.create(MyBinder.class);
|
||||
|
||||
@Override
|
||||
public EventSeriesOverallLeaderboardPlace placeToFire() {
|
||||
return new EventSeriesOverallLeaderboardPlace(currentPresenter.getCtx());
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
+14
-40
@@ -28,13 +28,17 @@ import com.sap.sse.gwt.shared.GwtHttpRequestUtils;
|
||||
public class EventSeriesLeaderboardsTabView extends Composite implements SeriesTabView<EventSeriesLeaderboardsPlace>,
|
||||
LeaderboardUpdateListener {
|
||||
|
||||
interface MyBinder extends UiBinder<HTMLPanel, EventSeriesLeaderboardsTabView> {
|
||||
}
|
||||
|
||||
private static MyBinder ourUiBinder = GWT.create(MyBinder.class);
|
||||
|
||||
private SeriesView.Presenter currentPresenter;
|
||||
|
||||
@UiField
|
||||
protected OldMultiLeaderboard leaderboard;
|
||||
|
||||
public EventSeriesLeaderboardsTabView() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -54,52 +58,34 @@ public class EventSeriesLeaderboardsTabView extends Composite implements SeriesT
|
||||
|
||||
@Override
|
||||
public void start(final EventSeriesLeaderboardsPlace myPlace, final AcceptsOneWidget contentArea) {
|
||||
|
||||
contentArea.setWidget(new Placeholder());
|
||||
|
||||
String leaderboardName = myPlace.getCtx().getSeriesDTO().getLeaderboardId();
|
||||
|
||||
if (leaderboardName != null && !leaderboardName.isEmpty()) {
|
||||
|
||||
EventSeriesAnalyticsDataManager regattaAnalyticsManager = currentPresenter.getCtx()
|
||||
.getAnalyticsManager();
|
||||
|
||||
|
||||
boolean autoExpandLastRaceColumn = GwtHttpRequestUtils.getBooleanParameter(
|
||||
LeaderboardUrlSettings.PARAM_AUTO_EXPAND_LAST_RACE_COLUMN, false);
|
||||
|
||||
final LeaderboardSettings leaderboardSettings = EventParamUtils
|
||||
.createLeaderboardSettingsFromURLParameters(Window.Location
|
||||
.getParameterMap());
|
||||
|
||||
final RaceIdentifier preselectedRace = EventParamUtils
|
||||
.getPreselectedRace(Window.Location.getParameterMap());
|
||||
|
||||
if (leaderboardName != null && !leaderboardName.isEmpty()) {
|
||||
EventSeriesAnalyticsDataManager regattaAnalyticsManager = currentPresenter.getCtx().getAnalyticsManager();
|
||||
boolean autoExpandLastRaceColumn = GwtHttpRequestUtils.getBooleanParameter(LeaderboardUrlSettings.PARAM_AUTO_EXPAND_LAST_RACE_COLUMN, false);
|
||||
final LeaderboardSettings leaderboardSettings = EventParamUtils.createLeaderboardSettingsFromURLParameters(Window.Location.getParameterMap());
|
||||
final RaceIdentifier preselectedRace = EventParamUtils.getPreselectedRace(Window.Location.getParameterMap());
|
||||
|
||||
MultiLeaderboardPanel leaderboardPanel = regattaAnalyticsManager.createMultiLeaderboardPanel(leaderboardSettings,
|
||||
null, // TODO: preselectedLeaderboardName
|
||||
preselectedRace,
|
||||
"leaderboardGroupName",
|
||||
"leaderboardGroupName",
|
||||
leaderboardName,
|
||||
true, // TODO @FM this information came from place, now hard coded. check with frank
|
||||
autoExpandLastRaceColumn);
|
||||
|
||||
initWidget(ourUiBinder.createAndBindUi(this));
|
||||
|
||||
leaderboard.setMultiLeaderboard(leaderboardPanel,
|
||||
currentPresenter.getAutoRefreshTimer());
|
||||
|
||||
leaderboard.setMultiLeaderboard(leaderboardPanel, currentPresenter.getAutoRefreshTimer());
|
||||
leaderboardPanel.addLeaderboardUpdateListener(this);
|
||||
|
||||
if (currentPresenter.getCtx().getSeriesDTO().getState() != EventSeriesState.RUNNING) {
|
||||
// TODO: this.leaderboard.hideRefresh();
|
||||
} else {
|
||||
// TODO: start autorefresh?
|
||||
}
|
||||
|
||||
|
||||
regattaAnalyticsManager.hideCompetitorChart();
|
||||
leaderboardPanel.setVisible(true);
|
||||
|
||||
contentArea.setWidget(this);
|
||||
} else {
|
||||
contentArea.setWidget(new Label("No leaderboard specified, cannot proceed to leaderboardpage"));
|
||||
@@ -109,36 +95,24 @@ public class EventSeriesLeaderboardsTabView extends Composite implements SeriesT
|
||||
currentPresenter.getHomeNavigation().goToPlace();
|
||||
}
|
||||
}.schedule(3000);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updatedLeaderboard(LeaderboardDTO leaderboard) {
|
||||
this.leaderboard.updatedMultiLeaderboard(leaderboard, true); // TODO hard coded
|
||||
this.leaderboard.updatedMultiLeaderboard(leaderboard, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void currentRaceSelected(RaceIdentifier raceIdentifier, RaceColumnDTO raceColumn) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stop() {
|
||||
|
||||
}
|
||||
|
||||
interface MyBinder extends UiBinder<HTMLPanel, EventSeriesLeaderboardsTabView> {
|
||||
}
|
||||
|
||||
private static MyBinder ourUiBinder = GWT.create(MyBinder.class);
|
||||
|
||||
@Override
|
||||
public EventSeriesLeaderboardsPlace placeToFire() {
|
||||
return new EventSeriesLeaderboardsPlace(currentPresenter.getCtx());
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
package com.sap.sailing.gwt.home.client.place.fakeseries.tabs;
|
||||
|
||||
import com.google.gwt.user.client.Window;
|
||||
import com.google.gwt.user.client.ui.Composite;
|
||||
import com.sap.sailing.domain.common.RegattaAndRaceIdentifier;
|
||||
import com.sap.sailing.gwt.home.client.place.event.utils.EventParamUtils;
|
||||
import com.sap.sailing.gwt.home.client.place.fakeseries.AbstractSeriesTabPlace;
|
||||
import com.sap.sailing.gwt.home.client.place.fakeseries.EventSeriesAnalyticsDataManager;
|
||||
import com.sap.sailing.gwt.home.client.place.fakeseries.SeriesTabView;
|
||||
import com.sap.sailing.gwt.ui.client.LeaderboardUpdateListener;
|
||||
import com.sap.sailing.gwt.ui.leaderboard.LeaderboardPanel;
|
||||
import com.sap.sailing.gwt.ui.leaderboard.LeaderboardSettings;
|
||||
import com.sap.sailing.gwt.ui.leaderboard.LeaderboardUrlSettings;
|
||||
import com.sap.sse.gwt.shared.GwtHttpRequestUtils;
|
||||
|
||||
/**
|
||||
* An abstract series tabView with some shared functions between the overall leaderboard tab and competitors chart tab
|
||||
*/
|
||||
public abstract class SharedLeaderboardEventSeriesTabView<T extends AbstractSeriesTabPlace> extends Composite implements SeriesTabView<T>,
|
||||
LeaderboardUpdateListener {
|
||||
|
||||
public SharedLeaderboardEventSeriesTabView() {
|
||||
}
|
||||
|
||||
public LeaderboardPanel createSharedLeaderboardPanel(String leaderboardName, EventSeriesAnalyticsDataManager eventSeriesAnalyticsManager) {
|
||||
boolean autoExpandLastRaceColumn = GwtHttpRequestUtils.getBooleanParameter(
|
||||
LeaderboardUrlSettings.PARAM_AUTO_EXPAND_LAST_RACE_COLUMN, false);
|
||||
final LeaderboardSettings leaderboardSettings = EventParamUtils
|
||||
.createLeaderboardSettingsFromURLParameters(Window.Location
|
||||
.getParameterMap());
|
||||
final RegattaAndRaceIdentifier preselectedRace = EventParamUtils
|
||||
.getPreselectedRace(Window.Location.getParameterMap());
|
||||
LeaderboardPanel leaderboardPanel = eventSeriesAnalyticsManager.createOverallLeaderboardPanel(
|
||||
leaderboardSettings,
|
||||
preselectedRace,
|
||||
"leaderboardGroupName",
|
||||
leaderboardName,
|
||||
true, // this information came from place, now hard coded. check with frank
|
||||
autoExpandLastRaceColumn);
|
||||
leaderboardPanel.addLeaderboardUpdateListener(this);
|
||||
return leaderboardPanel;
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -102,9 +102,9 @@ public class RaceDetailPanel extends SimplePanel {
|
||||
|
||||
Grid managementGrid = new Grid(3, 3);
|
||||
managementGrid.setCellSpacing(cellSpacing);
|
||||
managementGrid.setWidget(0, 0, new Label("Last update at"));
|
||||
managementGrid.setWidget(1, 0, new Label("Vessel position"));
|
||||
managementGrid.setWidget(2, 0, new Label("Last wind"));
|
||||
managementGrid.setWidget(0, 0, new Label(stringMessages.lastUpdate()));
|
||||
managementGrid.setWidget(1, 0, new Label(stringMessages.position()));
|
||||
managementGrid.setWidget(2, 0, new Label(stringMessages.wind()));
|
||||
managementGrid.setWidget(0, 1, updateTimeLabel);
|
||||
managementGrid.setWidget(1, 1, vesselPositionLabel);
|
||||
managementGrid.setWidget(2, 1, windLabel);
|
||||
@@ -193,7 +193,7 @@ public class RaceDetailPanel extends SimplePanel {
|
||||
+ getDegMinSecFormatForDecimalDegree(data.raceInfo.lastWind.position.getLngDeg()) + " ")
|
||||
.getHTML();
|
||||
}
|
||||
windText = new HTML(decimalFormat.format(data.raceInfo.lastWind.trueWindBearingDeg) + "° "
|
||||
windText = new HTML(decimalFormat.format(data.raceInfo.lastWind.trueWindFromDeg) + "° "
|
||||
+ decimalFormat.format(data.raceInfo.lastWind.trueWindSpeedInKnots) + "knts").getHTML();
|
||||
}
|
||||
vesselPositionLabel.setText(vesselPositionText);
|
||||
|
||||
+2
-1
@@ -69,7 +69,8 @@ public class RaceGroupDeserializer implements JsonDeserializer<RaceGroup> {
|
||||
configuration = configurationDeserializer.deserialize(value);
|
||||
}
|
||||
if (object.containsKey(RaceGroupJsonSerializer.FIELD_DISPLAY_NAME)) {
|
||||
displayName = object.get(RaceGroupJsonSerializer.FIELD_DISPLAY_NAME).toString();
|
||||
final Object displayNameJson = object.get(RaceGroupJsonSerializer.FIELD_DISPLAY_NAME);
|
||||
displayName = displayNameJson == null ? null : displayNameJson.toString();
|
||||
}
|
||||
return new RaceGroupImpl(name, displayName, boatClass, courseArea, series, configuration);
|
||||
}
|
||||
|
||||
+9
-1
@@ -1,4 +1,4 @@
|
||||
package com.sap.sse.common.settings;
|
||||
package com.sap.sailing.server.gateway.serialization.test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
@@ -14,6 +14,14 @@ import org.junit.Test;
|
||||
|
||||
import com.sap.sse.common.filter.TextOperator;
|
||||
import com.sap.sse.common.filter.TextOperator.Operators;
|
||||
import com.sap.sse.common.settings.EnumSetting;
|
||||
import com.sap.sse.common.settings.ListSetting;
|
||||
import com.sap.sse.common.settings.MapSettings;
|
||||
import com.sap.sse.common.settings.NumberSetting;
|
||||
import com.sap.sse.common.settings.Setting;
|
||||
import com.sap.sse.common.settings.Settings;
|
||||
import com.sap.sse.common.settings.StringSetting;
|
||||
import com.sap.sse.settings.SettingsToJsonSerializer;
|
||||
|
||||
public class SettingsJsonSerializationTest {
|
||||
@Test
|
||||
@@ -5,7 +5,7 @@ import java.util.Map;
|
||||
public class MapSettings extends AbstractSettings {
|
||||
private final Map<String, Setting> settingsMap;
|
||||
|
||||
protected MapSettings(Map<String, Setting> settingsMap) {
|
||||
public MapSettings(Map<String, Setting> settingsMap) {
|
||||
this.settingsMap = settingsMap;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,13 +11,15 @@ Export-Package: com.sap.sse,
|
||||
com.sap.sse.i18n.impl,
|
||||
com.sap.sse.osgi,
|
||||
com.sap.sse.qrcode,
|
||||
com.sap.sse.settings,
|
||||
com.sap.sse.util,
|
||||
com.sap.sse.util.impl,
|
||||
com.sap.sse.util.kmeans
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Require-Bundle: com.sap.sse.common,
|
||||
com.sap.sse.shared.android,
|
||||
org.apache.servicemix.bundles.zxing;bundle-version="3.1.0"
|
||||
org.apache.servicemix.bundles.zxing;bundle-version="3.1.0",
|
||||
org.json.simple;bundle-version="1.1.0"
|
||||
Import-Package: javax.servlet;version="3.1.0",
|
||||
javax.servlet.http;version="3.1.0",
|
||||
org.osgi.framework;version="1.8.0",
|
||||
|
||||
+15
-5
@@ -1,4 +1,4 @@
|
||||
package com.sap.sse.common.settings;
|
||||
package com.sap.sse.settings;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
@@ -10,6 +10,16 @@ import java.util.Map.Entry;
|
||||
import org.json.simple.JSONArray;
|
||||
import org.json.simple.JSONObject;
|
||||
|
||||
import com.sap.sse.common.settings.AbstractSettings;
|
||||
import com.sap.sse.common.settings.EnumSetting;
|
||||
import com.sap.sse.common.settings.ListSetting;
|
||||
import com.sap.sse.common.settings.MapSettings;
|
||||
import com.sap.sse.common.settings.NumberSetting;
|
||||
import com.sap.sse.common.settings.Setting;
|
||||
import com.sap.sse.common.settings.SettingType;
|
||||
import com.sap.sse.common.settings.Settings;
|
||||
import com.sap.sse.common.settings.StringSetting;
|
||||
|
||||
/**
|
||||
* Serializes a {@link Settings} object to a {@link JSONObject}. All setting types are supported as top-level entities.
|
||||
* Nesting of {@link Settings} is generally supported. For example, a {@link Settings} object can be contains as one
|
||||
@@ -136,11 +146,11 @@ public class SettingsToJsonSerializer {
|
||||
if (json.containsKey(typePropertyName)) {
|
||||
String[] typeNameAndClassName = ((String) json.get(typePropertyName)).split("/");
|
||||
type = SettingType.valueOf(typeNameAndClassName[0]);
|
||||
if (typeNameAndClassName.length > 1) {
|
||||
clazz = Class.forName(typeNameAndClassName[1]);
|
||||
} else {
|
||||
if (typeNameAndClassName.length > 1) {
|
||||
clazz = Class.forName(typeNameAndClassName[1]);
|
||||
} else {
|
||||
clazz = null;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
type = getSettingType(value);
|
||||
clazz = null;
|
||||
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: TracTrac Client module
|
||||
Bundle-SymbolicName: com.tractrac.clientmodule
|
||||
Bundle-Version: 3.0.10
|
||||
Bundle-Version: 3.0.11
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
|
||||
Bundle-ClassPath: .,
|
||||
lib/TracAPI.jar
|
||||
|
||||
@@ -16,6 +16,39 @@ It contains also some files:
|
||||
- test.sh -> script that compiles the code in the src folder, creates the test.jar library and execute the code of the example.
|
||||
- Manifest.txt -> manifest used to create the test.jar file
|
||||
|
||||
********************************************
|
||||
************* TracAPI 3.0.11 ***************
|
||||
********************************************
|
||||
This is a final version. It fixes bugs in the implementation and it adds a some features.
|
||||
These features add methods to the API, but they keep the backward compatibility.
|
||||
This version provides a new JavaDoc version.
|
||||
|
||||
Release date: 27/05/2015
|
||||
Build number: 10715
|
||||
|
||||
1) Features
|
||||
|
||||
- Adding the method IRace.setInitialized(boolean) that allows to load control point positions despite of
|
||||
the race is not initialized (Requested by Jorge Piera, 17/05/2015)
|
||||
|
||||
1) Bugs
|
||||
|
||||
- The subscription library sends (per each control point) an "ControlPointPosition" event with the positions
|
||||
of the parameters with a time stamp equals to the tracking start time. If the control point is static (it
|
||||
doesn't have a tracker), it means that this control won't exist until the tracking start time arrives: it is
|
||||
not possible to open a subscription connection before the tracking start time and see the control point. But
|
||||
if the control is static, it has to exist during all the event. Now when a control is static, the subscription
|
||||
library sends a "ControlPointPosition" event with the event start time and then it sends other "ControlPointPosition"
|
||||
event with the tracking start time. It allows to connect with future races and see the static controls (Requested
|
||||
by Jakob Odum, 25/02/2015)
|
||||
|
||||
- It is possible to add two or more subscriptions for the same subscriber (Reported by Jorge Piera, 02/05/2015)
|
||||
|
||||
- If a race is in a not initialized state and it is loaded using the parameters file, the library assumes that
|
||||
the consumer application wants to load the race and it changes its initialized attribute to true. This assumption
|
||||
is wrong. Now, if a race is not initialized it will continue being uninitialized until the event administrator
|
||||
changes its state to initialized (Reported by Axel Uhl, 17/05/2015)
|
||||
|
||||
********************************************
|
||||
************* TracAPI 3.0.10 ***************
|
||||
********************************************
|
||||
|
||||
Binary file not shown.
@@ -8,6 +8,6 @@
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>com.tractrac.clientmodule</artifactId>
|
||||
<version>3.0.10</version>
|
||||
<version>3.0.11</version>
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
</project>
|
||||
Reference in new issue
Block a user