Merge remote-tracking branch 'origin/gwt' into gwt

This commit is contained in:
fmittag committed 2012-02-07 13:59:23 +01:00
commit 6000aed5f1
21 files changed
+154 -40

No files matched your search

+5 -3
View File
@@ -32,6 +32,7 @@ body {
font-weight: 400;
padding: 80px 0 120px 0;
margin: 0;
color: #3b3b3b;
}
table td,select,button {
@@ -144,10 +145,11 @@ input.magnifier {
}
.timeLineInnerPanel {
height: 100%;
/*height: 100%;*/
margin: 0 12px;
margin-top: 20px;
background: #dddcdc;
padding: 38px 24px 0 24px;
/*padding: 38px 24px 0 24px;*/
}
.timeLineInnerBgPanel {
@@ -315,4 +317,4 @@ input.magnifier {
text-transform: uppercase;
color: #a1a1a1;
font-weight: 500;
}
}
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 492 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

@@ -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.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.WindDTO;
import com.sap.sailing.gwt.ui.shared.WindInfoForRaceDTO;
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 SailingServiceAsync sailingService;
private final Chart chart;
private final Timer timer;
/**
* @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.
*/
public WindChart(SailingServiceAsync sailingService, RaceSelectionProvider raceSelectionProvider,
WindChartSettings settings, StringMessages stringMessages, ErrorReporter errorReporter) {
Timer timer, WindChartSettings settings, StringMessages stringMessages, ErrorReporter errorReporter) {
super();
this.sailingService = sailingService;
this.stringMessages = stringMessages;
this.errorReporter = errorReporter;
this.windSourceSeries = new HashMap<WindSource, Series>();
this.windSourcesToDisplay = new HashSet<WindSource>();
this.timer = timer;
chart = new Chart()
.setZoomType(Chart.ZoomType.X)
.setSpacingRight(20)
@@ -206,6 +210,12 @@ public class WindChart implements Component<WindChartSettings>, RaceSelectionCha
@Override
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
}
}
@@ -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.SailingServiceAsync;
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.WindDTO;
import com.sap.sailing.gwt.ui.shared.WindInfoForRaceDTO;
@@ -173,7 +175,7 @@ public class WindPanel extends FormPanel implements EventDisplayer, WindShower,
windSourceSelectionPanel.add(showConfigAnchor);
grid.setWidget(1, 0, windSourceSelectionPanel);
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.getCellFormatter().setVerticalAlignment(1, 1, HasVerticalAlignment.ALIGN_TOP);
this.setWidget(grid);
@@ -3,7 +3,7 @@ package com.sap.sailing.gwt.ui.client;
import com.google.gwt.resources.client.ClientBundle;
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")
ImageResource settingsIcon();
@@ -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);
}
@@ -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;
}
}
@@ -36,9 +36,10 @@ import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.shared.GwtEvent;
import com.google.gwt.i18n.client.DateTimeFormat;
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.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.DeckPanel;
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.RaceIdentifier;
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.CompetitorSelectionProvider;
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.SailingServiceAsync;
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.CompetitorInRaceDTO;
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.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
@@ -80,7 +87,7 @@ import com.sap.sailing.gwt.ui.shared.components.SettingsDialog;
*
*/
public abstract class AbstractChartPanel<SettingsType extends ChartSettings> extends SimplePanel
implements CompetitorSelectionChangeListener, RaceSelectionChangeListener {
implements CompetitorSelectionChangeListener, RaceSelectionChangeListener, TimeListener {
private CompetitorInRaceDTO chartData;
private CompetitorsAndTimePointsDTO competitorsAndTimePointsDTO = null;
private final SailingServiceAsync sailingService;
@@ -102,18 +109,21 @@ implements CompetitorSelectionChangeListener, RaceSelectionChangeListener {
private final HashMap<CompetitorDTO, Widget> competitorLabels;
private final HashMap<String, String> markPassingBuoyName;
private int width, height;
private final Timer timer;
private DetailType dataToShow;
private AbsolutePanel loadingPanel;
private final CompetitorSelectionProvider competitorSelectionProvider;
private static final ClientResources resources = GWT.create(ClientResources.class);
public AbstractChartPanel(SailingServiceAsync sailingService,
CompetitorSelectionProvider competitorSelectionProvider, RaceSelectionProvider raceSelectionProvider,
final StringMessages stringMessages, int chartWidth, int chartHeight, ErrorReporter errorReporter,
DetailType dataToShow, boolean showRaceSelector) {
Timer timer, final StringMessages stringMessages, int chartWidth, int chartHeight,
ErrorReporter errorReporter, DetailType dataToShow, boolean showRaceSelector) {
width = chartWidth;
height = chartHeight;
this.dataToShow = dataToShow;
this.timer = timer;
this.competitorSelectionProvider = competitorSelectionProvider;
competitorSelectionProvider.addCompetitorSelectionChangeListener(this);
this.errorReporter = errorReporter;
@@ -140,9 +150,8 @@ implements CompetitorSelectionChangeListener, RaceSelectionChangeListener {
}
loadingPanel = new AbsolutePanel();
loadingPanel.setSize(width + "px", height + "px");
Anchor a = new Anchor(new SafeHtmlBuilder().appendHtmlConstant("<img src=\"/gwt/images/ajax-loader.gif\"/>")
.toSafeHtml());
loadingPanel.add(a, width / 2 - 32 / 2, height / 2 - 32 - 2);
BusyIndicator busyIndicator = new SimpleBusyIndicator(true, 1);
loadingPanel.add(busyIndicator, width / 2 - 32 / 2, height / 2 - 32 - 2);
chartPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
chartPanel.setSpacing(5);
legendPanel = new FlowPanel();
@@ -154,8 +163,8 @@ implements CompetitorSelectionChangeListener, RaceSelectionChangeListener {
chart.showWidget(0);
chartPanel.add(chart);
mainPanel.add(chartPanel);
Anchor showConfigAnchor = new Anchor(new SafeHtmlBuilder().appendHtmlConstant(
"<img class=\"linkNoBorder\" src=\"/gwt/images/settings.png\"/>").toSafeHtml());
ImageResource settingsIcon = resources.settingsIcon();
Anchor showConfigAnchor = new Anchor(AbstractImagePrototype.create(settingsIcon).getSafeHtml());
showConfigAnchor.setTitle(stringMessages.configuration());
showConfigAnchor.addClickHandler(new ClickHandler() {
@Override
@@ -754,4 +763,12 @@ implements CompetitorSelectionChangeListener, RaceSelectionChangeListener {
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
}
}
}
@@ -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.SailingServiceAsync;
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.SettingsDialogComponent;
@@ -24,10 +25,10 @@ import com.sap.sailing.gwt.ui.shared.components.SettingsDialogComponent;
public class ChartPanel extends AbstractChartPanel<ChartSettings> implements Component<ChartSettings> {
public ChartPanel(SailingServiceAsync sailingService, CompetitorSelectionProvider competitorSelectionProvider,
RaceSelectionProvider raceSelectionProvider, DetailType dataToShow, StringMessages stringMessages, int chartWidth,
int chartHeight, ErrorReporter errorReporter, boolean showRaceSelector) {
super(sailingService, competitorSelectionProvider, raceSelectionProvider, stringMessages, chartWidth, chartHeight,
errorReporter, dataToShow, showRaceSelector);
RaceSelectionProvider raceSelectionProvider, Timer timer, DetailType dataToShow, StringMessages stringMessages,
int chartWidth, int chartHeight, ErrorReporter errorReporter, boolean showRaceSelector) {
super(sailingService, competitorSelectionProvider, raceSelectionProvider, timer, stringMessages, chartWidth,
chartHeight, errorReporter, dataToShow, showRaceSelector);
}
@Override
@@ -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.SailingServiceAsync;
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.DataLoadedHandler;
@@ -34,14 +35,14 @@ public class CompareCompetitorsChartDialog extends DialogBox {
private Anchor closeAnchor;
public CompareCompetitorsChartDialog(SailingServiceAsync sailingService,
List<RaceIdentifier> races, final CompetitorSelectionProvider competitorSelectionProvider, StringMessages stringConstants,
ErrorReporter errorReporter) {
List<RaceIdentifier> races, final CompetitorSelectionProvider competitorSelectionProvider, Timer timer,
StringMessages stringConstants, ErrorReporter errorReporter) {
super(false);
RaceSelectionProvider raceSelectionProvider = new RaceSelectionModel();
raceSelectionProvider.setAllRaces(races);
final MultiChartPanel ccp = new MultiChartPanel(sailingService, competitorSelectionProvider, raceSelectionProvider,
stringConstants, (int) (Window.getClientWidth() - 350), (int) (Window.getClientHeight() - 170),
errorReporter, /* showRaceSelector */ true);
timer, stringConstants, (int) (Window.getClientWidth() - 350),
(int) (Window.getClientHeight() - 170), errorReporter, /* showRaceSelector */ true);
ccp.addDataLoadedHandler(new DataLoadedHandler() {
@Override
public void onDataLoaded(DataLoadedEvent event) {
@@ -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.Delegate;
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.EventTarget;
import com.google.gwt.dom.client.NativeEvent;
@@ -12,6 +13,7 @@ import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
public class ExpandCollapseButtonCell extends AbstractCell<SafeHtml> {
private static final LeaderboardResources RESOURCES = GWT.create(LeaderboardResources.class);
private final SafeHtml html;
private final Delegate<SafeHtml> delegate;
@@ -27,8 +29,10 @@ public class ExpandCollapseButtonCell extends AbstractCell<SafeHtml> {
super("click", "keydown");
this.column = column;
this.delegate = delegate;
String src = column.isExpanded() ? RESOURCES.magnifierSlashedIcon().getSafeUri().asString() : RESOURCES.magnifierIcon().getSafeUri().asString();
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
@@ -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.
*/
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}
@@ -240,6 +242,7 @@ public class LeaderboardPanel extends FormPanel implements TimeListener, PlaySta
selectedRaceDetails.addAll(newSettings.getRaceDetailsToShow());
selectedRaceColumns.clear();
selectedRaceColumns.addAll(newSettings.getRaceColumnsToShow());
setAutoExpandFirstRace(newSettings.isAutoExpandFirstRace());
// update leaderboard after settings panel column selection change
updateLeaderboard(leaderboard);
@@ -819,6 +822,7 @@ public class LeaderboardPanel extends FormPanel implements TimeListener, PlaySta
selectedManeuverDetails.add(DetailType.JIBE);
selectedManeuverDetails.add(DetailType.PENALTY_CIRCLE);
delayInMilliseconds = 0l;
autoExpandFirstRace = false;
this.timer = timer;
timer.addPlayStateListener(this);
timer.addTimeListener(this);
@@ -860,7 +864,7 @@ public class LeaderboardPanel extends FormPanel implements TimeListener, PlaySta
contentPanel = new VerticalPanel();
headerPanel = new DockPanel();
DockPanel toolbarPanel = new DockPanel();
busyIndicator = new SimpleBusyIndicator();
busyIndicator = new SimpleBusyIndicator(false, 0.8f);
if (!isEmbedded) {
toolbarPanel.add(busyIndicator, DockPanel.WEST);
}
@@ -936,6 +940,14 @@ public class LeaderboardPanel extends FormPanel implements TimeListener, PlaySta
private void setDelayInMilliseconds(long 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
@@ -1057,10 +1069,19 @@ public class LeaderboardPanel extends FormPanel implements TimeListener, PlaySta
adjustColumnLayout(leaderboard);
getData().getList().clear();
if (leaderboard != null) {
boolean firstRace = true;
getData().getList().addAll(leaderboard.rows.values());
for (int i = 0; i < getLeaderboardTable().getColumnCount(); i++) {
SortableColumn<?, ?> c = (SortableColumn<?, ?>) getLeaderboardTable().getColumn(i);
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();
if (comparator != null) {
@@ -1473,7 +1494,7 @@ public class LeaderboardPanel extends FormPanel implements TimeListener, PlaySta
private void compareCompetitors() {
List<RaceIdentifier> races = getTrackedRacesIdentifiers();
CompareCompetitorsChartDialog chartDialog = new CompareCompetitorsChartDialog(sailingService, races,
competitorSelectionProvider, stringConstants, errorReporter);
competitorSelectionProvider, timer, stringConstants, errorReporter);
chartDialog.show();
}
@@ -1503,7 +1524,7 @@ public class LeaderboardPanel extends FormPanel implements TimeListener, PlaySta
Collections.unmodifiableList(selectedLegDetails),
Collections.unmodifiableList(selectedRaceDetails), /* All races to select */
leaderboard.getRaceList(), selectedRaceColumns,
timer.getDelayBetweenAutoAdvancesInMilliseconds(), delayInMilliseconds, stringConstants);
autoExpandFirstRace, timer.getDelayBetweenAutoAdvancesInMilliseconds(), delayInMilliseconds, stringConstants);
}
@Override
@@ -16,4 +16,10 @@ interface LeaderboardResources extends ClientBundle {
@Source("com/sap/sailing/gwt/ui/client/images/chart.png")
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();
}
@@ -10,15 +10,17 @@ public class LeaderboardSettings {
private final List<DetailType> maneuverDetailsToShow;
private final List<DetailType> legDetailsToShow;
private final List<DetailType> raceDetailsToShow;
private final boolean autoExpandFirstRace;
private final long delayBetweenAutoAdvancesInMilliseconds;
private final long delayInMilliseconds;
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) {
this.legDetailsToShow = legDetailsToShow;
this.raceDetailsToShow = raceDetailsToShow;
this.raceColumnsToShow = raceColumnsToShow;
this.autoExpandFirstRace = autoExpandFirstRace;
this.delayBetweenAutoAdvancesInMilliseconds = delayBetweenAutoAdvancesInMilliseconds;
this.delayInMilliseconds = delayInMilliseconds;
this.maneuverDetailsToShow = meneuverDetailsToShow;
@@ -40,6 +42,10 @@ public class LeaderboardSettings {
return raceColumnsToShow;
}
public boolean isAutoExpandFirstRace() {
return autoExpandFirstRace;
}
public long getDelayBetweenAutoAdvancesInMilliseconds() {
return delayBetweenAutoAdvancesInMilliseconds;
}
@@ -33,12 +33,13 @@ public class LeaderboardSettingsDialogComponent implements SettingsDialogCompone
private final StringMessages stringConstants;
private LongBox delayBetweenAutoAdvancesInSecondsBox;
private LongBox delayInSecondsBox;
private final boolean autoExpandFirstRace;
private final long delayBetweenAutoAdvancesInMilliseconds;
private final long delayInMilliseconds;
public LeaderboardSettingsDialogComponent(List<DetailType> maneuverDetailSelection,
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) {
this.maneuverDetailSelection = maneuverDetailSelection;
this.raceColumnSelection = raceColumnSelection;
@@ -50,6 +51,7 @@ public class LeaderboardSettingsDialogComponent implements SettingsDialogCompone
maneuverDetailCheckboxes = new LinkedHashMap<DetailType, CheckBox>();
legDetailCheckboxes = new LinkedHashMap<DetailType, CheckBox>();
raceDetailCheckboxes = new LinkedHashMap<DetailType, CheckBox>();
this.autoExpandFirstRace = autoExpandFirstRace;
this.delayBetweenAutoAdvancesInMilliseconds = delayBetweenAutoAdvancesInMilliseconds;
this.delayInMilliseconds = delayInMilliseconds;
}
@@ -139,7 +141,7 @@ public class LeaderboardSettingsDialogComponent implements SettingsDialogCompone
}
Long delayBetweenAutoAdvancesValue = delayBetweenAutoAdvancesInSecondsBox.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()),
1000 * (delayInSecondsValue==null?0:delayInSecondsValue.longValue()));
}
@@ -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.SailingServiceAsync;
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.SettingsDialogComponent;
@@ -23,10 +24,10 @@ import com.sap.sailing.gwt.ui.shared.components.SettingsDialogComponent;
*/
public class MultiChartPanel extends AbstractChartPanel<MultiChartSettings> implements Component<MultiChartSettings> {
public MultiChartPanel(SailingServiceAsync sailingService, CompetitorSelectionProvider competitorSelectionProvider,
RaceSelectionProvider raceSelectionProvider, final StringMessages stringMessages, int chartWidth, int chartHeight,
ErrorReporter errorReporter, boolean showRaceSelector) {
super(sailingService, competitorSelectionProvider, raceSelectionProvider, stringMessages, chartWidth, chartHeight,
errorReporter, /* show initially: */ DetailType.WINDWARD_DISTANCE_TO_OVERALL_LEADER, showRaceSelector);
RaceSelectionProvider raceSelectionProvider, Timer timer, final StringMessages stringMessages, int chartWidth,
int chartHeight, ErrorReporter errorReporter, boolean showRaceSelector) {
super(sailingService, competitorSelectionProvider, raceSelectionProvider, timer, stringMessages, chartWidth,
chartHeight, errorReporter, /* show initially: */ DetailType.WINDWARD_DISTANCE_TO_OVERALL_LEADER, showRaceSelector);
}
@Override
@@ -126,7 +126,7 @@ public class RaceBoardPanel extends FormPanel implements EventDisplayer, RaceSel
boolean showWindChart = true;
if(showWindChart) {
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>(
windChart, "600px", "500px", stringMessages);
windChart.onRaceSelectionChange(raceSelectionProvider.getSelectedRaces());
@@ -1,5 +1,6 @@
package com.sap.sailing.gwt.ui.shared.panels;
import com.google.gwt.resources.client.ImageResource;
import com.google.gwt.user.client.ui.Image;
public class SimpleBusyIndicator extends BusyIndicator {
@@ -11,16 +12,22 @@ public class SimpleBusyIndicator extends BusyIndicator {
* The busy indicator component is a circling GIF.
*/
public SimpleBusyIndicator() {
this(false);
this(false, 1.0f);
}
/**
* Creates a new SimpleBusyIndicator with a custom <code>busy</code> state.<br />
* 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) {
busyIndicator = new Image(RESOURCES.busyIndicatorCircle());
public SimpleBusyIndicator(boolean busy, float scale) {
this.setStyleName(STYLE_NAME_PREFIX + "simpleBusyIndicator");
ImageResource resource = RESOURCES.busyIndicatorCircle();
busyIndicator = new Image(resource.getSafeUri());
busyIndicator.setStyleName(STYLE_NAME_PREFIX + "busyIndicatorCircle");
busyIndicator.setPixelSize((int) (resource.getWidth() * scale), (int) (resource.getHeight() * scale));
add(busyIndicator);
setBusy(busy);
}
@@ -29,8 +36,6 @@ public class SimpleBusyIndicator extends BusyIndicator {
public void setBusy(boolean busy) {
this.busy = busy;
busyIndicator.setVisible(busy);
// Element elem = busyIndicator.getElement();
// DOM.setStyleAttribute(elem, "visibility", busy ? "visible" : "hidden");
}
}