mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-02 18:33:54 +00:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
9aba83b0f9
40 files changed
+259
-322
No files matched your search
+14
-14
@@ -141,10 +141,10 @@ public class DomainObjectFactoryImpl implements DomainObjectFactory {
|
||||
for (DBObject o : leaderboardCollection.find(query)) {
|
||||
result = loadLeaderboard(o, regattaRegistry, /* leaderboardRegistry */ null, /* groupForMetaLeaderboard */ null);
|
||||
}
|
||||
} catch (Throwable t) {
|
||||
} catch (Exception e) {
|
||||
// something went wrong during DB access; report, then use empty new wind track
|
||||
logger.log(Level.SEVERE, "Error connecting to MongoDB, unable to load leaderboard "+name+".");
|
||||
logger.throwing(DomainObjectFactoryImpl.class.getName(), "loadLeaderboard", t);
|
||||
logger.throwing(DomainObjectFactoryImpl.class.getName(), "loadLeaderboard", e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -160,10 +160,10 @@ public class DomainObjectFactoryImpl implements DomainObjectFactory {
|
||||
result.add(loadedLeaderboard);
|
||||
}
|
||||
}
|
||||
} catch (Throwable t) {
|
||||
} catch (Exception e) {
|
||||
// something went wrong during DB access; report, then use empty new wind track
|
||||
logger.log(Level.SEVERE, "Error connecting to MongoDB, unable to load leaderboards.");
|
||||
logger.throwing(DomainObjectFactoryImpl.class.getName(), "getAllLeaderboards", t);
|
||||
logger.throwing(DomainObjectFactoryImpl.class.getName(), "getAllLeaderboards", e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -478,9 +478,9 @@ public class DomainObjectFactoryImpl implements DomainObjectFactory {
|
||||
BasicDBObject query = new BasicDBObject();
|
||||
query.put(FieldNames.LEADERBOARD_GROUP_NAME.name(), name);
|
||||
leaderboardGroup = loadLeaderboardGroup(leaderboardGroupCollection.findOne(query), regattaRegistry, leaderboardRegistry);
|
||||
} catch (Throwable t) {
|
||||
} catch (Exception e) {
|
||||
logger.log(Level.SEVERE, "Error connecting to MongoDB, unable to load leaderboard group "+name+".");
|
||||
logger.throwing(DomainObjectFactoryImpl.class.getName(), "loadLeaderboardGroup", t);
|
||||
logger.throwing(DomainObjectFactoryImpl.class.getName(), "loadLeaderboardGroup", e);
|
||||
}
|
||||
|
||||
return leaderboardGroup;
|
||||
@@ -494,9 +494,9 @@ public class DomainObjectFactoryImpl implements DomainObjectFactory {
|
||||
for (DBObject o : leaderboardGroupCollection.find()) {
|
||||
leaderboardGroups.add(loadLeaderboardGroup(o, regattaRegistry, leaderboardRegistry));
|
||||
}
|
||||
} catch (Throwable t) {
|
||||
} catch (Exception e) {
|
||||
logger.log(Level.SEVERE, "Error connecting to MongoDB, unable to load leaderboard groups.");
|
||||
logger.throwing(DomainObjectFactoryImpl.class.getName(), "loadLeaderboardGroup", t);
|
||||
logger.throwing(DomainObjectFactoryImpl.class.getName(), "loadLeaderboardGroup", e);
|
||||
}
|
||||
|
||||
return leaderboardGroups;
|
||||
@@ -555,9 +555,9 @@ public class DomainObjectFactoryImpl implements DomainObjectFactory {
|
||||
result.add(loadedLeaderboard);
|
||||
}
|
||||
}
|
||||
} catch (Throwable t) {
|
||||
} catch (Exception e) {
|
||||
logger.log(Level.SEVERE, "Error connecting to MongoDB, unable to load leaderboards.");
|
||||
logger.throwing(DomainObjectFactoryImpl.class.getName(), "getAllLeaderboards", t);
|
||||
logger.throwing(DomainObjectFactoryImpl.class.getName(), "getAllLeaderboards", e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -625,10 +625,10 @@ public class DomainObjectFactoryImpl implements DomainObjectFactory {
|
||||
" and race "+race.getName());
|
||||
windTracks.remove(queryByName);
|
||||
}
|
||||
} catch (Throwable t) {
|
||||
} catch (Exception e) {
|
||||
// something went wrong during DB access; report, then use empty new wind track
|
||||
logger.log(Level.SEVERE, "Error connecting to MongoDB, unable to load recorded wind data. Check MongoDB settings.");
|
||||
logger.throwing(DomainObjectFactoryImpl.class.getName(), "loadWindTrack", t);
|
||||
logger.throwing(DomainObjectFactoryImpl.class.getName(), "loadWindTrack", e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -677,9 +677,9 @@ public class DomainObjectFactoryImpl implements DomainObjectFactory {
|
||||
for (DBObject o : eventCollection.find()) {
|
||||
result.add(loadEvent(o));
|
||||
}
|
||||
} catch (Throwable t) {
|
||||
} catch (Exception e) {
|
||||
logger.log(Level.SEVERE, "Error connecting to MongoDB, unable to load events.");
|
||||
logger.throwing(DomainObjectFactoryImpl.class.getName(), "loadEvents", t);
|
||||
logger.throwing(DomainObjectFactoryImpl.class.getName(), "loadEvents", e);
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
+6
-6
@@ -287,19 +287,19 @@ public class StoreAndForward implements Runnable {
|
||||
try {
|
||||
// TODO if forwarding to os doesn't work, e.g., because the socket was closed or the client died, remove os from streamsToForwardTo and the socket from socketsToForwardTo
|
||||
transceiver.sendMessage(message, os);
|
||||
} catch (Throwable e) {
|
||||
} catch (Exception e) {
|
||||
int i=streamsToForwardTo.indexOf(os);
|
||||
try {
|
||||
os.close();
|
||||
} catch (Throwable t) {
|
||||
logger.throwing(StoreAndForward.class.getName(), "run", t);
|
||||
} catch (Exception exc) {
|
||||
logger.throwing(StoreAndForward.class.getName(), "run", exc);
|
||||
}
|
||||
streamsToForwardTo.remove(os);
|
||||
Socket s = socketsToForwardTo.remove(i);
|
||||
try {
|
||||
s.close();
|
||||
} catch (Throwable t) {
|
||||
logger.throwing(StoreAndForward.class.getName(), "run", t);
|
||||
} catch (Exception exc) {
|
||||
logger.throwing(StoreAndForward.class.getName(), "run", exc);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -314,7 +314,7 @@ public class StoreAndForward implements Runnable {
|
||||
for (Socket socketToForwardTo : socketsToForwardTo) {
|
||||
socketToForwardTo.close();
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
if (!stopped) {
|
||||
logger.throwing(StoreAndForward.class.getName(), "Error during forwarding message. Continuing...", e);
|
||||
|
||||
+4
-4
@@ -83,11 +83,11 @@ public class SwissTimingAdapterPersistenceImpl implements SwissTimingAdapterPers
|
||||
result.add(stConfig);
|
||||
}
|
||||
Collections.reverse(result);
|
||||
} catch (Throwable t) {
|
||||
} catch (Exception e) {
|
||||
// something went wrong during DB access; report, then use empty new wind track
|
||||
logger.log(Level.SEVERE,
|
||||
"Error connecting to MongoDB, unable to load recorded SwissTiming configurations. Check MongoDB settings.");
|
||||
logger.throwing(SwissTimingAdapterPersistenceImpl.class.getName(), "getSwissTimingConfigurations", t);
|
||||
logger.throwing(SwissTimingAdapterPersistenceImpl.class.getName(), "getSwissTimingConfigurations", e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -109,11 +109,11 @@ public class SwissTimingAdapterPersistenceImpl implements SwissTimingAdapterPers
|
||||
result.add(stConfig);
|
||||
}
|
||||
Collections.reverse(result);
|
||||
} catch (Throwable t) {
|
||||
} catch (Exception e) {
|
||||
// something went wrong during DB access; report, then use empty new wind track
|
||||
logger.log(Level.SEVERE,
|
||||
"Error connecting to MongoDB, unable to load recorded SwissTiming archive configurations. Check MongoDB settings.");
|
||||
logger.throwing(SwissTimingAdapterPersistenceImpl.class.getName(), "getSwissTimingArchiveConfigurations", t);
|
||||
logger.throwing(SwissTimingAdapterPersistenceImpl.class.getName(), "getSwissTimingArchiveConfigurations", e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
+18
-18
@@ -342,9 +342,9 @@ public class SailMasterConnectorImpl extends SailMasterTransceiverImpl implement
|
||||
for (SailMasterListener listener : getGeneralAndRaceSpecificListeners(message.getRaceID())) {
|
||||
try {
|
||||
listener.receivedTimingData(raceID, boatID, markIndicesRanksAndTimesSinceStartInMilliseconds);
|
||||
} catch (Throwable t) {
|
||||
logger.info("Exception occurred trying to notify listener "+listener+" about "+message+": "+t.getMessage());
|
||||
logger.throwing(SailMasterConnectorImpl.class.getName(), "notifyListenersTMD", t);
|
||||
} catch (Exception e) {
|
||||
logger.info("Exception occurred trying to notify listener "+listener+" about "+message+": "+e.getMessage());
|
||||
logger.throwing(SailMasterConnectorImpl.class.getName(), "notifyListenersTMD", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -354,9 +354,9 @@ public class SailMasterConnectorImpl extends SailMasterTransceiverImpl implement
|
||||
for (SailMasterListener listener : getGeneralAndRaceSpecificListeners(message.getRaceID())) {
|
||||
try {
|
||||
listener.receivedClockAtMark(message.getSections()[1], clockAtMarkResults);
|
||||
} catch (Throwable t) {
|
||||
logger.info("Exception occurred trying to notify listener "+listener+" about "+message+": "+t.getMessage());
|
||||
logger.throwing(SailMasterConnectorImpl.class.getName(), "notifyListenersCAM", t);
|
||||
} catch (Exception e) {
|
||||
logger.info("Exception occurred trying to notify listener "+listener+" about "+message+": "+e.getMessage());
|
||||
logger.throwing(SailMasterConnectorImpl.class.getName(), "notifyListenersCAM", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -366,9 +366,9 @@ public class SailMasterConnectorImpl extends SailMasterTransceiverImpl implement
|
||||
for (SailMasterListener listener : getGeneralAndRaceSpecificListeners(message.getRaceID())) {
|
||||
try {
|
||||
listener.receivedStartList(message.getSections()[1], startListMessage);
|
||||
} catch (Throwable t) {
|
||||
logger.info("Exception occurred trying to notify listener "+listener+" about "+message+": "+t.getMessage());
|
||||
logger.throwing(SailMasterConnectorImpl.class.getName(), "notifyListenersSTL", t);
|
||||
} catch (Exception e) {
|
||||
logger.info("Exception occurred trying to notify listener "+listener+" about "+message+": "+e.getMessage());
|
||||
logger.throwing(SailMasterConnectorImpl.class.getName(), "notifyListenersSTL", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -378,9 +378,9 @@ public class SailMasterConnectorImpl extends SailMasterTransceiverImpl implement
|
||||
for (SailMasterListener listener : getGeneralAndRaceSpecificListeners(message.getRaceID())) {
|
||||
try {
|
||||
listener.receivedCourseConfiguration(message.getSections()[1], course);
|
||||
} catch (Throwable t) {
|
||||
logger.info("Exception occurred trying to notify listener "+listener+" about "+message+": "+t.getMessage());
|
||||
logger.throwing(SailMasterConnectorImpl.class.getName(), "notifyListenersCCG", t);
|
||||
} catch (Exception e) {
|
||||
logger.info("Exception occurred trying to notify listener "+listener+" about "+message+": "+e.getMessage());
|
||||
logger.throwing(SailMasterConnectorImpl.class.getName(), "notifyListenersCCG", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -390,9 +390,9 @@ public class SailMasterConnectorImpl extends SailMasterTransceiverImpl implement
|
||||
for (SailMasterListener listener : listeners) {
|
||||
try {
|
||||
listener.receivedAvailableRaces(races);
|
||||
} catch (Throwable t) {
|
||||
logger.info("Exception occurred trying to notify listener "+listener+" about "+message+": "+t.getMessage());
|
||||
logger.throwing(SailMasterConnectorImpl.class.getName(), "notifyListenersRAC", t);
|
||||
} catch (Exception e) {
|
||||
logger.info("Exception occurred trying to notify listener "+listener+" about "+message+": "+e.getMessage());
|
||||
logger.throwing(SailMasterConnectorImpl.class.getName(), "notifyListenersRAC", e);
|
||||
}
|
||||
}
|
||||
// not race specific; no need to notify any listener from raceSpecificListeners
|
||||
@@ -467,9 +467,9 @@ public class SailMasterConnectorImpl extends SailMasterTransceiverImpl implement
|
||||
try {
|
||||
listener.receivedRacePositionData(raceID, status, timePoint, startTimeEstimatedStartTime, millisecondsSinceRaceStart,
|
||||
nextMarkIndexForLeader, distanceToNextMarkForLeader, fixes);
|
||||
} catch (Throwable t) {
|
||||
logger.info("Exception occurred trying to notify listener "+listener+" about "+message+": "+t.getMessage());
|
||||
logger.throwing(SailMasterConnectorImpl.class.getName(), "notifyListenersRPD", t);
|
||||
} catch (Exception e) {
|
||||
logger.info("Exception occurred trying to notify listener "+listener+" about "+message+": "+e.getMessage());
|
||||
logger.throwing(SailMasterConnectorImpl.class.getName(), "notifyListenersRPD", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -33,10 +33,10 @@ public class DomainObjectFactoryImpl implements DomainObjectFactory {
|
||||
result.add(ttConfig);
|
||||
}
|
||||
Collections.reverse(result);
|
||||
} catch (Throwable t) {
|
||||
} catch (Exception e) {
|
||||
// something went wrong during DB access; report, then use empty new wind track
|
||||
logger.log(Level.SEVERE, "Error connecting to MongoDB, unable to load recorded TracTrac configurations. Check MongoDB settings.");
|
||||
logger.throwing(DomainObjectFactoryImpl.class.getName(), "getTracTracConfigurations", t);
|
||||
logger.throwing(DomainObjectFactoryImpl.class.getName(), "getTracTracConfigurations", e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
+4
-4
@@ -200,8 +200,8 @@ public class Simulator {
|
||||
public void run() {
|
||||
try {
|
||||
delayMarkPassings(competitor, deliverLater);
|
||||
} catch (Throwable t) {
|
||||
logger.throwing(Simulator.class.getName(), "scheduleMarkPosition", t);
|
||||
} catch (Exception e) {
|
||||
logger.throwing(Simulator.class.getName(), "scheduleMarkPosition", e);
|
||||
}
|
||||
}
|
||||
}, transformedTimepoint.asDate());
|
||||
@@ -225,8 +225,8 @@ public class Simulator {
|
||||
public void run() {
|
||||
try {
|
||||
trackedRace.recordFix(mark, transformedMarkFix);
|
||||
} catch (Throwable t) {
|
||||
logger.throwing(Simulator.class.getName(), "scheduleMarkPosition", t);
|
||||
} catch (Exception e) {
|
||||
logger.throwing(Simulator.class.getName(), "scheduleMarkPosition", e);
|
||||
}
|
||||
}
|
||||
}, transformedTimepoint.asDate());
|
||||
|
||||
@@ -176,10 +176,10 @@ public class CourseImpl extends NamedImpl implements Course {
|
||||
for (CourseListener listener : listeners) {
|
||||
try {
|
||||
listener.waypointRemoved(index, waypointToRemove);
|
||||
} catch (Throwable t) {
|
||||
} catch (Exception e) {
|
||||
logger.log(Level.SEVERE, "Exception while notifying listener about waypoint " + waypointToRemove
|
||||
+ " that got removed from course " + this + ": " + t.getMessage());
|
||||
logger.throwing(CourseImpl.class.getName(), "notifyListenersWaypointRemoved", t);
|
||||
+ " that got removed from course " + this + ": " + e.getMessage());
|
||||
logger.throwing(CourseImpl.class.getName(), "notifyListenersWaypointRemoved", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -188,10 +188,10 @@ public class CourseImpl extends NamedImpl implements Course {
|
||||
for (CourseListener listener : listeners) {
|
||||
try {
|
||||
listener.waypointAdded(zeroBasedPosition, waypointToAdd);
|
||||
} catch (Throwable t) {
|
||||
} catch (Exception e) {
|
||||
logger.log(Level.SEVERE, "Exception while notifying listener about waypoint " + waypointToAdd
|
||||
+ " that got added to course " + this + ": " + t.getMessage());
|
||||
logger.throwing(CourseImpl.class.getName(), "notifyListenersWaypointAdded", t);
|
||||
+ " that got added to course " + this + ": " + e.getMessage());
|
||||
logger.throwing(CourseImpl.class.getName(), "notifyListenersWaypointAdded", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+30
-30
@@ -226,9 +226,9 @@ public class DynamicTrackedRaceImpl extends TrackedRaceImpl implements
|
||||
for (RaceChangeListener listener : listeners) {
|
||||
try {
|
||||
listener.windSourcesToExcludeChanged(windSourcesToExclude);
|
||||
} catch (Throwable t) {
|
||||
logger.log(Level.SEVERE, "RaceChangeListener " + listener + " threw exception " + t.getMessage());
|
||||
logger.throwing(DynamicTrackedRaceImpl.class.getName(), "notifyListenersWindSourcesToExcludeChanged(Iterable<WindSource>)", t);
|
||||
} catch (Exception e) {
|
||||
logger.log(Level.SEVERE, "RaceChangeListener " + listener + " threw exception " + e.getMessage());
|
||||
logger.throwing(DynamicTrackedRaceImpl.class.getName(), "notifyListenersWindSourcesToExcludeChanged(Iterable<WindSource>)", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -242,9 +242,9 @@ public class DynamicTrackedRaceImpl extends TrackedRaceImpl implements
|
||||
for (RaceChangeListener listener : listeners) {
|
||||
try {
|
||||
listener.raceTimesChanged(startOfTracking, endOfTracking, startTimeReceived);
|
||||
} catch (Throwable t) {
|
||||
logger.log(Level.SEVERE, "RaceChangeListener " + listener + " threw exception " + t.getMessage());
|
||||
logger.throwing(DynamicTrackedRaceImpl.class.getName(), "notifyListenersRaceTimesChanged(TimePoint, TimePoint, TimePoint)", t);
|
||||
} catch (Exception e) {
|
||||
logger.log(Level.SEVERE, "RaceChangeListener " + listener + " threw exception " + e.getMessage());
|
||||
logger.throwing(DynamicTrackedRaceImpl.class.getName(), "notifyListenersRaceTimesChanged(TimePoint, TimePoint, TimePoint)", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -257,9 +257,9 @@ public class DynamicTrackedRaceImpl extends TrackedRaceImpl implements
|
||||
for (RaceChangeListener listener : listeners) {
|
||||
try {
|
||||
listener.markPositionChanged(fix, mark);
|
||||
} catch (Throwable t) {
|
||||
logger.log(Level.SEVERE, "RaceChangeListener " + listener + " threw exception " + t.getMessage());
|
||||
logger.throwing(DynamicTrackedRaceImpl.class.getName(), "notifyListeners(GPSFix, Competitor)", t);
|
||||
} catch (Exception e) {
|
||||
logger.log(Level.SEVERE, "RaceChangeListener " + listener + " threw exception " + e.getMessage());
|
||||
logger.throwing(DynamicTrackedRaceImpl.class.getName(), "notifyListeners(GPSFix, Competitor)", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -272,9 +272,9 @@ public class DynamicTrackedRaceImpl extends TrackedRaceImpl implements
|
||||
for (RaceChangeListener listener : listeners) {
|
||||
try {
|
||||
listener.competitorPositionChanged(fix, competitor);
|
||||
} catch (Throwable t) {
|
||||
logger.log(Level.SEVERE, "RaceChangeListener " + listener + " threw exception " + t.getMessage());
|
||||
logger.throwing(DynamicTrackedRaceImpl.class.getName(), "notifyListeners(GPSFix, Competitor)", t);
|
||||
} catch (Exception e) {
|
||||
logger.log(Level.SEVERE, "RaceChangeListener " + listener + " threw exception " + e.getMessage());
|
||||
logger.throwing(DynamicTrackedRaceImpl.class.getName(), "notifyListeners(GPSFix, Competitor)", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -287,9 +287,9 @@ public class DynamicTrackedRaceImpl extends TrackedRaceImpl implements
|
||||
for (RaceChangeListener listener : listeners) {
|
||||
try {
|
||||
listener.windDataReceived(wind, windSource);
|
||||
} catch (Throwable t) {
|
||||
logger.log(Level.SEVERE, "RaceChangeListener " + listener + " threw exception " + t.getMessage());
|
||||
logger.throwing(DynamicTrackedRaceImpl.class.getName(), "notifyListeners(Wind)", t);
|
||||
} catch (Exception e) {
|
||||
logger.log(Level.SEVERE, "RaceChangeListener " + listener + " threw exception " + e.getMessage());
|
||||
logger.throwing(DynamicTrackedRaceImpl.class.getName(), "notifyListeners(Wind)", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -303,10 +303,10 @@ public class DynamicTrackedRaceImpl extends TrackedRaceImpl implements
|
||||
try {
|
||||
listener.speedAveragingChanged(oldMillisecondsOverWhichToAverageSpeed,
|
||||
newMillisecondsOverWhichToAverageSpeed);
|
||||
} catch (Throwable t) {
|
||||
logger.log(Level.SEVERE, "RaceChangeListener " + listener + " threw exception " + t.getMessage());
|
||||
} catch (Exception e) {
|
||||
logger.log(Level.SEVERE, "RaceChangeListener " + listener + " threw exception " + e.getMessage());
|
||||
logger.throwing(DynamicTrackedRaceImpl.class.getName(),
|
||||
"notifyListenersSpeedAveragingChanged(long, long)", t);
|
||||
"notifyListenersSpeedAveragingChanged(long, long)", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -320,10 +320,10 @@ public class DynamicTrackedRaceImpl extends TrackedRaceImpl implements
|
||||
try {
|
||||
listener.windAveragingChanged(oldMillisecondsOverWhichToAverageWind,
|
||||
newMillisecondsOverWhichToAverageWind);
|
||||
} catch (Throwable t) {
|
||||
logger.log(Level.SEVERE, "RaceChangeListener " + listener + " threw exception " + t.getMessage());
|
||||
} catch (Exception e) {
|
||||
logger.log(Level.SEVERE, "RaceChangeListener " + listener + " threw exception " + e.getMessage());
|
||||
logger.throwing(DynamicTrackedRaceImpl.class.getName(),
|
||||
"notifyListenersWindAveragingChanged(long, long)", t);
|
||||
"notifyListenersWindAveragingChanged(long, long)", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -336,10 +336,10 @@ public class DynamicTrackedRaceImpl extends TrackedRaceImpl implements
|
||||
for (RaceChangeListener listener : listeners) {
|
||||
try {
|
||||
listener.delayToLiveChanged(delayToLiveInMillis);
|
||||
} catch (Throwable t) {
|
||||
logger.log(Level.SEVERE, "RaceChangeListener " + listener + " threw exception " + t.getMessage());
|
||||
} catch (Exception e) {
|
||||
logger.log(Level.SEVERE, "RaceChangeListener " + listener + " threw exception " + e.getMessage());
|
||||
logger.throwing(DynamicTrackedRaceImpl.class.getName(),
|
||||
"notifyListenersDelayToLiveChanged(long)", t);
|
||||
"notifyListenersDelayToLiveChanged(long)", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -352,9 +352,9 @@ public class DynamicTrackedRaceImpl extends TrackedRaceImpl implements
|
||||
for (RaceChangeListener listener : listeners) {
|
||||
try {
|
||||
listener.windDataRemoved(wind, windSource);
|
||||
} catch (Throwable t) {
|
||||
logger.log(Level.SEVERE, "RaceChangeListener " + listener + " threw exception " + t.getMessage());
|
||||
logger.throwing(DynamicTrackedRaceImpl.class.getName(), "notifyListenersWindRemoved(Wind)", t);
|
||||
} catch (Exception e) {
|
||||
logger.log(Level.SEVERE, "RaceChangeListener " + listener + " threw exception " + e.getMessage());
|
||||
logger.throwing(DynamicTrackedRaceImpl.class.getName(), "notifyListenersWindRemoved(Wind)", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -367,9 +367,9 @@ public class DynamicTrackedRaceImpl extends TrackedRaceImpl implements
|
||||
for (RaceChangeListener listener : listeners) {
|
||||
try {
|
||||
listener.markPassingReceived(competitor, oldMarkPassings, markPassings);
|
||||
} catch (Throwable t) {
|
||||
logger.log(Level.SEVERE, "RaceChangeListener " + listener + " threw exception " + t.getMessage());
|
||||
logger.throwing(DynamicTrackedRaceImpl.class.getName(), "notifyListeners(MarkPassing)", t);
|
||||
} catch (Exception e) {
|
||||
logger.log(Level.SEVERE, "RaceChangeListener " + listener + " threw exception " + e.getMessage());
|
||||
logger.throwing(DynamicTrackedRaceImpl.class.getName(), "notifyListeners(MarkPassing)", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+9
-9
@@ -113,9 +113,9 @@ public class WindTrackImpl extends TrackImpl<Wind> implements WindTrack {
|
||||
for (WindListener listener : listeners) {
|
||||
try {
|
||||
listener.windDataReceived(wind);
|
||||
} catch (Throwable t) {
|
||||
logger.log(Level.SEVERE, "WindListener " + listener + " threw exception " + t.getMessage());
|
||||
logger.throwing(WindTrackImpl.class.getName(), "notifyListenersAboutReceive(Wind)", t);
|
||||
} catch (Exception e) {
|
||||
logger.log(Level.SEVERE, "WindListener " + listener + " threw exception " + e.getMessage());
|
||||
logger.throwing(WindTrackImpl.class.getName(), "notifyListenersAboutReceive(Wind)", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -126,9 +126,9 @@ public class WindTrackImpl extends TrackImpl<Wind> implements WindTrack {
|
||||
for (WindListener listener : listeners) {
|
||||
try {
|
||||
listener.windAveragingChanged(oldMillisecondsOverWhichToAverage, newMillisecondsOverWhichToAverage);
|
||||
} catch (Throwable t) {
|
||||
logger.log(Level.SEVERE, "WindListener " + listener + " threw exception " + t.getMessage());
|
||||
logger.throwing(WindTrackImpl.class.getName(), "notifyListenersAboutAveragingChange(long, long)", t);
|
||||
} catch (Exception e) {
|
||||
logger.log(Level.SEVERE, "WindListener " + listener + " threw exception " + e.getMessage());
|
||||
logger.throwing(WindTrackImpl.class.getName(), "notifyListenersAboutAveragingChange(long, long)", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -139,9 +139,9 @@ public class WindTrackImpl extends TrackImpl<Wind> implements WindTrack {
|
||||
for (WindListener listener : listeners) {
|
||||
try {
|
||||
listener.windDataRemoved(wind);
|
||||
} catch (Throwable t) {
|
||||
logger.log(Level.SEVERE, "WindListener " + listener + " threw exception " + t.getMessage());
|
||||
logger.throwing(WindTrackImpl.class.getName(), "notifyListenersAboutRemoval(Wind)", t);
|
||||
} catch (Exception e) {
|
||||
logger.log(Level.SEVERE, "WindListener " + listener + " threw exception " + e.getMessage());
|
||||
logger.throwing(WindTrackImpl.class.getName(), "notifyListenersAboutRemoval(Wind)", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -225,7 +225,7 @@ public class SmartFutureCache<K, V, U extends UpdateInterval<U>> {
|
||||
LockUtil.unlockAfterWrite(lock);
|
||||
ongoingRecalculations.remove(key);
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
} catch (Exception e) {
|
||||
// cache won't be updated
|
||||
logger.throwing(SmartFutureCache.class.getName(), "triggerUpdate", e);
|
||||
throw new RuntimeException(e);
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<classpathentry kind="src" path="src/main/java"/>
|
||||
<classpathentry exported="true" kind="lib" path="WEB-INF/classes/"/>
|
||||
<classpathentry exported="true" kind="lib" path="WEB-INF/lib/gwt-maps.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="WEB-INF/lib/gwt-servlet.jar" sourcepath="C:/apps/eclipse371/plugins/com.google.gwt.eclipse.sdkbundle_2.4.0.v201202290255-rel-r37/gwt-2.4.0/gwt-user.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="WEB-INF/lib/gwt-servlet.jar" sourcepath="/com.google.gwt.osgi/lib/gwt-user.jar"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
|
||||
<classpathentry exported="true" kind="con" path="com.google.gwt.eclipse.core.GWT_CONTAINER"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
|
||||
+6
@@ -482,4 +482,10 @@ public interface StringMessages extends Messages {
|
||||
String gapChangeSinceLegStartInSecondsTooltip();
|
||||
String velocityMadeGoodInKnotsTooltip();
|
||||
String sideToWhichMarkAtLegStartWasRoundedTooltip();
|
||||
String numberOfManeuversInRaceTooltip();
|
||||
String competitorColumnTooltip();
|
||||
String sailIdColumnTooltip();
|
||||
String rankColumnTooltip();
|
||||
String carryColumnTooltip();
|
||||
String totalsColumnTooltip();
|
||||
}
|
||||
+7
-1
@@ -147,6 +147,7 @@ lengthInSeconds=Length (s)
|
||||
stressTest=Stress Test
|
||||
numberOfManeuvers=Maneuvers
|
||||
numberOfManeuversTooltip=The amount of the sailed maneuvers in this leg.
|
||||
numberOfManeuversInRaceTooltip=The amount of the sailed maneuvers in this race.
|
||||
tacks=Tacks
|
||||
jibes=Jibes
|
||||
penaltyCircles=Penalty Circles
|
||||
@@ -483,4 +484,9 @@ sideToWhichMarkAtLegStartWasRoundedTooltip=Side to which the mark at leg start w
|
||||
raceIsLive=Race {0} is live
|
||||
racesAreLive=Races {0} are live
|
||||
scoringSchemeHighPointFirstGetsTen=High Point, winner gets 10 points
|
||||
knotsUnit=kts
|
||||
knotsUnit=kts
|
||||
competitorColumnTooltip=Names of the members of this competitor.
|
||||
sailIdColumnTooltip=Shows the flag of the country and the sail ID of the competitor.
|
||||
rankColumnTooltip=The overall rank of this competitor in the regatta.
|
||||
carryColumnTooltip=Carry of past races.
|
||||
totalsColumnTooltip=The total of all points of a competitor in the regatta.
|
||||
+7
-1
@@ -148,6 +148,7 @@ lengthInSeconds=Länge (s)
|
||||
stressTest=Stresstest
|
||||
numberOfManeuvers=Manöver
|
||||
numberOfManeuversTooltip=Die Anzahl der gesegelten Manöver in diesem Schenkel.
|
||||
numberOfManeuversInRaceTooltip=Die Anzahl der gesegelten Manöver in diesem Rennen.
|
||||
tacks=Wenden
|
||||
jibes=Halsen
|
||||
penaltyCircles=Strafkreise
|
||||
@@ -484,4 +485,9 @@ sideToWhichMarkAtLegStartWasRoundedTooltip=Seite zu der die Tonne am Schenkelsar
|
||||
raceIsLive=Rennen {0} ist live
|
||||
racesAreLive=Rennen {0} sind live
|
||||
scoringSchemeHighPointFirstGetsTen=High Point System, Gewinner erhält 10 Punkte
|
||||
knotsUnit=kn
|
||||
knotsUnit=kn
|
||||
competitorColumnTooltip=Namen der Segler dieses Teilnehmers.
|
||||
sailIdColumnTooltip=Zeigt die Länderflagge und die Segel-ID des Teilnehmers.
|
||||
rankColumnTooltip=Der Gesamtplatz des Teilnehmers in der Regatta.
|
||||
carryColumnTooltip=Übertrag vergangener Rennen.
|
||||
totalsColumnTooltip=Summe aller Punkte eines Teilnehmers in der Regatta.
|
||||
+4
-4
@@ -3,9 +3,9 @@ package com.sap.sailing.gwt.ui.leaderboard;
|
||||
import com.google.gwt.cell.client.AbstractSafeHtmlCell;
|
||||
import com.google.gwt.safehtml.shared.SafeHtml;
|
||||
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
|
||||
import com.google.gwt.safehtml.shared.SafeHtmlUtils;
|
||||
import com.google.gwt.text.shared.AbstractSafeHtmlRenderer;
|
||||
import com.google.gwt.user.cellview.client.Header;
|
||||
import com.google.gwt.user.cellview.client.TextHeader;
|
||||
import com.google.gwt.user.cellview.client.SafeHtmlHeader;
|
||||
import com.sap.sailing.domain.common.InvertibleComparator;
|
||||
import com.sap.sailing.domain.common.impl.InvertibleComparatorAdapter;
|
||||
import com.sap.sailing.gwt.ui.client.Collator;
|
||||
@@ -57,8 +57,8 @@ public class CompetitorColumnBase<T> {
|
||||
};
|
||||
}
|
||||
|
||||
public Header<String> getHeader() {
|
||||
return new TextHeader(getStringMessages().name());
|
||||
public SafeHtmlHeader getHeader() {
|
||||
return new SafeHtmlHeaderWithTooltip(SafeHtmlUtils.fromString(getStringMessages().name()), getStringMessages().competitorColumnTooltip());
|
||||
}
|
||||
|
||||
public void render(T t, String competitorColorBarStyle, SafeHtmlBuilder sb) {
|
||||
|
||||
+9
-17
@@ -3,14 +3,13 @@ package com.sap.sailing.gwt.ui.leaderboard;
|
||||
import com.google.gwt.cell.client.Cell;
|
||||
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
|
||||
import com.google.gwt.user.cellview.client.Header;
|
||||
import com.google.gwt.user.cellview.client.SafeHtmlHeader;
|
||||
import com.sap.sailing.domain.common.DetailType;
|
||||
import com.sap.sailing.domain.common.InvertibleComparator;
|
||||
import com.sap.sailing.domain.common.impl.InvertibleComparatorAdapter;
|
||||
import com.sap.sailing.gwt.ui.client.DetailTypeFormatter;
|
||||
import com.sap.sailing.gwt.ui.shared.LeaderboardRowDTO;
|
||||
|
||||
public abstract class LegDetailColumn<FieldType extends Comparable<?>, RenderingType> extends
|
||||
public abstract class DetailTypeColumn<FieldType extends Comparable<?>, RenderingType> extends
|
||||
SortableColumn<LeaderboardRowDTO, RenderingType> {
|
||||
|
||||
private static final String HtmlConstantToInlineHeadersWithAndWithoutUnit = " ";
|
||||
@@ -22,13 +21,11 @@ public abstract class LegDetailColumn<FieldType extends Comparable<?>, Rendering
|
||||
private final String unit;
|
||||
private final String tooltip;
|
||||
|
||||
private SafeHtmlHeader header;
|
||||
|
||||
public interface LegDetailField<T extends Comparable<?>> {
|
||||
T get(LeaderboardRowDTO row);
|
||||
}
|
||||
|
||||
protected LegDetailColumn(DetailType detailType, LegDetailField<FieldType> field, Cell<RenderingType> cell, String headerStyle, String columnStyle) {
|
||||
protected DetailTypeColumn(DetailType detailType, LegDetailField<FieldType> field, Cell<RenderingType> cell, String headerStyle, String columnStyle) {
|
||||
super(cell, detailType.getDefaultSortingOrder());
|
||||
setHorizontalAlignment(ALIGN_CENTER);
|
||||
this.title = DetailTypeFormatter.format(detailType);
|
||||
@@ -37,17 +34,6 @@ public abstract class LegDetailColumn<FieldType extends Comparable<?>, Rendering
|
||||
this.field = field;
|
||||
this.headerStyle = headerStyle;
|
||||
this.columnStyle = columnStyle;
|
||||
InitializeHeader();
|
||||
}
|
||||
|
||||
private void InitializeHeader() {
|
||||
SafeHtmlBuilder titleBuilder = new SafeHtmlBuilder().appendEscaped(title).appendHtmlConstant("<br>");
|
||||
if (unit == null || unit.isEmpty()) {
|
||||
titleBuilder.appendHtmlConstant(HtmlConstantToInlineHeadersWithAndWithoutUnit);
|
||||
} else {
|
||||
titleBuilder.appendEscaped(unit);
|
||||
}
|
||||
header = new SafeHtmlHeaderWithTooltip(titleBuilder.toSafeHtml(), tooltip);
|
||||
}
|
||||
|
||||
protected String getTitle() {
|
||||
@@ -88,7 +74,13 @@ public abstract class LegDetailColumn<FieldType extends Comparable<?>, Rendering
|
||||
|
||||
@Override
|
||||
public Header<?> getHeader() {
|
||||
return header;
|
||||
SafeHtmlBuilder titleBuilder = new SafeHtmlBuilder().appendEscaped(title).appendHtmlConstant("<br>");
|
||||
if (unit == null || unit.isEmpty()) {
|
||||
titleBuilder.appendHtmlConstant(HtmlConstantToInlineHeadersWithAndWithoutUnit);
|
||||
} else {
|
||||
titleBuilder.appendEscaped(unit);
|
||||
}
|
||||
return new SafeHtmlHeaderWithTooltip(titleBuilder.toSafeHtml(), tooltip);
|
||||
}
|
||||
|
||||
/**
|
||||
+2
-2
@@ -10,7 +10,7 @@ import com.sap.sailing.gwt.ui.client.NumberFormatterFactory;
|
||||
import com.sap.sailing.gwt.ui.shared.LeaderboardDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.LeaderboardRowDTO;
|
||||
|
||||
public class FormattedDoubleLegDetailColumn extends LegDetailColumn<Double, String> implements HasStringAndDoubleValue {
|
||||
public class FormattedDoubleDetailTypeColumn extends DetailTypeColumn<Double, String> implements HasStringAndDoubleValue {
|
||||
private final NumberFormat formatter;
|
||||
private final MinMaxRenderer minMaxRenderer;
|
||||
|
||||
@@ -23,7 +23,7 @@ public class FormattedDoubleLegDetailColumn extends LegDetailColumn<Double, Stri
|
||||
* @param headerStyle
|
||||
* @param columnStyle
|
||||
*/
|
||||
public FormattedDoubleLegDetailColumn(DetailType detailType, LegDetailField<Double> field, String headerStyle, String columnStyle) {
|
||||
public FormattedDoubleDetailTypeColumn(DetailType detailType, LegDetailField<Double> field, String headerStyle, String columnStyle) {
|
||||
super(detailType, field, new TextCell(), headerStyle, columnStyle);
|
||||
formatter = NumberFormatterFactory.getDecimalFormat(detailType.getPrecision());
|
||||
this.minMaxRenderer = new MinMaxRenderer(this, getComparator());
|
||||
-26
@@ -1,26 +0,0 @@
|
||||
package com.sap.sailing.gwt.ui.leaderboard;
|
||||
|
||||
import com.sap.sailing.domain.common.DetailType;
|
||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
import com.sap.sailing.gwt.ui.shared.LeaderboardRowDTO;
|
||||
|
||||
/**
|
||||
* Shows the {@link LeaderboardRowDTO#totalTimeSailedDownwindInSeconds} attribute.
|
||||
*
|
||||
* @author Axel Uhl (d043530)
|
||||
*
|
||||
*/
|
||||
public class KingOfTheDownwindColumn extends AbstractTimeInHoursMinutesSecondsColumn {
|
||||
|
||||
private static class KingOfTheDownwindField implements LegDetailField<Double> {
|
||||
@Override
|
||||
public Double get(LeaderboardRowDTO row) {
|
||||
return row.totalTimeSailedDownwindInSeconds;
|
||||
}
|
||||
}
|
||||
|
||||
public KingOfTheDownwindColumn(StringMessages stringMessages, String headerStyle, String columnStyle) {
|
||||
super(DetailType.TOTAL_TIME_SAILED_DOWNWIND_IN_SECONDS, new KingOfTheDownwindField(), headerStyle, columnStyle);
|
||||
}
|
||||
|
||||
}
|
||||
-25
@@ -1,25 +0,0 @@
|
||||
package com.sap.sailing.gwt.ui.leaderboard;
|
||||
|
||||
import com.sap.sailing.domain.common.DetailType;
|
||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
import com.sap.sailing.gwt.ui.shared.LeaderboardRowDTO;
|
||||
|
||||
/**
|
||||
* Shows the {@link LeaderboardRowDTO#totalTimeSailedDownwindInSeconds} attribute.
|
||||
*
|
||||
* @author Axel Uhl (d043530)
|
||||
*
|
||||
*/
|
||||
public class KingOfTheReachingColumn extends AbstractTimeInHoursMinutesSecondsColumn {
|
||||
|
||||
private static class KingOfTheReachingField implements LegDetailField<Double> {
|
||||
@Override
|
||||
public Double get(LeaderboardRowDTO row) {
|
||||
return row.totalTimeSailedReachingInSeconds;
|
||||
}
|
||||
}
|
||||
|
||||
public KingOfTheReachingColumn(StringMessages stringMessages, String headerStyle, String columnStyle) {
|
||||
super(DetailType.TOTAL_TIME_SAILED_REACHING_IN_SECONDS, new KingOfTheReachingField(), headerStyle, columnStyle);
|
||||
}
|
||||
}
|
||||
-26
@@ -1,26 +0,0 @@
|
||||
package com.sap.sailing.gwt.ui.leaderboard;
|
||||
|
||||
import com.sap.sailing.domain.common.DetailType;
|
||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
import com.sap.sailing.gwt.ui.shared.LeaderboardRowDTO;
|
||||
|
||||
/**
|
||||
* Shows the {@link LeaderboardRowDTO#totalTimeSailedDownwindInSeconds} attribute.
|
||||
*
|
||||
* @author Axel Uhl (d043530)
|
||||
*
|
||||
*/
|
||||
public class KingOfTheUpwindColumn extends AbstractTimeInHoursMinutesSecondsColumn {
|
||||
|
||||
private static class KingOfTheUpwindField implements LegDetailField<Double> {
|
||||
@Override
|
||||
public Double get(LeaderboardRowDTO row) {
|
||||
return row.totalTimeSailedUpwindInSeconds;
|
||||
}
|
||||
}
|
||||
|
||||
public KingOfTheUpwindColumn(StringMessages stringMessages, String headerStyle, String columnStyle) {
|
||||
super(DetailType.TOTAL_TIME_SAILED_UPWIND_IN_SECONDS, new KingOfTheUpwindField(), headerStyle, columnStyle);
|
||||
}
|
||||
|
||||
}
|
||||
+63
-28
@@ -25,9 +25,10 @@ import com.google.gwt.resources.client.ImageResource;
|
||||
import com.google.gwt.safehtml.client.SafeHtmlTemplates;
|
||||
import com.google.gwt.safehtml.shared.SafeHtml;
|
||||
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
|
||||
import com.google.gwt.safehtml.shared.SafeHtmlUtils;
|
||||
import com.google.gwt.user.cellview.client.Column;
|
||||
import com.google.gwt.user.cellview.client.Header;
|
||||
import com.google.gwt.user.cellview.client.TextHeader;
|
||||
import com.google.gwt.user.cellview.client.SafeHtmlHeader;
|
||||
import com.google.gwt.user.client.Window;
|
||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||
import com.google.gwt.user.client.ui.AbstractImagePrototype;
|
||||
@@ -74,7 +75,7 @@ import com.sap.sailing.gwt.ui.client.Timer;
|
||||
import com.sap.sailing.gwt.ui.client.Timer.PlayModes;
|
||||
import com.sap.sailing.gwt.ui.client.Timer.PlayStates;
|
||||
import com.sap.sailing.gwt.ui.client.UserAgentDetails;
|
||||
import com.sap.sailing.gwt.ui.leaderboard.LegDetailColumn.LegDetailField;
|
||||
import com.sap.sailing.gwt.ui.leaderboard.DetailTypeColumn.LegDetailField;
|
||||
import com.sap.sailing.gwt.ui.shared.AbstractLeaderboardDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.CompetitorDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.FleetDTO;
|
||||
@@ -561,7 +562,7 @@ public class LeaderboardPanel extends FormPanel implements TimeListener, PlaySta
|
||||
}
|
||||
|
||||
@Override
|
||||
public Header<String> getHeader() {
|
||||
public SafeHtmlHeader getHeader() {
|
||||
return base.getHeader();
|
||||
}
|
||||
|
||||
@@ -614,8 +615,8 @@ public class LeaderboardPanel extends FormPanel implements TimeListener, PlaySta
|
||||
}
|
||||
|
||||
@Override
|
||||
public Header<String> getHeader() {
|
||||
return new TextHeader(stringMessages.competitor());
|
||||
public SafeHtmlHeader getHeader() {
|
||||
return new SafeHtmlHeaderWithTooltip(SafeHtmlUtils.fromString(stringMessages.competitor()), stringMessages.sailIdColumnTooltip());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -762,10 +763,8 @@ public class LeaderboardPanel extends FormPanel implements TimeListener, PlaySta
|
||||
|
||||
@Override
|
||||
public Header<SafeHtml> getHeader() {
|
||||
SortableExpandableColumnHeader header = new SortableExpandableColumnHeader(
|
||||
/* title */race.getRaceColumnName(),
|
||||
/* iconURL */race.isMedalRace() ? "/gwt/images/medal_small.png" : null, LeaderboardPanel.this, this,
|
||||
stringMessages);
|
||||
SortableExpandableColumnHeader header = new SortableExpandableColumnHeader(/* title */race.getRaceColumnName(),
|
||||
/* iconURL */race.isMedalRace() ? "/gwt/images/medal_small.png" : null, LeaderboardPanel.this, this, stringMessages);
|
||||
return header;
|
||||
}
|
||||
}
|
||||
@@ -838,33 +837,33 @@ public class LeaderboardPanel extends FormPanel implements TimeListener, PlaySta
|
||||
Map<DetailType, SortableColumn<LeaderboardRowDTO, ?>> result = new HashMap<DetailType, SortableColumn<LeaderboardRowDTO, ?>>();
|
||||
|
||||
result.put(DetailType.RACE_DISTANCE_TRAVELED,
|
||||
new FormattedDoubleLegDetailColumn(DetailType.RACE_DISTANCE_TRAVELED, new RaceDistanceTraveledInMeters(),
|
||||
new FormattedDoubleDetailTypeColumn(DetailType.RACE_DISTANCE_TRAVELED, new RaceDistanceTraveledInMeters(),
|
||||
LEG_COLUMN_HEADER_STYLE, LEG_COLUMN_STYLE));
|
||||
|
||||
result.put(DetailType.RACE_AVERAGE_SPEED_OVER_GROUND_IN_KNOTS,
|
||||
new FormattedDoubleLegDetailColumn(DetailType.RACE_AVERAGE_SPEED_OVER_GROUND_IN_KNOTS, new RaceAverageSpeedInKnots(),
|
||||
new FormattedDoubleDetailTypeColumn(DetailType.RACE_AVERAGE_SPEED_OVER_GROUND_IN_KNOTS, new RaceAverageSpeedInKnots(),
|
||||
LEG_COLUMN_HEADER_STYLE, LEG_COLUMN_STYLE));
|
||||
|
||||
result.put(DetailType.RACE_GAP_TO_LEADER_IN_SECONDS,
|
||||
new FormattedDoubleLegDetailColumn(DetailType.RACE_GAP_TO_LEADER_IN_SECONDS, new RaceGapToLeaderInSeconds(),
|
||||
new FormattedDoubleDetailTypeColumn(DetailType.RACE_GAP_TO_LEADER_IN_SECONDS, new RaceGapToLeaderInSeconds(),
|
||||
LEG_COLUMN_HEADER_STYLE, LEG_COLUMN_STYLE));
|
||||
|
||||
result.put(DetailType.RACE_CURRENT_SPEED_OVER_GROUND_IN_KNOTS,
|
||||
new FormattedDoubleLegDetailColumn(DetailType.RACE_CURRENT_SPEED_OVER_GROUND_IN_KNOTS, new CurrentSpeedOverGroundInKnots(),
|
||||
new FormattedDoubleDetailTypeColumn(DetailType.RACE_CURRENT_SPEED_OVER_GROUND_IN_KNOTS, new CurrentSpeedOverGroundInKnots(),
|
||||
LEG_COLUMN_HEADER_STYLE, LEG_COLUMN_STYLE));
|
||||
|
||||
result.put(DetailType.RACE_DISTANCE_TO_LEADER_IN_METERS,
|
||||
new FormattedDoubleLegDetailColumn(DetailType.RACE_DISTANCE_TO_LEADER_IN_METERS, new RaceDistanceToLeaderInMeters(),
|
||||
new FormattedDoubleDetailTypeColumn(DetailType.RACE_DISTANCE_TO_LEADER_IN_METERS, new RaceDistanceToLeaderInMeters(),
|
||||
LEG_COLUMN_HEADER_STYLE, LEG_COLUMN_STYLE));
|
||||
|
||||
result.put(DetailType.RACE_AVERAGE_CROSS_TRACK_ERROR_IN_METERS,
|
||||
new FormattedDoubleLegDetailColumn(DetailType.RACE_AVERAGE_CROSS_TRACK_ERROR_IN_METERS, new RaceAverageCrossTrackErrorInMeters(),
|
||||
new FormattedDoubleDetailTypeColumn(DetailType.RACE_AVERAGE_CROSS_TRACK_ERROR_IN_METERS, new RaceAverageCrossTrackErrorInMeters(),
|
||||
LEG_COLUMN_HEADER_STYLE, LEG_COLUMN_STYLE));
|
||||
|
||||
result.put(DetailType.NUMBER_OF_MANEUVERS, getManeuverCountRaceColumn());
|
||||
|
||||
result.put(DetailType.CURRENT_LEG,
|
||||
new FormattedDoubleLegDetailColumn(DetailType.CURRENT_LEG, new CurrentLeg(), LEG_COLUMN_HEADER_STYLE, LEG_COLUMN_STYLE));
|
||||
new FormattedDoubleDetailTypeColumn(DetailType.CURRENT_LEG, new CurrentLeg(), LEG_COLUMN_HEADER_STYLE, LEG_COLUMN_STYLE));
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -1125,8 +1124,8 @@ public class LeaderboardPanel extends FormPanel implements TimeListener, PlaySta
|
||||
}
|
||||
|
||||
@Override
|
||||
public Header<String> getHeader() {
|
||||
return new TextHeader(stringMessages.total());
|
||||
public SafeHtmlHeader getHeader() {
|
||||
return new SafeHtmlHeaderWithTooltip(SafeHtmlUtils.fromString(stringMessages.total()), stringMessages.totalsColumnTooltip());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1165,8 +1164,8 @@ public class LeaderboardPanel extends FormPanel implements TimeListener, PlaySta
|
||||
}
|
||||
|
||||
@Override
|
||||
public Header<String> getHeader() {
|
||||
return new TextHeader(stringMessages.carry());
|
||||
public SafeHtmlHeader getHeader() {
|
||||
return new SafeHtmlHeaderWithTooltip(SafeHtmlUtils.fromString(stringMessages.carry()), stringMessages.carryColumnTooltip());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1196,8 +1195,8 @@ public class LeaderboardPanel extends FormPanel implements TimeListener, PlaySta
|
||||
}
|
||||
|
||||
@Override
|
||||
public Header<String> getHeader() {
|
||||
return new TextHeader(stringMessages.totalRank());
|
||||
public SafeHtmlHeader getHeader() {
|
||||
return new SafeHtmlHeaderWithTooltip(SafeHtmlUtils.fromString(stringMessages.totalRank()), stringMessages.rankColumnTooltip());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1400,18 +1399,54 @@ public class LeaderboardPanel extends FormPanel implements TimeListener, PlaySta
|
||||
setWidget(contentPanel);
|
||||
raceNameForDefaultSorting = settings.getNameOfRaceToSort();
|
||||
}
|
||||
|
||||
private static class KingOfTheDownwindField implements LegDetailField<Double> {
|
||||
@Override
|
||||
public Double get(LeaderboardRowDTO row) {
|
||||
return row.totalTimeSailedDownwindInSeconds;
|
||||
}
|
||||
}
|
||||
|
||||
private static class KingOfTheReachingField implements LegDetailField<Double> {
|
||||
@Override
|
||||
public Double get(LeaderboardRowDTO row) {
|
||||
return row.totalTimeSailedReachingInSeconds;
|
||||
}
|
||||
}
|
||||
|
||||
private static class KingOfTheUpwindField implements LegDetailField<Double> {
|
||||
@Override
|
||||
public Double get(LeaderboardRowDTO row) {
|
||||
return row.totalTimeSailedUpwindInSeconds;
|
||||
}
|
||||
}
|
||||
|
||||
private static class TotalTimeSailedField implements LegDetailField<Double> {
|
||||
@Override
|
||||
public Double get(LeaderboardRowDTO row) {
|
||||
return row.totalTimeSailedInSeconds;
|
||||
}
|
||||
}
|
||||
|
||||
private Map<DetailType, SortableColumn<LeaderboardRowDTO, ?>> createOverallDetailColumnMap() {
|
||||
Map<DetailType, SortableColumn<LeaderboardRowDTO, ?>> result = new HashMap<DetailType, SortableColumn<LeaderboardRowDTO, ?>>();
|
||||
result.put(DetailType.MAXIMUM_SPEED_OVER_GROUND_IN_KNOTS, new MaxSpeedOverallColumn(stringMessages,
|
||||
result.put(DetailType.MAXIMUM_SPEED_OVER_GROUND_IN_KNOTS, new MaxSpeedOverallColumn(RACE_COLUMN_HEADER_STYLE,
|
||||
RACE_COLUMN_STYLE));
|
||||
|
||||
result.put(DetailType.TOTAL_TIME_SAILED_UPWIND_IN_SECONDS, new TotalTimeColumn(
|
||||
DetailType.TOTAL_TIME_SAILED_UPWIND_IN_SECONDS, new KingOfTheUpwindField(),
|
||||
RACE_COLUMN_HEADER_STYLE, RACE_COLUMN_STYLE));
|
||||
result.put(DetailType.TOTAL_TIME_SAILED_UPWIND_IN_SECONDS, new KingOfTheUpwindColumn(stringMessages,
|
||||
|
||||
result.put(DetailType.TOTAL_TIME_SAILED_DOWNWIND_IN_SECONDS, new TotalTimeColumn(
|
||||
DetailType.TOTAL_TIME_SAILED_DOWNWIND_IN_SECONDS, new KingOfTheDownwindField(),
|
||||
RACE_COLUMN_HEADER_STYLE, RACE_COLUMN_STYLE));
|
||||
result.put(DetailType.TOTAL_TIME_SAILED_DOWNWIND_IN_SECONDS, new KingOfTheDownwindColumn(stringMessages,
|
||||
|
||||
result.put(DetailType.TOTAL_TIME_SAILED_REACHING_IN_SECONDS, new TotalTimeColumn(
|
||||
DetailType.TOTAL_TIME_SAILED_REACHING_IN_SECONDS, new KingOfTheReachingField(),
|
||||
RACE_COLUMN_HEADER_STYLE, RACE_COLUMN_STYLE));
|
||||
result.put(DetailType.TOTAL_TIME_SAILED_REACHING_IN_SECONDS, new KingOfTheReachingColumn(stringMessages,
|
||||
RACE_COLUMN_HEADER_STYLE, RACE_COLUMN_STYLE));
|
||||
result.put(DetailType.TOTAL_TIME_SAILED_IN_SECONDS, new TotalTimeSailedColumn(stringMessages,
|
||||
|
||||
result.put(DetailType.TOTAL_TIME_SAILED_IN_SECONDS, new TotalTimeColumn(
|
||||
DetailType.TOTAL_TIME_SAILED_IN_SECONDS, new TotalTimeSailedField(),
|
||||
RACE_COLUMN_HEADER_STYLE, RACE_COLUMN_STYLE));
|
||||
return result;
|
||||
}
|
||||
|
||||
+12
-12
@@ -14,7 +14,7 @@ import com.sap.sailing.domain.common.SortingOrder;
|
||||
import com.sap.sailing.domain.common.Tack;
|
||||
import com.sap.sailing.domain.common.impl.InvertibleComparatorAdapter;
|
||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
import com.sap.sailing.gwt.ui.leaderboard.LegDetailColumn.LegDetailField;
|
||||
import com.sap.sailing.gwt.ui.leaderboard.DetailTypeColumn.LegDetailField;
|
||||
import com.sap.sailing.gwt.ui.shared.LeaderboardEntryDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.LeaderboardRowDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.LegEntryDTO;
|
||||
@@ -137,7 +137,7 @@ public class LegColumn extends ExpandableSortableColumn<String> {
|
||||
}
|
||||
}
|
||||
|
||||
private class ManeuverCountLegDetailsColumn extends FormattedDoubleLegDetailColumn {
|
||||
private class ManeuverCountLegDetailsColumn extends FormattedDoubleDetailTypeColumn {
|
||||
public ManeuverCountLegDetailsColumn(String headerStyle, String columnStyle) {
|
||||
super(DetailType.NUMBER_OF_MANEUVERS, null, headerStyle, columnStyle);
|
||||
}
|
||||
@@ -240,23 +240,23 @@ public class LegColumn extends ExpandableSortableColumn<String> {
|
||||
Map<DetailType, SortableColumn<LeaderboardRowDTO, ?>> result = new HashMap<DetailType, SortableColumn<LeaderboardRowDTO, ?>>();
|
||||
|
||||
result.put(DetailType.DISTANCE_TRAVELED,
|
||||
new FormattedDoubleLegDetailColumn(DetailType.DISTANCE_TRAVELED, new DistanceTraveledInMeters(), detailHeaderStyle, detailColumnStyle));
|
||||
new FormattedDoubleDetailTypeColumn(DetailType.DISTANCE_TRAVELED, new DistanceTraveledInMeters(), detailHeaderStyle, detailColumnStyle));
|
||||
|
||||
result.put(DetailType.AVERAGE_SPEED_OVER_GROUND_IN_KNOTS,
|
||||
new FormattedDoubleLegDetailColumn(DetailType.AVERAGE_SPEED_OVER_GROUND_IN_KNOTS, new AverageSpeedOverGroundInKnots(), detailHeaderStyle, detailColumnStyle));
|
||||
new FormattedDoubleDetailTypeColumn(DetailType.AVERAGE_SPEED_OVER_GROUND_IN_KNOTS, new AverageSpeedOverGroundInKnots(), detailHeaderStyle, detailColumnStyle));
|
||||
|
||||
result.put(DetailType.CURRENT_SPEED_OVER_GROUND_IN_KNOTS,
|
||||
new FormattedDoubleLegDetailColumn(DetailType.CURRENT_SPEED_OVER_GROUND_IN_KNOTS, new CurrentSpeedOverGroundInKnots(), detailHeaderStyle, detailColumnStyle));
|
||||
new FormattedDoubleDetailTypeColumn(DetailType.CURRENT_SPEED_OVER_GROUND_IN_KNOTS, new CurrentSpeedOverGroundInKnots(), detailHeaderStyle, detailColumnStyle));
|
||||
|
||||
result.put(DetailType.ESTIMATED_TIME_TO_NEXT_WAYPOINT_IN_SECONDS,
|
||||
new FormattedDoubleLegDetailColumn(DetailType.ESTIMATED_TIME_TO_NEXT_WAYPOINT_IN_SECONDS, new EstimatedTimeToNextWaypointInSeconds(),
|
||||
new FormattedDoubleDetailTypeColumn(DetailType.ESTIMATED_TIME_TO_NEXT_WAYPOINT_IN_SECONDS, new EstimatedTimeToNextWaypointInSeconds(),
|
||||
detailHeaderStyle, detailColumnStyle));
|
||||
|
||||
result.put(DetailType.GAP_TO_LEADER_IN_SECONDS,
|
||||
new FormattedDoubleLegDetailColumn(DetailType.GAP_TO_LEADER_IN_SECONDS, new GapToLeaderInSeconds(), detailHeaderStyle, detailColumnStyle));
|
||||
new FormattedDoubleDetailTypeColumn(DetailType.GAP_TO_LEADER_IN_SECONDS, new GapToLeaderInSeconds(), detailHeaderStyle, detailColumnStyle));
|
||||
|
||||
result.put(DetailType.GAP_CHANGE_SINCE_LEG_START_IN_SECONDS,
|
||||
new FormattedDoubleLegDetailColumn(DetailType.GAP_CHANGE_SINCE_LEG_START_IN_SECONDS, new GapChangeSinceLegStartInSeconds(),
|
||||
new FormattedDoubleDetailTypeColumn(DetailType.GAP_CHANGE_SINCE_LEG_START_IN_SECONDS, new GapChangeSinceLegStartInSeconds(),
|
||||
detailHeaderStyle, detailColumnStyle));
|
||||
|
||||
result.put(DetailType.SIDE_TO_WHICH_MARK_AT_LEG_START_WAS_ROUNDED,
|
||||
@@ -264,20 +264,20 @@ public class LegColumn extends ExpandableSortableColumn<String> {
|
||||
new SideToWhichMarkAtLegStartWasRounded(), detailHeaderStyle, detailColumnStyle));
|
||||
|
||||
result.put(DetailType.VELOCITY_MADE_GOOD_IN_KNOTS,
|
||||
new FormattedDoubleLegDetailColumn(DetailType.VELOCITY_MADE_GOOD_IN_KNOTS, new VelocityMadeGoodInKnots(), detailHeaderStyle, detailColumnStyle));
|
||||
new FormattedDoubleDetailTypeColumn(DetailType.VELOCITY_MADE_GOOD_IN_KNOTS, new VelocityMadeGoodInKnots(), detailHeaderStyle, detailColumnStyle));
|
||||
|
||||
result.put(DetailType.WINDWARD_DISTANCE_TO_GO_IN_METERS,
|
||||
new FormattedDoubleLegDetailColumn(DetailType.WINDWARD_DISTANCE_TO_GO_IN_METERS, new WindwardDistanceToGoInMeters(), detailHeaderStyle, detailColumnStyle));
|
||||
new FormattedDoubleDetailTypeColumn(DetailType.WINDWARD_DISTANCE_TO_GO_IN_METERS, new WindwardDistanceToGoInMeters(), detailHeaderStyle, detailColumnStyle));
|
||||
|
||||
result.put(DetailType.RANK_GAIN, new RankGainColumn(stringMessages.rankGain(), new RankGain(), detailHeaderStyle, detailColumnStyle));
|
||||
|
||||
result.put(DetailType.NUMBER_OF_MANEUVERS, new ManeuverCountLegDetailsColumn(detailHeaderStyle, detailColumnStyle));
|
||||
|
||||
result.put(DetailType.TIME_TRAVELED,
|
||||
new FormattedDoubleLegDetailColumn(DetailType.TIME_TRAVELED, new TimeTraveledInSeconds(), detailHeaderStyle, detailColumnStyle));
|
||||
new FormattedDoubleDetailTypeColumn(DetailType.TIME_TRAVELED, new TimeTraveledInSeconds(), detailHeaderStyle, detailColumnStyle));
|
||||
|
||||
result.put(DetailType.AVERAGE_CROSS_TRACK_ERROR_IN_METERS,
|
||||
new FormattedDoubleLegDetailColumn(DetailType.AVERAGE_CROSS_TRACK_ERROR_IN_METERS, new AverageCrossTrackErrorInMeters(), detailHeaderStyle, detailColumnStyle));
|
||||
new FormattedDoubleDetailTypeColumn(DetailType.AVERAGE_CROSS_TRACK_ERROR_IN_METERS, new AverageCrossTrackErrorInMeters(), detailHeaderStyle, detailColumnStyle));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
+8
-8
@@ -14,7 +14,7 @@ import com.sap.sailing.domain.common.InvertibleComparator;
|
||||
import com.sap.sailing.domain.common.ManeuverType;
|
||||
import com.sap.sailing.domain.common.impl.InvertibleComparatorAdapter;
|
||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
import com.sap.sailing.gwt.ui.leaderboard.LegDetailColumn.LegDetailField;
|
||||
import com.sap.sailing.gwt.ui.leaderboard.DetailTypeColumn.LegDetailField;
|
||||
import com.sap.sailing.gwt.ui.shared.LeaderboardDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.LeaderboardEntryDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.LeaderboardRowDTO;
|
||||
@@ -169,7 +169,7 @@ public class ManeuverCountRaceColumn extends ExpandableSortableColumn<String> im
|
||||
@Override
|
||||
public Header<SafeHtml> getHeader() {
|
||||
SortableExpandableColumnHeader result = new SortableExpandableColumnHeader(
|
||||
/* title */stringMessages.maneuverTypes(),
|
||||
/* title */stringMessages.maneuverTypes(), /* tooltip */ stringMessages.numberOfManeuversInRaceTooltip(),
|
||||
/* iconURL */null, getLeaderboardPanel(), this, stringMessages);
|
||||
return result;
|
||||
}
|
||||
@@ -238,23 +238,23 @@ public class ManeuverCountRaceColumn extends ExpandableSortableColumn<String> im
|
||||
LeaderboardPanel leaderboardPanel, StringMessages stringMessages, String detailHeaderStyle,
|
||||
String detailColumnStyle) {
|
||||
Map<DetailType, SortableColumn<LeaderboardRowDTO, ?>> result = new HashMap<DetailType, SortableColumn<LeaderboardRowDTO, ?>>();
|
||||
result.put(DetailType.TACK, new FormattedDoubleLegDetailColumn(DetailType.TACK, new NumberOfTacks(), detailHeaderStyle, detailColumnStyle));
|
||||
result.put(DetailType.TACK, new FormattedDoubleDetailTypeColumn(DetailType.TACK, new NumberOfTacks(), detailHeaderStyle, detailColumnStyle));
|
||||
|
||||
result.put(DetailType.JIBE, new FormattedDoubleLegDetailColumn(DetailType.JIBE, new NumberOfJibes(), detailHeaderStyle, detailColumnStyle));
|
||||
result.put(DetailType.JIBE, new FormattedDoubleDetailTypeColumn(DetailType.JIBE, new NumberOfJibes(), detailHeaderStyle, detailColumnStyle));
|
||||
|
||||
result.put(DetailType.PENALTY_CIRCLE,
|
||||
new FormattedDoubleLegDetailColumn(DetailType.PENALTY_CIRCLE, new NumberOfPenaltyCircles(), detailHeaderStyle, detailColumnStyle));
|
||||
new FormattedDoubleDetailTypeColumn(DetailType.PENALTY_CIRCLE, new NumberOfPenaltyCircles(), detailHeaderStyle, detailColumnStyle));
|
||||
|
||||
result.put(DetailType.AVERAGE_TACK_LOSS_IN_METERS,
|
||||
new FormattedDoubleLegDetailColumn(DetailType.AVERAGE_TACK_LOSS_IN_METERS, new AverageTackLossInMeters(),
|
||||
new FormattedDoubleDetailTypeColumn(DetailType.AVERAGE_TACK_LOSS_IN_METERS, new AverageTackLossInMeters(),
|
||||
detailHeaderStyle, detailColumnStyle));
|
||||
|
||||
result.put(DetailType.AVERAGE_JIBE_LOSS_IN_METERS,
|
||||
new FormattedDoubleLegDetailColumn(DetailType.AVERAGE_JIBE_LOSS_IN_METERS, new AverageJibeLossInMeters(),
|
||||
new FormattedDoubleDetailTypeColumn(DetailType.AVERAGE_JIBE_LOSS_IN_METERS, new AverageJibeLossInMeters(),
|
||||
detailHeaderStyle, detailColumnStyle));
|
||||
|
||||
result.put(DetailType.AVERAGE_MANEUVER_LOSS_IN_METERS,
|
||||
new FormattedDoubleLegDetailColumn(DetailType.AVERAGE_MANEUVER_LOSS_IN_METERS, new AverageManeuverLossInMeters(),
|
||||
new FormattedDoubleDetailTypeColumn(DetailType.AVERAGE_MANEUVER_LOSS_IN_METERS, new AverageManeuverLossInMeters(),
|
||||
detailHeaderStyle, detailColumnStyle));
|
||||
|
||||
return result;
|
||||
|
||||
+2
-3
@@ -3,7 +3,6 @@ package com.sap.sailing.gwt.ui.leaderboard;
|
||||
import com.google.gwt.i18n.client.DateTimeFormat;
|
||||
import com.google.gwt.i18n.client.DateTimeFormat.PredefinedFormat;
|
||||
import com.sap.sailing.domain.common.DetailType;
|
||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
import com.sap.sailing.gwt.ui.shared.LeaderboardRowDTO;
|
||||
|
||||
/**
|
||||
@@ -12,7 +11,7 @@ import com.sap.sailing.gwt.ui.shared.LeaderboardRowDTO;
|
||||
* @author Axel Uhl (d043530)
|
||||
*
|
||||
*/
|
||||
public class MaxSpeedOverallColumn extends FormattedDoubleLegDetailColumn {
|
||||
public class MaxSpeedOverallColumn extends FormattedDoubleDetailTypeColumn {
|
||||
|
||||
private static class MaxSpeedOverallField implements LegDetailField<Double> {
|
||||
@Override
|
||||
@@ -21,7 +20,7 @@ public class MaxSpeedOverallColumn extends FormattedDoubleLegDetailColumn {
|
||||
}
|
||||
}
|
||||
|
||||
public MaxSpeedOverallColumn(StringMessages stringMessages, String headerStyle, String columnStyle) {
|
||||
public MaxSpeedOverallColumn(String headerStyle, String columnStyle) {
|
||||
super(DetailType.MAXIMUM_SPEED_OVER_GROUND_IN_KNOTS, new MaxSpeedOverallField(), headerStyle, columnStyle);
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -8,7 +8,7 @@ import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
|
||||
import com.sap.sailing.gwt.ui.shared.LeaderboardRowDTO;
|
||||
|
||||
/**
|
||||
* Renders the values and the percentage bar of the {@link LegDetailColumn} and {@link ManeuverCountRaceColumn}.
|
||||
* Renders the values and the percentage bar of the {@link DetailTypeColumn} and {@link ManeuverCountRaceColumn}.
|
||||
* It is used to update the minimum and maximum values of the columns, and to render the column content.
|
||||
*
|
||||
* @author Fabian Schwarz-Fritz
|
||||
@@ -21,7 +21,7 @@ public class MinMaxRenderer {
|
||||
private Double maximumValue;
|
||||
|
||||
/**
|
||||
* Renders the value and the percentage bar of the columns {@link LegDetailColumn} and
|
||||
* Renders the value and the percentage bar of the columns {@link DetailTypeColumn} and
|
||||
* {@link ManeuverCountRaceColumn}.
|
||||
*
|
||||
* @param valueProvider
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ import com.google.gwt.user.client.ui.ImageResourceRenderer;
|
||||
import com.sap.sailing.domain.common.DetailType;
|
||||
import com.sap.sailing.gwt.ui.shared.LeaderboardRowDTO;
|
||||
|
||||
public class RankGainColumn extends LegDetailColumn<Integer, Integer> {
|
||||
public class RankGainColumn extends DetailTypeColumn<Integer, Integer> {
|
||||
private static final LeaderboardResources leaderboardResources = GWT.create(LeaderboardResources.class);
|
||||
|
||||
public RankGainColumn(String title, LegDetailField<Integer> field, String headerStyle, String columnStyle) {
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ import com.sap.sailing.domain.common.DetailType;
|
||||
import com.sap.sailing.domain.common.Tack;
|
||||
import com.sap.sailing.gwt.ui.shared.LeaderboardRowDTO;
|
||||
|
||||
public class SideToWhichMarkAtLegStartWasRoundedColumn extends LegDetailColumn<Tack, String> {
|
||||
public class SideToWhichMarkAtLegStartWasRoundedColumn extends DetailTypeColumn<Tack, String> {
|
||||
public SideToWhichMarkAtLegStartWasRoundedColumn(String title, LegDetailField<Tack> field, String headerStyle, String columnStyle) {
|
||||
super(DetailType.SIDE_TO_WHICH_MARK_AT_LEG_START_WAS_ROUNDED, field, new TextCell(), headerStyle, columnStyle);
|
||||
}
|
||||
|
||||
+19
-7
@@ -44,19 +44,27 @@ public class SortableExpandableColumnHeader extends Header<SafeHtml> {
|
||||
}
|
||||
|
||||
interface RaceCellTemplates extends SafeHtmlTemplates {
|
||||
@SafeHtmlTemplates.Template("<span class=\"race-name\" title=\"{1}\">{0}</span>")
|
||||
SafeHtml cellWithTooltip(SafeHtml title, String tooltip);
|
||||
|
||||
@SafeHtmlTemplates.Template("<span class=\"race-name\">{0}</span>")
|
||||
SafeHtml cell(SafeHtml value);
|
||||
SafeHtml cell(SafeHtml title);
|
||||
}
|
||||
|
||||
private static RaceCellTemplates template = GWT.create(RaceCellTemplates.class);
|
||||
|
||||
public SortableExpandableColumnHeader(String title, String iconURL, LeaderboardPanel leaderboardPanel,
|
||||
ExpandableSortableColumn<?> column, StringMessages stringConstants) {
|
||||
super(constructCell(title, iconURL, column.isExpansionEnabled(), leaderboardPanel, column, stringConstants));
|
||||
ExpandableSortableColumn<?> column, StringMessages stringConstants) {
|
||||
this(title, null, iconURL, leaderboardPanel, column, stringConstants);
|
||||
}
|
||||
|
||||
private static <T> Cell<SafeHtml> constructCell(final String title, final String iconURL, boolean isExpansionEnabled,
|
||||
final LeaderboardPanel leaderboardPanel, final ExpandableSortableColumn<?> column, final StringMessages stringConstants) {
|
||||
public SortableExpandableColumnHeader(String title, String tooltip, String iconURL,
|
||||
LeaderboardPanel leaderboardPanel, ExpandableSortableColumn<?> column, StringMessages stringConstants) {
|
||||
super(constructCell(title, tooltip, iconURL, column.isExpansionEnabled(), leaderboardPanel, column, stringConstants));
|
||||
}
|
||||
|
||||
private static <T> Cell<SafeHtml> constructCell(final String title, final String tooltip, final String iconURL,
|
||||
boolean isExpansionEnabled, final LeaderboardPanel leaderboardPanel, final ExpandableSortableColumn<?> column, final StringMessages stringConstants) {
|
||||
final List<HasCell<SafeHtml, ?>> cells = new ArrayList<HasCell<SafeHtml, ?>>(3);
|
||||
// if it's a medal race, add the cell rendering the medal image
|
||||
// add the cell rendering the expand/collapse button:
|
||||
@@ -108,7 +116,11 @@ public class SortableExpandableColumnHeader extends Header<SafeHtml> {
|
||||
}
|
||||
@Override
|
||||
public SafeHtml getValue(SafeHtml object) {
|
||||
return template.cell(SafeHtmlUtils.fromString(title));
|
||||
if (tooltip == null) {
|
||||
return template.cell(SafeHtmlUtils.fromString(title));
|
||||
} else {
|
||||
return template.cellWithTooltip(SafeHtmlUtils.fromString(title), SafeHtmlUtils.htmlEscape(tooltip));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -135,7 +147,7 @@ public class SortableExpandableColumnHeader extends Header<SafeHtml> {
|
||||
// implementation-dependant and may easily break. We should probably file
|
||||
// a bug with Google...
|
||||
wrapper = wrapper.getFirstChildElement().getNextSiblingElement().getFirstChildElement();
|
||||
} catch (Throwable t) {
|
||||
} catch (Exception e) {
|
||||
// wrapper was no div, so no action necessary
|
||||
}
|
||||
while (wrapper != null) {
|
||||
|
||||
+2
-2
@@ -5,9 +5,9 @@ import com.sap.sailing.domain.common.DetailType;
|
||||
import com.sap.sailing.gwt.ui.client.NumberFormatterFactory;
|
||||
import com.sap.sailing.gwt.ui.shared.LeaderboardRowDTO;
|
||||
|
||||
public abstract class AbstractTimeInHoursMinutesSecondsColumn extends FormattedDoubleLegDetailColumn {
|
||||
public class TotalTimeColumn extends FormattedDoubleDetailTypeColumn {
|
||||
|
||||
protected AbstractTimeInHoursMinutesSecondsColumn(DetailType detailType, LegDetailField<Double> field, String headerStyle, String columnStyle) {
|
||||
protected TotalTimeColumn(DetailType detailType, LegDetailField<Double> field, String headerStyle, String columnStyle) {
|
||||
super(detailType, field, headerStyle, columnStyle);
|
||||
}
|
||||
|
||||
-43
@@ -1,43 +0,0 @@
|
||||
package com.sap.sailing.gwt.ui.leaderboard;
|
||||
|
||||
import com.google.gwt.i18n.client.NumberFormat;
|
||||
import com.sap.sailing.domain.common.DetailType;
|
||||
import com.sap.sailing.gwt.ui.client.NumberFormatterFactory;
|
||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
import com.sap.sailing.gwt.ui.shared.LeaderboardRowDTO;
|
||||
|
||||
/**
|
||||
* Shows the {@link LeaderboardRowDTO#totalTimeSailedDownwindInSeconds} attribute.
|
||||
*
|
||||
* @author Axel Uhl (d043530)
|
||||
*
|
||||
*/
|
||||
public class TotalTimeSailedColumn extends FormattedDoubleLegDetailColumn {
|
||||
|
||||
private static class TotalTimeSailedField implements LegDetailField<Double> {
|
||||
@Override
|
||||
public Double get(LeaderboardRowDTO row) {
|
||||
return row.totalTimeSailedInSeconds;
|
||||
}
|
||||
}
|
||||
|
||||
public TotalTimeSailedColumn(StringMessages stringMessages, String headerStyle, String columnStyle) {
|
||||
super(DetailType.TOTAL_TIME_SAILED_IN_SECONDS, new TotalTimeSailedField(), headerStyle, columnStyle);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getStringValueToRender(LeaderboardRowDTO object) {
|
||||
String result;
|
||||
Double timeInSeconds = getDoubleValue(object);
|
||||
if (timeInSeconds == null) {
|
||||
result = null;
|
||||
} else {
|
||||
int hh = (int) (timeInSeconds / 3600);
|
||||
int mm = (int) ((timeInSeconds - 3600 * hh) / 60);
|
||||
int ss = (int) (timeInSeconds - 3600 * hh - 60 * mm);
|
||||
NumberFormat numberFormat = NumberFormatterFactory.getDecimalFormat(2, 0);
|
||||
result = "" + numberFormat.format(hh) + ":" + numberFormat.format(mm) + ":" + numberFormat.format(ss);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
+2
-1
@@ -32,6 +32,7 @@ import com.google.gwt.user.cellview.client.CellTable.Resources;
|
||||
import com.google.gwt.user.cellview.client.Column;
|
||||
import com.google.gwt.user.cellview.client.ColumnSortEvent.ListHandler;
|
||||
import com.google.gwt.user.cellview.client.Header;
|
||||
import com.google.gwt.user.cellview.client.SafeHtmlHeader;
|
||||
import com.google.gwt.user.cellview.client.TextHeader;
|
||||
import com.google.gwt.user.client.Window;
|
||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||
@@ -184,7 +185,7 @@ public class EditableLeaderboardPanel extends LeaderboardPanel {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Header<String> getHeader() {
|
||||
public SafeHtmlHeader getHeader() {
|
||||
return base.getHeader();
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -253,13 +253,13 @@ public class LiveLeaderboardUpdater implements Runnable {
|
||||
}
|
||||
logger.info("" + LiveLeaderboardUpdater.class.getSimpleName() + " thread for leaderboard "
|
||||
+ leaderboard.getName() + " ending");
|
||||
} catch (Throwable t) {
|
||||
} catch (Exception e) {
|
||||
synchronized (this) {
|
||||
running = false;
|
||||
currentLiveLeaderboard = null;
|
||||
}
|
||||
logger.info("exception in "+LiveLeaderboardUpdater.class.getName()+".run(): "+t.getMessage());
|
||||
logger.throwing(LiveLeaderboardUpdater.class.getName(), "run", t);
|
||||
logger.info("exception in "+LiveLeaderboardUpdater.class.getName()+".run(): "+e.getMessage());
|
||||
logger.throwing(LiveLeaderboardUpdater.class.getName(), "run", e);
|
||||
} finally {
|
||||
if (interruptTask != null) {
|
||||
interruptTask.cancel();
|
||||
|
||||
+1
-1
@@ -85,7 +85,7 @@ public abstract class RaceChart extends SimplePanel implements RaceSelectionChan
|
||||
isZoomed = true;
|
||||
}
|
||||
timeRangeWithZoomProvider.setTimeZoom(new Date(xAxisMin), new Date(xAxisMax), this);
|
||||
} catch (Throwable t) {
|
||||
} catch (Exception e) {
|
||||
// in case the user clicks the "reset zoom" button chartSelectionEvent.getXAxisMinAsLong() throws in exception
|
||||
timeRangeWithZoomProvider.resetTimeZoom(this);
|
||||
// Trigger the redrawing... otherwise chart wouldn't reset the zoom
|
||||
|
||||
+4
-4
@@ -59,7 +59,7 @@ public class OSGiRestartingPortMonitor extends AbstractPortMonitor {
|
||||
try {
|
||||
sendMail(endpoint, "Couldn't find non-responsive bundle "+endpoint.getBundleName(),
|
||||
"Couldn't find bundle "+endpoint.getBundleName()+". Cannot restart. Please check monitoring.properties file");
|
||||
} catch (Throwable e) {
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.throwing(getClass().getName(), "handleFailure", e);
|
||||
}
|
||||
@@ -98,9 +98,9 @@ public class OSGiRestartingPortMonitor extends AbstractPortMonitor {
|
||||
content += "\n\nSystem information NOT available due to an error in the library (in most cases caused by native libs not being available)";
|
||||
}
|
||||
sendMail(endpoint, subject, content);
|
||||
} catch (Throwable ex) {
|
||||
ex.printStackTrace();
|
||||
log.throwing(getClass().getName(), "handleFailure", ex);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.throwing(getClass().getName(), "handleFailure", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -159,7 +159,7 @@ public class AdminApp extends SailingServerHttpServlet {
|
||||
} else {
|
||||
resp.getWriter().println("Hello admin!");
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
} catch (Exception e) {
|
||||
resp.getWriter().println("Error processing request:");
|
||||
e.printStackTrace(resp.getWriter());
|
||||
}
|
||||
|
||||
+1
-1
@@ -78,7 +78,7 @@ public class RegattaAndRaceDataJsonExportServlet extends JsonExportServlet {
|
||||
} else {
|
||||
resp.getWriter().println("No action specified!");
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
} catch (Exception e) {
|
||||
resp.getWriter().println("Error processing request:");
|
||||
e.printStackTrace(resp.getWriter());
|
||||
}
|
||||
|
||||
+2
-2
@@ -51,8 +51,8 @@ public abstract class AbstractServerReplicationTest {
|
||||
true, /* master=null means create a new one */ null,
|
||||
/* replica=null means create a new one */null);
|
||||
result.getA().startToReplicateFrom(result.getB());
|
||||
} catch (Throwable t) {
|
||||
t.printStackTrace();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
tearDown();
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -35,8 +35,8 @@ public class InitialLoadReplicationObjectIdentityTest extends AbstractServerRepl
|
||||
try {
|
||||
replicationDescriptorPair = basicSetUp(true, /* master=null means create a new one */ null,
|
||||
/* replica=null means create a new one */null);
|
||||
} catch (Throwable t) {
|
||||
t.printStackTrace();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
tearDown();
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -84,7 +84,7 @@ public class Replicator implements Runnable {
|
||||
} catch (ShutdownSignalException sse) {
|
||||
logger.info("Received "+sse.getMessage()+". Terminating "+this);
|
||||
break;
|
||||
} catch (Throwable e) {
|
||||
} catch (Exception e) {
|
||||
logger.info("Exception while processing replica: "+e.getMessage());
|
||||
logger.throwing(Replicator.class.getName(), "run", e);
|
||||
} finally {
|
||||
|
||||
@@ -128,8 +128,8 @@ public abstract class UDPReceiver<MessageType extends UDPMessage, ListenerType e
|
||||
try {
|
||||
ToListenerDispatcher dispatcher = listenerThreads.get(listener);
|
||||
dispatcher.dispatch(msg);
|
||||
} catch (Throwable t) {
|
||||
logger.info("Exception while dispatching UDP packet received to "+listener+": "+t.getMessage());
|
||||
} catch (Exception e) {
|
||||
logger.info("Exception while dispatching UDP packet received to "+listener+": "+e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user