mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-11-08 20:12:23 +00:00
Autoplay settings working
This commit is contained in:
1 parent
29fa3bc38f
commit
5ca88cc1e3
29 files changed
+207
-269
No files matched your search
+2
-2
@@ -12,7 +12,6 @@ import com.sap.sailing.gwt.ui.leaderboard.LeaderboardSettings;
|
||||
import com.sap.sailing.gwt.ui.leaderboard.SortedCellTable;
|
||||
import com.sap.sse.gwt.client.ErrorReporter;
|
||||
import com.sap.sse.gwt.client.async.AsyncActionsExecutor;
|
||||
import com.sap.sse.gwt.client.useragent.UserAgentDetails;
|
||||
|
||||
public class LeaderboardPanelMock extends LeaderboardPanel {
|
||||
|
||||
@@ -21,7 +20,8 @@ public class LeaderboardPanelMock extends LeaderboardPanel {
|
||||
StringMessages stringMessages) {
|
||||
super(null, null, sailingService, new AsyncActionsExecutor(), new LeaderboardSettings(),
|
||||
new CompetitorSelectionModel(
|
||||
/* hasMultiSelection */true), leaderboardName, errorReporter, stringMessages, new UserAgentDetails("gecko1_8"), /* showRaceDetails */ true);
|
||||
/* hasMultiSelection */true),
|
||||
leaderboardName, errorReporter, stringMessages, /* showRaceDetails */ true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+1
-3
@@ -1,9 +1,7 @@
|
||||
package com.sap.sailing.gwt.autoplay.client.app;
|
||||
|
||||
import com.sap.sailing.gwt.autoplay.client.place.player.AutoPlayerConfiguration;
|
||||
|
||||
public interface PlaceNavigator {
|
||||
void goToStart();
|
||||
|
||||
void goToPlayer(AutoPlayerConfiguration playerConfig, String settingsString);
|
||||
void goToPlayer(String contextAndSettings);
|
||||
}
|
||||
+2
-3
@@ -1,7 +1,6 @@
|
||||
package com.sap.sailing.gwt.autoplay.client.app;
|
||||
|
||||
import com.google.gwt.place.shared.PlaceController;
|
||||
import com.sap.sailing.gwt.autoplay.client.place.player.AutoPlayerConfiguration;
|
||||
import com.sap.sailing.gwt.autoplay.client.place.player.PlayerPlace;
|
||||
import com.sap.sailing.gwt.autoplay.client.place.start.StartPlace;
|
||||
|
||||
@@ -19,8 +18,8 @@ public class PlaceNavigatorImpl implements PlaceNavigator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void goToPlayer(AutoPlayerConfiguration playerConfig, String settingsplace) {
|
||||
PlayerPlace playerPlace = new PlayerPlace(playerConfig, settingsplace);
|
||||
public void goToPlayer(String contextAndSettings) {
|
||||
PlayerPlace playerPlace = new PlayerPlace(contextAndSettings);
|
||||
placeController.goTo(playerPlace);
|
||||
}
|
||||
|
||||
|
||||
+29
-39
@@ -10,9 +10,9 @@ import com.sap.sailing.domain.common.RegattaAndRaceIdentifier;
|
||||
import com.sap.sailing.domain.common.dto.FleetDTO;
|
||||
import com.sap.sailing.domain.common.dto.LeaderboardDTO;
|
||||
import com.sap.sailing.domain.common.dto.RaceColumnDTO;
|
||||
import com.sap.sailing.gwt.autoplay.client.shared.leaderboard.LeaderboardWithHeaderComponentContext;
|
||||
import com.sap.sailing.gwt.autoplay.client.place.start.AutoplayPerspectiveLifecycle;
|
||||
import com.sap.sailing.gwt.autoplay.client.place.start.AutoplayPerspectiveOwnSettings;
|
||||
import com.sap.sailing.gwt.autoplay.client.shared.leaderboard.LeaderboardWithHeaderPerspective;
|
||||
import com.sap.sailing.gwt.autoplay.client.shared.leaderboard.LeaderboardWithHeaderPerspectiveLifecycle;
|
||||
import com.sap.sailing.gwt.autoplay.client.shared.leaderboard.LeaderboardWithHeaderPerspectiveSettings;
|
||||
import com.sap.sailing.gwt.ui.client.CompetitorSelectionModel;
|
||||
import com.sap.sailing.gwt.ui.client.LeaderboardUpdateListener;
|
||||
@@ -22,9 +22,7 @@ import com.sap.sailing.gwt.ui.client.RaceTimesInfoProviderListener;
|
||||
import com.sap.sailing.gwt.ui.client.SailingServiceAsync;
|
||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
import com.sap.sailing.gwt.ui.leaderboard.LeaderboardEntryPoint;
|
||||
import com.sap.sailing.gwt.ui.raceboard.RaceBoardComponentContext;
|
||||
import com.sap.sailing.gwt.ui.raceboard.RaceBoardPanel;
|
||||
import com.sap.sailing.gwt.ui.raceboard.RaceBoardPerspectiveLifecycle;
|
||||
import com.sap.sailing.gwt.ui.raceboard.RaceBoardPerspectiveSettings;
|
||||
import com.sap.sailing.gwt.ui.shared.RaceTimesInfoDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.RaceboardDataDTO;
|
||||
@@ -63,22 +61,15 @@ public class AutoPlayController implements RaceTimesInfoProviderListener, Leader
|
||||
// raceboard perspective related attributes
|
||||
private RegattaAndRaceIdentifier currentLiveRace;
|
||||
|
||||
private LeaderboardWithHeaderPerspectiveLifecycle leaderboardLifecycle;
|
||||
private PerspectiveCompositeSettings<LeaderboardWithHeaderPerspectiveSettings> leaderboardSettings;
|
||||
private RaceBoardPerspectiveLifecycle raceboardLifecycle;
|
||||
private PerspectiveCompositeSettings<RaceBoardPerspectiveSettings> raceboardSettings;
|
||||
|
||||
private final PlayerView playerView;
|
||||
private final AutoPlayerConfiguration autoPlayerConfiguration;
|
||||
|
||||
private final LeaderboardWithHeaderComponentContext leaderboardWithHeaderContext;
|
||||
private final RaceBoardComponentContext raceBoardContext;
|
||||
|
||||
public AutoPlayController(LeaderboardWithHeaderComponentContext leaderboardWithHeaderContext, RaceBoardComponentContext raceBoardContext, SailingServiceAsync sailingService, MediaServiceAsync mediaService,
|
||||
UserService userService, ErrorReporter errorReporter, AutoPlayerConfiguration autoPlayerConfiguration,
|
||||
UserAgentDetails userAgent, long delayToLiveInMillis, boolean showRaceDetails, PlayerView playerView) {
|
||||
this.leaderboardWithHeaderContext = leaderboardWithHeaderContext;
|
||||
this.raceBoardContext = raceBoardContext;
|
||||
private final AutoPlayerContext autoPlayerConfiguration;
|
||||
private PerspectiveCompositeSettings<AutoplayPerspectiveOwnSettings> settings;
|
||||
private AutoplayPerspectiveLifecycle autoplayLiveCycle;
|
||||
|
||||
public AutoPlayController(SailingServiceAsync sailingService, MediaServiceAsync mediaService,
|
||||
UserService userService, ErrorReporter errorReporter, AutoPlayerContext autoPlayerConfiguration,
|
||||
PerspectiveCompositeSettings<AutoplayPerspectiveOwnSettings> settings,
|
||||
UserAgentDetails userAgent, PlayerView playerView, AutoplayPerspectiveLifecycle autoplayLiveCycle) {
|
||||
this.sailingService = sailingService;
|
||||
this.mediaService = mediaService;
|
||||
this.userService = userService;
|
||||
@@ -86,15 +77,18 @@ public class AutoPlayController implements RaceTimesInfoProviderListener, Leader
|
||||
this.autoPlayerConfiguration = autoPlayerConfiguration;
|
||||
this.userAgent = userAgent;
|
||||
this.playerView = playerView;
|
||||
this.settings = settings;
|
||||
this.autoplayLiveCycle = autoplayLiveCycle;
|
||||
|
||||
asyncActionsExecutor = new AsyncActionsExecutor();
|
||||
currentLeaderboard = null;
|
||||
leaderboardTimer = new Timer(PlayModes.Live, /* delayBetweenAutoAdvancesInMilliseconds */ LeaderboardEntryPoint.DEFAULT_REFRESH_INTERVAL_MILLIS);
|
||||
leaderboardTimer.setLivePlayDelayInMillis(delayToLiveInMillis);
|
||||
leaderboardTimer
|
||||
.setLivePlayDelayInMillis(settings.getPerspectiveOwnSettings().getTimeToSwitchBeforeRaceStart());
|
||||
leaderboardTimer.setRefreshInterval(REFRESH_INTERVAL_IN_MILLIS_LEADERBOARD);
|
||||
leaderboardTimer.play();
|
||||
raceboardTimer = new Timer(PlayModes.Live, /* delayBetweenAutoAdvancesInMilliseconds */1000l);
|
||||
raceboardTimer.setLivePlayDelayInMillis(delayToLiveInMillis);
|
||||
raceboardTimer.setLivePlayDelayInMillis(settings.getPerspectiveOwnSettings().getTimeToSwitchBeforeRaceStart());
|
||||
raceboardTimer.setRefreshInterval(REFRESH_INTERVAL_IN_MILLIS_RACEBOARD);
|
||||
raceboardTimer.play();
|
||||
|
||||
@@ -105,21 +99,18 @@ public class AutoPlayController implements RaceTimesInfoProviderListener, Leader
|
||||
private void showLeaderboard() {
|
||||
if (activeTvView != AutoPlayModes.Leaderboard) {
|
||||
|
||||
if (leaderboardLifecycle == null) {
|
||||
leaderboardLifecycle = leaderboardWithHeaderContext.getRootLifecycle();
|
||||
}
|
||||
if (leaderboardSettings == null) {
|
||||
leaderboardSettings = leaderboardWithHeaderContext.getDefaultSettings();
|
||||
}
|
||||
|
||||
playerView.clearContent();
|
||||
boolean withFullscreenButton = autoPlayerConfiguration.isFullscreenMode() && isInitialScreen;
|
||||
boolean withFullscreenButton = settings.getPerspectiveOwnSettings().isFullscreen() && isInitialScreen;
|
||||
|
||||
PerspectiveCompositeSettings<LeaderboardWithHeaderPerspectiveSettings> leaderboardSettings = settings
|
||||
.findSettingsByComponentId(autoplayLiveCycle.getLeaderboardLifecycle().getComponentId());
|
||||
|
||||
LeaderboardWithHeaderPerspective leaderboardPerspective = new LeaderboardWithHeaderPerspective(null,
|
||||
leaderboardWithHeaderContext, leaderboardLifecycle, leaderboardSettings,
|
||||
null, autoplayLiveCycle.getLeaderboardLifecycle(), leaderboardSettings,
|
||||
sailingService, userService, asyncActionsExecutor,
|
||||
new CompetitorSelectionModel(/* hasMultiSelection */ true), leaderboardTimer,
|
||||
autoPlayerConfiguration.getLeaderboardName(), errorReporter, StringMessages.INSTANCE,
|
||||
userAgent, withFullscreenButton);
|
||||
withFullscreenButton);
|
||||
|
||||
playerView.setContent(leaderboardPerspective);
|
||||
currentLiveRace = null;
|
||||
@@ -138,15 +129,13 @@ public class AutoPlayController implements RaceTimesInfoProviderListener, Leader
|
||||
@Override
|
||||
public void onSuccess(RaceboardDataDTO result) {
|
||||
|
||||
if (raceboardLifecycle == null) {
|
||||
raceboardLifecycle = raceBoardContext.getRootLifecycle();
|
||||
}
|
||||
if (raceboardSettings == null) {
|
||||
raceboardSettings = raceBoardContext.getDefaultSettings();
|
||||
}
|
||||
playerView.clearContent();
|
||||
|
||||
RaceBoardPanel raceboardPerspective = new RaceBoardPanel(null, raceBoardContext, raceboardLifecycle,
|
||||
PerspectiveCompositeSettings<RaceBoardPerspectiveSettings> raceboardSettings = settings
|
||||
.findSettingsByComponentId(autoplayLiveCycle.getRaceboardLifecycle().getComponentId());
|
||||
|
||||
RaceBoardPanel raceboardPerspective = new RaceBoardPanel(null, null,
|
||||
autoplayLiveCycle.getRaceboardLifecycle(),
|
||||
raceboardSettings,
|
||||
sailingService, mediaService, userService, asyncActionsExecutor,
|
||||
result.getCompetitorAndTheirBoats(), raceboardTimer, currentLiveRace, autoPlayerConfiguration.getLeaderboardName(),
|
||||
@@ -217,7 +206,8 @@ public class AutoPlayController implements RaceTimesInfoProviderListener, Leader
|
||||
RaceTimesInfoDTO raceTimes = raceTimesInfos.get(raceIdentifier);
|
||||
if (raceTimes != null && raceTimes.startOfTracking != null && raceTimes.getStartOfRace() != null && raceTimes.endOfRace == null) {
|
||||
long startTimeInMs = raceTimes.getStartOfRace().getTime();
|
||||
long timeToSwitchBeforeRaceStartInMs = autoPlayerConfiguration.getTimeToSwitchBeforeRaceStartInSeconds() * 1000;
|
||||
long timeToSwitchBeforeRaceStartInMs = settings.getPerspectiveOwnSettings()
|
||||
.getTimeToSwitchBeforeRaceStart() * 1000;
|
||||
long delayToLiveInMs = raceTimes.delayToLiveInMs;
|
||||
// the switch to the live race should happen at a defined timepoint before the race start (default is 3 min)
|
||||
if (serverTimePointAsMillis - delayToLiveInMs > startTimeInMs - timeToSwitchBeforeRaceStartInMs) {
|
||||
|
||||
-37
@@ -1,37 +0,0 @@
|
||||
package com.sap.sailing.gwt.autoplay.client.place.player;
|
||||
|
||||
|
||||
public class AutoPlayerConfiguration {
|
||||
public final static String PARAM_EVENTID = "eventId";
|
||||
public final static String PARAM_FULLSCREEN = "fullscreen";
|
||||
public final static String PARAM_LEADEROARD_NAME = "leaderboardName";
|
||||
public final static String PARAM_TIME_TO_SWITCH_BEFORE_RACE_START = "timeToSwitchBeforeRaceStart";
|
||||
|
||||
private String eventUidAsString;
|
||||
private String leaderboardName;
|
||||
private boolean fullscreenMode;
|
||||
private long timeToSwitchBeforeRaceStartInSeconds;
|
||||
|
||||
public AutoPlayerConfiguration(String eventUidAsString, String leaderboardName, boolean fullscreenMode, long timeToSwitchBeforeRaceStartInSeconds) {
|
||||
this.eventUidAsString = eventUidAsString;
|
||||
this.leaderboardName = leaderboardName;
|
||||
this.fullscreenMode = fullscreenMode;
|
||||
this.timeToSwitchBeforeRaceStartInSeconds = timeToSwitchBeforeRaceStartInSeconds;
|
||||
}
|
||||
|
||||
public String getEventUidAsString() {
|
||||
return eventUidAsString;
|
||||
}
|
||||
|
||||
public String getLeaderboardName() {
|
||||
return leaderboardName;
|
||||
}
|
||||
|
||||
public boolean isFullscreenMode() {
|
||||
return fullscreenMode;
|
||||
}
|
||||
|
||||
public long getTimeToSwitchBeforeRaceStartInSeconds() {
|
||||
return timeToSwitchBeforeRaceStartInSeconds;
|
||||
}
|
||||
}
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
package com.sap.sailing.gwt.autoplay.client.place.player;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import com.sap.sse.common.settings.generic.AbstractGenericSerializableSettings;
|
||||
import com.sap.sse.common.settings.generic.StringSetting;
|
||||
import com.sap.sse.common.settings.generic.UUIDSetting;
|
||||
|
||||
public class AutoPlayerContext extends AbstractGenericSerializableSettings {
|
||||
private static final long serialVersionUID = 2880854263616658272L;
|
||||
|
||||
private transient UUIDSetting eventUUID;
|
||||
private transient StringSetting leaderboardName;
|
||||
|
||||
public AutoPlayerContext(UUID eventUUID, String leaderboardName) {
|
||||
this.eventUUID.setValue(eventUUID);
|
||||
this.leaderboardName.setValue(leaderboardName);
|
||||
}
|
||||
|
||||
public AutoPlayerContext() {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addChildSettings() {
|
||||
eventUUID = new UUIDSetting("eventId", this);
|
||||
leaderboardName = new StringSetting("name", this);
|
||||
}
|
||||
|
||||
public UUID getEventUidAsString() {
|
||||
return eventUUID.getValue();
|
||||
}
|
||||
|
||||
public String getLeaderboardName() {
|
||||
return leaderboardName.getValue();
|
||||
}
|
||||
}
|
||||
+26
-49
@@ -7,29 +7,20 @@ import com.google.gwt.event.shared.EventBus;
|
||||
import com.google.gwt.user.client.Window;
|
||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||
import com.google.gwt.user.client.ui.AcceptsOneWidget;
|
||||
import com.sap.sailing.gwt.autoplay.client.shared.leaderboard.LeaderboardWithHeaderComponentContext;
|
||||
import com.sap.sailing.gwt.autoplay.client.shared.leaderboard.LeaderboardWithHeaderPerspectiveLifecycle;
|
||||
import com.sap.sailing.gwt.autoplay.client.shared.leaderboard.LeaderboardWithHeaderPerspectiveSettings;
|
||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
import com.sap.sailing.gwt.ui.raceboard.RaceBoardComponentContext;
|
||||
import com.sap.sailing.gwt.ui.raceboard.RaceBoardPerspectiveLifecycle;
|
||||
import com.sap.sailing.gwt.ui.raceboard.RaceBoardPerspectiveSettings;
|
||||
import com.sap.sailing.gwt.autoplay.client.place.start.AutoplayPerspectiveLifecycle;
|
||||
import com.sap.sailing.gwt.autoplay.client.place.start.AutoplayPerspectiveOwnSettings;
|
||||
import com.sap.sailing.gwt.ui.shared.EventDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.LeaderboardGroupDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.StrippedLeaderboardDTO;
|
||||
import com.sap.sse.gwt.client.mvp.ErrorView;
|
||||
import com.sap.sse.gwt.client.shared.perspective.DefaultOnSettingsLoadedCallback;
|
||||
import com.sap.sse.gwt.client.shared.perspective.PerspectiveCompositeSettings;
|
||||
import com.sap.sse.gwt.client.useragent.UserAgentDetails;
|
||||
import com.sap.sse.gwt.shared.GwtHttpRequestUtils;
|
||||
import com.sap.sse.gwt.settings.SettingsToStringSerializer;
|
||||
|
||||
public class PlayerActivity extends AbstractActivity {
|
||||
private final PlayerClientFactory clientFactory;
|
||||
private final PlayerPlace playerPlace;
|
||||
private AutoPlayController autoPlayController;
|
||||
|
||||
private static final String PARAM_SHOW_RACE_DETAILS = "showRaceDetails";
|
||||
private static final String PARAM_DELAY_TO_LIVE_MILLIS = "delayToLiveMillis";
|
||||
private AutoPlayController autoPlayController;
|
||||
|
||||
public PlayerActivity(PlayerPlace playerPlace, PlayerClientFactory clientFactory) {
|
||||
this.playerPlace = playerPlace;
|
||||
@@ -37,7 +28,7 @@ public class PlayerActivity extends AbstractActivity {
|
||||
this.autoPlayController = null;
|
||||
}
|
||||
|
||||
private StrippedLeaderboardDTO getSelectedLeaderboard(EventDTO event,String leaderBoardName) {
|
||||
private StrippedLeaderboardDTO getSelectedLeaderboard(EventDTO event, String leaderBoardName) {
|
||||
for (LeaderboardGroupDTO leaderboardGroup : event.getLeaderboardGroups()) {
|
||||
for (StrippedLeaderboardDTO leaderboard : leaderboardGroup.getLeaderboards()) {
|
||||
if (leaderboard.name.equals(leaderBoardName)) {
|
||||
@@ -47,50 +38,36 @@ public class PlayerActivity extends AbstractActivity {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void start(final AcceptsOneWidget panel, EventBus eventBus) {
|
||||
final boolean showRaceDetails = GwtHttpRequestUtils.getBooleanParameter(PARAM_SHOW_RACE_DETAILS, false);
|
||||
final long delayToLiveMillis = Window.Location.getParameter(PARAM_DELAY_TO_LIVE_MILLIS) != null ? Long
|
||||
.valueOf(Window.Location.getParameter(PARAM_DELAY_TO_LIVE_MILLIS)) : 5000l; // default 5s
|
||||
|
||||
final UUID eventUUID = UUID.fromString(playerPlace.getConfiguration().getEventUidAsString());
|
||||
|
||||
|
||||
// get the event
|
||||
SettingsToStringSerializer stringSerializer = new SettingsToStringSerializer();
|
||||
AutoPlayerContext context = new AutoPlayerContext();
|
||||
stringSerializer.fromString(playerPlace.getContext(), context);
|
||||
final UUID eventUUID = context.getEventUidAsString();
|
||||
|
||||
AsyncCallback<EventDTO> getEventByIdAsyncCallback = new AsyncCallback<EventDTO>() {
|
||||
@Override
|
||||
public void onSuccess(final EventDTO event) {
|
||||
StrippedLeaderboardDTO leaderBoardDTO = getSelectedLeaderboard(event, context.getLeaderboardName());
|
||||
AutoplayPerspectiveLifecycle autoplayLiveCycle = new AutoplayPerspectiveLifecycle(leaderBoardDTO);
|
||||
PerspectiveCompositeSettings<AutoplayPerspectiveOwnSettings> autoplaySettings = stringSerializer
|
||||
.fromString(playerPlace.getContext(), autoplayLiveCycle.createDefaultSettings());
|
||||
|
||||
//This place fixes a specific null pointer bug3950, once the settings are redone, this should be removed, and instead be done via playerplace (see comment there)
|
||||
StrippedLeaderboardDTO leaderBoardDTO = getSelectedLeaderboard(event,playerPlace.getConfiguration().getLeaderboardName());
|
||||
LeaderboardWithHeaderPerspectiveLifecycle leaderboardPerspectiveLifecycle = new LeaderboardWithHeaderPerspectiveLifecycle(leaderBoardDTO, StringMessages.INSTANCE);
|
||||
RaceBoardPerspectiveLifecycle raceboardPerspectiveLifecycle = new RaceBoardPerspectiveLifecycle(leaderBoardDTO, StringMessages.INSTANCE);
|
||||
|
||||
final RaceBoardComponentContext raceBoardContext = new RaceBoardComponentContext(clientFactory.getUserService(), "AutoPlay.RaceBoard", raceboardPerspectiveLifecycle, null, null, playerPlace.getConfiguration().getLeaderboardName(), null, eventUUID);
|
||||
final LeaderboardWithHeaderComponentContext leaderboardWithHeaderContext = new LeaderboardWithHeaderComponentContext(clientFactory.getUserService(), "AutoPlay.Leaderboard", leaderboardPerspectiveLifecycle);
|
||||
|
||||
raceBoardContext.initInitialSettings();
|
||||
|
||||
clientFactory.getUserService().updateUser(true);
|
||||
|
||||
|
||||
UserAgentDetails userAgent = new UserAgentDetails(Window.Navigator.getUserAgent());
|
||||
PlayerView view = clientFactory.createPlayerView();
|
||||
panel.setWidget(view.asWidget());
|
||||
|
||||
autoPlayController = new AutoPlayController(leaderboardWithHeaderContext, raceBoardContext, clientFactory.getSailingService(), clientFactory
|
||||
.getMediaService(), clientFactory.getUserService(), clientFactory.getErrorReporter(),
|
||||
playerPlace.getConfiguration(), userAgent, delayToLiveMillis, showRaceDetails, view);
|
||||
raceBoardContext.initInitialSettings(new DefaultOnSettingsLoadedCallback<PerspectiveCompositeSettings<RaceBoardPerspectiveSettings>>() {
|
||||
@Override
|
||||
public void onSuccess(PerspectiveCompositeSettings<RaceBoardPerspectiveSettings> defaultSettings) {
|
||||
leaderboardWithHeaderContext.initInitialSettings(new DefaultOnSettingsLoadedCallback<PerspectiveCompositeSettings<LeaderboardWithHeaderPerspectiveSettings>>() {
|
||||
@Override
|
||||
public void onSuccess(
|
||||
PerspectiveCompositeSettings<LeaderboardWithHeaderPerspectiveSettings> defaultSettings) {
|
||||
autoPlayController.updatePlayMode(AutoPlayModes.Leaderboard);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
autoPlayController = new AutoPlayController(clientFactory.getSailingService(),
|
||||
clientFactory.getMediaService(), clientFactory.getUserService(),
|
||||
clientFactory.getErrorReporter(), context, autoplaySettings, userAgent, view,
|
||||
autoplayLiveCycle);
|
||||
|
||||
autoPlayController.updatePlayMode(AutoPlayModes.Leaderboard);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -98,7 +75,7 @@ public class PlayerActivity extends AbstractActivity {
|
||||
createErrorView("Error while loading the event with service getEventById()", caught, panel);
|
||||
}
|
||||
};
|
||||
clientFactory.getSailingService().getEventById(eventUUID, true, getEventByIdAsyncCallback);
|
||||
clientFactory.getSailingService().getEventById(eventUUID, true, getEventByIdAsyncCallback);
|
||||
}
|
||||
|
||||
private void createErrorView(String errorMessage, Throwable errorReason, AcceptsOneWidget panel) {
|
||||
|
||||
+12
-28
@@ -1,46 +1,30 @@
|
||||
package com.sap.sailing.gwt.autoplay.client.place.player;
|
||||
|
||||
import com.google.gwt.place.shared.Place;
|
||||
import com.google.gwt.place.shared.PlaceTokenizer;
|
||||
import com.sap.sailing.gwt.common.client.AbstractBasePlace;
|
||||
import com.sap.sse.gwt.settings.SettingsToStringSerializer;
|
||||
|
||||
public class PlayerPlace extends AbstractBasePlace {
|
||||
private final AutoPlayerConfiguration playerConfiguration;
|
||||
public class PlayerPlace extends Place {
|
||||
private final String contextAndSettings;
|
||||
|
||||
public PlayerPlace(String url) {
|
||||
super(url);
|
||||
|
||||
String eventUuidAsString = getParameter(AutoPlayerConfiguration.PARAM_EVENTID);
|
||||
String leaderboardName= getParameter(AutoPlayerConfiguration.PARAM_LEADEROARD_NAME);
|
||||
Boolean fullscreen = Boolean.valueOf(getParameter(AutoPlayerConfiguration.PARAM_FULLSCREEN));
|
||||
Integer timeToSwitchBeforeRaceStartInSeconds = Integer.valueOf(getParameter(AutoPlayerConfiguration.PARAM_TIME_TO_SWITCH_BEFORE_RACE_START));
|
||||
|
||||
this.playerConfiguration = new AutoPlayerConfiguration(eventUuidAsString, leaderboardName, fullscreen, timeToSwitchBeforeRaceStartInSeconds);
|
||||
|
||||
//these are currently regenerated in the PlayerActivity, based on the historydata. Once the settings are properly stored, this should be replaced.
|
||||
public PlayerPlace(String contextAndSettings) {
|
||||
this.contextAndSettings = contextAndSettings;
|
||||
}
|
||||
|
||||
public PlayerPlace(AutoPlayerConfiguration playerConfiguration, String settingsplace) {
|
||||
super(AutoPlayerConfiguration.PARAM_EVENTID, playerConfiguration.getEventUidAsString(),
|
||||
AutoPlayerConfiguration.PARAM_FULLSCREEN, String.valueOf(playerConfiguration.isFullscreenMode()),
|
||||
AutoPlayerConfiguration.PARAM_LEADEROARD_NAME, playerConfiguration.getLeaderboardName(),
|
||||
AutoPlayerConfiguration.PARAM_TIME_TO_SWITCH_BEFORE_RACE_START, String.valueOf(playerConfiguration.getTimeToSwitchBeforeRaceStartInSeconds()));
|
||||
|
||||
this.playerConfiguration = playerConfiguration;
|
||||
}
|
||||
|
||||
public AutoPlayerConfiguration getConfiguration() {
|
||||
return this.playerConfiguration;
|
||||
public String getContext() {
|
||||
return contextAndSettings;
|
||||
}
|
||||
|
||||
public static class Tokenizer implements PlaceTokenizer<PlayerPlace> {
|
||||
SettingsToStringSerializer stringSerializer = new SettingsToStringSerializer();
|
||||
@Override
|
||||
public String getToken(PlayerPlace place) {
|
||||
return place.getParametersAsToken();
|
||||
return place.getContext();
|
||||
}
|
||||
|
||||
@Override
|
||||
public PlayerPlace getPlace(String url) {
|
||||
return new PlayerPlace(url);
|
||||
public PlayerPlace getPlace(String settingsAndContext) {
|
||||
return new PlayerPlace(settingsAndContext);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
-11
@@ -1,11 +0,0 @@
|
||||
package com.sap.sailing.gwt.autoplay.client.place.start;
|
||||
|
||||
import com.sap.sse.common.settings.generic.AbstractGenericSerializableSettings;
|
||||
|
||||
public class AutoplayContextSettings extends AbstractGenericSerializableSettings {
|
||||
private static final long serialVersionUID = 6699950643747065960L;
|
||||
|
||||
@Override
|
||||
protected void addChildSettings() {
|
||||
}
|
||||
}
|
||||
+8
@@ -30,6 +30,14 @@ public class AutoplayPerspectiveLifecycle extends AbstractPerspectiveLifecycle<A
|
||||
return new AutoplaySettingsDialogComponent(settings);
|
||||
}
|
||||
|
||||
public LeaderboardWithHeaderPerspectiveLifecycle getLeaderboardLifecycle() {
|
||||
return leaderboardLifecycle;
|
||||
}
|
||||
|
||||
public RaceBoardPerspectiveLifecycle getRaceboardLifecycle() {
|
||||
return raceboardLifecycle;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLocalizedShortName() {
|
||||
return StringMessages.INSTANCE.autoplayConfiguration();
|
||||
|
||||
+8
-23
@@ -22,11 +22,10 @@ import com.google.gwt.user.client.ui.Widget;
|
||||
import com.google.web.bindery.event.shared.EventBus;
|
||||
import com.sap.sailing.domain.common.dto.AbstractLeaderboardDTO;
|
||||
import com.sap.sailing.gwt.autoplay.client.app.PlaceNavigator;
|
||||
import com.sap.sailing.gwt.autoplay.client.place.player.AutoPlayerConfiguration;
|
||||
import com.sap.sailing.gwt.autoplay.client.place.player.AutoPlayerContext;
|
||||
import com.sap.sailing.gwt.common.authentication.FixedSailingAuthentication;
|
||||
import com.sap.sailing.gwt.common.authentication.SAPSailingHeaderWithAuthentication;
|
||||
import com.sap.sailing.gwt.common.client.SharedResources;
|
||||
import com.sap.sailing.gwt.ui.client.EntryPointLinkFactory;
|
||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
import com.sap.sailing.gwt.ui.shared.EventDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.LeaderboardGroupDTO;
|
||||
@@ -36,7 +35,6 @@ import com.sap.sse.common.settings.Settings;
|
||||
import com.sap.sse.gwt.client.GWTLocaleUtil;
|
||||
import com.sap.sse.gwt.client.dialog.DataEntryDialog.DialogCallback;
|
||||
import com.sap.sse.gwt.client.event.LocaleChangeEvent;
|
||||
import com.sap.sse.gwt.client.shared.components.LinkWithSettingsGenerator;
|
||||
import com.sap.sse.gwt.client.shared.components.SettingsDialogForLinkSharing;
|
||||
import com.sap.sse.gwt.client.shared.perspective.PerspectiveCompositeSettings;
|
||||
import com.sap.sse.gwt.settings.SettingsToStringSerializer;
|
||||
@@ -169,21 +167,11 @@ public class DesktopStartView extends Composite implements StartView {
|
||||
}
|
||||
|
||||
protected void openSettingsDialog() {
|
||||
final AutoplayContextSettings autoplayContextSettings = new AutoplayContextSettings();
|
||||
final LinkWithSettingsGenerator<PerspectiveCompositeSettings<AutoplayPerspectiveOwnSettings>> linkWithSettingsGenerator = new LinkWithSettingsGenerator<>(
|
||||
EntryPointLinkFactory.AUTOPLAY_PATH, autoplayContextSettings);
|
||||
|
||||
DialogCallback<PerspectiveCompositeSettings<AutoplayPerspectiveOwnSettings>> callback = new DialogCallback<PerspectiveCompositeSettings<AutoplayPerspectiveOwnSettings>>() {
|
||||
|
||||
@Override
|
||||
public void ok(PerspectiveCompositeSettings<AutoplayPerspectiveOwnSettings> editedObject) {
|
||||
String settingsString = new SettingsToStringSerializer().fromSettings(editedObject);
|
||||
// TODO testingcode remove once done
|
||||
GWT.log(settingsString);
|
||||
PerspectiveCompositeSettings<AutoplayPerspectiveOwnSettings> restored = new SettingsToStringSerializer()
|
||||
.fromString(settingsString, autoplayLifecycle.createDefaultSettings());
|
||||
GWT.log(editedObject.equals(restored) + " Equals " + restored);
|
||||
autoplayPerspectiveSettings = restored;
|
||||
autoplayPerspectiveSettings = editedObject;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -194,10 +182,9 @@ public class DesktopStartView extends Composite implements StartView {
|
||||
if (autoplayPerspectiveSettings == null) {
|
||||
autoplayPerspectiveSettings = autoplayLifecycle.createDefaultSettings();
|
||||
}
|
||||
SettingsDialogForLinkSharing<PerspectiveCompositeSettings<AutoplayPerspectiveOwnSettings>> dialog = new SettingsDialogForLinkSharing<PerspectiveCompositeSettings<AutoplayPerspectiveOwnSettings>>(
|
||||
linkWithSettingsGenerator, autoplayLifecycle, autoplayPerspectiveSettings,
|
||||
StringMessages.INSTANCE, true, callback);
|
||||
dialog.show();
|
||||
|
||||
new SettingsDialogForLinkSharing<PerspectiveCompositeSettings<AutoplayPerspectiveOwnSettings>>(null,
|
||||
autoplayLifecycle, autoplayPerspectiveSettings, StringMessages.INSTANCE, true, callback).show();
|
||||
|
||||
}
|
||||
|
||||
@@ -215,11 +202,9 @@ public class DesktopStartView extends Composite implements StartView {
|
||||
|
||||
if (selectedEvent != null && selectedLeaderboardName != null) {
|
||||
// TODO generate place settings url, and directly start other place
|
||||
String settingsString = new SettingsToStringSerializer().fromSettings(autoplayPerspectiveSettings);
|
||||
navigator.goToPlayer(new AutoPlayerConfiguration(selectedEvent.id.toString(), selectedLeaderboardName,
|
||||
autoplayPerspectiveSettings.getPerspectiveOwnSettings().isFullscreen(),
|
||||
autoplayPerspectiveSettings.getPerspectiveOwnSettings().getTimeToSwitchBeforeRaceStart()),
|
||||
settingsString);
|
||||
String contextAndSettings = new SettingsToStringSerializer().fromSettings(
|
||||
new AutoPlayerContext(selectedEvent.id, selectedLeaderboardName), autoplayPerspectiveSettings);
|
||||
navigator.goToPlayer(contextAndSettings);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+4
-6
@@ -30,7 +30,6 @@ import com.sap.sse.gwt.client.shared.components.Component;
|
||||
import com.sap.sse.gwt.client.shared.components.SettingsDialogComponent;
|
||||
import com.sap.sse.gwt.client.shared.perspective.AbstractPerspectiveComposite;
|
||||
import com.sap.sse.gwt.client.shared.perspective.PerspectiveCompositeSettings;
|
||||
import com.sap.sse.gwt.client.useragent.UserAgentDetails;
|
||||
import com.sap.sse.security.ui.client.UserService;
|
||||
|
||||
/**
|
||||
@@ -53,7 +52,7 @@ public class LeaderboardWithHeaderPerspective extends AbstractPerspectiveComposi
|
||||
SailingServiceAsync sailingService, UserService userService, AsyncActionsExecutor asyncActionsExecutor,
|
||||
CompetitorSelectionProvider competitorSelectionProvider, Timer timer,
|
||||
String leaderboardName, final ErrorReporter errorReporter, final StringMessages stringMessages,
|
||||
UserAgentDetails userAgent, boolean startInFullScreenMode) {
|
||||
boolean startInFullScreenMode) {
|
||||
super(parent, context, lifecycle, settings);
|
||||
this.stringMessages = stringMessages;
|
||||
Window.addResizeHandler(new ResizeHandler() {
|
||||
@@ -69,7 +68,7 @@ public class LeaderboardWithHeaderPerspective extends AbstractPerspectiveComposi
|
||||
settings.findSettingsByComponentId(sapHeaderLifecycle.getComponentId()),
|
||||
stringMessages, startInFullScreenMode);
|
||||
leaderboardPanel = createLeaderboardPanel(lifecycle, settings, sailingService, asyncActionsExecutor,
|
||||
competitorSelectionProvider, timer, leaderboardName, errorReporter, stringMessages, userAgent);
|
||||
competitorSelectionProvider, timer, leaderboardName, errorReporter, stringMessages);
|
||||
leaderboardPanel.getContentWidget().getElement().getStyle().setFontWeight(FontWeight.BOLD);
|
||||
addChildComponent(sapHeader);
|
||||
addChildComponent(leaderboardPanel);
|
||||
@@ -195,8 +194,7 @@ public class LeaderboardWithHeaderPerspective extends AbstractPerspectiveComposi
|
||||
PerspectiveCompositeSettings<LeaderboardWithHeaderPerspectiveSettings> settings,
|
||||
SailingServiceAsync sailingService, AsyncActionsExecutor asyncActionsExecutor,
|
||||
CompetitorSelectionProvider competitorSelectionProvider, Timer timer,
|
||||
String leaderboardName, final ErrorReporter errorReporter, final StringMessages stringMessages,
|
||||
final UserAgentDetails userAgent) {
|
||||
String leaderboardName, final ErrorReporter errorReporter, final StringMessages stringMessages) {
|
||||
LeaderboardPanelLifecycle leaderboardPanelLifecycle = getPerspectiveLifecycle().getLeaderboardPanelLifecycle();
|
||||
LeaderboardSettings leaderboardSettings = settings
|
||||
.findSettingsByComponentId(leaderboardPanelLifecycle.getComponentId());
|
||||
@@ -206,7 +204,7 @@ public class LeaderboardWithHeaderPerspective extends AbstractPerspectiveComposi
|
||||
leaderboardSettings, /*isEmbedded*/true, /* preSelectedRace */null,
|
||||
competitorSelectionProvider, timer, /* leaderboardGroupName */"",
|
||||
leaderboardName, errorReporter, stringMessages,
|
||||
userAgent, /*showRaceDetails */false, /* competitorSearchTextBox */ null, /* showRegattaRank */
|
||||
/* showRaceDetails */false, /* competitorSearchTextBox */ null, /* showRegattaRank */
|
||||
/* showSelectionCheckbox */false, /* raceTimesInfoProvider */null, false, /* autoExpandLastRaceColumn */
|
||||
/* adjustTimerDelay */ true, /* autoApplyTopNFilter */ false, /* showCompetitorFilterStatus */ false, /* enableSyncScroller */ false);
|
||||
|
||||
|
||||
+2
-6
@@ -4,7 +4,6 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.gwt.event.shared.EventBus;
|
||||
import com.google.gwt.user.client.Window;
|
||||
import com.google.gwt.user.client.ui.AcceptsOneWidget;
|
||||
import com.sap.sailing.gwt.home.communication.event.EventReferenceWithStateDTO;
|
||||
import com.sap.sailing.gwt.home.communication.event.EventState;
|
||||
@@ -25,12 +24,11 @@ import com.sap.sailing.gwt.home.shared.app.NavigationPathDisplay.NavigationItem;
|
||||
import com.sap.sailing.gwt.home.shared.app.PlaceNavigation;
|
||||
import com.sap.sailing.gwt.home.shared.places.event.EventContext;
|
||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
import com.sap.sailing.gwt.ui.leaderboard.LeaderboardEntryPoint;
|
||||
import com.sap.sailing.gwt.ui.leaderboard.LeaderboardEntryPoint;
|
||||
import com.sap.sse.gwt.client.async.AsyncActionsExecutor;
|
||||
import com.sap.sse.gwt.client.player.Timer;
|
||||
import com.sap.sse.gwt.client.player.Timer.PlayModes;
|
||||
import com.sap.sse.gwt.client.player.Timer.PlayStates;
|
||||
import com.sap.sse.gwt.client.useragent.UserAgentDetails;
|
||||
|
||||
/**
|
||||
* Base Activity for all desktop single-regatta-event/series-event pages as well as the pages for one regatta of a
|
||||
@@ -41,7 +39,6 @@ import com.sap.sse.gwt.client.useragent.UserAgentDetails;
|
||||
*/
|
||||
public class EventRegattaActivity extends AbstractEventActivity<AbstractEventRegattaPlace> implements EventRegattaView.Presenter {
|
||||
private EventRegattaView currentView = new TabletAndDesktopRegattaEventView();
|
||||
private final UserAgentDetails userAgent = new UserAgentDetails(Window.Navigator.getUserAgent());
|
||||
private final AsyncActionsExecutor asyncActionsExecutor = new AsyncActionsExecutor();
|
||||
private final long delayBetweenAutoAdvancesInMilliseconds = LeaderboardEntryPoint.DEFAULT_REFRESH_INTERVAL_MILLIS;
|
||||
|
||||
@@ -53,8 +50,7 @@ public class EventRegattaActivity extends AbstractEventActivity<AbstractEventReg
|
||||
clientFactory.getSailingService(),
|
||||
asyncActionsExecutor,
|
||||
new Timer(PlayModes.Live, PlayStates.Paused, delayBetweenAutoAdvancesInMilliseconds),
|
||||
clientFactory.getErrorReporter(),
|
||||
userAgent));
|
||||
clientFactory.getErrorReporter()));
|
||||
}
|
||||
|
||||
initNavigationPath(navigationPathDisplay);
|
||||
|
||||
+4
-5
@@ -18,7 +18,6 @@ import com.sap.sse.gwt.client.player.Timer;
|
||||
import com.sap.sse.gwt.client.shared.components.Component;
|
||||
import com.sap.sse.gwt.client.shared.components.SettingsDialog;
|
||||
import com.sap.sse.gwt.client.shared.perspective.SimpleComponentContext;
|
||||
import com.sap.sse.gwt.client.useragent.UserAgentDetails;
|
||||
|
||||
/**
|
||||
* A class managing analytical data on the regatta level (like leaderboard, regatta rank, etc.)
|
||||
@@ -32,17 +31,16 @@ public class RegattaAnalyticsDataManager {
|
||||
private final CompetitorSelectionModel competitorSelectionProvider;
|
||||
private final AsyncActionsExecutor asyncActionsExecutor;
|
||||
private final ErrorReporter errorReporter;
|
||||
private final UserAgentDetails userAgent;
|
||||
private final SailingServiceAsync sailingService;
|
||||
private final Timer timer;
|
||||
|
||||
public RegattaAnalyticsDataManager(final SailingServiceAsync sailingService, AsyncActionsExecutor asyncActionsExecutor, Timer timer, ErrorReporter errorReporter, UserAgentDetails userAgent) {
|
||||
public RegattaAnalyticsDataManager(final SailingServiceAsync sailingService,
|
||||
AsyncActionsExecutor asyncActionsExecutor, Timer timer, ErrorReporter errorReporter) {
|
||||
this.competitorSelectionProvider = new CompetitorSelectionModel(/* hasMultiSelection */true);
|
||||
this.sailingService = sailingService;
|
||||
this.asyncActionsExecutor = asyncActionsExecutor;
|
||||
this.timer = timer;
|
||||
this.errorReporter = errorReporter;
|
||||
this.userAgent = userAgent;
|
||||
this.leaderboardPanel = null;
|
||||
this.multiCompetitorChart = null;
|
||||
}
|
||||
@@ -57,7 +55,8 @@ public class RegattaAnalyticsDataManager {
|
||||
leaderboardSettings,
|
||||
true, preselectedRace,
|
||||
competitorSelectionProvider, timer, leaderboardGroupName, leaderboardName, errorReporter,
|
||||
StringMessages.INSTANCE, userAgent, showRaceDetails, /* competitorSearchTextBox */ null, /* showSelectionCheckbox */ true, /* raceTimesInfoProvider */ null, autoExpandLastRaceColumn,
|
||||
StringMessages.INSTANCE, showRaceDetails, /* competitorSearchTextBox */ null,
|
||||
/* showSelectionCheckbox */ true, /* raceTimesInfoProvider */ null, autoExpandLastRaceColumn,
|
||||
/* adjustTimerDelay */ true, /* autoApplyTopNFilter */ false, /* showCompetitorFilterStatus */ false, /* enableSyncScroller */ true);
|
||||
}
|
||||
return leaderboardPanel;
|
||||
|
||||
+5
-6
@@ -26,7 +26,6 @@ import com.sap.sse.gwt.client.player.Timer;
|
||||
import com.sap.sse.gwt.client.shared.components.Component;
|
||||
import com.sap.sse.gwt.client.shared.components.SettingsDialog;
|
||||
import com.sap.sse.gwt.client.shared.perspective.ComponentContext;
|
||||
import com.sap.sse.gwt.client.useragent.UserAgentDetails;
|
||||
|
||||
/**
|
||||
* A viewer for an overall series leaderboard. Additionally the viewer can render a chart for the series leaderboard and
|
||||
@@ -43,18 +42,17 @@ public class EventSeriesAnalyticsDataManager {
|
||||
private final CompetitorSelectionModel competitorSelectionProvider;
|
||||
private final AsyncActionsExecutor asyncActionsExecutor;
|
||||
private final ErrorReporter errorReporter;
|
||||
private final UserAgentDetails userAgent;
|
||||
private final SailingServiceAsync sailingService;
|
||||
private final Timer timer;
|
||||
private final int MAX_COMPETITORS_IN_CHART = 30;
|
||||
|
||||
public EventSeriesAnalyticsDataManager(final SailingServiceAsync sailingService, AsyncActionsExecutor asyncActionsExecutor, Timer timer, ErrorReporter errorReporter, UserAgentDetails userAgent) {
|
||||
public EventSeriesAnalyticsDataManager(final SailingServiceAsync sailingService,
|
||||
AsyncActionsExecutor asyncActionsExecutor, Timer timer, ErrorReporter errorReporter) {
|
||||
this.competitorSelectionProvider = new CompetitorSelectionModel(/* hasMultiSelection */true);
|
||||
this.sailingService = sailingService;
|
||||
this.asyncActionsExecutor = asyncActionsExecutor;
|
||||
this.timer = timer;
|
||||
this.errorReporter = errorReporter;
|
||||
this.userAgent = userAgent;
|
||||
this.overallLeaderboardPanel = null;
|
||||
this.multiCompetitorChart = null;
|
||||
}
|
||||
@@ -67,7 +65,8 @@ public class EventSeriesAnalyticsDataManager {
|
||||
overallLeaderboardPanel = new LeaderboardPanel(parent, context, sailingService, asyncActionsExecutor,
|
||||
leaderboardSettings, true, preselectedRace,
|
||||
competitorSelectionProvider, timer, leaderboardGroupName, leaderboardName, errorReporter,
|
||||
StringMessages.INSTANCE, userAgent, showRaceDetails, /* competitorSearchTextBox */ null, /* showSelectionCheckbox */ true,
|
||||
StringMessages.INSTANCE, showRaceDetails, /* competitorSearchTextBox */ null,
|
||||
/* showSelectionCheckbox */ true,
|
||||
/* raceTimesInfoProvider */null, autoExpandLastRaceColumn, /* adjustTimerDelay */ true, /* autoApplyTopNFilter */ false,
|
||||
/* showCompetitorFilterStatus */ false, /* enableSyncScroller */ false);
|
||||
}
|
||||
@@ -95,7 +94,7 @@ public class EventSeriesAnalyticsDataManager {
|
||||
multiLeaderboardPanel = new MultiLeaderboardProxyPanel(parent, context, sailingService, metaLeaderboardName,
|
||||
asyncActionsExecutor, timer, true /* isEmbedded */,
|
||||
preselectedLeaderboardName, preselectedRace, errorReporter, StringMessages.INSTANCE,
|
||||
userAgent, showRaceDetails, autoExpandLastRaceColumn, null);
|
||||
showRaceDetails, autoExpandLastRaceColumn, null);
|
||||
}
|
||||
return multiLeaderboardPanel;
|
||||
}
|
||||
|
||||
+3
-7
@@ -8,7 +8,6 @@ import com.google.gwt.event.shared.EventBus;
|
||||
import com.google.gwt.place.shared.Place;
|
||||
import com.google.gwt.safehtml.shared.SafeUri;
|
||||
import com.google.gwt.safehtml.shared.UriUtils;
|
||||
import com.google.gwt.user.client.Window;
|
||||
import com.google.gwt.user.client.ui.AcceptsOneWidget;
|
||||
import com.sap.sailing.gwt.common.client.controls.tabbar.TabView;
|
||||
import com.sap.sailing.gwt.home.client.place.event.legacy.SeriesClientFactory;
|
||||
@@ -16,7 +15,7 @@ import com.sap.sailing.gwt.home.communication.fakeseries.EventSeriesViewDTO;
|
||||
import com.sap.sailing.gwt.home.desktop.app.DesktopPlacesNavigator;
|
||||
import com.sap.sailing.gwt.home.shared.app.ApplicationHistoryMapper;
|
||||
import com.sap.sailing.gwt.home.shared.app.NavigationPathDisplay;
|
||||
import com.sap.sailing.gwt.home.shared.app.NavigationPathDisplay.NavigationItem;
|
||||
import com.sap.sailing.gwt.home.shared.app.NavigationPathDisplay.NavigationItem;
|
||||
import com.sap.sailing.gwt.home.shared.app.PlaceNavigation;
|
||||
import com.sap.sailing.gwt.home.shared.places.event.EventDefaultPlace;
|
||||
import com.sap.sailing.gwt.home.shared.places.events.EventsPlace;
|
||||
@@ -25,13 +24,12 @@ import com.sap.sailing.gwt.home.shared.places.fakeseries.SeriesContext;
|
||||
import com.sap.sailing.gwt.home.shared.places.fakeseries.SeriesDefaultPlace;
|
||||
import com.sap.sailing.gwt.home.shared.places.start.StartPlace;
|
||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
import com.sap.sailing.gwt.ui.leaderboard.LeaderboardEntryPoint;
|
||||
import com.sap.sailing.gwt.ui.client.refresh.ErrorAndBusyClientFactory;
|
||||
import com.sap.sailing.gwt.ui.leaderboard.LeaderboardEntryPoint;
|
||||
import com.sap.sse.gwt.client.async.AsyncActionsExecutor;
|
||||
import com.sap.sse.gwt.client.player.Timer;
|
||||
import com.sap.sse.gwt.client.player.Timer.PlayModes;
|
||||
import com.sap.sse.gwt.client.player.Timer.PlayStates;
|
||||
import com.sap.sse.gwt.client.useragent.UserAgentDetails;
|
||||
|
||||
public class SeriesActivity extends AbstractActivity implements SeriesView.Presenter {
|
||||
|
||||
@@ -45,7 +43,6 @@ public class SeriesActivity extends AbstractActivity implements SeriesView.Prese
|
||||
|
||||
private SeriesView<AbstractSeriesTabPlace, SeriesView.Presenter> currentView = new TabletAndDesktopSeriesView();
|
||||
|
||||
private final UserAgentDetails userAgent = new UserAgentDetails(Window.Navigator.getUserAgent());
|
||||
private final AsyncActionsExecutor asyncActionsExecutor = new AsyncActionsExecutor();
|
||||
private final long delayBetweenAutoAdvancesInMilliseconds = LeaderboardEntryPoint.DEFAULT_REFRESH_INTERVAL_MILLIS;
|
||||
private final EventSeriesViewDTO series;
|
||||
@@ -63,8 +60,7 @@ public class SeriesActivity extends AbstractActivity implements SeriesView.Prese
|
||||
clientFactory.getSailingService(), //
|
||||
asyncActionsExecutor, //
|
||||
new Timer(PlayModes.Live, PlayStates.Paused, delayBetweenAutoAdvancesInMilliseconds), //
|
||||
clientFactory.getErrorReporter(), //
|
||||
userAgent));
|
||||
clientFactory.getErrorReporter()));
|
||||
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -88,7 +88,8 @@ public class RegattaOverviewEntryPoint extends AbstractSailingEntryPoint {
|
||||
}
|
||||
|
||||
private void createAndAddRegattaPanel(RegattaOverviewBaseSettings regattaOverviewContextDefinition) {
|
||||
regattaPanel = new RegattaOverviewPanel(sailingService, getUserService(), this, getStringMessages(), regattaOverviewContextDefinition, userAgent);
|
||||
regattaPanel = new RegattaOverviewPanel(sailingService, getUserService(), this, getStringMessages(),
|
||||
regattaOverviewContextDefinition);
|
||||
|
||||
regattaPanel.addHandler(new EventDTOLoadedEvent.Handler() {
|
||||
@Override
|
||||
|
||||
+2
-6
@@ -43,7 +43,6 @@ import com.sap.sse.gwt.client.shared.perspective.ComponentContext;
|
||||
import com.sap.sse.gwt.client.shared.perspective.ComponentContextWithSettingsStorage;
|
||||
import com.sap.sse.gwt.client.shared.perspective.DefaultOnSettingsLoadedCallback;
|
||||
import com.sap.sse.gwt.client.shared.perspective.SettingsStorageManager;
|
||||
import com.sap.sse.gwt.client.useragent.UserAgentDetails;
|
||||
import com.sap.sse.security.ui.client.UserService;
|
||||
import com.sap.sse.security.ui.settings.UserSettingsStorageManager;
|
||||
|
||||
@@ -72,7 +71,6 @@ public class RegattaOverviewPanel extends SimplePanel {
|
||||
private final Anchor refreshNowButton;
|
||||
private final Anchor startStopUpdatingButton;
|
||||
private CheckBox leaderboardCheckBox;
|
||||
private final UserAgentDetails userAgent;
|
||||
private final FlowPanel repeatedInfoLabel = new FlowPanel();
|
||||
|
||||
private final RegattaOverviewResources.LocalCss style = RegattaOverviewResources.INSTANCE.css();
|
||||
@@ -87,8 +85,7 @@ public class RegattaOverviewPanel extends SimplePanel {
|
||||
UserService userService,
|
||||
final ErrorReporter errorReporter,
|
||||
final StringMessages stringMessages,
|
||||
RegattaOverviewBaseSettings regattaOverviewContextDefinition,
|
||||
UserAgentDetails userAgent) {
|
||||
RegattaOverviewBaseSettings regattaOverviewContextDefinition) {
|
||||
|
||||
this.sailingService = sailingService;
|
||||
this.stringMessages = stringMessages;
|
||||
@@ -97,7 +94,6 @@ public class RegattaOverviewPanel extends SimplePanel {
|
||||
this.serverUpdateTimer = new Timer(PlayModes.Live, serverUpdateRateInMs);
|
||||
this.uiUpdateTimer = new Timer(PlayModes.Live, uiUpdateRateInMs);
|
||||
this.eventDTO = null;
|
||||
this.userAgent = userAgent;
|
||||
this.raceGroupDTOs = new ArrayList<RaceGroupDTO>();
|
||||
this.eventRaceGroupListeners = new ArrayList<EventAndRaceGroupAvailabilityListener>();
|
||||
|
||||
@@ -271,7 +267,7 @@ public class RegattaOverviewPanel extends SimplePanel {
|
||||
/*preSelectedRace*/null,
|
||||
competitorSelectionProvider,
|
||||
null, leaderboard.name,
|
||||
errorReporter, stringMessages, userAgent, /*showRaceDetails*/false);
|
||||
errorReporter, stringMessages, /* showRaceDetails */false);
|
||||
leaderboardsTabPanel.add(leaderboardPanel,
|
||||
(leaderboard.getDisplayName() == null ? leaderboard.name : leaderboard.getDisplayName())
|
||||
+ " " + stringMessages.leaderboard());
|
||||
|
||||
+4
-3
@@ -34,8 +34,8 @@ import com.sap.sse.gwt.client.player.Timer.PlayModes;
|
||||
import com.sap.sse.gwt.client.player.Timer.PlayStates;
|
||||
import com.sap.sse.gwt.client.shared.components.LinkWithSettingsGenerator;
|
||||
import com.sap.sse.gwt.client.shared.components.SettingsDialogForLinkSharing;
|
||||
import com.sap.sse.gwt.client.shared.perspective.ComponentContextWithSettingsStorage;
|
||||
import com.sap.sse.gwt.client.shared.perspective.ComponentContext;
|
||||
import com.sap.sse.gwt.client.shared.perspective.ComponentContextWithSettingsStorage;
|
||||
import com.sap.sse.gwt.client.shared.perspective.OnSettingsLoadedCallback;
|
||||
import com.sap.sse.gwt.client.shared.perspective.PerspectiveCompositeSettings;
|
||||
import com.sap.sse.gwt.settings.SettingsToUrlSerializer;
|
||||
@@ -139,7 +139,8 @@ public class LeaderboardEntryPoint extends AbstractSailingEntryPoint {
|
||||
final MetaLeaderboardViewer leaderboardViewer = new MetaLeaderboardViewer(null, context,
|
||||
rootComponentLifeCycle, defaultSettings, sailingService, new AsyncActionsExecutor(),
|
||||
timer, null, preselectedRace, leaderboardGroupName, leaderboardName,
|
||||
LeaderboardEntryPoint.this, getStringMessages(), userAgent, getActualChartDetailType(defaultSettings));
|
||||
LeaderboardEntryPoint.this, getStringMessages(),
|
||||
getActualChartDetailType(defaultSettings));
|
||||
createUi(leaderboardViewer, defaultSettings, timer, leaderboardContextSettings);
|
||||
}
|
||||
|
||||
@@ -166,7 +167,7 @@ public class LeaderboardEntryPoint extends AbstractSailingEntryPoint {
|
||||
final LeaderboardViewer leaderboardViewer = new LeaderboardViewer(null, context,
|
||||
rootComponentLifeCycle, defaultSettings, sailingService, new AsyncActionsExecutor(),
|
||||
timer, preselectedRace, leaderboardGroupName, leaderboardName,
|
||||
LeaderboardEntryPoint.this, getStringMessages(), userAgent, getActualChartDetailType(defaultSettings));
|
||||
LeaderboardEntryPoint.this, getStringMessages(), getActualChartDetailType(defaultSettings));
|
||||
createUi(leaderboardViewer, defaultSettings, timer, leaderboardContextSettings);
|
||||
}
|
||||
|
||||
|
||||
+5
-6
@@ -124,7 +124,6 @@ import com.sap.sse.gwt.client.shared.components.IsEmbeddableComponent;
|
||||
import com.sap.sse.gwt.client.shared.components.SettingsDialog;
|
||||
import com.sap.sse.gwt.client.shared.components.SettingsDialogComponent;
|
||||
import com.sap.sse.gwt.client.shared.perspective.ComponentContext;
|
||||
import com.sap.sse.gwt.client.useragent.UserAgentDetails;
|
||||
|
||||
/**
|
||||
* A leaderboard essentially consists of a table widget that in its columns displays the entries.
|
||||
@@ -366,10 +365,10 @@ public class LeaderboardPanel extends AbstractCompositeComponent<LeaderboardSett
|
||||
public LeaderboardPanel(Component<?> parent, ComponentContext<?, ?> context, SailingServiceAsync sailingService,
|
||||
AsyncActionsExecutor asyncActionsExecutor, LeaderboardSettings settings,
|
||||
CompetitorSelectionProvider competitorSelectionProvider, String leaderboardName,
|
||||
ErrorReporter errorReporter, final StringMessages stringMessages, final UserAgentDetails userAgent,
|
||||
ErrorReporter errorReporter, final StringMessages stringMessages,
|
||||
boolean showRaceDetails) {
|
||||
this(parent, context, sailingService, asyncActionsExecutor, settings, false, /* preSelectedRace */null,
|
||||
competitorSelectionProvider, null, leaderboardName, errorReporter, stringMessages, userAgent,
|
||||
competitorSelectionProvider, null, leaderboardName, errorReporter, stringMessages,
|
||||
showRaceDetails);
|
||||
}
|
||||
|
||||
@@ -377,14 +376,14 @@ public class LeaderboardPanel extends AbstractCompositeComponent<LeaderboardSett
|
||||
AsyncActionsExecutor asyncActionsExecutor, LeaderboardSettings settings, boolean isEmbedded,
|
||||
RegattaAndRaceIdentifier preSelectedRace, CompetitorSelectionProvider competitorSelectionProvider,
|
||||
String leaderboardGroupName, String leaderboardName, ErrorReporter errorReporter,
|
||||
final StringMessages stringMessages, final UserAgentDetails userAgent, boolean showRaceDetails) {
|
||||
final StringMessages stringMessages, boolean showRaceDetails) {
|
||||
this(parent, context, sailingService, asyncActionsExecutor, settings, isEmbedded, preSelectedRace,
|
||||
competitorSelectionProvider,
|
||||
new Timer(
|
||||
// perform the first request as "live" but don't by default auto-play
|
||||
PlayModes.Live, PlayStates.Paused,
|
||||
/* delayBetweenAutoAdvancesInMilliseconds */ LeaderboardEntryPoint.DEFAULT_REFRESH_INTERVAL_MILLIS),
|
||||
leaderboardGroupName, leaderboardName, errorReporter, stringMessages, userAgent, showRaceDetails,
|
||||
leaderboardGroupName, leaderboardName, errorReporter, stringMessages, showRaceDetails,
|
||||
/* competitorSearchTextBox */ null, /* showSelectionCheckbox */ true,
|
||||
/* optionalRaceTimesInfoProvider */ null, /* autoExpandLastRaceColumn */ false,
|
||||
/* adjustTimerDelay */ true, /* autoApplyTopNFilter */ false, /* showCompetitorFilterStatus */ false,
|
||||
@@ -395,7 +394,7 @@ public class LeaderboardPanel extends AbstractCompositeComponent<LeaderboardSett
|
||||
AsyncActionsExecutor asyncActionsExecutor, LeaderboardSettings settings, boolean isEmbedded,
|
||||
RegattaAndRaceIdentifier preSelectedRace, CompetitorSelectionProvider competitorSelectionProvider,
|
||||
Timer timer, String leaderboardGroupName, String leaderboardName, final ErrorReporter errorReporter,
|
||||
final StringMessages stringMessages, final UserAgentDetails userAgent, boolean showRaceDetails,
|
||||
final StringMessages stringMessages, boolean showRaceDetails,
|
||||
CompetitorFilterPanel competitorSearchTextBox, boolean showSelectionCheckbox,
|
||||
RaceTimesInfoProvider optionalRaceTimesInfoProvider, boolean autoExpandLastRaceColumn,
|
||||
boolean adjustTimerDelay, boolean autoApplyTopNFilter, boolean showCompetitorFilterStatus,
|
||||
|
||||
+5
-6
@@ -18,7 +18,6 @@ import com.sap.sse.gwt.client.player.Timer;
|
||||
import com.sap.sse.gwt.client.shared.components.Component;
|
||||
import com.sap.sse.gwt.client.shared.perspective.ComponentContext;
|
||||
import com.sap.sse.gwt.client.shared.perspective.PerspectiveCompositeSettings;
|
||||
import com.sap.sse.gwt.client.useragent.UserAgentDetails;
|
||||
|
||||
/**
|
||||
* A viewer for a single leaderboard and a leaderboard chart.
|
||||
@@ -36,11 +35,11 @@ public class LeaderboardViewer extends AbstractLeaderboardViewer<LeaderboardPers
|
||||
final SailingServiceAsync sailingService, final AsyncActionsExecutor asyncActionsExecutor,
|
||||
final Timer timer, final RegattaAndRaceIdentifier preselectedRace,
|
||||
final String leaderboardGroupName, String leaderboardName, final ErrorReporter errorReporter,
|
||||
final StringMessages stringMessages, final UserAgentDetails userAgent, DetailType chartDetailType) {
|
||||
final StringMessages stringMessages, DetailType chartDetailType) {
|
||||
this(parent, componentContext, lifecycle, settings, new CompetitorSelectionModel(/* hasMultiSelection */true),
|
||||
sailingService, asyncActionsExecutor, timer,
|
||||
preselectedRace, leaderboardGroupName, leaderboardName, errorReporter,
|
||||
stringMessages, userAgent, chartDetailType);
|
||||
stringMessages, chartDetailType);
|
||||
}
|
||||
|
||||
private LeaderboardViewer(Component<?> parent,
|
||||
@@ -51,14 +50,14 @@ public class LeaderboardViewer extends AbstractLeaderboardViewer<LeaderboardPers
|
||||
final SailingServiceAsync sailingService, final AsyncActionsExecutor asyncActionsExecutor,
|
||||
final Timer timer, final RegattaAndRaceIdentifier preselectedRace,
|
||||
final String leaderboardGroupName, String leaderboardName, final ErrorReporter errorReporter,
|
||||
final StringMessages stringMessages, final UserAgentDetails userAgent, DetailType chartDetailType) {
|
||||
final StringMessages stringMessages, DetailType chartDetailType) {
|
||||
super(parent, componentContext, lifecycle, settings, competitorSelectionModel, asyncActionsExecutor, timer,
|
||||
stringMessages);
|
||||
// FIXME: Cleanup with java8 using supplier
|
||||
init(new LeaderboardPanel(this, getComponentContext(), sailingService, asyncActionsExecutor,
|
||||
settings.findSettingsByComponentId(LeaderboardPanelLifecycle.ID), preselectedRace != null,
|
||||
preselectedRace, competitorSelectionModel, timer, leaderboardGroupName, leaderboardName, errorReporter,
|
||||
stringMessages, userAgent, settings.getPerspectiveOwnSettings().isShowRaceDetails(),
|
||||
stringMessages, settings.getPerspectiveOwnSettings().isShowRaceDetails(),
|
||||
/* competitorSearchTextBox */ null, /* showSelectionCheckbox */ true, /* raceTimesInfoProvider */ null,
|
||||
settings.getPerspectiveOwnSettings().isAutoExpandLastRaceColumn(), /* adjustTimerDelay */ true,
|
||||
/* autoApplyTopNFilter */ false, /* showCompetitorFilterStatus */ false,
|
||||
@@ -101,7 +100,7 @@ public class LeaderboardViewer extends AbstractLeaderboardViewer<LeaderboardPers
|
||||
asyncActionsExecutor,
|
||||
settings.findSettingsByComponentId(OverallLeaderboardPanelLifecycle.ID),
|
||||
preselectedRace != null, preselectedRace, competitorSelectionProvider, timer,
|
||||
leaderboardGroupName, overallLeaderboardName, errorReporter, stringMessages, userAgent,
|
||||
leaderboardGroupName, overallLeaderboardName, errorReporter, stringMessages,
|
||||
false, /* competitorSearchTextBox */ null, /* showSelectionCheckbox */ true, /* raceTimesInfoProvider */null,
|
||||
false, /* adjustTimerDelay */ true, /* autoApplyTopNFilter */ false,
|
||||
/* showCompetitorFilterStatus */ false, /* enableSyncScroller */ false);
|
||||
|
||||
+5
-6
@@ -15,7 +15,6 @@ import com.sap.sse.gwt.client.player.Timer;
|
||||
import com.sap.sse.gwt.client.shared.components.Component;
|
||||
import com.sap.sse.gwt.client.shared.perspective.ComponentContext;
|
||||
import com.sap.sse.gwt.client.shared.perspective.PerspectiveCompositeSettings;
|
||||
import com.sap.sse.gwt.client.useragent.UserAgentDetails;
|
||||
|
||||
/**
|
||||
* A viewer for an overall series leaderboard. Additionally the viewer can render a chart for the series leaderboard and
|
||||
@@ -36,11 +35,11 @@ public class MetaLeaderboardViewer extends AbstractLeaderboardViewer<MetaLeaderb
|
||||
SailingServiceAsync sailingService, AsyncActionsExecutor asyncActionsExecutor,
|
||||
Timer timer, String preselectedLeaderboardName, RegattaAndRaceIdentifier preselectedRace,
|
||||
String leaderboardGroupName, String metaLeaderboardName, ErrorReporter errorReporter,
|
||||
StringMessages stringMessages, UserAgentDetails userAgent, DetailType chartDetailType) {
|
||||
StringMessages stringMessages, DetailType chartDetailType) {
|
||||
this(parent, componentContext, lifecycle, settings, new CompetitorSelectionModel(/* hasMultiSelection */true),
|
||||
sailingService, asyncActionsExecutor, timer,
|
||||
preselectedLeaderboardName, preselectedRace, leaderboardGroupName, metaLeaderboardName,
|
||||
errorReporter, stringMessages, userAgent, chartDetailType);
|
||||
errorReporter, stringMessages, chartDetailType);
|
||||
}
|
||||
|
||||
private MetaLeaderboardViewer(Component<?> parent,
|
||||
@@ -51,7 +50,7 @@ public class MetaLeaderboardViewer extends AbstractLeaderboardViewer<MetaLeaderb
|
||||
AsyncActionsExecutor asyncActionsExecutor, Timer timer,
|
||||
String preselectedLeaderboardName, RegattaAndRaceIdentifier preselectedRace, String leaderboardGroupName,
|
||||
String metaLeaderboardName, ErrorReporter errorReporter, StringMessages stringMessages,
|
||||
UserAgentDetails userAgent, DetailType chartDetailType) {
|
||||
DetailType chartDetailType) {
|
||||
super(parent, componentContext, lifecycle, settings, competitorSelectionModel, asyncActionsExecutor, timer,
|
||||
stringMessages);
|
||||
|
||||
@@ -62,7 +61,7 @@ public class MetaLeaderboardViewer extends AbstractLeaderboardViewer<MetaLeaderb
|
||||
init(new LeaderboardPanel(this, componentContext, sailingService, asyncActionsExecutor,
|
||||
settings.findSettingsByComponentId(LeaderboardPanelLifecycle.ID),
|
||||
preselectedRace != null, preselectedRace, competitorSelectionModel, timer,
|
||||
leaderboardGroupName, metaLeaderboardName, errorReporter, stringMessages, userAgent,
|
||||
leaderboardGroupName, metaLeaderboardName, errorReporter, stringMessages,
|
||||
settings.getPerspectiveOwnSettings().isShowRaceDetails(), /* competitorSearchTextBox */ null,
|
||||
/* showSelectionCheckbox */ true, /* raceTimesInfoProvider */null,
|
||||
settings.getPerspectiveOwnSettings().isAutoExpandLastRaceColumn(), /* adjustTimerDelay */ true,
|
||||
@@ -87,7 +86,7 @@ public class MetaLeaderboardViewer extends AbstractLeaderboardViewer<MetaLeaderb
|
||||
metaLeaderboardName,
|
||||
asyncActionsExecutor, timer, false /* isEmbedded */,
|
||||
preselectedLeaderboardName, preselectedRace, errorReporter, stringMessages,
|
||||
userAgent, perspectiveSettings.isShowRaceDetails(), perspectiveSettings.isAutoExpandLastRaceColumn(),
|
||||
perspectiveSettings.isShowRaceDetails(), perspectiveSettings.isAutoExpandLastRaceColumn(),
|
||||
settings.findSettingsByComponentId(MultiLeaderboardPanelLifecycle.MID));
|
||||
multiLeaderboardPanel.setVisible(perspectiveSettings.isShowSeriesLeaderboards());
|
||||
mainPanel.add(getLeaderboardPanel());
|
||||
|
||||
+2
-3
@@ -10,7 +10,6 @@ import com.sap.sse.gwt.client.async.AsyncActionsExecutor;
|
||||
import com.sap.sse.gwt.client.player.Timer;
|
||||
import com.sap.sse.gwt.client.shared.components.Component;
|
||||
import com.sap.sse.gwt.client.shared.perspective.ComponentContext;
|
||||
import com.sap.sse.gwt.client.useragent.UserAgentDetails;
|
||||
|
||||
/**
|
||||
* Represents a single Leaderboard in the Context of a MultiLeaderboard
|
||||
@@ -22,13 +21,13 @@ public class MultiLeaderboardPanel extends LeaderboardPanel {
|
||||
boolean isEmbedded, RegattaAndRaceIdentifier preSelectedRace,
|
||||
CompetitorSelectionProvider competitorSelectionProvider, Timer timer, String leaderboardGroupName,
|
||||
String leaderboardName, ErrorReporter errorReporter, StringMessages stringMessages,
|
||||
UserAgentDetails userAgent, boolean showRaceDetails, CompetitorFilterPanel competitorSearchTextBox,
|
||||
boolean showRaceDetails, CompetitorFilterPanel competitorSearchTextBox,
|
||||
boolean showSelectionCheckbox, RaceTimesInfoProvider optionalRaceTimesInfoProvider,
|
||||
boolean autoExpandLastRaceColumn, boolean adjustTimerDelay, boolean autoApplyTopNFilter,
|
||||
boolean showCompetitorFilterStatus, boolean enableSyncScroller) {
|
||||
super(parent, context, sailingService, asyncActionsExecutor, settings, isEmbedded, preSelectedRace,
|
||||
competitorSelectionProvider, timer, leaderboardGroupName, leaderboardName, errorReporter,
|
||||
stringMessages, userAgent, showRaceDetails, competitorSearchTextBox, showSelectionCheckbox,
|
||||
stringMessages, showRaceDetails, competitorSearchTextBox, showSelectionCheckbox,
|
||||
optionalRaceTimesInfoProvider, autoExpandLastRaceColumn, adjustTimerDelay, autoApplyTopNFilter,
|
||||
showCompetitorFilterStatus, enableSyncScroller);
|
||||
}
|
||||
|
||||
+3
-6
@@ -31,9 +31,8 @@ import com.sap.sse.gwt.client.player.Timer;
|
||||
import com.sap.sse.gwt.client.shared.components.AbstractLazyComponent;
|
||||
import com.sap.sse.gwt.client.shared.components.Component;
|
||||
import com.sap.sse.gwt.client.shared.components.SettingsDialogComponent;
|
||||
import com.sap.sse.gwt.client.shared.perspective.ComponentContextWithSettingsStorage;
|
||||
import com.sap.sse.gwt.client.shared.perspective.ComponentContext;
|
||||
import com.sap.sse.gwt.client.useragent.UserAgentDetails;
|
||||
import com.sap.sse.gwt.client.shared.perspective.ComponentContextWithSettingsStorage;
|
||||
|
||||
/**
|
||||
* A panel managing multiple {@link LeaderboardPanel}s (e.g. from a meta leaderboard) so that the user can switch between them.
|
||||
@@ -51,7 +50,6 @@ public class MultiLeaderboardProxyPanel extends AbstractLazyComponent<Leaderboar
|
||||
private String selectedLeaderboardName;
|
||||
|
||||
private final AsyncActionsExecutor asyncActionsExecutor;
|
||||
private final UserAgentDetails userAgent;
|
||||
private final boolean showRaceDetails;
|
||||
private final Timer timer;
|
||||
|
||||
@@ -73,7 +71,7 @@ public class MultiLeaderboardProxyPanel extends AbstractLazyComponent<Leaderboar
|
||||
AsyncActionsExecutor asyncActionsExecutor,
|
||||
Timer timer, boolean isEmbedded, String preselectedLeaderboardName, RaceIdentifier preselectedRace,
|
||||
ErrorReporter errorReporter, StringMessages stringMessages,
|
||||
UserAgentDetails userAgent, boolean showRaceDetails, boolean autoExpandLastRaceColumn,
|
||||
boolean showRaceDetails, boolean autoExpandLastRaceColumn,
|
||||
LeaderboardSettings settings) {
|
||||
super(parent, context);
|
||||
|
||||
@@ -87,7 +85,6 @@ public class MultiLeaderboardProxyPanel extends AbstractLazyComponent<Leaderboar
|
||||
this.sailingService = sailingService;
|
||||
this.metaLeaderboardName = metaLeaderboardName;
|
||||
this.asyncActionsExecutor = asyncActionsExecutor;
|
||||
this.userAgent = userAgent;
|
||||
this.showRaceDetails = showRaceDetails;
|
||||
this.timer = timer;
|
||||
this.isEmbedded = isEmbedded;
|
||||
@@ -247,7 +244,7 @@ public class MultiLeaderboardProxyPanel extends AbstractLazyComponent<Leaderboar
|
||||
sailingService,
|
||||
asyncActionsExecutor, toMerge, isEmbedded,
|
||||
/* preselectedRace*/ null, new CompetitorSelectionModel(true), timer,
|
||||
null, newSelectedLeaderboardName, errorReporter, stringMessages, userAgent,
|
||||
null, newSelectedLeaderboardName, errorReporter, stringMessages,
|
||||
showRaceDetails, /* competitorSearchTextBox */ null, /* showSelectionCheckbox */ true, /* raceTimesInfoProvider */null,
|
||||
false, /* adjustTimerDelay */ true, /* autoApplyTopNFilter */ false,
|
||||
/* showCompetitorFilterStatus */ false, /* enableSyncScroller */ false);
|
||||
|
||||
+2
-3
@@ -10,7 +10,6 @@ import com.sap.sse.gwt.client.async.AsyncActionsExecutor;
|
||||
import com.sap.sse.gwt.client.player.Timer;
|
||||
import com.sap.sse.gwt.client.shared.components.Component;
|
||||
import com.sap.sse.gwt.client.shared.perspective.ComponentContext;
|
||||
import com.sap.sse.gwt.client.useragent.UserAgentDetails;
|
||||
|
||||
public class OverallLeaderboardPanel extends LeaderboardPanel {
|
||||
public OverallLeaderboardPanel(Component<?> parent, ComponentContext<?, ?> context,
|
||||
@@ -18,13 +17,13 @@ public class OverallLeaderboardPanel extends LeaderboardPanel {
|
||||
boolean isEmbedded, RegattaAndRaceIdentifier preSelectedRace,
|
||||
CompetitorSelectionProvider competitorSelectionProvider, Timer timer, String leaderboardGroupName,
|
||||
String leaderboardName, ErrorReporter errorReporter, StringMessages stringMessages,
|
||||
UserAgentDetails userAgent, boolean showRaceDetails, CompetitorFilterPanel competitorSearchTextBox,
|
||||
boolean showRaceDetails, CompetitorFilterPanel competitorSearchTextBox,
|
||||
boolean showSelectionCheckbox, RaceTimesInfoProvider optionalRaceTimesInfoProvider,
|
||||
boolean autoExpandLastRaceColumn, boolean adjustTimerDelay, boolean autoApplyTopNFilter,
|
||||
boolean showCompetitorFilterStatus, boolean enableSyncScroller) {
|
||||
super(parent, context, sailingService, asyncActionsExecutor, settings, isEmbedded, preSelectedRace,
|
||||
competitorSelectionProvider, timer, leaderboardGroupName, leaderboardName, errorReporter,
|
||||
stringMessages, userAgent, showRaceDetails, competitorSearchTextBox, showSelectionCheckbox,
|
||||
stringMessages, showRaceDetails, competitorSearchTextBox, showSelectionCheckbox,
|
||||
optionalRaceTimesInfoProvider, autoExpandLastRaceColumn, adjustTimerDelay, autoApplyTopNFilter,
|
||||
showCompetitorFilterStatus, enableSyncScroller);
|
||||
}
|
||||
|
||||
+1
-1
@@ -585,7 +585,7 @@ public class EditableLeaderboardPanel extends LeaderboardPanel {
|
||||
final StringMessages stringMessages, UserAgentDetails userAgent) {
|
||||
super(null, null, sailingService, asyncActionsExecutor, new LeaderboardSettings(),
|
||||
new CompetitorSelectionModel(/* hasMultiSelection */true),
|
||||
leaderboardName, errorReporter, stringMessages, userAgent, /* showRaceDetails */ true);
|
||||
leaderboardName, errorReporter, stringMessages, /* showRaceDetails */ true);
|
||||
suppressedCompetitorsShown = new ListDataProvider<CompetitorDTO>(new ArrayList<CompetitorDTO>());
|
||||
suppressedCompetitorsTable = createSuppressedCompetitorsTable();
|
||||
ImageResource importIcon = resources.importIcon();
|
||||
|
||||
+1
-1
@@ -488,7 +488,7 @@ public class RaceBoardPanel extends AbstractPerspectiveComposite<RaceBoardPerspe
|
||||
leaderboardSettings,
|
||||
selectedRaceIdentifier != null, selectedRaceIdentifier,
|
||||
competitorSelectionProvider, timer, leaderboardGroupName, leaderboardName, errorReporter, stringMessages,
|
||||
userAgent, /* showRaceDetails */ true, competitorSearchTextBox,
|
||||
/* showRaceDetails */ true, competitorSearchTextBox,
|
||||
/* showSelectionCheckbox */ true, raceTimesInfoProvider, /* autoExpandLastRaceColumn */ false,
|
||||
/* don't adjust the timer's delay from the leaderboard; control it solely from the RaceTimesInfoProvider */ false,
|
||||
/* autoApplyTopNFilter */ false, /* showCompetitorFilterStatus */ false, /* enableSyncScroller */ false);
|
||||
|
||||
+4
-2
@@ -41,8 +41,10 @@ public abstract class AbstractSettingsDialog<SettingsType extends Settings> exte
|
||||
|
||||
@Override
|
||||
protected void onChange(SettingsType result) {
|
||||
String link = linkWithSettingsGenerator.createUrl(result);
|
||||
shareAnchor.setHref(link);
|
||||
if (linkWithSettingsGenerator != null) {
|
||||
String link = linkWithSettingsGenerator.createUrl(result);
|
||||
shareAnchor.setHref(link);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -23,6 +23,20 @@ public class SettingsToStringSerializer {
|
||||
return writeParameterMapToString(serializedValues);
|
||||
}
|
||||
|
||||
public String fromSettings(GenericSerializableSettings context, GenericSerializableSettings settings) {
|
||||
Map<String, Iterable<String>> serializedContext = settingsToStringMapSerializer.serialize(context);
|
||||
Map<String, Iterable<String>> serializedValues = settingsToStringMapSerializer.serialize(settings);
|
||||
serializedValues.putAll(serializedContext);
|
||||
return writeParameterMapToString(serializedValues);
|
||||
}
|
||||
|
||||
public String fromSettings(GenericSerializableSettings context, SettingsMap settings) {
|
||||
Map<String, Iterable<String>> serializedContext = settingsToStringMapSerializer.serialize(context);
|
||||
Map<String, Iterable<String>> serializedValues = settingsToStringMapSerializer.serialize(settings);
|
||||
serializedValues.putAll(serializedContext);
|
||||
return writeParameterMapToString(serializedValues);
|
||||
}
|
||||
|
||||
private String writeParameterMapToString(Map<String, Iterable<String>> serializedValues) {
|
||||
String settingsString = "";
|
||||
for (Entry<String, Iterable<String>> val : serializedValues.entrySet()) {
|
||||
@@ -38,6 +52,21 @@ public class SettingsToStringSerializer {
|
||||
return settingsString;
|
||||
}
|
||||
|
||||
public final <T extends GenericSerializableSettings, C extends GenericSerializableSettings> void fromString(
|
||||
String serializedSettings, C contextSettings,
|
||||
T settings) {
|
||||
Map<String, Iterable<String>> values = deserializeStringToMap(serializedSettings);
|
||||
settingsToStringMapSerializer.deserialize(settings, values);
|
||||
settingsToStringMapSerializer.deserialize(contextSettings, values);
|
||||
}
|
||||
|
||||
public final <T extends SettingsMap, C extends GenericSerializableSettings> void fromString(
|
||||
String serializedSettings, C contextSettings, T settings) {
|
||||
Map<String, Iterable<String>> values = deserializeStringToMap(serializedSettings);
|
||||
settingsToStringMapSerializer.deserializeSettingsMap(settings, values);
|
||||
settingsToStringMapSerializer.deserialize(contextSettings, values);
|
||||
}
|
||||
|
||||
public final <T extends GenericSerializableSettings> T fromString(String serializedSettings, T settings) {
|
||||
Map<String, Iterable<String>> values = deserializeStringToMap(serializedSettings);
|
||||
return settingsToStringMapSerializer.deserialize(settings, values);
|
||||
|
||||
Reference in new issue
Block a user