Merge branch 'master' into tracapi

This commit is contained in:
Axel Uhl committed 2014-04-24 10:04:29 +02:00
commit 22e5fee79c
7 files changed
+76 -50

No files matched your search

+2
View File
@@ -85,7 +85,9 @@
<execution>
<configuration>
<extraJvmArgs>-Dgwt.persistentunitcache=false</extraJvmArgs>
<!--
<userAgents>chrome</userAgents>
-->
<modules>
<module>com.sap.sailing.gwt.ui.EmulatedJRE</module>
<module>com.sap.sailing.gwt.ui.AdminConsole</module>
@@ -193,7 +193,7 @@ public class RaceTimePanel extends TimePanel<RaceTimePanelSettings> implements R
* {@link RaceTimesInfoDTO#timePointOfNewestEvent timePointOfNewestEvent} received from the tracking infrastructure
* so far and puts the timer into {@link PlayStates#Playing play mode}.
*/
private boolean initTimerPosition(RaceTimesInfoDTO newRaceTimesInfo) {
private void initTimerPosition(RaceTimesInfoDTO newRaceTimesInfo) {
// initialize timer position
switch (timer.getPlayMode()) {
case Live:
@@ -209,7 +209,6 @@ public class RaceTimePanel extends TimePanel<RaceTimePanelSettings> implements R
}
break;
}
return timer.getTime() != null;
}
private void updateLegMarkers(RaceTimesInfoDTO newRaceTimesInfo) {
@@ -1461,7 +1461,9 @@ public class LeaderboardPanel extends SimplePanel implements TimeListener, PlayS
leaderboardTable.setSelectionModel(leaderboardSelectionModel);
}
setShowAddedScores(settings.isShowAddedScores());
loadCompleteLeaderboard(getLeaderboardDisplayDate());
if (timer.isInitialized()) {
loadCompleteLeaderboard(getLeaderboardDisplayDate());
}
if (this.preSelectedRace == null) {
isEmbedded = false;
@@ -1645,7 +1647,16 @@ public class LeaderboardPanel extends SimplePanel implements TimeListener, PlayS
}
private void setDelayInMilliseconds(long delayInMilliseconds) {
// If the timer is currently in a mode that causes null to be used as the leaderboard request time stamp,
// don't let a live play delay change cause another load request by unregistering this panel as timer
// listener before and re-registering it after adjusting the live play delay.
if (useNullAsTimePoint()) {
timer.removeTimeListener(this);
}
timer.setLivePlayDelayInMillis(delayInMilliseconds);
if (useNullAsTimePoint()) {
timer.addTimeListener(this);
}
}
private boolean isAutoExpandPreSelectedRace() {
@@ -1754,7 +1765,7 @@ public class LeaderboardPanel extends SimplePanel implements TimeListener, PlayS
private void loadCompleteLeaderboard(Date date) {
if (needsDataLoading()) {
GetLeaderboardByNameAction getLeaderboardByNameAction = new GetLeaderboardByNameAction(sailingService,
getLeaderboardName(), timer.getPlayMode() == PlayModes.Live ? null : date,
getLeaderboardName(), useNullAsTimePoint() ? null : date,
/* namesOfRacesForWhichToLoadLegDetails */getNamesOfExpandedRaces(),
/* previousLeaderboard */ getLeaderboard(), timer, errorReporter, stringMessages);
this.asyncActionsExecutor.execute(getLeaderboardByNameAction, LOAD_LEADERBOARD_DATA_CATEGORY,
@@ -1778,6 +1789,16 @@ public class LeaderboardPanel extends SimplePanel implements TimeListener, PlayS
}
}
/**
* In {@link PlayModes#Live live mode}, when {@link #loadCompleteLeaderboard(Date) loading the leaderboard contents}, <code>null</code>
* is used as time point. The condition for this is encapsulated in this method so others can find out. For example, when a time change
* is signaled due to local offset / delay adjustments, no additional call to {@link #loadCompleteLeaderboard(Date)} would be required
* as <code>null</code> will be passed in any case, not being affected by local time offsets.
*/
private boolean useNullAsTimePoint() {
return timer.getPlayMode() == PlayModes.Live;
}
private boolean needsDataLoading() {
return isVisible();
}
@@ -2511,7 +2532,9 @@ public class LeaderboardPanel extends SimplePanel implements TimeListener, PlayS
@Override
public void competitorsListChanged(Iterable<CompetitorDTO> competitors) {
timeChanged(timer.getTime(), null);
if (timer.isInitialized()) {
timeChanged(timer.getTime(), null);
}
}
@Override
@@ -104,6 +104,15 @@ public class Timer {
private long millisecondsClientIsBehindServer;
private boolean clientServerOffsetHasAtLeastBeenSetOnce;
/**
* A timer may be in the <em>uninitialized</em> state that can be detected using {@link #isInitialized}. For reasons of
* backward compatibility, even an uninitialized timer will return a non-<code>null</code> time from {@link #getTime()}.
* However, clients are encouraged to use {@link #isInitialized} to check if the time returned by the timer is good
* to be used. A call to {@link #setTime(long)} will automatically put the timer into the <em>initialized</em> state from
* where it cannot get back into <em>uninitialized</em> state.
*/
private boolean initialized;
/**
* The timer can run in two different modes: Live and Replay
@@ -125,6 +134,12 @@ public class Timer {
this(playMode, getDefaultPlayStateForPlayMode(playMode));
}
/**
* The timer is created using the client's "now" as its current time, 1.0 as its {@link #playSpeedFactor play speed
* factor} and 1 second (1000ms) as the {@link #refreshInterval delay between automatic updates} should the timer be
* {@link #resume() started}. The {@link #millisecondsClientIsBehindServer offset} to the server time is initially
* left at 0ms until updated by a call to {@link #adjustClientServerOffset(long, Date, long)}.
*/
public Timer(PlayModes playMode, PlayStates playState) {
this(playMode, playState, 1000 /* refreshIntervalInMillis */);
}
@@ -139,11 +154,16 @@ public class Timer {
this(playMode, getDefaultPlayStateForPlayMode(playMode), refreshIntervalInMillis);
}
/**
* The timer uses "now" as its current time and 1.0 as its {@link #playSpeedFactor acceleration factor}. The
* {@link #livePlayDelayInMillis} is set to zero seconds.
*/
public Timer(PlayModes playMode, PlayStates playState, long refreshIntervalInMillis) {
this.refreshInterval = refreshIntervalInMillis;
// Using the client's clock is only a default; the time offset between client and server is adjusted when
// information about the server time is present; see adjustClientServerOffset(...)
time = new Date();
initialized = playMode == PlayModes.Live;
timeListeners = new HashSet<TimeListener>();
playStateListeners = new HashSet<PlayStateListener>();
setPlaySpeedFactor(1.0);
@@ -152,6 +172,19 @@ public class Timer {
setPlayState(playState, /* updatePlayMode */ false);
}
/**
* A timer may be in the <em>uninitialized</em> state that can be detected using this method. For reasons of
* backward compatibility, even an uninitialized timer will return a non-<code>null</code> time from
* {@link #getTime()} which is usually the client's notion of "now." However, clients are encouraged to use
* {@link #isInitialized} to check if the time returned by the timer is good to be used. A call to
* {@link #setTime(long)} will automatically put the timer into the <em>initialized</em> state from where it cannot
* get back into <em>uninitialized</em> state. A timer in {@link PlayModes#Live live mode} is always considered
* initialized because it will be able to provide a live time point.
*/
public boolean isInitialized() {
return initialized;
}
private static PlayStates getDefaultPlayStateForPlayMode(PlayModes playMode) {
return playMode == PlayModes.Live ? PlayStates.Playing : PlayStates.Paused;
}
@@ -203,6 +236,7 @@ public class Timer {
}
public void setTime(long timePointAsMillis) {
initialized = true;
Date oldTime = time;
time = new Date(timePointAsMillis);
if ((oldTime == null) != (time == null) || (oldTime != null && !oldTime.equals(time))) {
+1 -37
View File
@@ -1,43 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry exported="true" kind="lib" path="lib/phantomjsdriver-1.1.0.jar"/>
<classpathentry exported="true" kind="lib" path="selenium-java-2.40.0.jar"/>
<classpathentry exported="true" kind="lib" path="lib/apache-mime4j-0.6.jar"/>
<classpathentry exported="true" kind="lib" path="lib/bsh-1.3.0.jar"/>
<classpathentry exported="true" kind="lib" path="lib/cglib-nodep-2.1_3.jar"/>
<classpathentry exported="true" kind="lib" path="lib/commons-codec-1.8.jar"/>
<classpathentry exported="true" kind="lib" path="lib/commons-collections-3.2.1.jar"/>
<classpathentry exported="true" kind="lib" path="lib/commons-exec-1.1.jar"/>
<classpathentry exported="true" kind="lib" path="lib/commons-io-2.2.jar"/>
<classpathentry exported="true" kind="lib" path="lib/commons-jxpath-1.3.jar"/>
<classpathentry exported="true" kind="lib" path="lib/commons-lang3-3.1.jar"/>
<classpathentry exported="true" kind="lib" path="lib/commons-logging-1.1.1.jar"/>
<classpathentry exported="true" kind="lib" path="lib/cssparser-0.9.11.jar"/>
<classpathentry exported="true" kind="lib" path="lib/guava-15.0.jar"/>
<classpathentry exported="true" kind="lib" path="lib/hamcrest-core-1.3.jar"/>
<classpathentry exported="true" kind="lib" path="lib/hamcrest-library-1.3.jar"/>
<classpathentry exported="true" kind="lib" path="lib/htmlunit-2.13.jar"/>
<classpathentry exported="true" kind="lib" path="lib/htmlunit-core-js-2.13.jar"/>
<classpathentry exported="true" kind="lib" path="lib/httpclient-4.3.1.jar"/>
<classpathentry exported="true" kind="lib" path="lib/httpcore-4.3.jar"/>
<classpathentry exported="true" kind="lib" path="lib/httpmime-4.3.1.jar"/>
<classpathentry exported="true" kind="lib" path="lib/ini4j-0.5.2.jar"/>
<classpathentry exported="true" kind="lib" path="lib/jcommander-1.29.jar"/>
<classpathentry exported="true" kind="lib" path="lib/jetty-websocket-8.1.8.jar"/>
<classpathentry exported="true" kind="lib" path="lib/jna-3.4.0.jar"/>
<classpathentry exported="true" kind="lib" path="lib/jna-platform-3.4.0.jar"/>
<classpathentry exported="true" kind="lib" path="lib/json-20080701.jar"/>
<classpathentry exported="true" kind="lib" path="lib/junit-dep-4.11.jar"/>
<classpathentry exported="true" kind="lib" path="lib/nekohtml-1.9.19.jar"/>
<classpathentry exported="true" kind="lib" path="lib/netty-3.5.7.Final.jar"/>
<classpathentry exported="true" kind="lib" path="lib/operadriver-1.5.jar"/>
<classpathentry exported="true" kind="lib" path="lib/protobuf-java-2.4.1.jar"/>
<classpathentry exported="true" kind="lib" path="lib/sac-1.3.jar"/>
<classpathentry exported="true" kind="lib" path="lib/serializer-2.7.1.jar"/>
<classpathentry exported="true" kind="lib" path="lib/testng-6.8.5.jar"/>
<classpathentry exported="true" kind="lib" path="lib/xalan-2.7.1.jar"/>
<classpathentry exported="true" kind="lib" path="lib/xercesImpl-2.10.0.jar"/>
<classpathentry exported="true" kind="lib" path="lib/xml-apis-1.4.01.jar"/>
<classpathentry exported="true" kind="lib" path="selenium-java-2.40.0.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="output" path="bin"/>
@@ -3,8 +3,7 @@ Bundle-ManifestVersion: 2
Bundle-Name: Selenium
Bundle-SymbolicName: org.openqa.selenium.osgi
Bundle-Version: 2.40.0
Bundle-ClassPath: selenium-java-2.40.0.jar,
lib/apache-mime4j-0.6.jar,
Bundle-ClassPath: lib/apache-mime4j-0.6.jar,
lib/bsh-1.3.0.jar,
lib/cglib-nodep-2.1_3.jar,
lib/commons-codec-1.8.jar,
@@ -15,7 +14,6 @@ Bundle-ClassPath: selenium-java-2.40.0.jar,
lib/commons-lang3-3.1.jar,
lib/commons-logging-1.1.1.jar,
lib/cssparser-0.9.11.jar,
lib/guava-15.0.jar,
lib/hamcrest-core-1.3.jar,
lib/hamcrest-library-1.3.jar,
lib/htmlunit-2.13.jar,
@@ -40,21 +38,29 @@ Bundle-ClassPath: selenium-java-2.40.0.jar,
lib/testng-6.8.5.jar,
lib/xalan-2.7.1.jar,
lib/xercesImpl-2.10.0.jar,
lib/xml-apis-1.4.01.jar
lib/xml-apis-1.4.01.jar,
selenium-java-2.40.0.jar,
lib/guava-15.0.jar
Bundle-Vendor: openqa
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Export-Package: com.google.common.annotations,
com.google.common.base,
com.google.common.base.internal,
com.google.common.cache,
com.google.common.collect,
com.google.common.escape,
com.google.common.eventbus,
com.google.common.hash,
com.google.common.html,
com.google.common.io,
com.google.common.math,
com.google.common.net,
com.google.common.primitives,
com.google.common.reflect,
com.google.common.util.concurrent,
com.google.common.xml,
com.thoughtworks.selenium,
com.thoughtworks.selenium.condition,
org.openqa.selenium,
org.openqa.selenium.browserlaunchers,
org.openqa.selenium.browserlaunchers.locators,
@@ -76,7 +82,6 @@ Export-Package: com.google.common.annotations,
org.openqa.selenium.logging.profiler,
org.openqa.selenium.net,
org.openqa.selenium.os,
org.openqa.selenium.phantomjs,
org.openqa.selenium.remote,
org.openqa.selenium.remote.html5,
org.openqa.selenium.remote.internal,
@@ -89,4 +94,3 @@ Export-Package: com.google.common.annotations,
org.openqa.selenium.support.pagefactory,
org.openqa.selenium.support.pagefactory.internal,
org.openqa.selenium.support.ui
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
@@ -10,7 +10,6 @@ bin.includes = META-INF/,\
lib/commons-lang3-3.1.jar,\
lib/commons-logging-1.1.1.jar,\
lib/cssparser-0.9.11.jar,\
lib/guava-15.0.jar,\
lib/hamcrest-core-1.3.jar,\
lib/hamcrest-library-1.3.jar,\
lib/htmlunit-2.13.jar,\
@@ -35,5 +34,6 @@ bin.includes = META-INF/,\
lib/xalan-2.7.1.jar,\
lib/xercesImpl-2.10.0.jar,\
lib/xml-apis-1.4.01.jar,\
lib/phantomjsdriver-1.1.0.jar,\
selenium-java-2.40.0.jar,\
lib/phantomjsdriver-1.1.0.jar
lib/guava-15.0.jar