Merge remote-tracking branch 'origin/master'

Conflicts:
	java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/spectator/LeaderboardGroupPanel.java
This commit is contained in:
fmittag committed 2012-06-16 22:28:59 +02:00
commit d08d9da133
10 files changed
+99 -70

No files matched your search

@@ -222,7 +222,7 @@ public interface DomainFactory {
* <code>timeoutInMilliseconds</code> in case no modifications happen on the set of races cached by this factory. * <code>timeoutInMilliseconds</code> in case no modifications happen on the set of races cached by this factory.
* *
* @param timeoutInMilliseconds * @param timeoutInMilliseconds
* passing -1 means an infinite timeout; 0 means return immediately with <code>null</code> result if no * passing -1 means an infinite timeout; 0 means return immediately with <code>null</code> as result if no
* race definition is found for <code>race</code>. * race definition is found for <code>race</code>.
*/ */
RaceDefinition getAndWaitForRaceDefinition(Race race, long timeoutInMilliseconds); RaceDefinition getAndWaitForRaceDefinition(Race race, long timeoutInMilliseconds);
@@ -7,7 +7,6 @@ import com.sap.sailing.domain.common.impl.Util.Triple;
import com.sap.sailing.domain.tracking.RaceTracker; import com.sap.sailing.domain.tracking.RaceTracker;
public interface TracTracRaceTracker extends RaceTracker { public interface TracTracRaceTracker extends RaceTracker {
/** /**
* returns the paramURL, liveURI and storedURI for the TracTrac connection maintained by this tracker * returns the paramURL, liveURI and storedURI for the TracTrac connection maintained by this tracker
*/ */
@@ -8,6 +8,7 @@ import com.sap.sailing.domain.base.RaceDefinition;
import com.sap.sailing.domain.common.impl.Util.Triple; import com.sap.sailing.domain.common.impl.Util.Triple;
import com.sap.sailing.domain.tracking.DynamicTrackedRace; import com.sap.sailing.domain.tracking.DynamicTrackedRace;
import com.sap.sailing.domain.tracking.DynamicTrackedRegatta; import com.sap.sailing.domain.tracking.DynamicTrackedRegatta;
import com.sap.sailing.domain.tracking.RaceTracker;
import com.sap.sailing.domain.tracking.TrackedRace; import com.sap.sailing.domain.tracking.TrackedRace;
import com.sap.sailing.domain.tracking.TrackedRegatta; import com.sap.sailing.domain.tracking.TrackedRegatta;
import com.sap.sailing.domain.tractracadapter.DomainFactory; import com.sap.sailing.domain.tractracadapter.DomainFactory;
@@ -133,17 +134,23 @@ public abstract class AbstractReceiverWithQueue<A, B, C> implements Runnable, Re
protected abstract void handleEvent(Triple<A, B, C> event); protected abstract void handleEvent(Triple<A, B, C> event);
/** /**
* Tries to find a {@link TrackedRace} for <code>race</code> in the {@link com.sap.sailing.domain.base.Regatta} corresponding * Tries to find a {@link TrackedRace} for <code>race</code> in the {@link com.sap.sailing.domain.base.Regatta}
* to {@link #tractracEvent}, as keyed by the {@link #domainFactory}. If the {@link RaceDefinition} for <code>race</code> * corresponding to {@link #tractracEvent}, as keyed by the {@link #domainFactory}. Waits for
* is not found in the {@link com.sap.sailing.domain.base.Regatta}, <code>null</code> is returned. If the {@link TrackedRace} * {@link RaceTracker#TIMEOUT_FOR_RECEIVING_RACE_DEFINITION_IN_MILLISECONDS} milliseconds for the
* for <code>race</code> isn't found in the {@link TrackedRegatta}, <code>null</code> is returned, too. * {@link RaceDefinition} to show up. If it doesn't, <code>null</code> is returned. If the {@link RaceDefinition}
* for <code>race</code> is not found in the {@link com.sap.sailing.domain.base.Regatta}, <code>null</code> is
* returned. If the {@link TrackedRace} for <code>race</code> isn't found in the {@link TrackedRegatta},
* <code>null</code> is returned, too.
*/ */
protected DynamicTrackedRace getTrackedRace(Race race) { protected DynamicTrackedRace getTrackedRace(Race race) {
DynamicTrackedRace result = null; DynamicTrackedRace result = null;
RaceDefinition raceDefinition = getDomainFactory().getAndWaitForRaceDefinition(race); RaceDefinition raceDefinition = getDomainFactory().getAndWaitForRaceDefinition(race,
com.sap.sailing.domain.base.Regatta domainRegatta = trackedRegatta.getRegatta(); RaceTracker.TIMEOUT_FOR_RECEIVING_RACE_DEFINITION_IN_MILLISECONDS);
if (domainRegatta.getRaceByName(raceDefinition.getName()) != null) { if (raceDefinition != null) {
result = trackedRegatta.getTrackedRace(raceDefinition); com.sap.sailing.domain.base.Regatta domainRegatta = trackedRegatta.getRegatta();
if (domainRegatta.getRaceByName(raceDefinition.getName()) != null) {
result = trackedRegatta.getTrackedRace(raceDefinition);
}
} }
return result; return result;
} }
@@ -226,7 +226,14 @@ public class DomainFactoryImpl implements DomainFactory {
boolean interrupted = false; boolean interrupted = false;
while ((timeoutInMilliseconds == -1 || System.currentTimeMillis()-start < timeoutInMilliseconds) && !interrupted && result == null) { while ((timeoutInMilliseconds == -1 || System.currentTimeMillis()-start < timeoutInMilliseconds) && !interrupted && result == null) {
try { try {
raceCache.wait(); if (timeoutInMilliseconds == -1) {
raceCache.wait();
} else {
long timeToWait = timeoutInMilliseconds-(System.currentTimeMillis()-start);
if (timeToWait > 0) {
raceCache.wait(timeToWait);
}
}
result = raceCache.get(race); result = raceCache.get(race);
} catch (InterruptedException e) { } catch (InterruptedException e) {
interrupted = true; interrupted = true;
@@ -312,7 +319,9 @@ public class DomainFactoryImpl implements DomainFactory {
@Override @Override
public Iterable<Receiver> getUpdateReceivers(DynamicTrackedRegatta trackedRegatta, public Iterable<Receiver> getUpdateReceivers(DynamicTrackedRegatta trackedRegatta,
com.tractrac.clientmodule.Event tractracEvent, TimePoint startOfTracking, TimePoint endOfTracking, long delayToLiveInMillis, WindStore windStore, DynamicRaceDefinitionSet raceDefinitionSetToUpdate, TrackedRegattaRegistry trackedRegattaRegistry) { com.tractrac.clientmodule.Event tractracEvent, TimePoint startOfTracking, TimePoint endOfTracking,
long delayToLiveInMillis, WindStore windStore, DynamicRaceDefinitionSet raceDefinitionSetToUpdate,
TrackedRegattaRegistry trackedRegattaRegistry) {
return getUpdateReceivers(trackedRegatta, tractracEvent, windStore, startOfTracking, endOfTracking, delayToLiveInMillis, return getUpdateReceivers(trackedRegatta, tractracEvent, windStore, startOfTracking, endOfTracking, delayToLiveInMillis,
raceDefinitionSetToUpdate, trackedRegattaRegistry, ReceiverType.RACECOURSE, raceDefinitionSetToUpdate, trackedRegattaRegistry, ReceiverType.RACECOURSE,
ReceiverType.MARKPASSINGS, ReceiverType.MARKPOSITIONS, ReceiverType.RACESTARTFINISH, ReceiverType.RAWPOSITIONS); ReceiverType.MARKPASSINGS, ReceiverType.MARKPOSITIONS, ReceiverType.RACESTARTFINISH, ReceiverType.RAWPOSITIONS);
@@ -32,6 +32,13 @@ import com.sap.sailing.domain.common.RegattaAndRaceIdentifier;
* *
*/ */
public interface RaceTracker { public interface RaceTracker {
/**
* By default, wait five minutes for race data; sometimes, a tracking provider's server may be under heavy load and
* may serve races one after another. If many races are requested concurrently, this can lead to a queue
* of several minutes length.
*/
static long TIMEOUT_FOR_RECEIVING_RACE_DEFINITION_IN_MILLISECONDS = 300000;
/** /**
* Stops tracking the races. * Stops tracking the races.
*/ */
@@ -232,7 +232,7 @@ public class MatchAndApplyScoreCorrectionsDialog extends DataEntryDialog<BulkSco
// apply the score correction of the cell: // apply the score correction of the cell:
String raceNameOrNumber = getSelectedString(raceNameOrNumberChoosers, raceColumn); String raceNameOrNumber = getSelectedString(raceNameOrNumberChoosers, raceColumn);
String officialSailID = getSelectedString(officialSailIDChoosers, competitor); String officialSailID = getSelectedString(officialSailIDChoosers, competitor);
if (officialSailID != null) { if (officialSailID != null && raceNameOrNumber != null) {
ScoreCorrectionEntryDTO officialCorrectionEntry = regattaScoreCorrection ScoreCorrectionEntryDTO officialCorrectionEntry = regattaScoreCorrection
.getScoreCorrectionsByRaceNameOrNumber().get(raceNameOrNumber).get(officialSailID); .getScoreCorrectionsByRaceNameOrNumber().get(raceNameOrNumber).get(officialSailID);
result.addMaxPointsReasonUpdate(competitor, raceColumn, result.addMaxPointsReasonUpdate(competitor, raceColumn,
@@ -287,7 +287,7 @@ public class MatchAndApplyScoreCorrectionsDialog extends DataEntryDialog<BulkSco
VerticalPanel cell = new VerticalPanel(); VerticalPanel cell = new VerticalPanel();
cell.add(new Label(entry.netPoints+"/"+entry.totalPoints+"/"+entry.reasonForMaxPoints+ cell.add(new Label(entry.netPoints+"/"+entry.totalPoints+"/"+entry.reasonForMaxPoints+
(entry.discarded?"/discarded":""))); (entry.discarded?"/discarded":"")));
if (officialSailID != null) { if (officialSailID != null && raceNameOrNumber != null) {
ScoreCorrectionEntryDTO officialCorrectionEntry = ScoreCorrectionEntryDTO officialCorrectionEntry =
regattaScoreCorrection.getScoreCorrectionsByRaceNameOrNumber() regattaScoreCorrection.getScoreCorrectionsByRaceNameOrNumber()
.get(raceNameOrNumber).get(officialSailID); .get(raceNameOrNumber).get(officialSailID);
@@ -105,6 +105,7 @@ import com.sap.sailing.domain.tracking.GPSFixMoving;
import com.sap.sailing.domain.tracking.GPSFixTrack; import com.sap.sailing.domain.tracking.GPSFixTrack;
import com.sap.sailing.domain.tracking.Maneuver; import com.sap.sailing.domain.tracking.Maneuver;
import com.sap.sailing.domain.tracking.MarkPassing; import com.sap.sailing.domain.tracking.MarkPassing;
import com.sap.sailing.domain.tracking.RaceTracker;
import com.sap.sailing.domain.tracking.RacesHandle; import com.sap.sailing.domain.tracking.RacesHandle;
import com.sap.sailing.domain.tracking.TrackedLeg; import com.sap.sailing.domain.tracking.TrackedLeg;
import com.sap.sailing.domain.tracking.TrackedLegOfCompetitor; import com.sap.sailing.domain.tracking.TrackedLegOfCompetitor;
@@ -214,13 +215,6 @@ public class SailingServiceImpl extends RemoteServiceServlet implements SailingS
private static final long serialVersionUID = 9031688830194537489L; private static final long serialVersionUID = 9031688830194537489L;
/**
* Wait five minutes for race data; sometimes, a tracking provider's server may be under heavy load and
* may serve races one after another. If many races are requested concurrently, this can lead to a queue
* of several minutes length.
*/
private static final long TIMEOUT_FOR_RECEIVING_RACE_DEFINITION_IN_MILLISECONDS = 300000;
private final ServiceTracker<RacingEventService, RacingEventService> racingEventServiceTracker; private final ServiceTracker<RacingEventService, RacingEventService> racingEventServiceTracker;
private final ServiceTracker<ReplicationService, ReplicationService> replicationServiceTracker; private final ServiceTracker<ReplicationService, ReplicationService> replicationServiceTracker;
@@ -622,14 +616,16 @@ public class SailingServiceImpl extends RemoteServiceServlet implements SailingS
if (storedURI == null || storedURI.trim().length() == 0) { if (storedURI == null || storedURI.trim().length() == 0) {
storedURI = rr.storedURI; storedURI = rr.storedURI;
} }
final RacesHandle raceHandle = getService().addTracTracRace(regattaToAddTo, new URL(rr.paramURL), new URI(liveURI), final RacesHandle raceHandle = getService().addTracTracRace(regattaToAddTo, new URL(rr.paramURL),
new URI(storedURI), new MillisecondsTimePoint(rr.trackingStartTime), new URI(liveURI), new URI(storedURI), new MillisecondsTimePoint(rr.trackingStartTime),
new MillisecondsTimePoint(rr.trackingEndTime), MongoWindStoreFactory.INSTANCE.getMongoWindStore(mongoObjectFactory, domainObjectFactory), TIMEOUT_FOR_RECEIVING_RACE_DEFINITION_IN_MILLISECONDS); new MillisecondsTimePoint(rr.trackingEndTime),
MongoWindStoreFactory.INSTANCE.getMongoWindStore(mongoObjectFactory, domainObjectFactory),
RaceTracker.TIMEOUT_FOR_RECEIVING_RACE_DEFINITION_IN_MILLISECONDS);
if (trackWind) { if (trackWind) {
new Thread("Wind tracking starter for race "+rr.regattaName+"/"+rr.name) { new Thread("Wind tracking starter for race "+rr.regattaName+"/"+rr.name) {
public void run() { public void run() {
try { try {
startTrackingWind(raceHandle, correctWindByDeclination, TIMEOUT_FOR_RECEIVING_RACE_DEFINITION_IN_MILLISECONDS); startTrackingWind(raceHandle, correctWindByDeclination, RaceTracker.TIMEOUT_FOR_RECEIVING_RACE_DEFINITION_IN_MILLISECONDS);
} catch (Exception e) { } catch (Exception e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
@@ -1624,12 +1620,13 @@ public class SailingServiceImpl extends RemoteServiceServlet implements SailingS
boolean canSendRequests, boolean trackWind, final boolean correctWindByDeclination) throws Exception { boolean canSendRequests, boolean trackWind, final boolean correctWindByDeclination) throws Exception {
final RacesHandle raceHandle = getService().addSwissTimingRace(regattaToAddTo, rr.ID, hostname, port, final RacesHandle raceHandle = getService().addSwissTimingRace(regattaToAddTo, rr.ID, hostname, port,
canSendRequests, canSendRequests,
MongoWindStoreFactory.INSTANCE.getMongoWindStore(mongoObjectFactory, domainObjectFactory), TIMEOUT_FOR_RECEIVING_RACE_DEFINITION_IN_MILLISECONDS); MongoWindStoreFactory.INSTANCE.getMongoWindStore(mongoObjectFactory, domainObjectFactory),
RaceTracker.TIMEOUT_FOR_RECEIVING_RACE_DEFINITION_IN_MILLISECONDS);
if (trackWind) { if (trackWind) {
new Thread("Wind tracking starter for race "+rr.ID+"/"+rr.description) { new Thread("Wind tracking starter for race "+rr.ID+"/"+rr.description) {
public void run() { public void run() {
try { try {
startTrackingWind(raceHandle, correctWindByDeclination, TIMEOUT_FOR_RECEIVING_RACE_DEFINITION_IN_MILLISECONDS); startTrackingWind(raceHandle, correctWindByDeclination, RaceTracker.TIMEOUT_FOR_RECEIVING_RACE_DEFINITION_IN_MILLISECONDS);
} catch (Exception e) { } catch (Exception e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
@@ -125,31 +125,29 @@ public class LeaderboardGroupPanel extends FormPanel implements HasWelcomeWidget
} }
private void buildGUI() { private void buildGUI() {
// Create breadcrumb panel if (!embedded) {
BreadcrumbPanel breadcrumbPanel = createBreadcrumbPanel(); // Create breadcrumb panel
if (breadcrumbPanel != null) { BreadcrumbPanel breadcrumbPanel = createBreadcrumbPanel();
mainPanel.add(breadcrumbPanel); if (breadcrumbPanel != null) {
} mainPanel.add(breadcrumbPanel);
}
// Create group details GUI // Create group details GUI
FlowPanel groupDetailsPanel = new FlowPanel(); FlowPanel groupDetailsPanel = new FlowPanel();
groupDetailsPanel.setStyleName(STYLE_NAME_PREFIX + "GroupDetailsPanel"); groupDetailsPanel.setStyleName(STYLE_NAME_PREFIX + "GroupDetailsPanel");
mainPanel.add(groupDetailsPanel); mainPanel.add(groupDetailsPanel);
Label groupNameLabel = new Label(group.name + ":");
Label groupNameLabel = new Label(group.name + ":"); groupNameLabel.setStyleName(STYLE_NAME_PREFIX + "GroupName");
groupNameLabel.setStyleName(STYLE_NAME_PREFIX + "GroupName"); groupDetailsPanel.add(groupNameLabel);
groupDetailsPanel.add(groupNameLabel); // Using HTML to display the line breaks in the description
HTML groupDescriptionLabel = new HTML(new SafeHtmlBuilder().appendEscapedLines(group.description)
// Using HTML to display the line breaks in the description .toSafeHtml());
HTML groupDescriptionLabel = new HTML(new SafeHtmlBuilder().appendEscapedLines(group.description).toSafeHtml()); groupDescriptionLabel.setStyleName(STYLE_NAME_PREFIX + "GroupDescription");
groupDescriptionLabel.setStyleName(STYLE_NAME_PREFIX + "GroupDescription"); groupDetailsPanel.add(groupDescriptionLabel);
groupDetailsPanel.add(groupDescriptionLabel); // Create group leaderboards GUI
Label leaderboardsTableLabel = new Label(stringConstants.leaderboards());
// Create group leaderboards GUI leaderboardsTableLabel.setStyleName(STYLE_NAME_PREFIX + "LeaderboardsTableLabel");
Label leaderboardsTableLabel = new Label(stringConstants.leaderboards()); mainPanel.add(leaderboardsTableLabel);
leaderboardsTableLabel.setStyleName(STYLE_NAME_PREFIX + "LeaderboardsTableLabel"); }
mainPanel.add(leaderboardsTableLabel);
if (group.leaderboards.size() <= MAX_COLUMNS_IN_ROW) { if (group.leaderboards.size() <= MAX_COLUMNS_IN_ROW) {
LeaderboardGroupFullTableResources tableResources = GWT.create(LeaderboardGroupFullTableResources.class); LeaderboardGroupFullTableResources tableResources = GWT.create(LeaderboardGroupFullTableResources.class);
CellTable<Integer> leaderboardsTable = new CellTable<Integer>(200, tableResources); CellTable<Integer> leaderboardsTable = new CellTable<Integer>(200, tableResources);
@@ -204,10 +202,10 @@ public class LeaderboardGroupPanel extends FormPanel implements HasWelcomeWidget
+ "&leaderboardGroupName=" + group.name + "&root=" + root + "&leaderboardGroupName=" + group.name + "&root=" + root
+ (debugParam != null && !debugParam.isEmpty() ? "&gwt.codesvr=" + debugParam : "")); + (debugParam != null && !debugParam.isEmpty() ? "&gwt.codesvr=" + debugParam : ""));
if (embedded) { if (embedded) {
return ANCHORTEMPLATE.anchor(link, stringConstants.overview(), STYLE_NAME_PREFIX + "ActiveLeaderboard");
} else {
return ANCHORTEMPLATE.anchorWithTarget(link, stringConstants.overview(), STYLE_NAME_PREFIX + "ActiveLeaderboard", return ANCHORTEMPLATE.anchorWithTarget(link, stringConstants.overview(), STYLE_NAME_PREFIX + "ActiveLeaderboard",
/* target */ "_blank"); /* target */ "_blank");
} else {
return ANCHORTEMPLATE.anchor(link, stringConstants.overview(), STYLE_NAME_PREFIX + "ActiveLeaderboard");
} }
} }
}; };
@@ -280,7 +278,11 @@ public class LeaderboardGroupPanel extends FormPanel implements HasWelcomeWidget
if (viewMode != null && !viewMode.isEmpty()) { if (viewMode != null && !viewMode.isEmpty()) {
link += "&viewMode=" + viewMode; link += "&viewMode=" + viewMode;
} }
b.append(ANCHORTEMPLATE.anchor(link, linkText, STYLE_NAME_PREFIX + "ActiveRace")); if (embedded) {
b.append(ANCHORTEMPLATE.anchorWithTarget(link, linkText, STYLE_NAME_PREFIX + "ActiveRace", "_blank"));
} else {
b.append(ANCHORTEMPLATE.anchor(link, linkText, STYLE_NAME_PREFIX + "ActiveRace"));
}
} else { } else {
b.append(TEXTTEMPLATE.textWithClass(linkText, STYLE_NAME_PREFIX + "InactiveRace")); b.append(TEXTTEMPLATE.textWithClass(linkText, STYLE_NAME_PREFIX + "InactiveRace"));
} }
@@ -341,7 +343,11 @@ public class LeaderboardGroupPanel extends FormPanel implements HasWelcomeWidget
if (viewMode != null && !viewMode.isEmpty()) { if (viewMode != null && !viewMode.isEmpty()) {
link += "&viewMode=" + viewMode; link += "&viewMode=" + viewMode;
} }
b.append(ANCHORTEMPLATE.anchor(link, linkText, STYLE_NAME_PREFIX + "ActiveRace")); if (embedded) {
b.append(ANCHORTEMPLATE.anchorWithTarget(link, linkText, STYLE_NAME_PREFIX + "ActiveRace", "_blank"));
} else {
b.append(ANCHORTEMPLATE.anchor(link, linkText, STYLE_NAME_PREFIX + "ActiveRace"));
}
} else { } else {
b.append(TEXTTEMPLATE.textWithClass(linkText, STYLE_NAME_PREFIX + "InactiveRace")); b.append(TEXTTEMPLATE.textWithClass(linkText, STYLE_NAME_PREFIX + "InactiveRace"));
} }
@@ -1,6 +1,7 @@
package com.sap.sailing.gwt.ui.spectator; package com.sap.sailing.gwt.ui.spectator;
import com.google.gwt.dom.client.Style; import com.google.gwt.dom.client.Style;
import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.safehtml.shared.SafeHtmlBuilder; import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
import com.google.gwt.user.client.Window; import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.rpc.AsyncCallback; import com.google.gwt.user.client.rpc.AsyncCallback;
@@ -9,8 +10,8 @@ import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.RootPanel; import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.SimplePanel; import com.google.gwt.user.client.ui.SimplePanel;
import com.sap.sailing.gwt.ui.client.AbstractEntryPoint; import com.sap.sailing.gwt.ui.client.AbstractEntryPoint;
import com.sap.sailing.gwt.ui.client.RegattaRefresher;
import com.sap.sailing.gwt.ui.client.LogoAndTitlePanel; import com.sap.sailing.gwt.ui.client.LogoAndTitlePanel;
import com.sap.sailing.gwt.ui.client.RegattaRefresher;
import com.sap.sailing.gwt.ui.shared.LeaderboardGroupDTO; import com.sap.sailing.gwt.ui.shared.LeaderboardGroupDTO;
import com.sap.sailing.gwt.ui.shared.panels.SimpleWelcomeWidget; import com.sap.sailing.gwt.ui.shared.panels.SimpleWelcomeWidget;
@@ -55,6 +56,9 @@ public class SpectatorEntryPoint extends AbstractEntryPoint implements RegattaRe
: stringMessages.overview(), stringMessages); : stringMessages.overview(), stringMessages);
logoAndTitlePanel.addStyleName("LogoAndTitlePanel"); logoAndTitlePanel.addStyleName("LogoAndTitlePanel");
rootPanel.add(logoAndTitlePanel); rootPanel.add(logoAndTitlePanel);
} else {
RootPanel.getBodyElement().getStyle().setPadding(0, Unit.PX);
RootPanel.getBodyElement().getStyle().setPaddingTop(20, Unit.PX);
} }
if (groupName == null) { if (groupName == null) {
FlowPanel groupOverviewPanel = new FlowPanel(); FlowPanel groupOverviewPanel = new FlowPanel();
@@ -65,22 +69,22 @@ public class SpectatorEntryPoint extends AbstractEntryPoint implements RegattaRe
LeaderboardGroupPanel groupPanel = new LeaderboardGroupPanel(sailingService, stringMessages, this, LeaderboardGroupPanel groupPanel = new LeaderboardGroupPanel(sailingService, stringMessages, this,
groupName, root, viewModeParamValue, embedded); groupName, root, viewModeParamValue, embedded);
groupPanel.getElement().getStyle().setFloat(Style.Float.LEFT); groupPanel.getElement().getStyle().setFloat(Style.Float.LEFT);
groupPanel.setWelcomeWidget(new SimpleWelcomeWidget( stringMessages.welcomeToSailingAnalytics(), stringMessages.welcomeToSailingAnalyticsBody()));
SimplePanel feedbackPanel = new SimplePanel();
feedbackPanel.getElement().getStyle().setProperty("clear", "right");
feedbackPanel.addStyleName("feedbackPanel");
Anchor feedbackLink = new Anchor(new SafeHtmlBuilder().appendHtmlConstant(
"<img class=\"linkNoBorder\" src=\"/gwt/images/feedbackPanel-bg.png\"/>").toSafeHtml());//TODO set image
feedbackLink.setHref("mailto:sailing_analytics%40sap.com?subject=[SAP Sailing] Feedback");
feedbackLink.addStyleName("feedbackLink");
feedbackPanel.add(feedbackLink);
groupAndFeedbackPanel.add(groupPanel); groupAndFeedbackPanel.add(groupPanel);
groupAndFeedbackPanel.add(feedbackPanel); if (!embedded) {
groupPanel.setWelcomeWidget(new SimpleWelcomeWidget(stringMessages.welcomeToSailingAnalytics(),
stringMessages.welcomeToSailingAnalyticsBody()));
SimplePanel feedbackPanel = new SimplePanel();
feedbackPanel.getElement().getStyle().setProperty("clear", "right");
feedbackPanel.addStyleName("feedbackPanel");
Anchor feedbackLink = new Anchor(new SafeHtmlBuilder().appendHtmlConstant(
"<img class=\"linkNoBorder\" src=\"/gwt/images/feedbackPanel-bg.png\"/>").toSafeHtml());// TODO set image
feedbackLink.setHref("mailto:sailing_analytics%40sap.com?subject=[SAP Sailing] Feedback");
feedbackLink.addStyleName("feedbackLink");
feedbackPanel.add(feedbackLink);
groupAndFeedbackPanel.add(feedbackPanel);
}
rootPanel.add(groupAndFeedbackPanel); rootPanel.add(groupAndFeedbackPanel);
} }
fillRegattas(); fillRegattas();
} }