mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-30 17:36:40 +00:00
Merge remote-tracking branch 'origin/gwt' into gwt
This commit is contained in:
commit
6000aed5f1
21 files changed
+154
-40
No files matched your search
@@ -32,6 +32,7 @@ body {
|
|||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
padding: 80px 0 120px 0;
|
padding: 80px 0 120px 0;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
color: #3b3b3b;
|
||||||
}
|
}
|
||||||
|
|
||||||
table td,select,button {
|
table td,select,button {
|
||||||
@@ -144,10 +145,11 @@ input.magnifier {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.timeLineInnerPanel {
|
.timeLineInnerPanel {
|
||||||
height: 100%;
|
/*height: 100%;*/
|
||||||
margin: 0 12px;
|
margin: 0 12px;
|
||||||
|
margin-top: 20px;
|
||||||
background: #dddcdc;
|
background: #dddcdc;
|
||||||
padding: 38px 24px 0 24px;
|
/*padding: 38px 24px 0 24px;*/
|
||||||
}
|
}
|
||||||
|
|
||||||
.timeLineInnerBgPanel {
|
.timeLineInnerBgPanel {
|
||||||
@@ -315,4 +317,4 @@ input.magnifier {
|
|||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
color: #a1a1a1;
|
color: #a1a1a1;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
}
|
}
|
||||||
Executable → Regular
BIN
Binary file not shown.
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 492 B |
BIN
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
+11
-1
@@ -29,6 +29,8 @@ import com.sap.sailing.gwt.ui.client.RaceSelectionProvider;
|
|||||||
import com.sap.sailing.gwt.ui.client.SailingServiceAsync;
|
import com.sap.sailing.gwt.ui.client.SailingServiceAsync;
|
||||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||||
import com.sap.sailing.gwt.ui.client.TimeListener;
|
import com.sap.sailing.gwt.ui.client.TimeListener;
|
||||||
|
import com.sap.sailing.gwt.ui.client.Timer;
|
||||||
|
import com.sap.sailing.gwt.ui.client.Timer.PlayModes;
|
||||||
import com.sap.sailing.gwt.ui.shared.WindDTO;
|
import com.sap.sailing.gwt.ui.shared.WindDTO;
|
||||||
import com.sap.sailing.gwt.ui.shared.WindInfoForRaceDTO;
|
import com.sap.sailing.gwt.ui.shared.WindInfoForRaceDTO;
|
||||||
import com.sap.sailing.gwt.ui.shared.WindTrackInfoDTO;
|
import com.sap.sailing.gwt.ui.shared.WindTrackInfoDTO;
|
||||||
@@ -47,6 +49,7 @@ public class WindChart implements Component<WindChartSettings>, RaceSelectionCha
|
|||||||
private final ErrorReporter errorReporter;
|
private final ErrorReporter errorReporter;
|
||||||
private final SailingServiceAsync sailingService;
|
private final SailingServiceAsync sailingService;
|
||||||
private final Chart chart;
|
private final Chart chart;
|
||||||
|
private final Timer timer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param raceSelectionProvider
|
* @param raceSelectionProvider
|
||||||
@@ -55,13 +58,14 @@ public class WindChart implements Component<WindChartSettings>, RaceSelectionCha
|
|||||||
* server and displayed in this chart. If no race is selected, the chart is cleared.
|
* server and displayed in this chart. If no race is selected, the chart is cleared.
|
||||||
*/
|
*/
|
||||||
public WindChart(SailingServiceAsync sailingService, RaceSelectionProvider raceSelectionProvider,
|
public WindChart(SailingServiceAsync sailingService, RaceSelectionProvider raceSelectionProvider,
|
||||||
WindChartSettings settings, StringMessages stringMessages, ErrorReporter errorReporter) {
|
Timer timer, WindChartSettings settings, StringMessages stringMessages, ErrorReporter errorReporter) {
|
||||||
super();
|
super();
|
||||||
this.sailingService = sailingService;
|
this.sailingService = sailingService;
|
||||||
this.stringMessages = stringMessages;
|
this.stringMessages = stringMessages;
|
||||||
this.errorReporter = errorReporter;
|
this.errorReporter = errorReporter;
|
||||||
this.windSourceSeries = new HashMap<WindSource, Series>();
|
this.windSourceSeries = new HashMap<WindSource, Series>();
|
||||||
this.windSourcesToDisplay = new HashSet<WindSource>();
|
this.windSourcesToDisplay = new HashSet<WindSource>();
|
||||||
|
this.timer = timer;
|
||||||
chart = new Chart()
|
chart = new Chart()
|
||||||
.setZoomType(Chart.ZoomType.X)
|
.setZoomType(Chart.ZoomType.X)
|
||||||
.setSpacingRight(20)
|
.setSpacingRight(20)
|
||||||
@@ -206,6 +210,12 @@ public class WindChart implements Component<WindChartSettings>, RaceSelectionCha
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void timeChanged(Date date) {
|
public void timeChanged(Date date) {
|
||||||
|
if (timer.getPlayMode() == PlayModes.Live) {
|
||||||
|
// TODO fetch missing pieces from cache
|
||||||
|
} else {
|
||||||
|
// assuming play mode is replay / non-live
|
||||||
|
// TODO fetch all if not yet fetched
|
||||||
|
}
|
||||||
// TODO implement timeChanged by loading missing wind data and adding to series
|
// TODO implement timeChanged by loading missing wind data and adding to series
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+3
-1
@@ -47,6 +47,8 @@ import com.sap.sailing.gwt.ui.client.RaceSelectionModel;
|
|||||||
import com.sap.sailing.gwt.ui.client.RaceSelectionProvider;
|
import com.sap.sailing.gwt.ui.client.RaceSelectionProvider;
|
||||||
import com.sap.sailing.gwt.ui.client.SailingServiceAsync;
|
import com.sap.sailing.gwt.ui.client.SailingServiceAsync;
|
||||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||||
|
import com.sap.sailing.gwt.ui.client.Timer;
|
||||||
|
import com.sap.sailing.gwt.ui.client.Timer.PlayModes;
|
||||||
import com.sap.sailing.gwt.ui.shared.EventDTO;
|
import com.sap.sailing.gwt.ui.shared.EventDTO;
|
||||||
import com.sap.sailing.gwt.ui.shared.WindDTO;
|
import com.sap.sailing.gwt.ui.shared.WindDTO;
|
||||||
import com.sap.sailing.gwt.ui.shared.WindInfoForRaceDTO;
|
import com.sap.sailing.gwt.ui.shared.WindInfoForRaceDTO;
|
||||||
@@ -173,7 +175,7 @@ public class WindPanel extends FormPanel implements EventDisplayer, WindShower,
|
|||||||
windSourceSelectionPanel.add(showConfigAnchor);
|
windSourceSelectionPanel.add(showConfigAnchor);
|
||||||
grid.setWidget(1, 0, windSourceSelectionPanel);
|
grid.setWidget(1, 0, windSourceSelectionPanel);
|
||||||
windChart = new WindChart(sailingService, /* race selection provider */ raceSelectionProvider,
|
windChart = new WindChart(sailingService, /* race selection provider */ raceSelectionProvider,
|
||||||
new WindChartSettings(WindSource.values()), stringMessages, errorReporter);
|
new Timer(PlayModes.Replay), new WindChartSettings(WindSource.values()), stringMessages, errorReporter);
|
||||||
grid.setWidget(2, 0, windChart.getEntryWidget());
|
grid.setWidget(2, 0, windChart.getEntryWidget());
|
||||||
grid.getCellFormatter().setVerticalAlignment(1, 1, HasVerticalAlignment.ALIGN_TOP);
|
grid.getCellFormatter().setVerticalAlignment(1, 1, HasVerticalAlignment.ALIGN_TOP);
|
||||||
this.setWidget(grid);
|
this.setWidget(grid);
|
||||||
|
|||||||
+1
-1
@@ -3,7 +3,7 @@ package com.sap.sailing.gwt.ui.client;
|
|||||||
import com.google.gwt.resources.client.ClientBundle;
|
import com.google.gwt.resources.client.ClientBundle;
|
||||||
import com.google.gwt.resources.client.ImageResource;
|
import com.google.gwt.resources.client.ImageResource;
|
||||||
|
|
||||||
interface ClientResources extends ClientBundle {
|
public interface ClientResources extends ClientBundle {
|
||||||
|
|
||||||
@Source("com/sap/sailing/gwt/ui/client/images/settings.png")
|
@Source("com/sap/sailing/gwt/ui/client/images/settings.png")
|
||||||
ImageResource settingsIcon();
|
ImageResource settingsIcon();
|
||||||
|
|||||||
+11
@@ -0,0 +1,11 @@
|
|||||||
|
package com.sap.sailing.gwt.ui.client;
|
||||||
|
|
||||||
|
public interface UserAgentChecker {
|
||||||
|
|
||||||
|
public enum UserAgentTypes{ DESKTOP, MOBILE }
|
||||||
|
|
||||||
|
public final UserAgentCheckerImpl INSTANCE = new UserAgentCheckerImpl();
|
||||||
|
|
||||||
|
public UserAgentTypes checkUserAgent(String userAgent);
|
||||||
|
|
||||||
|
}
|
||||||
+25
@@ -0,0 +1,25 @@
|
|||||||
|
package com.sap.sailing.gwt.ui.client;
|
||||||
|
|
||||||
|
|
||||||
|
public class UserAgentCheckerImpl implements UserAgentChecker {
|
||||||
|
|
||||||
|
private static final String[] MOBILE_SPECIFIC_SUBSTRING = { "iPhone", "Android", "MIDP", "Opera Mobi", "iPad",
|
||||||
|
"Opera Mini", "BlackBerry", "HP iPAQ", "IEMobile", "MSIEMobile", "Windows Phone", "HTC", "LG", "MOT",
|
||||||
|
"Nokia", "Symbian", "Fennec", "Maemo", "Tear", "Midori", "armv", "Windows CE", "WindowsCE", "Smartphone",
|
||||||
|
"240x320", "176x220", "320x320", "160x160", "webOS", "Palm", "Sagem", "Samsung", "SGH", "SIE",
|
||||||
|
"SonyEricsson", "MMP", "UCWEB" };
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public UserAgentTypes checkUserAgent(String userAgent) {
|
||||||
|
UserAgentTypes agentType = UserAgentTypes.DESKTOP;
|
||||||
|
for (String mobile : MOBILE_SPECIFIC_SUBSTRING) {
|
||||||
|
if (userAgent.contains(mobile) || userAgent.contains(mobile.toUpperCase())
|
||||||
|
|| userAgent.contains(mobile.toLowerCase())) {
|
||||||
|
agentType = UserAgentTypes.MOBILE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return agentType;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+26
-9
@@ -36,9 +36,10 @@ import com.google.gwt.event.dom.client.ClickHandler;
|
|||||||
import com.google.gwt.event.shared.GwtEvent;
|
import com.google.gwt.event.shared.GwtEvent;
|
||||||
import com.google.gwt.i18n.client.DateTimeFormat;
|
import com.google.gwt.i18n.client.DateTimeFormat;
|
||||||
import com.google.gwt.i18n.client.NumberFormat;
|
import com.google.gwt.i18n.client.NumberFormat;
|
||||||
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
|
import com.google.gwt.resources.client.ImageResource;
|
||||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||||
import com.google.gwt.user.client.ui.AbsolutePanel;
|
import com.google.gwt.user.client.ui.AbsolutePanel;
|
||||||
|
import com.google.gwt.user.client.ui.AbstractImagePrototype;
|
||||||
import com.google.gwt.user.client.ui.Anchor;
|
import com.google.gwt.user.client.ui.Anchor;
|
||||||
import com.google.gwt.user.client.ui.DeckPanel;
|
import com.google.gwt.user.client.ui.DeckPanel;
|
||||||
import com.google.gwt.user.client.ui.FlowPanel;
|
import com.google.gwt.user.client.ui.FlowPanel;
|
||||||
@@ -53,6 +54,7 @@ import com.google.gwt.user.client.ui.Widget;
|
|||||||
import com.sap.sailing.domain.common.DetailType;
|
import com.sap.sailing.domain.common.DetailType;
|
||||||
import com.sap.sailing.domain.common.RaceIdentifier;
|
import com.sap.sailing.domain.common.RaceIdentifier;
|
||||||
import com.sap.sailing.domain.common.impl.Util.Pair;
|
import com.sap.sailing.domain.common.impl.Util.Pair;
|
||||||
|
import com.sap.sailing.gwt.ui.client.ClientResources;
|
||||||
import com.sap.sailing.gwt.ui.client.CompetitorSelectionChangeListener;
|
import com.sap.sailing.gwt.ui.client.CompetitorSelectionChangeListener;
|
||||||
import com.sap.sailing.gwt.ui.client.CompetitorSelectionProvider;
|
import com.sap.sailing.gwt.ui.client.CompetitorSelectionProvider;
|
||||||
import com.sap.sailing.gwt.ui.client.DetailTypeFormatter;
|
import com.sap.sailing.gwt.ui.client.DetailTypeFormatter;
|
||||||
@@ -61,11 +63,16 @@ import com.sap.sailing.gwt.ui.client.RaceSelectionChangeListener;
|
|||||||
import com.sap.sailing.gwt.ui.client.RaceSelectionProvider;
|
import com.sap.sailing.gwt.ui.client.RaceSelectionProvider;
|
||||||
import com.sap.sailing.gwt.ui.client.SailingServiceAsync;
|
import com.sap.sailing.gwt.ui.client.SailingServiceAsync;
|
||||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||||
|
import com.sap.sailing.gwt.ui.client.TimeListener;
|
||||||
|
import com.sap.sailing.gwt.ui.client.Timer;
|
||||||
|
import com.sap.sailing.gwt.ui.client.Timer.PlayModes;
|
||||||
import com.sap.sailing.gwt.ui.shared.CompetitorDTO;
|
import com.sap.sailing.gwt.ui.shared.CompetitorDTO;
|
||||||
import com.sap.sailing.gwt.ui.shared.CompetitorInRaceDTO;
|
import com.sap.sailing.gwt.ui.shared.CompetitorInRaceDTO;
|
||||||
import com.sap.sailing.gwt.ui.shared.CompetitorsAndTimePointsDTO;
|
import com.sap.sailing.gwt.ui.shared.CompetitorsAndTimePointsDTO;
|
||||||
import com.sap.sailing.gwt.ui.shared.components.Component;
|
import com.sap.sailing.gwt.ui.shared.components.Component;
|
||||||
import com.sap.sailing.gwt.ui.shared.components.SettingsDialog;
|
import com.sap.sailing.gwt.ui.shared.components.SettingsDialog;
|
||||||
|
import com.sap.sailing.gwt.ui.shared.panels.BusyIndicator;
|
||||||
|
import com.sap.sailing.gwt.ui.shared.panels.SimpleBusyIndicator;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ChartPanel is a GWT panel that can show one sort of competitor data (e.g. current speed over ground, windward distance to
|
* ChartPanel is a GWT panel that can show one sort of competitor data (e.g. current speed over ground, windward distance to
|
||||||
@@ -80,7 +87,7 @@ import com.sap.sailing.gwt.ui.shared.components.SettingsDialog;
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public abstract class AbstractChartPanel<SettingsType extends ChartSettings> extends SimplePanel
|
public abstract class AbstractChartPanel<SettingsType extends ChartSettings> extends SimplePanel
|
||||||
implements CompetitorSelectionChangeListener, RaceSelectionChangeListener {
|
implements CompetitorSelectionChangeListener, RaceSelectionChangeListener, TimeListener {
|
||||||
private CompetitorInRaceDTO chartData;
|
private CompetitorInRaceDTO chartData;
|
||||||
private CompetitorsAndTimePointsDTO competitorsAndTimePointsDTO = null;
|
private CompetitorsAndTimePointsDTO competitorsAndTimePointsDTO = null;
|
||||||
private final SailingServiceAsync sailingService;
|
private final SailingServiceAsync sailingService;
|
||||||
@@ -102,18 +109,21 @@ implements CompetitorSelectionChangeListener, RaceSelectionChangeListener {
|
|||||||
private final HashMap<CompetitorDTO, Widget> competitorLabels;
|
private final HashMap<CompetitorDTO, Widget> competitorLabels;
|
||||||
private final HashMap<String, String> markPassingBuoyName;
|
private final HashMap<String, String> markPassingBuoyName;
|
||||||
private int width, height;
|
private int width, height;
|
||||||
|
private final Timer timer;
|
||||||
|
|
||||||
private DetailType dataToShow;
|
private DetailType dataToShow;
|
||||||
private AbsolutePanel loadingPanel;
|
private AbsolutePanel loadingPanel;
|
||||||
private final CompetitorSelectionProvider competitorSelectionProvider;
|
private final CompetitorSelectionProvider competitorSelectionProvider;
|
||||||
|
private static final ClientResources resources = GWT.create(ClientResources.class);
|
||||||
|
|
||||||
public AbstractChartPanel(SailingServiceAsync sailingService,
|
public AbstractChartPanel(SailingServiceAsync sailingService,
|
||||||
CompetitorSelectionProvider competitorSelectionProvider, RaceSelectionProvider raceSelectionProvider,
|
CompetitorSelectionProvider competitorSelectionProvider, RaceSelectionProvider raceSelectionProvider,
|
||||||
final StringMessages stringMessages, int chartWidth, int chartHeight, ErrorReporter errorReporter,
|
Timer timer, final StringMessages stringMessages, int chartWidth, int chartHeight,
|
||||||
DetailType dataToShow, boolean showRaceSelector) {
|
ErrorReporter errorReporter, DetailType dataToShow, boolean showRaceSelector) {
|
||||||
width = chartWidth;
|
width = chartWidth;
|
||||||
height = chartHeight;
|
height = chartHeight;
|
||||||
this.dataToShow = dataToShow;
|
this.dataToShow = dataToShow;
|
||||||
|
this.timer = timer;
|
||||||
this.competitorSelectionProvider = competitorSelectionProvider;
|
this.competitorSelectionProvider = competitorSelectionProvider;
|
||||||
competitorSelectionProvider.addCompetitorSelectionChangeListener(this);
|
competitorSelectionProvider.addCompetitorSelectionChangeListener(this);
|
||||||
this.errorReporter = errorReporter;
|
this.errorReporter = errorReporter;
|
||||||
@@ -140,9 +150,8 @@ implements CompetitorSelectionChangeListener, RaceSelectionChangeListener {
|
|||||||
}
|
}
|
||||||
loadingPanel = new AbsolutePanel();
|
loadingPanel = new AbsolutePanel();
|
||||||
loadingPanel.setSize(width + "px", height + "px");
|
loadingPanel.setSize(width + "px", height + "px");
|
||||||
Anchor a = new Anchor(new SafeHtmlBuilder().appendHtmlConstant("<img src=\"/gwt/images/ajax-loader.gif\"/>")
|
BusyIndicator busyIndicator = new SimpleBusyIndicator(true, 1);
|
||||||
.toSafeHtml());
|
loadingPanel.add(busyIndicator, width / 2 - 32 / 2, height / 2 - 32 - 2);
|
||||||
loadingPanel.add(a, width / 2 - 32 / 2, height / 2 - 32 - 2);
|
|
||||||
chartPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
|
chartPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
|
||||||
chartPanel.setSpacing(5);
|
chartPanel.setSpacing(5);
|
||||||
legendPanel = new FlowPanel();
|
legendPanel = new FlowPanel();
|
||||||
@@ -154,8 +163,8 @@ implements CompetitorSelectionChangeListener, RaceSelectionChangeListener {
|
|||||||
chart.showWidget(0);
|
chart.showWidget(0);
|
||||||
chartPanel.add(chart);
|
chartPanel.add(chart);
|
||||||
mainPanel.add(chartPanel);
|
mainPanel.add(chartPanel);
|
||||||
Anchor showConfigAnchor = new Anchor(new SafeHtmlBuilder().appendHtmlConstant(
|
ImageResource settingsIcon = resources.settingsIcon();
|
||||||
"<img class=\"linkNoBorder\" src=\"/gwt/images/settings.png\"/>").toSafeHtml());
|
Anchor showConfigAnchor = new Anchor(AbstractImagePrototype.create(settingsIcon).getSafeHtml());
|
||||||
showConfigAnchor.setTitle(stringMessages.configuration());
|
showConfigAnchor.setTitle(stringMessages.configuration());
|
||||||
showConfigAnchor.addClickHandler(new ClickHandler() {
|
showConfigAnchor.addClickHandler(new ClickHandler() {
|
||||||
@Override
|
@Override
|
||||||
@@ -754,4 +763,12 @@ implements CompetitorSelectionChangeListener, RaceSelectionChangeListener {
|
|||||||
return new Pair<Boolean, Boolean>(everyPassingInRange, twoPassingsInRangeBeforeError);
|
return new Pair<Boolean, Boolean>(everyPassingInRange, twoPassingsInRangeBeforeError);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void timeChanged(Date date) {
|
||||||
|
if (timer.getPlayMode() == PlayModes.Live) {
|
||||||
|
// TODO fetch parts missing so far from cache
|
||||||
|
} else {
|
||||||
|
// TODO check if fetched already; if not, fetch all
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
+5
-4
@@ -6,6 +6,7 @@ import com.sap.sailing.gwt.ui.client.ErrorReporter;
|
|||||||
import com.sap.sailing.gwt.ui.client.RaceSelectionProvider;
|
import com.sap.sailing.gwt.ui.client.RaceSelectionProvider;
|
||||||
import com.sap.sailing.gwt.ui.client.SailingServiceAsync;
|
import com.sap.sailing.gwt.ui.client.SailingServiceAsync;
|
||||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||||
|
import com.sap.sailing.gwt.ui.client.Timer;
|
||||||
import com.sap.sailing.gwt.ui.shared.components.Component;
|
import com.sap.sailing.gwt.ui.shared.components.Component;
|
||||||
import com.sap.sailing.gwt.ui.shared.components.SettingsDialogComponent;
|
import com.sap.sailing.gwt.ui.shared.components.SettingsDialogComponent;
|
||||||
|
|
||||||
@@ -24,10 +25,10 @@ import com.sap.sailing.gwt.ui.shared.components.SettingsDialogComponent;
|
|||||||
public class ChartPanel extends AbstractChartPanel<ChartSettings> implements Component<ChartSettings> {
|
public class ChartPanel extends AbstractChartPanel<ChartSettings> implements Component<ChartSettings> {
|
||||||
|
|
||||||
public ChartPanel(SailingServiceAsync sailingService, CompetitorSelectionProvider competitorSelectionProvider,
|
public ChartPanel(SailingServiceAsync sailingService, CompetitorSelectionProvider competitorSelectionProvider,
|
||||||
RaceSelectionProvider raceSelectionProvider, DetailType dataToShow, StringMessages stringMessages, int chartWidth,
|
RaceSelectionProvider raceSelectionProvider, Timer timer, DetailType dataToShow, StringMessages stringMessages,
|
||||||
int chartHeight, ErrorReporter errorReporter, boolean showRaceSelector) {
|
int chartWidth, int chartHeight, ErrorReporter errorReporter, boolean showRaceSelector) {
|
||||||
super(sailingService, competitorSelectionProvider, raceSelectionProvider, stringMessages, chartWidth, chartHeight,
|
super(sailingService, competitorSelectionProvider, raceSelectionProvider, timer, stringMessages, chartWidth,
|
||||||
errorReporter, dataToShow, showRaceSelector);
|
chartHeight, errorReporter, dataToShow, showRaceSelector);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
+5
-4
@@ -21,6 +21,7 @@ import com.sap.sailing.gwt.ui.client.RaceSelectionModel;
|
|||||||
import com.sap.sailing.gwt.ui.client.RaceSelectionProvider;
|
import com.sap.sailing.gwt.ui.client.RaceSelectionProvider;
|
||||||
import com.sap.sailing.gwt.ui.client.SailingServiceAsync;
|
import com.sap.sailing.gwt.ui.client.SailingServiceAsync;
|
||||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||||
|
import com.sap.sailing.gwt.ui.client.Timer;
|
||||||
import com.sap.sailing.gwt.ui.leaderboard.AbstractChartPanel.DataLoadedEvent;
|
import com.sap.sailing.gwt.ui.leaderboard.AbstractChartPanel.DataLoadedEvent;
|
||||||
import com.sap.sailing.gwt.ui.leaderboard.AbstractChartPanel.DataLoadedHandler;
|
import com.sap.sailing.gwt.ui.leaderboard.AbstractChartPanel.DataLoadedHandler;
|
||||||
|
|
||||||
@@ -34,14 +35,14 @@ public class CompareCompetitorsChartDialog extends DialogBox {
|
|||||||
private Anchor closeAnchor;
|
private Anchor closeAnchor;
|
||||||
|
|
||||||
public CompareCompetitorsChartDialog(SailingServiceAsync sailingService,
|
public CompareCompetitorsChartDialog(SailingServiceAsync sailingService,
|
||||||
List<RaceIdentifier> races, final CompetitorSelectionProvider competitorSelectionProvider, StringMessages stringConstants,
|
List<RaceIdentifier> races, final CompetitorSelectionProvider competitorSelectionProvider, Timer timer,
|
||||||
ErrorReporter errorReporter) {
|
StringMessages stringConstants, ErrorReporter errorReporter) {
|
||||||
super(false);
|
super(false);
|
||||||
RaceSelectionProvider raceSelectionProvider = new RaceSelectionModel();
|
RaceSelectionProvider raceSelectionProvider = new RaceSelectionModel();
|
||||||
raceSelectionProvider.setAllRaces(races);
|
raceSelectionProvider.setAllRaces(races);
|
||||||
final MultiChartPanel ccp = new MultiChartPanel(sailingService, competitorSelectionProvider, raceSelectionProvider,
|
final MultiChartPanel ccp = new MultiChartPanel(sailingService, competitorSelectionProvider, raceSelectionProvider,
|
||||||
stringConstants, (int) (Window.getClientWidth() - 350), (int) (Window.getClientHeight() - 170),
|
timer, stringConstants, (int) (Window.getClientWidth() - 350),
|
||||||
errorReporter, /* showRaceSelector */ true);
|
(int) (Window.getClientHeight() - 170), errorReporter, /* showRaceSelector */ true);
|
||||||
ccp.addDataLoadedHandler(new DataLoadedHandler() {
|
ccp.addDataLoadedHandler(new DataLoadedHandler() {
|
||||||
@Override
|
@Override
|
||||||
public void onDataLoaded(DataLoadedEvent event) {
|
public void onDataLoaded(DataLoadedEvent event) {
|
||||||
|
|||||||
+5
-1
@@ -4,6 +4,7 @@ import com.google.gwt.cell.client.AbstractCell;
|
|||||||
import com.google.gwt.cell.client.ActionCell;
|
import com.google.gwt.cell.client.ActionCell;
|
||||||
import com.google.gwt.cell.client.ActionCell.Delegate;
|
import com.google.gwt.cell.client.ActionCell.Delegate;
|
||||||
import com.google.gwt.cell.client.ValueUpdater;
|
import com.google.gwt.cell.client.ValueUpdater;
|
||||||
|
import com.google.gwt.core.client.GWT;
|
||||||
import com.google.gwt.dom.client.Element;
|
import com.google.gwt.dom.client.Element;
|
||||||
import com.google.gwt.dom.client.EventTarget;
|
import com.google.gwt.dom.client.EventTarget;
|
||||||
import com.google.gwt.dom.client.NativeEvent;
|
import com.google.gwt.dom.client.NativeEvent;
|
||||||
@@ -12,6 +13,7 @@ import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
|
|||||||
|
|
||||||
public class ExpandCollapseButtonCell extends AbstractCell<SafeHtml> {
|
public class ExpandCollapseButtonCell extends AbstractCell<SafeHtml> {
|
||||||
|
|
||||||
|
private static final LeaderboardResources RESOURCES = GWT.create(LeaderboardResources.class);
|
||||||
|
|
||||||
private final SafeHtml html;
|
private final SafeHtml html;
|
||||||
private final Delegate<SafeHtml> delegate;
|
private final Delegate<SafeHtml> delegate;
|
||||||
@@ -27,8 +29,10 @@ public class ExpandCollapseButtonCell extends AbstractCell<SafeHtml> {
|
|||||||
super("click", "keydown");
|
super("click", "keydown");
|
||||||
this.column = column;
|
this.column = column;
|
||||||
this.delegate = delegate;
|
this.delegate = delegate;
|
||||||
|
|
||||||
|
String src = column.isExpanded() ? RESOURCES.magnifierSlashedIcon().getSafeUri().asString() : RESOURCES.magnifierIcon().getSafeUri().asString();
|
||||||
this.html = new SafeHtmlBuilder().appendHtmlConstant(
|
this.html = new SafeHtmlBuilder().appendHtmlConstant(
|
||||||
"<input class=\"valignMiddle magnifier\" type=\"image\" src=\"/gwt/images/"+(column.isExpanded()?"magnifier_slashed":"magnifier")+".png\" />").toSafeHtml();
|
"<input class=\"valignMiddle magnifier\" type=\"image\" src=\"" + src + "\" />").toSafeHtml();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
+24
-3
@@ -148,6 +148,8 @@ public class LeaderboardPanel extends FormPanel implements TimeListener, PlaySta
|
|||||||
* The delay with which the timer shall work. Before the timer is resumed, the delay is set to this value.
|
* The delay with which the timer shall work. Before the timer is resumed, the delay is set to this value.
|
||||||
*/
|
*/
|
||||||
private long delayInMilliseconds;
|
private long delayInMilliseconds;
|
||||||
|
|
||||||
|
private boolean autoExpandFirstRace;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This anchor's HTML holds the image tag for the play/pause button that needs to be updated when the {@link #timer}
|
* This anchor's HTML holds the image tag for the play/pause button that needs to be updated when the {@link #timer}
|
||||||
@@ -240,6 +242,7 @@ public class LeaderboardPanel extends FormPanel implements TimeListener, PlaySta
|
|||||||
selectedRaceDetails.addAll(newSettings.getRaceDetailsToShow());
|
selectedRaceDetails.addAll(newSettings.getRaceDetailsToShow());
|
||||||
selectedRaceColumns.clear();
|
selectedRaceColumns.clear();
|
||||||
selectedRaceColumns.addAll(newSettings.getRaceColumnsToShow());
|
selectedRaceColumns.addAll(newSettings.getRaceColumnsToShow());
|
||||||
|
setAutoExpandFirstRace(newSettings.isAutoExpandFirstRace());
|
||||||
// update leaderboard after settings panel column selection change
|
// update leaderboard after settings panel column selection change
|
||||||
updateLeaderboard(leaderboard);
|
updateLeaderboard(leaderboard);
|
||||||
|
|
||||||
@@ -819,6 +822,7 @@ public class LeaderboardPanel extends FormPanel implements TimeListener, PlaySta
|
|||||||
selectedManeuverDetails.add(DetailType.JIBE);
|
selectedManeuverDetails.add(DetailType.JIBE);
|
||||||
selectedManeuverDetails.add(DetailType.PENALTY_CIRCLE);
|
selectedManeuverDetails.add(DetailType.PENALTY_CIRCLE);
|
||||||
delayInMilliseconds = 0l;
|
delayInMilliseconds = 0l;
|
||||||
|
autoExpandFirstRace = false;
|
||||||
this.timer = timer;
|
this.timer = timer;
|
||||||
timer.addPlayStateListener(this);
|
timer.addPlayStateListener(this);
|
||||||
timer.addTimeListener(this);
|
timer.addTimeListener(this);
|
||||||
@@ -860,7 +864,7 @@ public class LeaderboardPanel extends FormPanel implements TimeListener, PlaySta
|
|||||||
contentPanel = new VerticalPanel();
|
contentPanel = new VerticalPanel();
|
||||||
headerPanel = new DockPanel();
|
headerPanel = new DockPanel();
|
||||||
DockPanel toolbarPanel = new DockPanel();
|
DockPanel toolbarPanel = new DockPanel();
|
||||||
busyIndicator = new SimpleBusyIndicator();
|
busyIndicator = new SimpleBusyIndicator(false, 0.8f);
|
||||||
if (!isEmbedded) {
|
if (!isEmbedded) {
|
||||||
toolbarPanel.add(busyIndicator, DockPanel.WEST);
|
toolbarPanel.add(busyIndicator, DockPanel.WEST);
|
||||||
}
|
}
|
||||||
@@ -936,6 +940,14 @@ public class LeaderboardPanel extends FormPanel implements TimeListener, PlaySta
|
|||||||
private void setDelayInMilliseconds(long delayInMilliseconds) {
|
private void setDelayInMilliseconds(long delayInMilliseconds) {
|
||||||
this.delayInMilliseconds = delayInMilliseconds;
|
this.delayInMilliseconds = delayInMilliseconds;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isAutoExpandFirstRace() {
|
||||||
|
return autoExpandFirstRace;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setAutoExpandFirstRace(boolean autoExpandFirstRace) {
|
||||||
|
this.autoExpandFirstRace = autoExpandFirstRace;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The time point for which the leaderboard currently shows results
|
* The time point for which the leaderboard currently shows results
|
||||||
@@ -1057,10 +1069,19 @@ public class LeaderboardPanel extends FormPanel implements TimeListener, PlaySta
|
|||||||
adjustColumnLayout(leaderboard);
|
adjustColumnLayout(leaderboard);
|
||||||
getData().getList().clear();
|
getData().getList().clear();
|
||||||
if (leaderboard != null) {
|
if (leaderboard != null) {
|
||||||
|
boolean firstRace = true;
|
||||||
getData().getList().addAll(leaderboard.rows.values());
|
getData().getList().addAll(leaderboard.rows.values());
|
||||||
for (int i = 0; i < getLeaderboardTable().getColumnCount(); i++) {
|
for (int i = 0; i < getLeaderboardTable().getColumnCount(); i++) {
|
||||||
SortableColumn<?, ?> c = (SortableColumn<?, ?>) getLeaderboardTable().getColumn(i);
|
SortableColumn<?, ?> c = (SortableColumn<?, ?>) getLeaderboardTable().getColumn(i);
|
||||||
c.updateMinMax(leaderboard);
|
c.updateMinMax(leaderboard);
|
||||||
|
//Toggle the first race, if the setting is set and it isn't open yet
|
||||||
|
if (firstRace && isAutoExpandFirstRace() && c instanceof ExpandableSortableColumn<?>) {
|
||||||
|
ExpandableSortableColumn<?> expandableSortableColumn = (ExpandableSortableColumn<?>) c;
|
||||||
|
if (!expandableSortableColumn.isExpanded()) {
|
||||||
|
expandableSortableColumn.toggleExpansion();
|
||||||
|
}
|
||||||
|
firstRace = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Comparator<LeaderboardRowDTO> comparator = getComparatorForSelectedSorting();
|
Comparator<LeaderboardRowDTO> comparator = getComparatorForSelectedSorting();
|
||||||
if (comparator != null) {
|
if (comparator != null) {
|
||||||
@@ -1473,7 +1494,7 @@ public class LeaderboardPanel extends FormPanel implements TimeListener, PlaySta
|
|||||||
private void compareCompetitors() {
|
private void compareCompetitors() {
|
||||||
List<RaceIdentifier> races = getTrackedRacesIdentifiers();
|
List<RaceIdentifier> races = getTrackedRacesIdentifiers();
|
||||||
CompareCompetitorsChartDialog chartDialog = new CompareCompetitorsChartDialog(sailingService, races,
|
CompareCompetitorsChartDialog chartDialog = new CompareCompetitorsChartDialog(sailingService, races,
|
||||||
competitorSelectionProvider, stringConstants, errorReporter);
|
competitorSelectionProvider, timer, stringConstants, errorReporter);
|
||||||
chartDialog.show();
|
chartDialog.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1503,7 +1524,7 @@ public class LeaderboardPanel extends FormPanel implements TimeListener, PlaySta
|
|||||||
Collections.unmodifiableList(selectedLegDetails),
|
Collections.unmodifiableList(selectedLegDetails),
|
||||||
Collections.unmodifiableList(selectedRaceDetails), /* All races to select */
|
Collections.unmodifiableList(selectedRaceDetails), /* All races to select */
|
||||||
leaderboard.getRaceList(), selectedRaceColumns,
|
leaderboard.getRaceList(), selectedRaceColumns,
|
||||||
timer.getDelayBetweenAutoAdvancesInMilliseconds(), delayInMilliseconds, stringConstants);
|
autoExpandFirstRace, timer.getDelayBetweenAutoAdvancesInMilliseconds(), delayInMilliseconds, stringConstants);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
+6
@@ -16,4 +16,10 @@ interface LeaderboardResources extends ClientBundle {
|
|||||||
|
|
||||||
@Source("com/sap/sailing/gwt/ui/client/images/chart.png")
|
@Source("com/sap/sailing/gwt/ui/client/images/chart.png")
|
||||||
ImageResource chartIcon();
|
ImageResource chartIcon();
|
||||||
|
|
||||||
|
@Source("com/sap/sailing/gwt/ui/client/images/magnifier.png")
|
||||||
|
ImageResource magnifierIcon();
|
||||||
|
|
||||||
|
@Source("com/sap/sailing/gwt/ui/client/images/magnifier_slashed.png")
|
||||||
|
ImageResource magnifierSlashedIcon();
|
||||||
}
|
}
|
||||||
+7
-1
@@ -10,15 +10,17 @@ public class LeaderboardSettings {
|
|||||||
private final List<DetailType> maneuverDetailsToShow;
|
private final List<DetailType> maneuverDetailsToShow;
|
||||||
private final List<DetailType> legDetailsToShow;
|
private final List<DetailType> legDetailsToShow;
|
||||||
private final List<DetailType> raceDetailsToShow;
|
private final List<DetailType> raceDetailsToShow;
|
||||||
|
private final boolean autoExpandFirstRace;
|
||||||
private final long delayBetweenAutoAdvancesInMilliseconds;
|
private final long delayBetweenAutoAdvancesInMilliseconds;
|
||||||
private final long delayInMilliseconds;
|
private final long delayInMilliseconds;
|
||||||
|
|
||||||
public LeaderboardSettings(List<DetailType> meneuverDetailsToShow, List<DetailType> legDetailsToShow,
|
public LeaderboardSettings(List<DetailType> meneuverDetailsToShow, List<DetailType> legDetailsToShow,
|
||||||
List<DetailType> raceDetailsToShow, List<RaceInLeaderboardDTO> raceColumnsToShow,
|
List<DetailType> raceDetailsToShow, List<RaceInLeaderboardDTO> raceColumnsToShow, boolean autoExpandFirstRace,
|
||||||
long delayBetweenAutoAdvancesInMilliseconds, long delayInMilliseconds) {
|
long delayBetweenAutoAdvancesInMilliseconds, long delayInMilliseconds) {
|
||||||
this.legDetailsToShow = legDetailsToShow;
|
this.legDetailsToShow = legDetailsToShow;
|
||||||
this.raceDetailsToShow = raceDetailsToShow;
|
this.raceDetailsToShow = raceDetailsToShow;
|
||||||
this.raceColumnsToShow = raceColumnsToShow;
|
this.raceColumnsToShow = raceColumnsToShow;
|
||||||
|
this.autoExpandFirstRace = autoExpandFirstRace;
|
||||||
this.delayBetweenAutoAdvancesInMilliseconds = delayBetweenAutoAdvancesInMilliseconds;
|
this.delayBetweenAutoAdvancesInMilliseconds = delayBetweenAutoAdvancesInMilliseconds;
|
||||||
this.delayInMilliseconds = delayInMilliseconds;
|
this.delayInMilliseconds = delayInMilliseconds;
|
||||||
this.maneuverDetailsToShow = meneuverDetailsToShow;
|
this.maneuverDetailsToShow = meneuverDetailsToShow;
|
||||||
@@ -40,6 +42,10 @@ public class LeaderboardSettings {
|
|||||||
return raceColumnsToShow;
|
return raceColumnsToShow;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isAutoExpandFirstRace() {
|
||||||
|
return autoExpandFirstRace;
|
||||||
|
}
|
||||||
|
|
||||||
public long getDelayBetweenAutoAdvancesInMilliseconds() {
|
public long getDelayBetweenAutoAdvancesInMilliseconds() {
|
||||||
return delayBetweenAutoAdvancesInMilliseconds;
|
return delayBetweenAutoAdvancesInMilliseconds;
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-2
@@ -33,12 +33,13 @@ public class LeaderboardSettingsDialogComponent implements SettingsDialogCompone
|
|||||||
private final StringMessages stringConstants;
|
private final StringMessages stringConstants;
|
||||||
private LongBox delayBetweenAutoAdvancesInSecondsBox;
|
private LongBox delayBetweenAutoAdvancesInSecondsBox;
|
||||||
private LongBox delayInSecondsBox;
|
private LongBox delayInSecondsBox;
|
||||||
|
private final boolean autoExpandFirstRace;
|
||||||
private final long delayBetweenAutoAdvancesInMilliseconds;
|
private final long delayBetweenAutoAdvancesInMilliseconds;
|
||||||
private final long delayInMilliseconds;
|
private final long delayInMilliseconds;
|
||||||
|
|
||||||
public LeaderboardSettingsDialogComponent(List<DetailType> maneuverDetailSelection,
|
public LeaderboardSettingsDialogComponent(List<DetailType> maneuverDetailSelection,
|
||||||
List<DetailType> legDetailSelection, List<DetailType> raceDetailSelection, List<RaceInLeaderboardDTO> raceAllRaceColumns,
|
List<DetailType> legDetailSelection, List<DetailType> raceDetailSelection, List<RaceInLeaderboardDTO> raceAllRaceColumns,
|
||||||
List<RaceInLeaderboardDTO> raceColumnSelection, long delayBetweenAutoAdvancesInMilliseconds, long delayInMilliseconds,
|
List<RaceInLeaderboardDTO> raceColumnSelection, boolean autoExpandFirstRace, long delayBetweenAutoAdvancesInMilliseconds, long delayInMilliseconds,
|
||||||
StringMessages stringConstants) {
|
StringMessages stringConstants) {
|
||||||
this.maneuverDetailSelection = maneuverDetailSelection;
|
this.maneuverDetailSelection = maneuverDetailSelection;
|
||||||
this.raceColumnSelection = raceColumnSelection;
|
this.raceColumnSelection = raceColumnSelection;
|
||||||
@@ -50,6 +51,7 @@ public class LeaderboardSettingsDialogComponent implements SettingsDialogCompone
|
|||||||
maneuverDetailCheckboxes = new LinkedHashMap<DetailType, CheckBox>();
|
maneuverDetailCheckboxes = new LinkedHashMap<DetailType, CheckBox>();
|
||||||
legDetailCheckboxes = new LinkedHashMap<DetailType, CheckBox>();
|
legDetailCheckboxes = new LinkedHashMap<DetailType, CheckBox>();
|
||||||
raceDetailCheckboxes = new LinkedHashMap<DetailType, CheckBox>();
|
raceDetailCheckboxes = new LinkedHashMap<DetailType, CheckBox>();
|
||||||
|
this.autoExpandFirstRace = autoExpandFirstRace;
|
||||||
this.delayBetweenAutoAdvancesInMilliseconds = delayBetweenAutoAdvancesInMilliseconds;
|
this.delayBetweenAutoAdvancesInMilliseconds = delayBetweenAutoAdvancesInMilliseconds;
|
||||||
this.delayInMilliseconds = delayInMilliseconds;
|
this.delayInMilliseconds = delayInMilliseconds;
|
||||||
}
|
}
|
||||||
@@ -139,7 +141,7 @@ public class LeaderboardSettingsDialogComponent implements SettingsDialogCompone
|
|||||||
}
|
}
|
||||||
Long delayBetweenAutoAdvancesValue = delayBetweenAutoAdvancesInSecondsBox.getValue();
|
Long delayBetweenAutoAdvancesValue = delayBetweenAutoAdvancesInSecondsBox.getValue();
|
||||||
Long delayInSecondsValue = delayInSecondsBox.getValue();
|
Long delayInSecondsValue = delayInSecondsBox.getValue();
|
||||||
return new LeaderboardSettings(maneuverDetailsToShow, legDetailsToShow, raceDetailsToShow, raceColumnsToShow,
|
return new LeaderboardSettings(maneuverDetailsToShow, legDetailsToShow, raceDetailsToShow, raceColumnsToShow, autoExpandFirstRace,
|
||||||
1000l * (delayBetweenAutoAdvancesValue == null ? 0l : delayBetweenAutoAdvancesValue.longValue()),
|
1000l * (delayBetweenAutoAdvancesValue == null ? 0l : delayBetweenAutoAdvancesValue.longValue()),
|
||||||
1000 * (delayInSecondsValue==null?0:delayInSecondsValue.longValue()));
|
1000 * (delayInSecondsValue==null?0:delayInSecondsValue.longValue()));
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-4
@@ -6,6 +6,7 @@ import com.sap.sailing.gwt.ui.client.ErrorReporter;
|
|||||||
import com.sap.sailing.gwt.ui.client.RaceSelectionProvider;
|
import com.sap.sailing.gwt.ui.client.RaceSelectionProvider;
|
||||||
import com.sap.sailing.gwt.ui.client.SailingServiceAsync;
|
import com.sap.sailing.gwt.ui.client.SailingServiceAsync;
|
||||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||||
|
import com.sap.sailing.gwt.ui.client.Timer;
|
||||||
import com.sap.sailing.gwt.ui.shared.components.Component;
|
import com.sap.sailing.gwt.ui.shared.components.Component;
|
||||||
import com.sap.sailing.gwt.ui.shared.components.SettingsDialogComponent;
|
import com.sap.sailing.gwt.ui.shared.components.SettingsDialogComponent;
|
||||||
|
|
||||||
@@ -23,10 +24,10 @@ import com.sap.sailing.gwt.ui.shared.components.SettingsDialogComponent;
|
|||||||
*/
|
*/
|
||||||
public class MultiChartPanel extends AbstractChartPanel<MultiChartSettings> implements Component<MultiChartSettings> {
|
public class MultiChartPanel extends AbstractChartPanel<MultiChartSettings> implements Component<MultiChartSettings> {
|
||||||
public MultiChartPanel(SailingServiceAsync sailingService, CompetitorSelectionProvider competitorSelectionProvider,
|
public MultiChartPanel(SailingServiceAsync sailingService, CompetitorSelectionProvider competitorSelectionProvider,
|
||||||
RaceSelectionProvider raceSelectionProvider, final StringMessages stringMessages, int chartWidth, int chartHeight,
|
RaceSelectionProvider raceSelectionProvider, Timer timer, final StringMessages stringMessages, int chartWidth,
|
||||||
ErrorReporter errorReporter, boolean showRaceSelector) {
|
int chartHeight, ErrorReporter errorReporter, boolean showRaceSelector) {
|
||||||
super(sailingService, competitorSelectionProvider, raceSelectionProvider, stringMessages, chartWidth, chartHeight,
|
super(sailingService, competitorSelectionProvider, raceSelectionProvider, timer, stringMessages, chartWidth,
|
||||||
errorReporter, /* show initially: */ DetailType.WINDWARD_DISTANCE_TO_OVERALL_LEADER, showRaceSelector);
|
chartHeight, errorReporter, /* show initially: */ DetailType.WINDWARD_DISTANCE_TO_OVERALL_LEADER, showRaceSelector);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
+1
-1
@@ -126,7 +126,7 @@ public class RaceBoardPanel extends FormPanel implements EventDisplayer, RaceSel
|
|||||||
boolean showWindChart = true;
|
boolean showWindChart = true;
|
||||||
if(showWindChart) {
|
if(showWindChart) {
|
||||||
WindChartSettings windChartSettings = new WindChartSettings();
|
WindChartSettings windChartSettings = new WindChartSettings();
|
||||||
WindChart windChart = new WindChart(sailingService, raceSelectionProvider, windChartSettings, stringMessages, errorReporter);
|
WindChart windChart = new WindChart(sailingService, raceSelectionProvider, timer, windChartSettings, stringMessages, errorReporter);
|
||||||
CollapsableComponentViewer<WindChartSettings> windChartViewer = new CollapsableComponentViewer<WindChartSettings>(
|
CollapsableComponentViewer<WindChartSettings> windChartViewer = new CollapsableComponentViewer<WindChartSettings>(
|
||||||
windChart, "600px", "500px", stringMessages);
|
windChart, "600px", "500px", stringMessages);
|
||||||
windChart.onRaceSelectionChange(raceSelectionProvider.getSelectedRaces());
|
windChart.onRaceSelectionChange(raceSelectionProvider.getSelectedRaces());
|
||||||
|
|||||||
+10
-5
@@ -1,5 +1,6 @@
|
|||||||
package com.sap.sailing.gwt.ui.shared.panels;
|
package com.sap.sailing.gwt.ui.shared.panels;
|
||||||
|
|
||||||
|
import com.google.gwt.resources.client.ImageResource;
|
||||||
import com.google.gwt.user.client.ui.Image;
|
import com.google.gwt.user.client.ui.Image;
|
||||||
|
|
||||||
public class SimpleBusyIndicator extends BusyIndicator {
|
public class SimpleBusyIndicator extends BusyIndicator {
|
||||||
@@ -11,16 +12,22 @@ public class SimpleBusyIndicator extends BusyIndicator {
|
|||||||
* The busy indicator component is a circling GIF.
|
* The busy indicator component is a circling GIF.
|
||||||
*/
|
*/
|
||||||
public SimpleBusyIndicator() {
|
public SimpleBusyIndicator() {
|
||||||
this(false);
|
this(false, 1.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new SimpleBusyIndicator with a custom <code>busy</code> state.<br />
|
* Creates a new SimpleBusyIndicator with a custom <code>busy</code> state.<br />
|
||||||
* The busy indicator component is a circling GIF.
|
* The busy indicator component is a circling GIF.
|
||||||
|
*
|
||||||
|
* @param busy Sets the busy state of the BusyIndicator
|
||||||
|
* @param scale Scales the displayed image. 1.0 is 100%, 0.50 is 50%, ...
|
||||||
*/
|
*/
|
||||||
public SimpleBusyIndicator(boolean busy) {
|
public SimpleBusyIndicator(boolean busy, float scale) {
|
||||||
busyIndicator = new Image(RESOURCES.busyIndicatorCircle());
|
this.setStyleName(STYLE_NAME_PREFIX + "simpleBusyIndicator");
|
||||||
|
ImageResource resource = RESOURCES.busyIndicatorCircle();
|
||||||
|
busyIndicator = new Image(resource.getSafeUri());
|
||||||
busyIndicator.setStyleName(STYLE_NAME_PREFIX + "busyIndicatorCircle");
|
busyIndicator.setStyleName(STYLE_NAME_PREFIX + "busyIndicatorCircle");
|
||||||
|
busyIndicator.setPixelSize((int) (resource.getWidth() * scale), (int) (resource.getHeight() * scale));
|
||||||
add(busyIndicator);
|
add(busyIndicator);
|
||||||
setBusy(busy);
|
setBusy(busy);
|
||||||
}
|
}
|
||||||
@@ -29,8 +36,6 @@ public class SimpleBusyIndicator extends BusyIndicator {
|
|||||||
public void setBusy(boolean busy) {
|
public void setBusy(boolean busy) {
|
||||||
this.busy = busy;
|
this.busy = busy;
|
||||||
busyIndicator.setVisible(busy);
|
busyIndicator.setVisible(busy);
|
||||||
// Element elem = busyIndicator.getElement();
|
|
||||||
// DOM.setStyleAttribute(elem, "visibility", busy ? "visible" : "hidden");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
File renamed without changes.
Reference in new issue
Block a user