diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/autoplay/client/place/player/AutoPlayController.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/autoplay/client/place/player/AutoPlayController.java
index 3bd593ab8ad..f980a4a7917 100644
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/autoplay/client/place/player/AutoPlayController.java
+++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/autoplay/client/place/player/AutoPlayController.java
@@ -127,7 +127,7 @@ public class AutoPlayController implements RaceTimesInfoProviderListener, Leader
sailingService, mediaService, userService, asyncActionsExecutor,
result.getCompetitorAndTheirBoats(), raceboardTimer, currentLiveRace, autoPlayerConfiguration.getLeaderboardName(),
/** leaderboardGroupName */ null, /** eventId */ null, errorReporter,
- StringMessages.INSTANCE, userAgent, raceTimesInfoProvider);
+ StringMessages.INSTANCE, userAgent, raceTimesInfoProvider, true);
playerView.setContent(raceboardPerspective);
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/client/GWTLocaleUtil.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/client/GWTLocaleUtil.java
index 848aa76eba2..d9265b0c6b1 100644
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/client/GWTLocaleUtil.java
+++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/client/GWTLocaleUtil.java
@@ -7,12 +7,21 @@ import java.util.List;
import com.google.gwt.i18n.client.LocaleInfo;
import com.sap.sse.common.Util;
+/**
+ * Utilities for working with GWT client locales.
+ */
public final class GWTLocaleUtil {
private static final String NO_LOCALE_TEXT = "---";
private GWTLocaleUtil() {
}
+ /**
+ * Returns all available client locales. As GWT works with a placeholder locale "default", this ensures that only
+ * real locales are returned.
+ *
+ * @return all available client locales
+ */
public static Iterable getAvailableLocales() {
List result = new ArrayList<>();
result.addAll(Arrays.asList(LocaleInfo.getAvailableLocaleNames()));
@@ -20,6 +29,12 @@ public final class GWTLocaleUtil {
return result;
}
+ /**
+ * Returns all available client locales plus a null entry. This is useful where you need to populate UI elements for
+ * all locales plus a fallback entry.
+ *
+ * @return all available client locales plus a null entry
+ */
public static Iterable getAvailableLocalesAndDefault() {
List result = new ArrayList<>();
result.add(null);
@@ -27,10 +42,20 @@ public final class GWTLocaleUtil {
return result;
}
+ /**
+ * @return the count of available client locales (including a default entry)
+ */
public static int getLanguageCountWithDefault() {
return Util.size(getAvailableLocalesAndDefault());
}
+ /**
+ * Renders a locale with it's name in the language itself plus the technical locale name.
+ * For the fallback entry (null) a placeholder is returned instead
+ *
+ * @param localeNameOrNull the locale's name or null for the fallback entry
+ * @return a decorated representation of the locale to be shown on the UI
+ */
public static String getDecoratedLanguageDisplayNameWithDefaultLocaleSupport(String localeNameOrNull) {
if (localeNameOrNull == null || localeNameOrNull.isEmpty()) {
return NO_LOCALE_TEXT;
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/client/formfactor/DeviceDetector.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/client/formfactor/DeviceDetector.java
index 5569893e62b..608455d68d8 100644
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/client/formfactor/DeviceDetector.java
+++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/client/formfactor/DeviceDetector.java
@@ -5,6 +5,16 @@ import java.util.logging.Logger;
import com.google.gwt.regexp.shared.RegExp;
import com.google.gwt.user.client.Window.Navigator;
+/**
+ * Helps to detect different form factors/device categories by analyzing the browser's user agent string. Based on the
+ * browser itself or the name of the operating system it's easy to detect mobile OSes as iOS or Android. Distinguishing
+ * smartphones and tablets is a little bit more complex because you need to analyze common device ID patterns for known
+ * tablets of various companies as Samsung or Sony.
+ *
+ * By now, it's not possible to ask the browser about the device or even the physical size of the device or browser
+ * window. It's also not possible to render an element with CSS size "1cm" or "1in" and read its pixel size in order to
+ * calculate the real size of the screen. This is caused by the fact that at least mobile browsers always fake 96 dpi.
+ */
public class DeviceDetector {
private static Logger LOG = Logger.getLogger(DeviceDetector.class.getName());
@@ -13,6 +23,7 @@ public class DeviceDetector {
private static final RegExp tabletBlacklistRegExp = RegExp.compile(
"iPad|" // Apple ;-)
+ "Nexus 7|Nexus 10|Nexus 9|" // Google Tablets
+ + "Ryu|" // Google Pixel C
+ "PlayBook|" // Blackberry
+ "KFAPWI|" // Kindle Fire HD
+ "FZ-B|" // Panasonic ToughPad
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/imagegallery/Image.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/imagegallery/Image.java
deleted file mode 100644
index e56f312e13a..00000000000
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/imagegallery/Image.java
+++ /dev/null
@@ -1,32 +0,0 @@
-package com.sap.sailing.gwt.common.theme.component.imagegallery;
-
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.dom.client.DivElement;
-import com.google.gwt.dom.client.ImageElement;
-import com.google.gwt.uibinder.client.UiBinder;
-import com.google.gwt.uibinder.client.UiField;
-import com.google.gwt.user.client.ui.Composite;
-import com.google.gwt.user.client.ui.Widget;
-
-public class Image extends Composite {
- private static ImageUiBinder uiBinder = GWT.create(ImageUiBinder.class);
-
- interface ImageUiBinder extends UiBinder {
- }
-
- private final ImageDescriptor imageDescriptor;
-
- @UiField DivElement title;
- @UiField ImageElement image;
-
- public Image(ImageDescriptor imageDescriptor) {
- this.imageDescriptor = imageDescriptor;
-
- ImageGalleryResources.INSTANCE.css().ensureInjected();
-
- initWidget(uiBinder.createAndBindUi(this));
-
- title.setInnerText(this.imageDescriptor.getTitle());
- image.setSrc(this.imageDescriptor.getImageURL());
- }
-}
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/imagegallery/Image.ui.xml b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/imagegallery/Image.ui.xml
deleted file mode 100644
index 03c905c2a93..00000000000
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/imagegallery/Image.ui.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
![]()
-
-
-
-
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/imagegallery/ImageDescriptor.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/imagegallery/ImageDescriptor.java
deleted file mode 100644
index fdd0f4c0d83..00000000000
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/imagegallery/ImageDescriptor.java
+++ /dev/null
@@ -1,102 +0,0 @@
-package com.sap.sailing.gwt.common.theme.component.imagegallery;
-
-import java.util.Date;
-
-public class ImageDescriptor {
- private String title;
- private String subtitle;
- private Date createdAtDate;
- private String author;
-
- private int widthInPx;
- private int heightInPx;
- private String imageURL;
-
- private String thumbnailURL;
- private int thumbnailWidthInPx;
- private int thumbnailHeightInPx;
-
- public ImageDescriptor(String imageURL) {
- this.imageURL = imageURL;
- }
-
- public String getTitle() {
- return title;
- }
-
- public void setTitle(String title) {
- this.title = title;
- }
-
- public Date getCreatedAtDate() {
- return createdAtDate;
- }
-
- public void setCreatedAtDate(Date createdAtDate) {
- this.createdAtDate = createdAtDate;
- }
-
- public String getAuthor() {
- return author;
- }
-
- public void setAuthor(String author) {
- this.author = author;
- }
-
- public int getWidthInPx() {
- return widthInPx;
- }
-
- public void setWidthInPx(int widthInPx) {
- this.widthInPx = widthInPx;
- }
-
- public int getHeightInPx() {
- return heightInPx;
- }
-
- public void setHeightInPx(int heightInPx) {
- this.heightInPx = heightInPx;
- }
-
- public String getThumbnailURL() {
- return thumbnailURL;
- }
-
- public void setThumbnailURL(String thumbnailURL) {
- this.thumbnailURL = thumbnailURL;
- }
-
- public String getImageURL() {
- return imageURL;
- }
-
- public void setImageURL(String imageURL) {
- this.imageURL = imageURL;
- }
-
- public int getThumbnailWidthInPx() {
- return thumbnailWidthInPx;
- }
-
- public void setThumbnailWidthInPx(int thumbnailWidthInPx) {
- this.thumbnailWidthInPx = thumbnailWidthInPx;
- }
-
- public int getThumbnailHeightInPx() {
- return thumbnailHeightInPx;
- }
-
- public void setThumbnailHeightInPx(int thumbnailHeightInPx) {
- this.thumbnailHeightInPx = thumbnailHeightInPx;
- }
-
- public String getSubtitle() {
- return subtitle;
- }
-
- public void setSubtitle(String subtitle) {
- this.subtitle = subtitle;
- }
-}
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/imagegallery/ImageGallery.gss b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/imagegallery/ImageGallery.gss
deleted file mode 100644
index e46fdf65acd..00000000000
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/imagegallery/ImageGallery.gss
+++ /dev/null
@@ -1,2 +0,0 @@
-.sampleCssClass {
-}
\ No newline at end of file
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/imagegallery/ImageGallery.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/imagegallery/ImageGallery.java
deleted file mode 100644
index 5b33a7d7982..00000000000
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/imagegallery/ImageGallery.java
+++ /dev/null
@@ -1,42 +0,0 @@
-package com.sap.sailing.gwt.common.theme.component.imagegallery;
-
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.dom.client.DivElement;
-import com.google.gwt.uibinder.client.UiBinder;
-import com.google.gwt.uibinder.client.UiField;
-import com.google.gwt.user.client.ui.Composite;
-import com.google.gwt.user.client.ui.HTMLPanel;
-import com.google.gwt.user.client.ui.Widget;
-
-public class ImageGallery extends Composite {
- private static ImageGalleryUiBinder uiBinder = GWT.create(ImageGalleryUiBinder.class);
-
- interface ImageGalleryUiBinder extends UiBinder {
- }
-
- private ImageGalleryData imageGalleryData;
-
- @UiField DivElement titleUi;
- @UiField HTMLPanel imagesPanel;
-
- public ImageGallery() {
- ImageGalleryResources.INSTANCE.css().ensureInjected();
-
- initWidget(uiBinder.createAndBindUi(this));
- }
-
- public ImageGallery(ImageGalleryData data) {
- this();
- setData(data);
- }
-
- public void setData(ImageGalleryData data) {
- this.imageGalleryData = data;
- titleUi.setInnerText(this.imageGalleryData.getName() != null ? this.imageGalleryData.getName() : "");
-
- for(ImageDescriptor imageDesc: imageGalleryData.getImages()) {
- Image image = new Image(imageDesc);
- imagesPanel.add(image);
- }
- }
-}
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/imagegallery/ImageGallery.ui.xml b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/imagegallery/ImageGallery.ui.xml
deleted file mode 100644
index 41e8f10894f..00000000000
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/imagegallery/ImageGallery.ui.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/imagegallery/ImageGalleryData.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/imagegallery/ImageGalleryData.java
deleted file mode 100644
index 6d95f941b78..00000000000
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/imagegallery/ImageGalleryData.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package com.sap.sailing.gwt.common.theme.component.imagegallery;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class ImageGalleryData {
- private String name;
- private List images;
-
- public ImageGalleryData() {
- this("", new ArrayList());
- }
-
- public ImageGalleryData(String name) {
- this(name, new ArrayList());
- }
-
- public ImageGalleryData(String name, List images) {
- this.name = name;
- this.images = images;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public List getImages() {
- return images;
- }
-
- public void setImages(List images) {
- this.images = images;
- }
-}
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/imagegallery/ImageGalleryResources.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/imagegallery/ImageGalleryResources.java
deleted file mode 100644
index b4e3a49fc6e..00000000000
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/imagegallery/ImageGalleryResources.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package com.sap.sailing.gwt.common.theme.component.imagegallery;
-
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.resources.client.ClientBundle;
-import com.google.gwt.resources.client.CssResource;
-
-public interface ImageGalleryResources extends ClientBundle {
- public static final ImageGalleryResources INSTANCE = GWT.create(ImageGalleryResources.class);
-
- @Source("ImageGallery.gss")
- LocalCss css();
-
- public interface LocalCss extends CssResource {
- String sampleCssClass();
- }
-}
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/sapfooter/SAPFooter.gss b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/sapfooter/SAPFooter.gss
deleted file mode 100644
index 05a39fd654a..00000000000
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/sapfooter/SAPFooter.gss
+++ /dev/null
@@ -1,55 +0,0 @@
-/**
- * Website footer styling
- */
-.sitefooter {
- font-size: 1rem;
- background: #333;
- border-top: 5px solid #fff;
- color: #fff;
- line-height: 5em;
- width: 100%;
- padding: 0 1.333333333333333em;
-}
-.sitefooter_copyright {
- font-weight: 600;
- margin-right: 2em;
-}
-@media (min-width: 45em) {
- .sitefooter_copyright {
- float: left;
- }
-}
-.sitefooter_links {
- text-align: left;
- font-size: 1em;
- font-weight: 600;
- text-transform: uppercase;
-}
-.sitefooter_links_link {
- display: block;
- color: #fff;
- text-decoration: none;
- margin-right: 2em;
-}
-.sitefooter_links_link:last-child {
- margin-right: 0;
-}
-@media (min-width: 45em) {
- .sitefooter_links_link {
- display: inline-block;
- }
-}
-.sitefooter_language {
- text-align: left;
-}
-@media (min-width: 45em) {
- .sitefooter_language {
- text-align: right;
- }
-}
-.sitefooter_language_link {
- color: #f0ab00;
- display: inline-block;
- cursor: pointer;
- margin-left: 0.666666666666667em;
-}
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/sapfooter/SAPFooter.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/sapfooter/SAPFooter.java
deleted file mode 100644
index 2eb17b06120..00000000000
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/sapfooter/SAPFooter.java
+++ /dev/null
@@ -1,68 +0,0 @@
-package com.sap.sailing.gwt.common.theme.component.sapfooter;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.dom.client.DivElement;
-import com.google.gwt.event.dom.client.ClickEvent;
-import com.google.gwt.http.client.UrlBuilder;
-import com.google.gwt.i18n.client.LocaleInfo;
-import com.google.gwt.uibinder.client.UiBinder;
-import com.google.gwt.uibinder.client.UiField;
-import com.google.gwt.uibinder.client.UiHandler;
-import com.google.gwt.user.client.Window;
-import com.google.gwt.user.client.Window.Location;
-import com.google.gwt.user.client.ui.Anchor;
-import com.google.gwt.user.client.ui.Composite;
-import com.google.gwt.user.client.ui.Widget;
-
-public class SAPFooter extends Composite {
- private static SAPFooterPanelUiBinder uiBinder = GWT.create(SAPFooterPanelUiBinder.class);
-
- interface SAPFooterPanelUiBinder extends UiBinder {
- }
-
- @UiField Anchor changeLanguageLink;
- @UiField DivElement languageSelectionDiv;
-
- private final Map localeAndLanguages;
-
- public SAPFooter() {
- localeAndLanguages = new HashMap();
- localeAndLanguages.put("default", "English");
- localeAndLanguages.put("de", "Deutsch");
-
- SAPFooterResources.INSTANCE.css().ensureInjected();
-
- initWidget(uiBinder.createAndBindUi(this));
-
- updateUI();
- }
-
- @UiHandler("changeLanguageLink")
- public void changeLanguage(ClickEvent e) {
- String selectedLanguage = changeLanguageLink.getText();
- String selectedLocale = null;
- for (Entry entry: localeAndLanguages.entrySet()) {
- if (entry.getValue().equals(selectedLanguage)) {
- selectedLocale = entry.getKey();
- }
- }
- if(selectedLocale != null) {
- UrlBuilder builder = Location.createUrlBuilder().setParameter("locale", selectedLocale);
- Window.Location.replace(builder.buildString());
- }
- }
-
- private void updateUI() {
- LocaleInfo currentLocale = LocaleInfo.getCurrentLocale();
- HashMap languagesToSelectFrom = new HashMap(localeAndLanguages);
- languagesToSelectFrom.remove(currentLocale.getLocaleName());
-
- if(languagesToSelectFrom.size() == 1) {
- changeLanguageLink.setText(languagesToSelectFrom.values().iterator().next());
- }
- }
-}
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/sapfooter/SAPFooter.ui.xml b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/sapfooter/SAPFooter.ui.xml
deleted file mode 100644
index b3aadc99bb2..00000000000
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/sapfooter/SAPFooter.ui.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/sapfooter/SAPFooterResources.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/sapfooter/SAPFooterResources.java
deleted file mode 100644
index 68f9a4a0459..00000000000
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/sapfooter/SAPFooterResources.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package com.sap.sailing.gwt.common.theme.component.sapfooter;
-
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.resources.client.ClientBundle;
-import com.google.gwt.resources.client.CssResource;
-
-public interface SAPFooterResources extends ClientBundle {
- public static final SAPFooterResources INSTANCE = GWT.create(SAPFooterResources.class);
-
- @Source("SAPFooter.gss")
- LocalCss css();
-
- public interface LocalCss extends CssResource {
- String sitefooter();
- String sitefooter_copyright();
- String sitefooter_links();
- String sitefooter_links_link();
- String sitefooter_language();
- String sitefooter_language_link();
- }
-}
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/videogallery/VideoDescriptor.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/videogallery/VideoDescriptor.java
deleted file mode 100644
index 7fc38369f17..00000000000
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/videogallery/VideoDescriptor.java
+++ /dev/null
@@ -1,102 +0,0 @@
-package com.sap.sailing.gwt.common.theme.component.videogallery;
-
-import java.util.Date;
-
-public class VideoDescriptor {
- private String title;
- private String subtitle;
- private Date createdAtDate;
- private String author;
-
- private int widthInPx;
- private int heightInPx;
- private String videoURL;
-
- private String thumbnailURL;
- private int thumbnailWidthInPx;
- private int thumbnailHeightInPx;
-
- public VideoDescriptor(String videoURL) {
- this.videoURL = videoURL;
- }
-
- public String getTitle() {
- return title;
- }
-
- public void setTitle(String title) {
- this.title = title;
- }
-
- public Date getCreatedAtDate() {
- return createdAtDate;
- }
-
- public void setCreatedAtDate(Date createdAtDate) {
- this.createdAtDate = createdAtDate;
- }
-
- public String getAuthor() {
- return author;
- }
-
- public void setAuthor(String author) {
- this.author = author;
- }
-
- public int getWidthInPx() {
- return widthInPx;
- }
-
- public void setWidthInPx(int widthInPx) {
- this.widthInPx = widthInPx;
- }
-
- public int getHeightInPx() {
- return heightInPx;
- }
-
- public void setHeightInPx(int heightInPx) {
- this.heightInPx = heightInPx;
- }
-
- public String getThumbnailURL() {
- return thumbnailURL;
- }
-
- public void setThumbnailURL(String thumbnailURL) {
- this.thumbnailURL = thumbnailURL;
- }
-
- public String getVideoURL() {
- return videoURL;
- }
-
- public void setVideoURL(String videoURL) {
- this.videoURL = videoURL;
- }
-
- public int getThumbnailWidthInPx() {
- return thumbnailWidthInPx;
- }
-
- public void setThumbnailWidthInPx(int thumbnailWidthInPx) {
- this.thumbnailWidthInPx = thumbnailWidthInPx;
- }
-
- public int getThumbnailHeightInPx() {
- return thumbnailHeightInPx;
- }
-
- public void setThumbnailHeightInPx(int thumbnailHeightInPx) {
- this.thumbnailHeightInPx = thumbnailHeightInPx;
- }
-
- public String getSubtitle() {
- return subtitle;
- }
-
- public void setSubtitle(String subtitle) {
- this.subtitle = subtitle;
- }
-}
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/videogallery/VideoGallery.gss b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/videogallery/VideoGallery.gss
deleted file mode 100644
index e46fdf65acd..00000000000
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/videogallery/VideoGallery.gss
+++ /dev/null
@@ -1,2 +0,0 @@
-.sampleCssClass {
-}
\ No newline at end of file
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/videogallery/VideoGallery.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/videogallery/VideoGallery.java
deleted file mode 100644
index aef4331a35e..00000000000
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/videogallery/VideoGallery.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package com.sap.sailing.gwt.common.theme.component.videogallery;
-
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.dom.client.DivElement;
-import com.google.gwt.uibinder.client.UiBinder;
-import com.google.gwt.uibinder.client.UiField;
-import com.google.gwt.user.client.ui.Composite;
-import com.google.gwt.user.client.ui.Widget;
-
-public class VideoGallery extends Composite {
- private static VideoGalleryUiBinder uiBinder = GWT.create(VideoGalleryUiBinder.class);
-
- interface VideoGalleryUiBinder extends UiBinder {
- }
-
- private VideoGalleryData videoGalleryData;
-
- @UiField DivElement galleryTitle;
-
- public VideoGallery() {
- VideoGalleryResources.INSTANCE.css().ensureInjected();
-
- initWidget(uiBinder.createAndBindUi(this));
- }
-
- public VideoGallery(VideoGalleryData data) {
- this();
- setData(data);
- }
-
- public void setData(VideoGalleryData data) {
- this.videoGalleryData = data;
-
- galleryTitle.setInnerText(this.videoGalleryData.getName() != null ? this.videoGalleryData.getName() : "");
- }
-}
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/videogallery/VideoGallery.ui.xml b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/videogallery/VideoGallery.ui.xml
deleted file mode 100644
index 2e3e7024591..00000000000
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/videogallery/VideoGallery.ui.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
- Video gallery...
-
-
-
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/videogallery/VideoGalleryData.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/videogallery/VideoGalleryData.java
deleted file mode 100644
index 28e4e8106e3..00000000000
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/videogallery/VideoGalleryData.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package com.sap.sailing.gwt.common.theme.component.videogallery;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class VideoGalleryData {
- private String name;
- private List videos;
-
- public VideoGalleryData() {
- this("", new ArrayList());
- }
-
- public VideoGalleryData(String name) {
- this(name, new ArrayList());
- }
-
- public VideoGalleryData(String name, List videos) {
- this.name = name;
- this.videos = videos;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public List getVideos() {
- return videos;
- }
-
- public void setVideos(List videos) {
- this.videos = videos;
- }
-}
\ No newline at end of file
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/videogallery/VideoGalleryResources.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/videogallery/VideoGalleryResources.java
deleted file mode 100644
index 2bea511ecd9..00000000000
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/common/theme/component/videogallery/VideoGalleryResources.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package com.sap.sailing.gwt.common.theme.component.videogallery;
-
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.resources.client.ClientBundle;
-import com.google.gwt.resources.client.CssResource;
-
-public interface VideoGalleryResources extends ClientBundle {
- public static final VideoGalleryResources INSTANCE = GWT.create(VideoGalleryResources.class);
-
- @Source("VideoGallery.gss")
- LocalCss css();
-
- public interface LocalCss extends CssResource {
- String sampleCssClass();
- }
-}
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/SailingAction.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/SailingAction.java
index 6916c74c908..8ab40468887 100644
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/SailingAction.java
+++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/SailingAction.java
@@ -5,9 +5,14 @@ import com.sap.sse.gwt.dispatch.shared.commands.Action;
import com.sap.sse.gwt.dispatch.shared.commands.Result;
import com.sap.sse.gwt.dispatch.shared.exceptions.DispatchException;
+/**
+ * Extended {@link Action} interface, which requires a {@link SailingDispatchContext} for server-side execution.
+ *
+ * @param
+ * {@link Result} type provided by the actions {@link #execute(SailingDispatchContext)} method
+ */
public interface SailingAction extends Action {
@GwtIncompatible
R execute(SailingDispatchContext ctx) throws DispatchException;
-
}
\ No newline at end of file
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/SailingDispatchContext.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/SailingDispatchContext.java
index a7233e60d5e..f17c2ba6bb3 100644
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/SailingDispatchContext.java
+++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/SailingDispatchContext.java
@@ -8,7 +8,10 @@ import com.sap.sailing.news.EventNewsService;
import com.sap.sailing.server.RacingEventService;
import com.sap.sse.gwt.dispatch.client.system.DispatchContext;
-
+/**
+ * {@link DispatchContext} implementation, which is passed to backend-side {@link SailingAction} executions to provide
+ * access to the required services related to the sailing domain.
+ */
public interface SailingDispatchContext extends DispatchContext {
@GwtIncompatible
RacingEventService getRacingEventService();
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetCompetitionFormatRacesAction.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetCompetitionFormatRacesAction.java
index bfc213fe9dd..7479b838571 100644
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetCompetitionFormatRacesAction.java
+++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetCompetitionFormatRacesAction.java
@@ -13,6 +13,18 @@ import com.sap.sse.gwt.dispatch.shared.commands.ListResult;
import com.sap.sse.gwt.dispatch.shared.commands.ResultWithTTL;
import com.sap.sse.gwt.dispatch.shared.exceptions.DispatchException;
+/**
+ *
+ * {@link SailingAction} implementation to load data to be shown in the competition format races view for the
+ * {@link #GetCompetitionFormatRacesAction(UUID, String) given event- and regatta-id}, using a
+ * {@link RaceCompetitionFormatDataCalculator} to prepare the appropriate data structure.
+ *
+ *
+ * The {@link ResultWithTTL result's} time to live
+ * {@link EventActionUtil#getEventStateDependentTTL(SailingDispatchContext, UUID, Duration) depends on the event's
+ * state} using a duration of 1 minute for currently running events.
+ *
+ */
public class GetCompetitionFormatRacesAction implements
SailingAction>>, IsClientCacheable {
@@ -22,6 +34,12 @@ public class GetCompetitionFormatRacesAction implements
protected GetCompetitionFormatRacesAction() {
}
+ /**
+ * Creates a {@link GetCompetitionFormatRacesAction} instance for the given event and regatta-id.
+ *
+ * @param eventId {@link UUID} of the event to load races for
+ * @param regattaId {@link String id} of the regatta to load races for
+ */
public GetCompetitionFormatRacesAction(UUID eventId, String regattaId) {
this.eventId = eventId;
this.regattaId = regattaId;
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetEventListViewAction.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetEventListViewAction.java
index 81741e5ad66..d33f1507d2c 100644
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetEventListViewAction.java
+++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetEventListViewAction.java
@@ -8,6 +8,12 @@ import com.sap.sailing.gwt.server.EventListDataCalculator;
import com.sap.sailing.gwt.server.HomeServiceUtil;
import com.sap.sse.gwt.dispatch.shared.caching.IsClientCacheable;
+/**
+ *
+ * {@link SailingAction} implementation to load data to be shown in the events list overview, using a
+ * {@link EventListDataCalculator} to prepare the appropriate data structure.
+ *
+ */
public class GetEventListViewAction implements SailingAction, IsClientCacheable {
@Override
@GwtIncompatible
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetFinishedRacesAction.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetFinishedRacesAction.java
index ee5a8df3853..c172a7d24a1 100644
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetFinishedRacesAction.java
+++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetFinishedRacesAction.java
@@ -12,6 +12,18 @@ import com.sap.sse.gwt.dispatch.shared.caching.IsClientCacheable;
import com.sap.sse.gwt.dispatch.shared.commands.ResultWithTTL;
import com.sap.sse.gwt.dispatch.shared.commands.SortedSetResult;
+/**
+ *
+ * {@link SailingAction} implementation to load data to be shown in the finished races section for the
+ * {@link #GetFinishedRacesAction(UUID, String) given event- and regatta-id}, using a {@link RaceListDataCalculator} to
+ * prepare the appropriate data structure.
+ *
+ *
+ * The {@link ResultWithTTL result's} time to live
+ * {@link EventActionUtil#getEventStateDependentTTL(SailingDispatchContext, UUID, Duration) depends on the event's
+ * state} using a duration of 5 minutes for currently running events.
+ *
+ */
public class GetFinishedRacesAction implements SailingAction>>,
IsClientCacheable {
@@ -22,6 +34,12 @@ public class GetFinishedRacesAction implements SailingAction
+ * {@link SailingAction} implementation to load data to be shown in the live races section for the
+ * {@link #GetLiveRacesForEventAction(UUID) given event-id}, using a {@link LiveRaceCalculator} to prepare the
+ * appropriate data structure.
+ *
+ *
+ * The {@link ResultWithTTL result's} time to live is calculated using the {@link LiveRaceCalculator}'s internal
+ * {@link com.sap.sailing.gwt.home.server.RaceRefreshCalculator}, which is called for every race in the event.
+ *
+ *
+ * NOTE: Because there can only be live races in currently running events, this action returns an empty
+ * {@link ResultWithTTL result} with a {@link EventActionUtil#calculateTtlForNonLiveEvent(Event, EventState)
+ * state-dependent} time to live, if the {@link Event} for the given id is not currently running.
+ *
+ */
public class GetLiveRacesForEventAction implements SailingAction>>,
IsClientCacheable {
private UUID eventId;
@@ -21,6 +37,12 @@ public class GetLiveRacesForEventAction implements SailingAction
+ * {@link SailingAction} implementation to load data to be shown in the live races section for the
+ * {@link #GetLiveRacesForRegattaAction(UUID, String) given event-id and regatta name}, using a
+ * {@link LiveRaceCalculator} to prepare the appropriate data structure.
+ *
+ *
+ * The {@link ResultWithTTL result's} time to live is calculated using the {@link LiveRaceCalculator}'s internal
+ * {@link com.sap.sailing.gwt.home.server.RaceRefreshCalculator}, which is called for every race in the regatta.
+ *
+ *
+ * NOTE: Because there can only be live races in currently running events, this action returns an empty
+ * {@link ResultWithTTL result} with a {@link EventActionUtil#calculateTtlForNonLiveEvent(Event, EventState)
+ * state-dependent} time to live, if the {@link Event} for the given id is not currently running.
+ *
+ */
public class GetLiveRacesForRegattaAction implements SailingAction>>,
IsClientCacheable {
private UUID eventId;
@@ -21,7 +37,13 @@ public class GetLiveRacesForRegattaAction implements SailingAction
+ * {@link SailingAction} implementation to load data to be shown on the event overview or regattas page for the
+ * {@link #GetRegattaListViewAction(UUID) given event-id}, preparing the appropriate data structure.
+ *
+ *
+ * The {@link ResultWithTTL result's} time to live
+ * {@link EventActionUtil#getEventStateDependentTTL(SailingDispatchContext, UUID, Duration) depends on the event's
+ * state} using a duration of 3 minutes for currently running events.
+ *
+ */
public class GetRegattaListViewAction implements SailingAction>>,
IsClientCacheable {
private UUID eventId;
@@ -24,6 +35,12 @@ public class GetRegattaListViewAction implements SailingAction
+ * {@link SailingAction} implementation to load data to be shown in the statistics sections for the
+ * {@link #GetRegattaStatisticsAction(UUID) given event- and regatta-id}, using a {@link StatisticsCalculator} to prepare
+ * the appropriate data structure.
+ *
+ *
+ * The {@link ResultWithTTL result's} time to live is 5 minutes.
+ *
+ */
public class GetRegattaStatisticsAction implements SailingAction>, IsClientCacheable {
private UUID eventId;
@@ -20,6 +30,12 @@ public class GetRegattaStatisticsAction implements SailingAction
+ * {@link SailingAction} implementation to load data to be shown on the regatta overview page for the
+ * {@link #GetRegattaWithProgressAction(UUID, String) given event- and regatta-id}, using a
+ * {@link RaceCompetitionFormatDataCalculator} to prepare the appropriate data structure.
+ *
+ *
+ * The {@link ResultWithTTL result's} time to live
+ * {@link EventActionUtil#getEventStateDependentTTL(SailingDispatchContext, UUID, Duration) depends on the event's
+ * state} using a duration of 5 minutes for currently running events.
+ *
+ */
public class GetRegattaWithProgressAction implements SailingAction>, IsClientCacheable {
private UUID eventId;
@@ -20,6 +33,12 @@ public class GetRegattaWithProgressAction implements SailingAction
+ * {@link SailingAction} implementation to load data to be shown on the mobile event overview page for the
+ * {@link #GetRegattasAndLiveRacesForEventAction(UUID) given event-id}, preparing the appropriate data structure.
+ *
+ *
+ * The {@link ResultWithTTL result's} time to live is 2 minutes for upcoming and currently running events,
+ * otherwise it {@link EventActionUtil#calculateTtlForNonLiveEvent(Event, EventState) depends on the event's state}.
+ *
+ */
public class GetRegattasAndLiveRacesForEventAction implements SailingAction>,
IsClientCacheable {
private UUID eventId;
@@ -30,6 +40,12 @@ public class GetRegattasAndLiveRacesForEventAction implements SailingAction
+ * {@link SailingAction} implementation to load data to be shown in the statistics sections for the
+ * {@link #GetSeriesStatisticsAction(UUID) given series-id}, using a {@link StatisticsCalculator} to prepare the
+ * appropriate data structure.
+ *
+ *
+ * The {@link ResultWithTTL result's} time to live is 5 minutes.
+ *
+ */
public class GetSeriesStatisticsAction implements SailingAction>, IsClientCacheable {
private UUID seriesId;
@@ -19,6 +30,12 @@ public class GetSeriesStatisticsAction implements SailingAction
+ * {@link SailingAction} implementation to load data to be shown in compact leaderboard (e.g. on the event overview
+ * page) for the {@link #GetMiniLeaderbordAction(UUID, String) given event-id and leaderboard name}, where the amount of
+ * loaded entries can optionally be {@link #GetMiniLeaderbordAction(UUID, String, int) limited}.
+ *
+ *
+ * The {@link ResultWithTTL result's} time to live is 1 minute for currently running events, 2 minutes
+ * otherwise.
+ *
+ */
public class GetMiniLeaderbordAction implements SailingAction>, IsClientCacheable {
private UUID eventId;
private String leaderboardName;
@@ -18,10 +30,30 @@ public class GetMiniLeaderbordAction implements SailingAction
+ * {@link SailingAction} implementation to load data to be shown in compact leaderboard (e.g. on the series overview
+ * page) for the {@link #GetMiniOverallLeaderbordAction(UUID) given series-id}, where the amount of loaded entries can
+ * optionally be {@link #GetMiniOverallLeaderbordAction(UUID, int) limited}.
+ *
+ *
+ * The {@link ResultWithTTL result's} time to live is 1 minute for currently running events, 2 minutes
+ * otherwise.
+ *
+ */
public class GetMiniOverallLeaderbordAction implements SailingAction>, IsClientCacheable {
private UUID seriesId;
private int limit = 0;
@@ -17,10 +28,26 @@ public class GetMiniOverallLeaderbordAction implements SailingAction
+ * {@link SailingAction} implementation to load data to be shown in the news ticker section for the
+ * {@link #GetEventOverviewNewsAction(UUID) given event-id}, where the amount of loaded news entries can optionally be
+ * {@link #GetEventOverviewNewsAction(UUID, int) limited}.
+ *
+ *
+ * The {@link ResultWithTTL result's} time to live is 2 minutes for currently running events.
+ *
+ *
+ * NOTE: Because the news ticker section is only shown in currently running events, this action returns an empty
+ * {@link ResultWithTTL result} with a {@link EventActionUtil#calculateTtlForNonLiveEvent(Event, EventState)
+ * state-dependent} time to live, if the {@link Event} for the given id is not currently running.
+ *
+ */
public class GetEventOverviewNewsAction implements SailingAction>>, IsClientCacheable {
private UUID eventId;
/**
@@ -29,10 +45,26 @@ public class GetEventOverviewNewsAction implements SailingAction
+ * {@link SailingAction} implementation to load data to be shown in the statistics sections for the
+ * {@link #GetEventStatisticsAction(UUID) given event-id}, using a {@link StatisticsCalculator} to prepare the
+ * appropriate data structure.
+ *
+ *
+ * The {@link ResultWithTTL result's} time to live is 5 minutes.
+ *
+ */
public class GetEventStatisticsAction implements SailingAction>, IsClientCacheable {
private UUID eventId;
@@ -18,6 +28,12 @@ public class GetEventStatisticsAction implements SailingAction
+ * {@link SailingAction} implementation to load data to be shown in the series list overview for the
+ * {@link #GetEventSeriesViewAction(UUID) given series-id}, preparing the appropriate data structure.
+ *
+ */
public class GetEventSeriesViewAction implements SailingAction, IsClientCacheable {
private UUID id;
@@ -27,6 +33,12 @@ public class GetEventSeriesViewAction implements SailingAction
+ * {@link SailingAction} implementation to load images and videos to be shown on the media page for the
+ * {@link #GetMediaForEventAction(UUID) given event-id}, preparing the appropriate data structure.
+ *
+ */
public class GetMediaForEventAction implements SailingAction, IsClientCacheable {
private UUID eventId;
@@ -23,6 +29,12 @@ public class GetMediaForEventAction implements SailingAction, IsClient
private GetMediaForEventAction() {
}
+ /**
+ * Creates a {@link GetMediaForEventAction} instance for the given event-id.
+ *
+ * @param eventId
+ * {@link UUID} of the event to load media for
+ */
public GetMediaForEventAction(UUID eventId) {
this.eventId = eventId;
}
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/start/GetRecentEventsAction.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/start/GetRecentEventsAction.java
index 1084608c5ad..64cd78cb6d0 100644
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/start/GetRecentEventsAction.java
+++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/start/GetRecentEventsAction.java
@@ -15,6 +15,12 @@ import com.sap.sse.gwt.dispatch.shared.caching.IsClientCacheable;
import com.sap.sse.gwt.dispatch.shared.commands.ListResult;
import com.sap.sse.gwt.dispatch.shared.exceptions.DispatchException;
+/**
+ *
+ * {@link SailingAction} implementation to load recent events to be shown in the event list overview, where
+ * the amount of loaded entries can be {@link #GetRecentEventsAction(int) limited}.
+ *
+ */
public class GetRecentEventsAction implements SailingAction>, IsClientCacheable {
private int limit;
@@ -22,6 +28,12 @@ public class GetRecentEventsAction implements SailingAction {
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/app/DesktopActivityManager.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/app/DesktopActivityManager.java
index db887a2371b..d428c72cc30 100644
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/app/DesktopActivityManager.java
+++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/app/DesktopActivityManager.java
@@ -5,6 +5,10 @@ import com.google.gwt.activity.shared.ActivityMapper;
import com.google.web.bindery.event.shared.EventBus;
import com.sap.sailing.gwt.home.shared.app.SailingActivityManager;
+/**
+ * Ensures that {@link DesktopResettableNavigationPathDisplay} will be correcly informed about the Activity type when
+ * the current activity changes.
+ */
public class DesktopActivityManager extends SailingActivityManager {
public DesktopActivityManager(ActivityMapper mapper, EventBus eventBus) {
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/app/DesktopResettableNavigationPathDisplay.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/app/DesktopResettableNavigationPathDisplay.java
index f34d6fe0a9c..f2429a9e5da 100644
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/app/DesktopResettableNavigationPathDisplay.java
+++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/app/DesktopResettableNavigationPathDisplay.java
@@ -1,7 +1,13 @@
package com.sap.sailing.gwt.home.desktop.app;
+import com.sap.sailing.gwt.home.shared.app.NavigationPathDisplay;
import com.sap.sailing.gwt.home.shared.app.ResettableNavigationPathDisplay;
+/**
+ * In sailing there are two kinds of activities: Ones with header and ones without. Because the header has a gray
+ * background, the {@link NavigationPathDisplay} needs to be set to the exact same background. Activities without header
+ * have white background, so we need to switch this based on the Activity type.
+ */
public interface DesktopResettableNavigationPathDisplay extends ResettableNavigationPathDisplay {
void setWithHeader(boolean withHeader);
}
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/partials/media/MediaPage.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/partials/media/MediaPage.java
index 9a29ccccc9c..634745d1de2 100644
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/partials/media/MediaPage.java
+++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/partials/media/MediaPage.java
@@ -22,6 +22,9 @@ import com.sap.sailing.gwt.ui.client.StringMessages;
import com.sap.sailing.gwt.ui.client.media.GalleryImageHolder;
import com.sap.sailing.gwt.ui.client.media.VideoThumbnail;
+/**
+ * Desktop page to show videos and images as a gallery.
+ */
public class MediaPage extends Composite {
private static MediaPageUiBinder uiBinder = GWT.create(MediaPageUiBinder.class);
@@ -65,6 +68,8 @@ public class MediaPage extends Composite {
photoSectionUi.getStyle().clearDisplay();
String photoCss = null;
+ // To make the image gallery look good, we use different styling if there are only few (<7) images
+ // available. If there are more images, always 4 images are shown in a row.
switch (photosCount) {
case 1:
photoCss = res.mediaCss().medium12();
@@ -139,6 +144,12 @@ public class MediaPage extends Composite {
}
}
+ /**
+ * Shows a selected video in the big viewer.
+ *
+ * @param video the video to show in the big viewer
+ * @param autoplay true, if the video should play automatically, false otherwise
+ */
private void putVideoOnDisplay(final SailingVideoDTO video, boolean autoplay) {
videoDisplayUi = new VideoWithLowerThird(true, autoplay);
videoDisplayUi.setVideo(video);
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/partials/media/SailingFullscreenViewer.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/partials/media/SailingFullscreenViewer.java
index 158540ea0b2..f41d6dd02fa 100644
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/partials/media/SailingFullscreenViewer.java
+++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/partials/media/SailingFullscreenViewer.java
@@ -9,6 +9,10 @@ import com.sap.sailing.gwt.home.communication.media.SailingImageDTO;
import com.sap.sailing.gwt.home.shared.partials.fullscreen.FullscreenContainer;
import com.sap.sse.gwt.client.controls.carousel.ImageCarousel.FullscreenViewer;
+/**
+ * Fullscreen viewer for the image gallery that shows the current image in a big view and lists all images on the bottom
+ * as small slider.
+ */
public class SailingFullscreenViewer extends FullscreenContainer implements
FullscreenViewer {
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/places/event/AbstractEventActivity.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/places/event/AbstractEventActivity.java
index e19a7d188be..ef7f47ba72b 100755
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/places/event/AbstractEventActivity.java
+++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/places/event/AbstractEventActivity.java
@@ -40,6 +40,12 @@ import com.sap.sailing.gwt.ui.raceboard.RaceBoardPerspectiveSettings;
import com.sap.sse.gwt.client.player.Timer;
import com.sap.sse.gwt.client.player.Timer.PlayModes;
+/**
+ * Base Activity for all desktop event pages. This includes the event page itself for multi-regatta events as well as
+ * regatta/single-regatta-event pages.
+ *
+ * @param The concrete {@link AbstractEventPlace} subclass, this instance is bound to.
+ */
public abstract class AbstractEventActivity extends AbstractActivity implements
EventView.Presenter {
@@ -57,6 +63,12 @@ public abstract class AbstractEventActivity ex
protected final EventViewDTO eventDTO;
+ /**
+ * @param place the place of the tab to be activated
+ * @param eventDTO the basic event data
+ * @param clientFactory the {@link EventClientFactory} to use
+ * @param homePlacesNavigator the {@link DesktopPlacesNavigator} to use to navigate to other places in the application
+ */
public AbstractEventActivity(PLACE place, EventViewDTO eventDTO, EventClientFactory clientFactory, DesktopPlacesNavigator homePlacesNavigator) {
this.currentPlace = place;
this.eventDTO = eventDTO;
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/places/event/multiregatta/EventMultiregattaActivity.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/places/event/multiregatta/EventMultiregattaActivity.java
index 07ee5a3edeb..7e47928bfcf 100644
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/places/event/multiregatta/EventMultiregattaActivity.java
+++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/places/event/multiregatta/EventMultiregattaActivity.java
@@ -12,6 +12,11 @@ import com.sap.sailing.gwt.home.shared.app.NavigationPathDisplay;
import com.sap.sailing.gwt.home.shared.app.NavigationPathDisplay.NavigationItem;
import com.sap.sailing.gwt.ui.client.StringMessages;
+/**
+ * Base Activity for all desktop multi-regatta-event pages.
+ *
+ * @param The concrete {@link AbstractMultiregattaEventPlace} subclass, this instance is bound to.
+ */
public class EventMultiregattaActivity extends AbstractEventActivity implements EventMultiregattaView.Presenter {
private EventMultiregattaView currentView = new TabletAndDesktopMultiRegattaEventView();
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/places/event/multiregatta/mediatab/MultiregattaMediaPlace.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/places/event/multiregatta/mediatab/MultiregattaMediaPlace.java
index d017f174be3..12188404b8f 100644
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/places/event/multiregatta/mediatab/MultiregattaMediaPlace.java
+++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/places/event/multiregatta/mediatab/MultiregattaMediaPlace.java
@@ -2,12 +2,12 @@ package com.sap.sailing.gwt.home.desktop.places.event.multiregatta.mediatab;
import com.google.gwt.place.shared.Prefix;
import com.sap.sailing.gwt.home.desktop.places.event.multiregatta.AbstractMultiregattaEventPlace;
-import com.sap.sailing.gwt.home.shared.app.MobileSupport;
+import com.sap.sailing.gwt.home.shared.app.HasMobileVersion;
import com.sap.sailing.gwt.home.shared.places.PlaceTokenPrefixes;
import com.sap.sailing.gwt.home.shared.places.event.AbstractEventPlace;
import com.sap.sailing.gwt.home.shared.places.event.EventContext;
-public class MultiregattaMediaPlace extends AbstractMultiregattaEventPlace implements MobileSupport {
+public class MultiregattaMediaPlace extends AbstractMultiregattaEventPlace implements HasMobileVersion {
public MultiregattaMediaPlace(String id) {
super(id);
}
@@ -23,9 +23,4 @@ public class MultiregattaMediaPlace extends AbstractMultiregattaEventPlace imple
return new MultiregattaMediaPlace(context);
}
}
-
- @Override
- public boolean hasMobileVersion() {
- return true;
- }
}
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/places/event/regatta/EventRegattaActivity.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/places/event/regatta/EventRegattaActivity.java
index 04598a7de12..07b77da5c7e 100644
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/places/event/regatta/EventRegattaActivity.java
+++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/places/event/regatta/EventRegattaActivity.java
@@ -8,11 +8,11 @@ import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.AcceptsOneWidget;
import com.sap.sailing.gwt.home.communication.event.EventReferenceDTO;
import com.sap.sailing.gwt.home.communication.eventview.EventViewDTO;
+import com.sap.sailing.gwt.home.communication.eventview.EventViewDTO.EventType;
import com.sap.sailing.gwt.home.communication.eventview.HasRegattaMetadata;
+import com.sap.sailing.gwt.home.communication.eventview.HasRegattaMetadata.RegattaState;
import com.sap.sailing.gwt.home.communication.eventview.RegattaMetadataDTO;
import com.sap.sailing.gwt.home.communication.eventview.RegattaReferenceDTO;
-import com.sap.sailing.gwt.home.communication.eventview.EventViewDTO.EventType;
-import com.sap.sailing.gwt.home.communication.eventview.HasRegattaMetadata.RegattaState;
import com.sap.sailing.gwt.home.desktop.app.DesktopPlacesNavigator;
import com.sap.sailing.gwt.home.desktop.places.event.AbstractEventActivity;
import com.sap.sailing.gwt.home.desktop.places.event.EventClientFactory;
@@ -20,8 +20,8 @@ import com.sap.sailing.gwt.home.desktop.places.event.EventView;
import com.sap.sailing.gwt.home.desktop.places.event.EventView.PlaceCallback;
import com.sap.sailing.gwt.home.desktop.places.event.regatta.overviewtab.RegattaOverviewPlace;
import com.sap.sailing.gwt.home.shared.app.NavigationPathDisplay;
-import com.sap.sailing.gwt.home.shared.app.PlaceNavigation;
import com.sap.sailing.gwt.home.shared.app.NavigationPathDisplay.NavigationItem;
+import com.sap.sailing.gwt.home.shared.app.PlaceNavigation;
import com.sap.sailing.gwt.home.shared.places.event.EventContext;
import com.sap.sailing.gwt.ui.client.StringMessages;
import com.sap.sse.gwt.client.async.AsyncActionsExecutor;
@@ -30,6 +30,13 @@ import com.sap.sse.gwt.client.player.Timer.PlayModes;
import com.sap.sse.gwt.client.player.Timer.PlayStates;
import com.sap.sse.gwt.client.useragent.UserAgentDetails;
+/**
+ * Base Activity for all desktop single-regatta-event/series-event pages as well as the pages for one regatta of a
+ * multi-regatta-event.
+ *
+ * @param
+ * The concrete {@link AbstractEventRegattaPlace} subclass, this instance is bound to.
+ */
public class EventRegattaActivity extends AbstractEventActivity implements EventRegattaView.Presenter {
private EventRegattaView currentView = new TabletAndDesktopRegattaEventView();
private final UserAgentDetails userAgent = new UserAgentDetails(Window.Navigator.getUserAgent());
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/places/event/regatta/mediatab/RegattaMediaPlace.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/places/event/regatta/mediatab/RegattaMediaPlace.java
index 7c08099a4af..4c8e7d1b04a 100644
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/places/event/regatta/mediatab/RegattaMediaPlace.java
+++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/places/event/regatta/mediatab/RegattaMediaPlace.java
@@ -2,12 +2,12 @@ package com.sap.sailing.gwt.home.desktop.places.event.regatta.mediatab;
import com.google.gwt.place.shared.Prefix;
import com.sap.sailing.gwt.home.desktop.places.event.regatta.AbstractEventRegattaPlace;
-import com.sap.sailing.gwt.home.shared.app.MobileSupport;
+import com.sap.sailing.gwt.home.shared.app.HasMobileVersion;
import com.sap.sailing.gwt.home.shared.places.PlaceTokenPrefixes;
import com.sap.sailing.gwt.home.shared.places.event.AbstractEventPlace;
import com.sap.sailing.gwt.home.shared.places.event.EventContext;
-public class RegattaMediaPlace extends AbstractEventRegattaPlace implements MobileSupport {
+public class RegattaMediaPlace extends AbstractEventRegattaPlace implements HasMobileVersion {
public RegattaMediaPlace(String id, String regattaId) {
super(id, regattaId);
}
@@ -29,9 +29,4 @@ public class RegattaMediaPlace extends AbstractEventRegattaPlace implements Mobi
return new RegattaMediaPlace(context);
}
}
-
- @Override
- public boolean hasMobileVersion() {
- return true;
- }
}
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/places/event/regatta/racestab/RegattaRacesPlace.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/places/event/regatta/racestab/RegattaRacesPlace.java
index 05c2be9c32f..574760b72cb 100644
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/places/event/regatta/racestab/RegattaRacesPlace.java
+++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/places/event/regatta/racestab/RegattaRacesPlace.java
@@ -2,12 +2,12 @@ package com.sap.sailing.gwt.home.desktop.places.event.regatta.racestab;
import com.google.gwt.place.shared.Prefix;
import com.sap.sailing.gwt.home.desktop.places.event.regatta.AbstractEventRegattaPlace;
-import com.sap.sailing.gwt.home.shared.app.MobileSupport;
+import com.sap.sailing.gwt.home.shared.app.HasMobileVersion;
import com.sap.sailing.gwt.home.shared.places.PlaceTokenPrefixes;
import com.sap.sailing.gwt.home.shared.places.event.AbstractEventPlace;
import com.sap.sailing.gwt.home.shared.places.event.EventContext;
-public class RegattaRacesPlace extends AbstractEventRegattaPlace implements MobileSupport {
+public class RegattaRacesPlace extends AbstractEventRegattaPlace implements HasMobileVersion {
public RegattaRacesPlace(String id, String leaderboardName) {
super(id, leaderboardName);
}
@@ -28,9 +28,4 @@ public class RegattaRacesPlace extends AbstractEventRegattaPlace implements Mobi
return new RegattaRacesPlace(context);
}
}
-
- @Override
- public boolean hasMobileVersion() {
- return true;
- }
}
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/mobile/MobileEntryPoint.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/mobile/MobileEntryPoint.java
index 164aa0175e4..ea5a9c00fe3 100644
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/mobile/MobileEntryPoint.java
+++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/mobile/MobileEntryPoint.java
@@ -9,6 +9,7 @@ import com.google.gwt.user.client.rpc.ServiceDefTarget;
import com.sap.sailing.gwt.common.client.SharedResources;
import com.sap.sailing.gwt.home.mobile.app.MobileActivityMapper;
import com.sap.sailing.gwt.home.mobile.app.MobileApplicationClientFactory;
+import com.sap.sailing.gwt.home.shared.SwitchingEntryPoint;
import com.sap.sailing.gwt.home.shared.app.ApplicationHistoryMapper;
import com.sap.sailing.gwt.home.shared.app.ResettableNavigationPathDisplay;
import com.sap.sailing.gwt.home.shared.app.SailingActivityManager;
@@ -20,6 +21,10 @@ import com.sap.sse.gwt.client.EntryPointHelper;
import com.sap.sse.gwt.client.mvp.AbstractMvpEntryPoint;
import com.sap.sse.gwt.resources.CommonControlsCSS;
+/**
+ * Smartphone EntryPoint for the Home module. Be aware that this EntryPoint isn't directly started but instead the
+ * {@link SwitchingEntryPoint} decides about which version of the application will be shown.
+ */
public class MobileEntryPoint extends AbstractMvpEntryPoint {
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/mobile/partials/footer/Footer.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/mobile/partials/footer/Footer.java
index 0f950aeedaf..a07f9cbce7d 100644
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/mobile/partials/footer/Footer.java
+++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/mobile/partials/footer/Footer.java
@@ -30,6 +30,9 @@ import com.sap.sailing.gwt.home.mobile.app.MobilePlacesNavigator;
import com.sap.sailing.gwt.home.shared.SwitchingEntryPoint;
import com.sap.sse.common.Util.Pair;
+/**
+ * Mobile page footer with several links and the ability to switch the language.
+ */
public class Footer extends Composite {
private static FooterPanelUiBinder uiBinder = GWT.create(FooterPanelUiBinder.class);
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/mobile/partials/header/Header.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/mobile/partials/header/Header.java
index bdc4b894e95..19e1aaa45ee 100644
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/mobile/partials/header/Header.java
+++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/mobile/partials/header/Header.java
@@ -26,6 +26,9 @@ import com.sap.sse.gwt.client.LinkUtil;
import com.sap.sse.security.ui.authentication.AuthenticationContextEvent;
import com.sap.sse.security.ui.authentication.AuthenticationSignOutRequestEvent;
+/**
+ * Mobile page header with SAP logo title and a dropdown menu (burger button) on the right.
+ */
public class Header extends Composite {
// @UiField TextBox searchText;
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/mobile/partials/header/HeaderNavigationItem.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/mobile/partials/header/HeaderNavigationItem.java
index c435e005ca5..5eeeb84c3a6 100644
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/mobile/partials/header/HeaderNavigationItem.java
+++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/mobile/partials/header/HeaderNavigationItem.java
@@ -11,6 +11,9 @@ import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Widget;
+/**
+ * Represents an entry in the header's popup menu.
+ */
public class HeaderNavigationItem extends Widget implements HasClickHandlers {
@UiField
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/server/EventActionUtil.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/server/EventActionUtil.java
index 4b71d62d830..6e548372e1b 100644
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/server/EventActionUtil.java
+++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/server/EventActionUtil.java
@@ -82,6 +82,19 @@ public final class EventActionUtil {
return new LeaderboardContext(context, event, leaderboardGroups, leaderboard);
}
+ /**
+ * Gets or calculates the time to live for the event with the given ID, depending on its
+ * {@link HomeServiceUtil#calculateEventState(com.sap.sailing.domain.base.EventBase) calculated state}.
+ *
+ * @param context
+ * {@link SailingDispatchContext} to retrieve {@link Event}
+ * @param eventId
+ * {@link UUID} of the {@link Event} to get/calculate the time to live for
+ * @param liveTTL
+ * the {@link Duration time to live} to use if the event is currently running
+ * @return the given liveTTL if the event is currently running, otherwise the
+ * {@link #calculateTtlForNonLiveEvent(Event, EventState) calculated TTL}
+ */
public static Duration getEventStateDependentTTL(SailingDispatchContext context, UUID eventId, Duration liveTTL) {
Event event = context.getRacingEventService().getEvent(eventId);
return getEventStateDependentTTL(event, liveTTL);
@@ -104,6 +117,25 @@ public final class EventActionUtil {
return callback.calculateWithEvent(event);
}
+ /**
+ * Calculates the time to live based on the given {@link Event}'s {@link Event#getStartDate() start time} and the
+ * given {@link HomeServiceUtil#calculateEventState(com.sap.sailing.domain.base.EventBase) calculated state}:
+ *
+ * | Event state | Start time | TTL |
+ * | UPMCOMING/PLANNED | 36 hours and more before | => 1 hour |
+ * | | less than 36 hours before | => 30 minutes |
+ * | | less than 3 hours before | => 15 minutes |
+ * | | less than 15 minutes before | => time till start |
+ * | FINISHED | any | => 12 hours |
+ * | RUNNING | any | => [0] |
+ *
+ *
+ * @param event
+ * {@link Event} to calculate the time to live for
+ * @param eventState
+ * the {@link EventState} to calculate the time to live for
+ * @return The calculated {@link Duration time to live}
+ */
public static Duration calculateTtlForNonLiveEvent(Event event, EventState eventState) {
TimePoint now = MillisecondsTimePoint.now();
if(eventState == EventState.UPCOMING || eventState == EventState.PLANNED) {
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/app/ApplicationPlaceUpdater.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/app/ApplicationPlaceUpdater.java
index a9bce22ac0f..ca9b53885da 100644
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/app/ApplicationPlaceUpdater.java
+++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/app/ApplicationPlaceUpdater.java
@@ -21,8 +21,7 @@ import com.sap.sailing.gwt.home.shared.places.fakeseries.SeriesContext;
import com.sap.sailing.gwt.home.shared.places.fakeseries.SeriesDefaultPlace;
/**
- * Helper class to support converting old places to new ones.
- *
+ * Helper class to support converting old places to new ones and relace inconsistent places with working ones.
*/
public class ApplicationPlaceUpdater {
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/app/ClientFactoryWithDispatch.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/app/ClientFactoryWithDispatch.java
index 60873539a5d..fdd01d8bfce 100644
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/app/ClientFactoryWithDispatch.java
+++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/app/ClientFactoryWithDispatch.java
@@ -2,6 +2,10 @@ package com.sap.sailing.gwt.home.shared.app;
import com.sap.sailing.gwt.home.communication.SailingDispatchSystem;
+/**
+ * Definition of ClientFactories that provide access to the dispatch based remote framework through
+ * {@link SailingDispatchSystem}.
+ */
public interface ClientFactoryWithDispatch {
SailingDispatchSystem getDispatch();
}
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/app/HasLocationTitle.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/app/HasLocationTitle.java
index 4fc85964603..07cd4a3f11f 100644
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/app/HasLocationTitle.java
+++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/app/HasLocationTitle.java
@@ -1,5 +1,9 @@
package com.sap.sailing.gwt.home.shared.app;
+/**
+ * Allows places to define a custom page title. This title is shown as page title on desktop and in the header on
+ * mobile.
+ */
public interface HasLocationTitle {
String getLocationTitle();
}
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/app/HasMobileVersion.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/app/HasMobileVersion.java
index 47458ea4d43..e8b9236d97c 100644
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/app/HasMobileVersion.java
+++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/app/HasMobileVersion.java
@@ -1,5 +1,9 @@
package com.sap.sailing.gwt.home.shared.app;
+/**
+ * Marker for Places that have a mobile version. This is used to decide which page version has to be shown for a
+ * specific place.
+ */
public interface HasMobileVersion {
}
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/app/MobileSupport.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/app/MobileSupport.java
index 90eb7e158d4..595df413452 100644
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/app/MobileSupport.java
+++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/app/MobileSupport.java
@@ -1,5 +1,10 @@
package com.sap.sailing.gwt.home.shared.app;
+/**
+ * Marker for Places that have a mobile version depending on some place state. This is commonly uses in combination with
+ * {@link com.sap.sailing.gwt.home.shared.ExperimentalFeatures} for new mobile places that should be able to be
+ * deactivated during active development.
+ */
public interface MobileSupport {
boolean hasMobileVersion();
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/app/NavigationPathDisplay.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/app/NavigationPathDisplay.java
index a93ff9eeef9..fd5ca8d454e 100644
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/app/NavigationPathDisplay.java
+++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/app/NavigationPathDisplay.java
@@ -1,5 +1,18 @@
package com.sap.sailing.gwt.home.shared.app;
+/**
+ * Abstraction of a hierarchy regarding navigation. This concept is introduced to allow activities to define its
+ * navigation path/hierarchy using a UI element that is not part of the activity itself. This allows the central
+ * definition of the navigation UI without losing the ability to control the concrete navigation path for an activity in
+ * a fine grained way.
+ *
+ * {@link NavigationPathDisplay} uses a async mechanism to let activities set their concrete navigation path because
+ * some parts of the navigation path can rely on dynamic information (e.g. event/series names) that isn't available on
+ * construction of the activity.
+ *
+ * The abtraction also allows different implementations/visualizations. So it's possible to render breadcrumbs on
+ * desktop, while on mobile devices a popup menu is used.
+ */
public interface NavigationPathDisplay {
void showNavigationPath(NavigationItem... navigationPath);
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/app/ResettableNavigationPathDisplay.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/app/ResettableNavigationPathDisplay.java
index e6f39c027aa..511fed30a2e 100644
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/app/ResettableNavigationPathDisplay.java
+++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/app/ResettableNavigationPathDisplay.java
@@ -1,5 +1,8 @@
package com.sap.sailing.gwt.home.shared.app;
+/**
+ * {@link NavigationPathDisplay} that can be reset to clear the currently shown navigation path.
+ */
public interface ResettableNavigationPathDisplay extends NavigationPathDisplay {
void reset();
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/app/SailingActivityManager.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/app/SailingActivityManager.java
index fb7e03f84a7..b5d20b68c10 100644
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/app/SailingActivityManager.java
+++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/app/SailingActivityManager.java
@@ -5,6 +5,13 @@ import com.google.gwt.activity.shared.ActivityMapper;
import com.google.web.bindery.event.shared.EventBus;
import com.sap.sse.gwt.client.mvp.CustomActivityManager;
+/**
+ * Specific {@link CustomActivityManager} that controls a {@link ResettableNavigationPathDisplay} by resetting the
+ * navigation path before activation of an activity. With that, there is no wrong path in the navigation path if an
+ * acitivity defines a navigation path by itself.
+ *
+ * @param the concrete {@link ResettableNavigationPathDisplay} used by this ActivityManager.
+ */
public class SailingActivityManager extends CustomActivityManager {
private NPD navigationPathDisplay;
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/partials/fullscreen/FullscreenContainer.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/partials/fullscreen/FullscreenContainer.java
index 8315428bfd4..b34d249b5a8 100644
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/partials/fullscreen/FullscreenContainer.java
+++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/partials/fullscreen/FullscreenContainer.java
@@ -26,6 +26,12 @@ import com.google.gwt.user.client.ui.SimpleLayoutPanel;
import com.google.gwt.user.client.ui.SimplePanel;
import com.google.gwt.user.client.ui.Widget;
+/**
+ * Base class for fullscreen viewer UIs. This viewer has an extensible header area with a close button and a content
+ * area that takes the rest of the available space.
+ *
+ * @param The type of the content widget.
+ */
public class FullscreenContainer {
private static FullscreenContainerUiBinder uiBinder = GWT.create(FullscreenContainerUiBinder.class);
@@ -56,9 +62,15 @@ public class FullscreenContainer {
popup.addStyleName(style.popup());
}
+ /**
+ * To be overwritten by subclasses to hook into the fullscreen viewer's lifecycle.
+ */
protected void onShow() {
}
+ /**
+ * To be overwritten by subclasses to hook into the fullscreen viewer's lifecycle.
+ */
protected void onClose() {
}
@@ -72,6 +84,9 @@ public class FullscreenContainer {
headerContentUi.getElement().getStyle().setMarginLeft(5, Unit.EM);
}
+ /**
+ * Should be called by subclasses if the content needs a border as optical guidance for the user.
+ */
protected void showBorder() {
contentUi.addStyleName(style.contentBorder());
}
@@ -85,6 +100,11 @@ public class FullscreenContainer {
return popup.addCloseHandler(handler);
}
+ /**
+ * To be called by subclasses to add more actions (in addition to the close button) to the upper right corner of the fullscreen veiwer.
+ *
+ * @param widget the action widget to add to the toolbar in the upper right corner.
+ */
public void addToolbarAction(Widget widget) {
widget.addStyleName(style.toolbarAction());
toolbarUi.add(widget);
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/partials/videoplayer/VideoPlayer.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/partials/videoplayer/VideoPlayer.java
index 9a6706e01e5..32ac8f59f2f 100644
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/partials/videoplayer/VideoPlayer.java
+++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/partials/videoplayer/VideoPlayer.java
@@ -10,6 +10,9 @@ import com.sap.sailing.gwt.ui.client.media.PlayEvent;
import com.sap.sailing.gwt.ui.client.media.VideoJSPlayer;
import com.sap.sse.gwt.client.media.VideoDTO;
+/**
+ * Video player with custom play button.
+ */
public class VideoPlayer extends Composite {
private final VideoPlayerResources.LocalCss style = VideoPlayerResources.INSTANCE.css();
private VideoJSPlayer videoJSPlayer;
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/partials/videoplayer/VideoWithLowerThird.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/partials/videoplayer/VideoWithLowerThird.java
index 77275ab7b09..b26fd8e6984 100644
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/partials/videoplayer/VideoWithLowerThird.java
+++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/shared/partials/videoplayer/VideoWithLowerThird.java
@@ -4,6 +4,9 @@ import com.sap.sailing.gwt.home.communication.event.LabelType;
import com.sap.sailing.gwt.home.shared.partials.lowerthird.LowerThird;
import com.sap.sse.gwt.client.media.VideoDTO;
+/**
+ * Video player with a lower third containing title, subtitle and an optional {@link LabelType}.
+ */
public class VideoWithLowerThird extends VideoPlayer {
private final LowerThird lowerThird = new LowerThird();
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/StringMessages.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/StringMessages.java
index 4b8fdb771a5..644c4d01b94 100644
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/StringMessages.java
+++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/StringMessages.java
@@ -1606,4 +1606,6 @@ public interface StringMessages extends com.sap.sse.gwt.client.StringMessages,
String loadingRegattasAndRaces();
String selectFromRacesWithOverlappingTimeRange();
String finishTime(String timeAsString);
+ String showCompetitorCharts();
+ String showWindChart();
}
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/StringMessages.properties b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/StringMessages.properties
index 7a59cfa2d8b..794deb9a603 100644
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/StringMessages.properties
+++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/StringMessages.properties
@@ -444,7 +444,7 @@ scoringSchemeHighPointFirstGetsTen=High Point, winner gets 10 points
scoringSchemeHighPointFirstGetsTenOrEight=High Point, winner gets 10 points (or 8)
scoringSchemeHighPointFirstGetsTenOrEightDescription=Score in points. Winner scores 10 points, 2nd - 9 points, .... A tie is broken in favour of the competitor having won most races, if tie remains then tie is broken by the rank in the last race scored.
scoringSchemeHighPointFirstGetsTwelveOrEight=High Point, winner gets 12 points (or 8)
-scoringSchemeHighPointFirstGetsTwelveOrEightDescription=Score in points. Winner scores 12 points, 2nd - 11 points, .... A tie is broken in favour of the competitor having won most races, if tie remains then tie is broken by the rank in the last race scored.
+scoringSchemeHighPointFirstGetsTwelveOrEightDescription=Score in points. Winner scores 12 points, 2nd - 11 points, .... A tie is broken in favour of the competitor with the highest score, if tie remains then tie is broken by the rank in the last race scored.
scoringSystem=Scoring system
createFlexibleLeaderboard=Create flexible leaderboard
createRegattaLeaderboard=Create regatta leaderboard
@@ -1578,4 +1578,6 @@ noTracksFound=No tracks found
noRacesAvailable=No races available
loadingRegattasAndRaces=Loading Regattas and Races
selectFromRacesWithOverlappingTimeRange=Select from the races whose time range overlaps with media track those to which the track shall be linked
-finishTime=Finish at: {0}
\ No newline at end of file
+finishTime=Finish at: {0}
+showCompetitorCharts=Show competitor chart
+showWindChart=Show wind chart
\ No newline at end of file
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/StringMessages_de.properties b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/StringMessages_de.properties
index 49447446d0a..dc5ae9682d0 100644
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/StringMessages_de.properties
+++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/StringMessages_de.properties
@@ -1563,4 +1563,6 @@ noTracksFound=Keine Tracks gefunden
noRacesAvailable=Keine Rennen verfügbar
loadingRegattasAndRaces=Regatten und Rennen werden geladen
selectFromRacesWithOverlappingTimeRange=Das oder die Rennen aus der Liste derer zum Verknüpfen auswählen, die zeitlich mit dem Medien-Track überlappen
-finishTime=Ende um: {0}
\ No newline at end of file
+finishTime=Ende um: {0}
+showCompetitorCharts=Teilnehmer-Diagramme zeigen
+showWindChart=Windiagramm zeigen
\ No newline at end of file
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/media/MediaPlayerLifecycle.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/media/MediaPlayerLifecycle.java
index 0a349505ddf..cfcf70911c5 100644
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/media/MediaPlayerLifecycle.java
+++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/media/MediaPlayerLifecycle.java
@@ -20,7 +20,7 @@ public class MediaPlayerLifecycle implements ComponentLifecycle1h to avoid
+ * unnecessary 00:yy or 00:xx:yy values.
+ *
+ * Be aware that this method doesn't work for durations >= 24h.
+ *
+ * @param timeInMilliseconds
+ * the duration in milliseconds to format
+ * @return the formatted duration
+ */
public static String formatElapsedTime(long timeInMilliseconds) {
String result = "";
int seconds = (int) (timeInMilliseconds / 1000) % 60 ;
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/raceboard/RaceBoardEntryPoint.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/raceboard/RaceBoardEntryPoint.java
index bc141596896..40a28743b54 100644
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/raceboard/RaceBoardEntryPoint.java
+++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/raceboard/RaceBoardEntryPoint.java
@@ -12,6 +12,7 @@ import com.google.gwt.user.client.rpc.ServiceDefTarget;
import com.google.gwt.user.client.ui.DockLayoutPanel;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.RootLayoutPanel;
+import com.sap.sailing.gwt.common.client.formfactor.DeviceDetector;
import com.sap.sailing.gwt.ui.client.AbstractSailingEntryPoint;
import com.sap.sailing.gwt.ui.client.LogoAndTitlePanel;
import com.sap.sailing.gwt.ui.client.MediaService;
@@ -25,6 +26,7 @@ import com.sap.sse.gwt.client.EntryPointHelper;
import com.sap.sse.gwt.client.async.AsyncActionsExecutor;
import com.sap.sse.gwt.client.player.Timer;
import com.sap.sse.gwt.client.player.Timer.PlayModes;
+import com.sap.sse.gwt.client.shared.perspective.PerspectiveCompositeSettings;
import com.sap.sse.gwt.client.shared.perspective.PerspectiveLifecycleWithAllSettings;
public class RaceBoardEntryPoint extends AbstractSailingEntryPoint {
@@ -74,6 +76,11 @@ public class RaceBoardEntryPoint extends AbstractSailingEntryPoint {
// read perspective settings parameters from URL
final RaceBoardPerspectiveSettings perspectiveSettings = RaceBoardPerspectiveSettings.readSettingsFromURL();
+ // Determine if the charts, such as the competitor chart or the wind chart, the edit marks
+ // panels, such as mark passing and mark position editors and manage media buttons should be shown.
+ // Automatic selection of attached video (if any) also depends on this flag.
+ // The decision is made once during initial page load based on the device type (mobile or not).
+ final boolean showChartMarkEditMediaButtonsAndVideo = !DeviceDetector.isMobile();
sailingService.getRaceboardData(regattaName, raceName, leaderboardName, leaderboardGroupName, eventId, new AsyncCallback() {
@Override
@@ -100,7 +107,7 @@ public class RaceBoardEntryPoint extends AbstractSailingEntryPoint {
return;
}
- createPerspectivePage(raceboardData, perspectiveSettings);
+ createPerspectivePage(raceboardData, perspectiveSettings, showChartMarkEditMediaButtonsAndVideo);
}
@Override
@@ -119,7 +126,8 @@ public class RaceBoardEntryPoint extends AbstractSailingEntryPoint {
vp.add(new Label(message));
}
- private void createPerspectivePage(RaceboardDataDTO raceboardData, RaceBoardPerspectiveSettings perspectiveSettings) {
+ private void createPerspectivePage(RaceboardDataDTO raceboardData, RaceBoardPerspectiveSettings perspectiveSettings,
+ boolean showChartMarkEditMediaButtonsAndVideo) {
selectedRace = raceboardData.getRace();
Window.setTitle(selectedRace.getName());
Timer timer = new Timer(PlayModes.Replay, 1000l);
@@ -128,13 +136,18 @@ public class RaceBoardEntryPoint extends AbstractSailingEntryPoint {
Collections.singletonList(selectedRace.getRaceIdentifier()), 5000l /* requestInterval*/);
RaceBoardPerspectiveLifecycle raceboardPerspectiveLifecycle = new RaceBoardPerspectiveLifecycle(null, StringMessages.INSTANCE);
+ PerspectiveCompositeSettings defaultSettings = raceboardPerspectiveLifecycle.createDefaultSettings();
+ PerspectiveCompositeSettings perspectiveCompositeSettings =
+ new PerspectiveCompositeSettings<>(perspectiveSettings, defaultSettings.getSettingsPerComponentId());
+
PerspectiveLifecycleWithAllSettings raceboardPerspectiveLifecyclesAndSettings = new PerspectiveLifecycleWithAllSettings<>(raceboardPerspectiveLifecycle,
- raceboardPerspectiveLifecycle.createDefaultSettings());
+ perspectiveCompositeSettings);
- RaceBoardPanel raceBoardPerspective = new RaceBoardPanel(
- raceboardPerspectiveLifecyclesAndSettings, sailingService, mediaService, getUserService(),
- asyncActionsExecutor, raceboardData.getCompetitorAndTheirBoats(), timer, selectedRace.getRaceIdentifier(), leaderboardName,
- leaderboardGroupName, eventId, RaceBoardEntryPoint.this, getStringMessages(), userAgent, raceTimesInfoProvider);
+ RaceBoardPanel raceBoardPerspective = new RaceBoardPanel(raceboardPerspectiveLifecyclesAndSettings,
+ sailingService, mediaService, getUserService(), asyncActionsExecutor,
+ raceboardData.getCompetitorAndTheirBoats(), timer, selectedRace.getRaceIdentifier(), leaderboardName,
+ leaderboardGroupName, eventId, RaceBoardEntryPoint.this, getStringMessages(), userAgent,
+ raceTimesInfoProvider, showChartMarkEditMediaButtonsAndVideo);
RootLayoutPanel.get().add(raceBoardPerspective.getEntryWidget());
}
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/raceboard/RaceBoardPanel.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/raceboard/RaceBoardPanel.java
index bdf895de019..0a38092c800 100644
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/raceboard/RaceBoardPanel.java
+++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/raceboard/RaceBoardPanel.java
@@ -159,13 +159,18 @@ public class RaceBoardPanel extends AbstractPerspectiveCompositetrue charts, such as the competitor chart or the wind chart, (as well as edit mark
+ * panels and manage media buttons) are shown and a padding is provided for the RaceTimePanel that
+ * aligns its right border with that of the chart. Otherwise those components will be hidden.
*/
public RaceBoardPanel(PerspectiveLifecycleWithAllSettings perspectiveLifecycleWithAllSettings,
- SailingServiceAsync sailingService, MediaServiceAsync mediaService,
- UserService userService, AsyncActionsExecutor asyncActionsExecutor, Map competitorsAndTheirBoats,
+ SailingServiceAsync sailingService, MediaServiceAsync mediaService, UserService userService,
+ AsyncActionsExecutor asyncActionsExecutor, Map competitorsAndTheirBoats,
Timer timer, RegattaAndRaceIdentifier selectedRaceIdentifier, String leaderboardName,
String leaderboardGroupName, UUID eventId, ErrorReporter errorReporter, final StringMessages stringMessages,
- UserAgentDetails userAgent, RaceTimesInfoProvider raceTimesInfoProvider) {
+ UserAgentDetails userAgent, RaceTimesInfoProvider raceTimesInfoProvider,
+ boolean showChartMarkEditMediaButtonsAndVideo) {
super(perspectiveLifecycleWithAllSettings.getPerspectiveLifecycle(), perspectiveLifecycleWithAllSettings.getPerspectiveSettings());
this.perspectiveLifecycleWithAllSettings = perspectiveLifecycleWithAllSettings;
this.sailingService = sailingService;
@@ -250,7 +255,8 @@ public class RaceBoardPanel extends AbstractPerspectiveCompositenull or else can be used to show some context information in
* the {@link GlobalNavigationPanel}.
+ * @param showChartMarkEditMediaButtonsAndVideo
* @param isScreenLargeEnoughToOfferChartSupport
* if the screen is large enough to display charts such as the competitor chart or the wind chart, a
* padding is provided for the RaceTimePanel that aligns its right border with that of the charts, and
* the charts are created.
*/
- private void createOneScreenView(String leaderboardName, String leaderboardGroupName, UUID event, FlowPanel mainPanel,
- boolean isScreenLargeEnoughToInitiallyDisplayLeaderboard, RaceMap raceMap, UserService userService) {
-
+ private void createOneScreenView(String leaderboardName, String leaderboardGroupName, UUID event,
+ FlowPanel mainPanel, boolean isScreenLargeEnoughToInitiallyDisplayLeaderboard, RaceMap raceMap,
+ UserService userService, boolean showChartMarkEditMediaButtonsAndVideo) {
+
MediaPlayerLifecycle mediaPlayerLifecycle = perspectiveLifecycleWithAllSettings.getPerspectiveLifecycle().getMediaPlayerLifecycle();
MediaPlayerSettings mediaPlayerSettings = perspectiveLifecycleWithAllSettings.findComponentSettingsByLifecycle(mediaPlayerLifecycle);
@@ -309,7 +318,7 @@ public class RaceBoardPanel extends AbstractPerspectiveComposite> componentsForSideBySideViewer = new ArrayList>();
- if (getPerspectiveSettings().isChartSupportEnabled()) {
+ if (showChartMarkEditMediaButtonsAndVideo) {
competitorChart = new MultiCompetitorRaceChart(multiCompetitorRaceChartLifecycle, sailingService, asyncActionsExecutor,
competitorSelectionProvider, selectedRaceIdentifier, timer, timeRangeWithZoomModel, stringMessages,
errorReporter, true, true, leaderboardGroupName, leaderboardName);
@@ -324,18 +333,23 @@ public class RaceBoardPanel extends AbstractPerspectiveComposite= 600;
- final boolean chartSupportEnabled = GwtHttpRequestUtils.getBooleanParameter(PARAM_VIEW_CHART_SUPPORT_ENABLED, isScreenLargeEnoughToOfferChartSupport);
-
final Duration initialDurationAfterRaceStartInReplay = parseDuration(GwtHttpRequestUtils.getStringParameter(
PARAM_TIME_AFTER_RACE_START_AS_HOURS_COLON_MILLIS_COLON_SECONDS, null /* default */));
return new RaceBoardPerspectiveSettings(activeCompetitorsFilterSetName, showLeaderboard, showWindChart,
- showCompetitorsChart, simulationEnabled, canReplayWhileLiveIsPossible, chartSupportEnabled,
- !DeviceDetector.isMobile(), initialDurationAfterRaceStartInReplay);
- }
-
- public boolean isShowChartMarkEditMediaButtonsAndVideo() {
- return showChartMarkEditMediaButtonsAndVideo;
+ showCompetitorsChart, simulationEnabled, canReplayWhileLiveIsPossible, initialDurationAfterRaceStartInReplay);
}
public Duration getInitialDurationAfterRaceStartInReplay() {
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/raceboard/RaceBoardPerspectiveSettingsDialogComponent.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/raceboard/RaceBoardPerspectiveSettingsDialogComponent.java
index 521320e7fd1..a895c381002 100644
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/raceboard/RaceBoardPerspectiveSettingsDialogComponent.java
+++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/raceboard/RaceBoardPerspectiveSettingsDialogComponent.java
@@ -26,15 +26,15 @@ public class RaceBoardPerspectiveSettingsDialogComponent implements SettingsDial
public Widget getAdditionalWidget(DataEntryDialog> dialog) {
VerticalPanel vp = new VerticalPanel();
- showLeaderboardCheckBox = dialog.createCheckbox(stringMessages.show() + " " + stringMessages.leaderboard());
+ showLeaderboardCheckBox = dialog.createCheckbox(stringMessages.showLeaderboard());
showLeaderboardCheckBox.setValue(initialSettings.isShowLeaderboard());
vp.add(showLeaderboardCheckBox);
- showWindChartCheckBox = dialog.createCheckbox(stringMessages.show() + " " + stringMessages.windChart());
+ showWindChartCheckBox = dialog.createCheckbox(stringMessages.showWindChart());
showWindChartCheckBox.setValue(initialSettings.isShowWindChart());
vp.add(showWindChartCheckBox);
- showCompetitorsChartCheckBox = dialog.createCheckbox(stringMessages.show() + " " + stringMessages.competitorCharts());
+ showCompetitorsChartCheckBox = dialog.createCheckbox(stringMessages.showCompetitorCharts());
showCompetitorsChartCheckBox.setValue(initialSettings.isShowCompetitorsChart());
vp.add(showCompetitorsChartCheckBox);
@@ -45,8 +45,7 @@ public class RaceBoardPerspectiveSettingsDialogComponent implements SettingsDial
public RaceBoardPerspectiveSettings getResult() {
RaceBoardPerspectiveSettings result = new RaceBoardPerspectiveSettings(initialSettings.getActiveCompetitorsFilterSetName(),
showLeaderboardCheckBox.getValue(), showWindChartCheckBox.getValue(), showCompetitorsChartCheckBox.getValue(),
- initialSettings.isSimulationEnabled(), initialSettings.isCanReplayDuringLiveRaces(), initialSettings.isChartSupportEnabled(),
- initialSettings.isShowChartMarkEditMediaButtonsAndVideo(),
+ initialSettings.isSimulationEnabled(), initialSettings.isCanReplayDuringLiveRaces(),
initialSettings.getInitialDurationAfterRaceStartInReplay());
return result;
}
diff --git a/java/com.sap.sailing.server.gateway/src/com/sap/sailing/server/gateway/jaxrs/api/RegattasResource.java b/java/com.sap.sailing.server.gateway/src/com/sap/sailing/server/gateway/jaxrs/api/RegattasResource.java
index 5f5a39c07ad..f276e5f3639 100644
--- a/java/com.sap.sailing.server.gateway/src/com/sap/sailing/server/gateway/jaxrs/api/RegattasResource.java
+++ b/java/com.sap.sailing.server.gateway/src/com/sap/sailing/server/gateway/jaxrs/api/RegattasResource.java
@@ -687,8 +687,12 @@ public class RegattasResource extends AbstractSailingServerResource {
Regatta regatta = findRegattaByName(regattaName);
if (regatta == null) {
response = Response.status(Status.NOT_FOUND)
- .entity("Could not find a regatta with name '" + StringEscapeUtils.escapeHtml(regattaName) + "'.").type(MediaType.TEXT_PLAIN)
- .build();
+ .entity("Could not find a regatta with name '" + StringEscapeUtils.escapeHtml(regattaName) + "'.").type(MediaType.TEXT_PLAIN)
+ .build();
+ } else if (!((fromtime != null && totime != null) || (fromtimeasmillis != null && totimeasmillis != null))) {
+ response = Response.status(Status.NOT_FOUND)
+ .entity("Either the 'fromtime' and 'totime' or the 'fromtimeasmillis' and 'totimeasmillis' parameter must be set.").type(MediaType.TEXT_PLAIN)
+ .build();
} else {
RaceDefinition race = findRaceByName(regatta, raceName);
if (race == null) {
diff --git a/java/com.sap.sailing.server.gateway/webservices/api/v1/raceWindGetDoc.html b/java/com.sap.sailing.server.gateway/webservices/api/v1/raceWindGetDoc.html
index 53aecc8b065..631748067ab 100644
--- a/java/com.sap.sailing.server.gateway/webservices/api/v1/raceWindGetDoc.html
+++ b/java/com.sap.sailing.server.gateway/webservices/api/v1/raceWindGetDoc.html
@@ -26,8 +26,8 @@
| Mandatory parameters: |
- regattaname
- racename
+ fromtime (ISO format, such as 2014-02-14T10:12:03Z) or fromtimeasmillis (time in milliseconds)
+ totime (ISO format, such as 2014-02-14T10:12:03Z) or totimeasmillis (time in milliseconds)
|
@@ -35,10 +35,6 @@
|
windsource [COMBINED = Default, WEB, EXPEDITION, TRACK_BASED_ESTIMATION, COURSE_BASED, RACECOMMITTEE]
windsourceid (Id of a wind source. For example Igtimi wind sources will have the type=EXPEDITION but each of them has unique ids. If you want to filter by these then you can use this parameter)
- fromtime (ISO format, such as 2014-02-14T10:12:03Z)
- fromtimeasmillis
- totime (ISO format, such as 2014-02-14T10:12:03Z)
- totimeasmillis
|
diff --git a/java/com.sap.sse.gwt/src/com/sap/sse/gwt/client/JavaScriptInjector.java b/java/com.sap.sse.gwt/src/com/sap/sse/gwt/client/JavaScriptInjector.java
index 0daa7e73839..31e512b1784 100644
--- a/java/com.sap.sse.gwt/src/com/sap/sse/gwt/client/JavaScriptInjector.java
+++ b/java/com.sap.sse.gwt/src/com/sap/sse/gwt/client/JavaScriptInjector.java
@@ -13,6 +13,7 @@ import com.google.gwt.dom.client.ScriptElement;
* D049941
*/
public class JavaScriptInjector {
+ // TODO: why not simply use com.google.gwt.core.client.ScriptInjector? Is there specific functionality that isn't provided by the GWT class?
private static HeadElement head;
/**
diff --git a/java/com.sap.sse.gwt/src/com/sap/sse/gwt/client/mvp/CustomActivityManager.java b/java/com.sap.sse.gwt/src/com/sap/sse/gwt/client/mvp/CustomActivityManager.java
index c4c04330643..777b25ab86c 100644
--- a/java/com.sap.sse.gwt/src/com/sap/sse/gwt/client/mvp/CustomActivityManager.java
+++ b/java/com.sap.sse.gwt/src/com/sap/sse/gwt/client/mvp/CustomActivityManager.java
@@ -1,9 +1,14 @@
package com.sap.sse.gwt.client.mvp;
+import com.google.gwt.activity.shared.ActivityManager;
import com.google.gwt.activity.shared.ActivityMapper;
import com.google.gwt.place.shared.Place;
import com.google.web.bindery.event.shared.EventBus;
+/**
+ * Custom {@link ActivityManager} implementation that fires a {@link PlaceChangedEvent} on the given {@link EventBus}
+ * whenever the current place changed.
+ */
public class CustomActivityManager extends DelegatingActivityManager {
private EventBus eventBus;
diff --git a/java/com.sap.sse.gwt/src/com/sap/sse/gwt/client/mvp/DelegatingActivityManager.java b/java/com.sap.sse.gwt/src/com/sap/sse/gwt/client/mvp/DelegatingActivityManager.java
index 10816047fa2..d17e384e9f7 100644
--- a/java/com.sap.sse.gwt/src/com/sap/sse/gwt/client/mvp/DelegatingActivityManager.java
+++ b/java/com.sap.sse.gwt/src/com/sap/sse/gwt/client/mvp/DelegatingActivityManager.java
@@ -10,6 +10,10 @@ import com.google.gwt.user.client.ui.AcceptsOneWidget;
import com.google.web.bindery.event.shared.EventBus;
import com.google.web.bindery.event.shared.SimpleEventBus;
+/**
+ * Custom {@link ActivityManager} implementation that allows hooking into the lifecycle.
+ *
+ */
public class DelegatingActivityManager extends ActivityManager {
private final ActivityManager realActivityManager;
@@ -35,9 +39,19 @@ public class DelegatingActivityManager extends ActivityManager {
realActivityManager.setDisplay(display);
}
+ /**
+ * To be overwritten by sublcasses to hook into the lifecycle.
+ *
+ * @param activity the activity to be started
+ */
protected void beforeActivityStart(Activity activity) {
}
+ /**
+ * To be overwritten by sublcasses to hook into the lifecycle.
+ *
+ * @param activity the place that has been started
+ */
protected void afterPlaceActivation(Place place) {
}
diff --git a/java/com.sap.sse.gwt/src/com/sap/sse/gwt/client/mvp/ErrorView.java b/java/com.sap.sse.gwt/src/com/sap/sse/gwt/client/mvp/ErrorView.java
index 9783fe65282..8b820f2942c 100644
--- a/java/com.sap.sse.gwt/src/com/sap/sse/gwt/client/mvp/ErrorView.java
+++ b/java/com.sap.sse.gwt/src/com/sap/sse/gwt/client/mvp/ErrorView.java
@@ -2,6 +2,9 @@ package com.sap.sse.gwt.client.mvp;
import com.google.gwt.user.client.ui.IsWidget;
+/**
+ * View that shows an application error.
+ */
public interface ErrorView extends IsWidget {
}
diff --git a/java/com.sap.sse.gwt/src/com/sap/sse/gwt/dispatch/servlets/AbstractDispatchServlet.java b/java/com.sap.sse.gwt/src/com/sap/sse/gwt/dispatch/servlets/AbstractDispatchServlet.java
index a1ca8f24acd..8a8173f6c68 100644
--- a/java/com.sap.sse.gwt/src/com/sap/sse/gwt/dispatch/servlets/AbstractDispatchServlet.java
+++ b/java/com.sap.sse.gwt/src/com/sap/sse/gwt/dispatch/servlets/AbstractDispatchServlet.java
@@ -12,6 +12,12 @@ import com.sap.sse.gwt.dispatch.shared.commands.Result;
import com.sap.sse.gwt.dispatch.shared.exceptions.DispatchException;
import com.sap.sse.gwt.dispatch.shared.exceptions.ServerDispatchException;
+/**
+ * Abstract server-side part of the dispatch functionality. Needs to be subclassed in modules that want to use dispatch
+ * along with a custom DispatchContext.
+ *
+ * @param the concrete {@link DispatchContext} used by dispatch.
+ */
public abstract class AbstractDispatchServlet extends ProxiedRemoteServiceServlet
implements DispatchRPC {
private static final long serialVersionUID = -4279307111608131857L;