mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-10 14:20:55 +00:00
Added the rendering of a color in the competitorColumn of a leaderboard. The same color is used in the racemap and the competitor charts to identify a competitor.
This commit is contained in:
1 parent
fc9ec9aa9a
commit
96427c32ba
1 file changed
+14
-1
+14
-1
@@ -333,7 +333,6 @@ public class LeaderboardPanel extends FormPanel implements TimeListener, PlaySta
|
||||
}
|
||||
|
||||
protected class CompetitorColumn extends SortableColumn<LeaderboardRowDTO, String> {
|
||||
|
||||
protected CompetitorColumn() {
|
||||
super(new TextCell());
|
||||
}
|
||||
@@ -362,6 +361,20 @@ public class LeaderboardPanel extends FormPanel implements TimeListener, PlaySta
|
||||
public String getValue(LeaderboardRowDTO object) {
|
||||
return getLeaderboard().getDisplayName(object.competitor);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(Context context, LeaderboardRowDTO object, SafeHtmlBuilder sb) {
|
||||
String competitorColor = LeaderboardPanel.this.competitorSelectionProvider.getColor(object.competitor);
|
||||
String competitorColorBarStyle;
|
||||
if(LeaderboardPanel.this.isEmbedded) {
|
||||
competitorColorBarStyle = "style=\"border-bottom: 2px solid "+competitorColor+";\"";
|
||||
} else {
|
||||
competitorColorBarStyle = "style=\"border: none;\"";
|
||||
}
|
||||
sb.appendHtmlConstant("<div "+competitorColorBarStyle+">");
|
||||
sb.appendEscaped(getLeaderboard().getDisplayName(object.competitor));
|
||||
sb.appendHtmlConstant("</div>");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user