mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-03 02:43:53 +00:00
Late loading of races in leaderboard panel are now displayed automatically
in leaderboard.
This commit is contained in:
1 parent
4929543d5e
commit
dfb299edc2
3 files changed
+13
-21
No files matched your search
@@ -11,6 +11,7 @@ Require-Bundle: com.sap.sailing.gwt.ui,
|
||||
org.json.simple,
|
||||
com.sap.sailing.server,
|
||||
com.google.gwt.osgi,
|
||||
org.eclipse.osgi,
|
||||
org.junit4
|
||||
Bundle-ClassPath: .
|
||||
Import-Package: org.osgi.framework,
|
||||
org.osgi.util.tracker;version="1.5.0"
|
||||
@@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.4.0//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.4.0/distro-source/core/src/gwt-module.dtd">
|
||||
<module>
|
||||
<inherits name="com.google.gwt.user.User" />
|
||||
<inherits name="com.sap.sailing.gwt.ui.AdminConsole" />
|
||||
<source path="client"/>
|
||||
|
||||
<servlet path='/testsailing' class='com.sap.sailing.gwt.ui.test.MyTestSailingServiceImpl'/>
|
||||
</module>
|
||||
+11
-11
@@ -99,8 +99,6 @@ public class LeaderboardPanel extends FormPanel implements TimeListener, PlaySta
|
||||
protected final String TOTAL_COLUMN_STYLE;
|
||||
|
||||
private final Timer timer;
|
||||
|
||||
boolean firstTimeLeaderboardLoaded;
|
||||
|
||||
/**
|
||||
* The delay with which the timer shall work. Before the timer is resumed, the delay is set to this value.
|
||||
@@ -711,7 +709,6 @@ public class LeaderboardPanel extends FormPanel implements TimeListener, PlaySta
|
||||
this.selectedLegDetails.add(DetailColumnType.RANK_GAIN);
|
||||
this.selectedRaceDetails = new ArrayList<DetailColumnType>();
|
||||
this.selectedRaceColumns = new ArrayList<String>();
|
||||
this.firstTimeLeaderboardLoaded = true;
|
||||
delayInMilliseconds = 0l;
|
||||
timer = new Timer(/* delayBetweenAutoAdvancesInMilliseconds */ 3000l);
|
||||
timer.setDelay(getDelayInMilliseconds()); // set time/delay before
|
||||
@@ -913,6 +910,7 @@ public class LeaderboardPanel extends FormPanel implements TimeListener, PlaySta
|
||||
* Also updates the min/max values on the columns
|
||||
*/
|
||||
protected void updateLeaderboard(LeaderboardDAO leaderboard) {
|
||||
selectedRaceColumns.addAll(getRacesAddedNew(this.leaderboard, leaderboard));
|
||||
setLeaderboard(leaderboard);
|
||||
adjustColumnLayout(leaderboard);
|
||||
getData().getList().clear();
|
||||
@@ -969,18 +967,20 @@ public class LeaderboardPanel extends FormPanel implements TimeListener, PlaySta
|
||||
// first remove race columns no longer needed:
|
||||
removeUnusedRaceColumns(leaderboard);
|
||||
if (leaderboard != null) {
|
||||
if(firstTimeLeaderboardLoaded){
|
||||
for (String string : leaderboard.getRaceList()) {
|
||||
selectedRaceColumns.add(string);
|
||||
}
|
||||
if(selectedRaceColumns.size()!=0){
|
||||
firstTimeLeaderboardLoaded = false;
|
||||
}
|
||||
}
|
||||
createMissingAndAdjustExistingRaceColumns(leaderboard);
|
||||
ensureTotalsColumn();
|
||||
}
|
||||
}
|
||||
|
||||
private List<String> getRacesAddedNew(LeaderboardDAO oldLeaderboard, LeaderboardDAO newLeaderboard){
|
||||
List<String> result = new ArrayList<String>();
|
||||
for (String s : newLeaderboard.getRaceList()) {
|
||||
if(!oldLeaderboard.getRaceList().contains(s)){
|
||||
result.add(s);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private boolean leaderboardTableContainsRace(String raceName) {
|
||||
for (int leaderboardposition = 0; leaderboardposition < getLeaderboardTable().getColumnCount(); leaderboardposition++) {
|
||||
|
||||
Reference in new issue
Block a user