Merge branch 'bug-2008'

This commit is contained in:
Frederik Petersen committed 2014-06-21 17:51:35 +02:00
commit fa09759b73
6 files changed
+36 -14

No files matched your search

@@ -92,9 +92,10 @@ public class RaceBoardEntryPoint extends AbstractEntryPoint {
final boolean canReplayWhileLiveIsPossible = GwtHttpRequestUtils.getBooleanParameter(RaceBoardViewConfiguration.PARAM_CAN_REPLAY_DURING_LIVE_RACES, false);
final boolean autoSelectMedia = GwtHttpRequestUtils.getBooleanParameter(RaceBoardViewConfiguration.PARAM_AUTOSELECT_MEDIA, false);
final boolean showMapControls = GwtHttpRequestUtils.getBooleanParameter(RaceBoardViewConfiguration.PARAM_VIEW_SHOW_MAPCONTROLS, true /* default*/);
raceboardViewConfig = new RaceBoardViewConfiguration(activeCompetitorsFilterSetName, showLeaderboard, showWindChart,
showCompetitorsChart, canReplayWhileLiveIsPossible, autoSelectMedia);
final boolean showNavigationPanel = GwtHttpRequestUtils.getBooleanParameter(RaceBoardViewConfiguration.PARAM_VIEW_SHOW_NAVIGATION_PANEL, true /* default */);
raceboardViewConfig = new RaceBoardViewConfiguration(activeCompetitorsFilterSetName, showLeaderboard,
showWindChart, showCompetitorsChart, canReplayWhileLiveIsPossible, autoSelectMedia, showNavigationPanel);
final ParallelExecutionCallback<List<String>> getLeaderboardNamesCallback = new ParallelExecutionCallback<List<String>>();
final ParallelExecutionCallback<List<RegattaDTO>> getRegattasCallback = new ParallelExecutionCallback<List<RegattaDTO>>();
final ParallelExecutionCallback<LeaderboardGroupDTO> getLeaderboardGroupByNameCallback = new ParallelExecutionCallback<LeaderboardGroupDTO>();
@@ -165,7 +166,7 @@ public class RaceBoardEntryPoint extends AbstractEntryPoint {
RaceBoardPanel raceBoardPanel = new RaceBoardPanel(sailingService, mediaService, user, timer, raceSelectionModel, leaderboardName,
leaderboardGroupName, raceboardViewConfig, RaceBoardEntryPoint.this, stringMessages, userAgent, raceTimesInfoProvider, showMapControls);
raceBoardPanel.fillRegattas(regattas);
createRaceBoardInOneScreenMode(raceBoardPanel);
createRaceBoardInOneScreenMode(raceBoardPanel, raceboardViewConfig);
}
private RaceDTO findRace(String regattaName, String raceName, List<RegattaDTO> regattas) {
@@ -217,7 +218,8 @@ public class RaceBoardEntryPoint extends AbstractEntryPoint {
return logoAndTitlePanel;
}
private void createRaceBoardInOneScreenMode(RaceBoardPanel raceBoardPanel) {
private void createRaceBoardInOneScreenMode(RaceBoardPanel raceBoardPanel,
RaceBoardViewConfiguration raceboardViewConfiguration) {
DockLayoutPanel p = new DockLayoutPanel(Unit.PX);
RootLayoutPanel.get().add(p);
Panel toolbarPanel = raceBoardPanel.getToolbarPanel();
@@ -229,9 +231,11 @@ public class RaceBoardEntryPoint extends AbstractEntryPoint {
FlowPanel logoAndTitlePanel = createLogoAndTitlePanel(raceBoardPanel);
FlowPanel timePanel = createTimePanel(raceBoardPanel);
p.addNorth(logoAndTitlePanel, 68);
p.addNorth(toolbarPanel, 40);
p.addSouth(timePanel, 90);
if (raceboardViewConfiguration.isShowNavigationPanel()) {
p.addNorth(toolbarPanel, 40);
}
p.addSouth(timePanel, 90);
p.add(raceBoardPanel);
p.addStyleName("dockLayoutPanel");
}
}
}
@@ -163,6 +163,7 @@ public class RaceBoardPanel extends SimplePanel implements RegattasDisplayer, Ra
componentControlsPanel = new FlowPanel();
componentControlsPanel.addStyleName("raceBoardNavigation");
toolbarPanel.add(componentControlsPanel);
viewControlsPanel = new FlowPanel();
viewControlsPanel.addStyleName("raceBoardControls");
toolbarPanel.add(viewControlsPanel);
@@ -12,6 +12,7 @@ public class RaceBoardViewConfiguration {
private String activeCompetitorsFilterSetName;
private boolean canReplayDuringLiveRaces;
private final boolean autoSelectMedia;
private final boolean showNavigationPanel;
public static final String PARAM_VIEW_MODE = "viewMode";
public static final String PARAM_VIEW_SHOW_LEADERBOARD = "viewShowLeaderboard";
@@ -28,16 +29,19 @@ public class RaceBoardViewConfiguration {
showWindChart = false;
showCompetitorsChart = false;
autoSelectMedia = false;
showNavigationPanel = true;
}
public RaceBoardViewConfiguration(String activeCompetitorsFilterSetName, boolean showLeaderboard,
boolean showWindChart, boolean showCompetitorsChart, boolean canReplayDuringLiveRaces, boolean autoSelectMedia) {
boolean showWindChart, boolean showCompetitorsChart, boolean canReplayDuringLiveRaces,
boolean autoSelectMedia, boolean showNavigationPanel) {
this.activeCompetitorsFilterSetName = activeCompetitorsFilterSetName;
this.showLeaderboard = showLeaderboard;
this.showWindChart = showWindChart;
this.showCompetitorsChart = showCompetitorsChart;
this.canReplayDuringLiveRaces = canReplayDuringLiveRaces;
this.autoSelectMedia = autoSelectMedia;
this.autoSelectMedia = autoSelectMedia;
this.showNavigationPanel = showNavigationPanel;
}
public boolean isShowLeaderboard() {
@@ -64,4 +68,8 @@ public class RaceBoardViewConfiguration {
return autoSelectMedia;
}
public boolean isShowNavigationPanel() {
return showNavigationPanel;
}
}
@@ -104,11 +104,13 @@ public class LeaderboardGroupPanel extends SimplePanel implements HasWelcomeWidg
private final boolean showRaceDetails;
private final boolean canReplayDuringLiveRaces;
private final boolean showMapControls;
private final boolean showNavigationPanel;
private final Timer timerForClientServerOffset;
public LeaderboardGroupPanel(SailingServiceAsync sailingService, StringMessages stringConstants,
ErrorReporter errorReporter, final String groupName, String root, String viewMode, boolean embedded,
boolean showRaceDetails, boolean canReplayDuringLiveRaces, boolean showMapControls) {
boolean showRaceDetails, boolean canReplayDuringLiveRaces, boolean showMapControls,
boolean showNavigationPanel) {
super();
this.isEmbedded = embedded;
this.showRaceDetails = showRaceDetails;
@@ -117,6 +119,7 @@ public class LeaderboardGroupPanel extends SimplePanel implements HasWelcomeWidg
this.sailingService = sailingService;
this.stringMessages = stringConstants;
this.errorReporter = errorReporter;
this.showNavigationPanel = showNavigationPanel;
this.root = (root == null || root.length() == 0) ? "leaderboardGroupPanel" : root;
this.viewMode = viewMode;
setWidth("95%");
@@ -424,6 +427,8 @@ public class LeaderboardGroupPanel extends SimplePanel implements HasWelcomeWidg
linkParams.put(RaceBoardViewConfiguration.PARAM_CAN_REPLAY_DURING_LIVE_RACES, "true");
}
linkParams.put(RaceBoardViewConfiguration.PARAM_VIEW_SHOW_MAPCONTROLS, Boolean.toString(showMapControls));
linkParams.put(RaceBoardViewConfiguration.PARAM_VIEW_SHOW_NAVIGATION_PANEL,
Boolean.toString(showNavigationPanel));
linkParams.put("regattaName", raceIdentifier.getRegattaName());
linkParams.put("leaderboardGroupName", leaderboardGroup.getName());
if (viewMode != null && !viewMode.isEmpty()) {
@@ -43,6 +43,8 @@ public class SpectatorEntryPoint extends AbstractEntryPoint implements RegattaRe
RaceBoardViewConfiguration.PARAM_CAN_REPLAY_DURING_LIVE_RACES, /* defaultValue */ false);
final boolean showMapControls = GwtHttpRequestUtils.getBooleanParameter(
RaceBoardViewConfiguration.PARAM_VIEW_SHOW_MAPCONTROLS, /* defaultValue */ true);
final boolean showNavigationPanel = GwtHttpRequestUtils.getBooleanParameter(
RaceBoardViewConfiguration.PARAM_VIEW_SHOW_NAVIGATION_PANEL, true /* default */);
boolean showRaceDetails = Window.Location.getParameter("showRaceDetails") != null
&& Window.Location.getParameter("showRaceDetails").equalsIgnoreCase("true");
final String groupName;
@@ -93,7 +95,8 @@ public class SpectatorEntryPoint extends AbstractEntryPoint implements RegattaRe
rootPanel.add(groupOverviewPanel);
} else {
LeaderboardGroupPanel groupPanel = new LeaderboardGroupPanel(sailingService, stringMessages, this,
groupName, root, viewModeParamValue, embedded, showRaceDetails, canReplayDuringLiveRaces, showMapControls);
groupName, root, viewModeParamValue, embedded, showRaceDetails, canReplayDuringLiveRaces,
showMapControls, showNavigationPanel);
groupAndFeedbackPanel.add(groupPanel);
if (!embedded) {
groupPanel.setWelcomeWidget(new SimpleWelcomeWidget(stringMessages.welcomeToSailingAnalytics(),
@@ -58,8 +58,9 @@ public class TVEntryPoint extends AbstractEntryPoint {
RaceBoardViewConfiguration.PARAM_VIEW_SHOW_COMPETITORSCHART, false /* default */);
String activeCompetitorsFilterSetName = GwtHttpRequestUtils.getStringParameter(RaceBoardViewConfiguration.PARAM_VIEW_COMPETITOR_FILTER, null /* default*/);
final boolean autoSelectMedia = GwtHttpRequestUtils.getBooleanParameter(RaceBoardViewConfiguration.PARAM_AUTOSELECT_MEDIA, false);
raceboardViewConfig = new RaceBoardViewConfiguration(activeCompetitorsFilterSetName,
showLeaderboard, showWindChart, showCompetitorsChart, /* canReplayWhileLiveIsPossible */ false, autoSelectMedia);
raceboardViewConfig = new RaceBoardViewConfiguration(activeCompetitorsFilterSetName, showLeaderboard,
showWindChart, showCompetitorsChart, /* canReplayWhileLiveIsPossible */false, autoSelectMedia,
showNavigationPanel);
sailingService.getLeaderboardNames(new AsyncCallback<List<String>>() {
@Override