Merge branch 'master' into bug3529

This commit is contained in:
Steffen Schaefer committed 2017-02-09 08:53:06 +01:00
commit 58b1aa15c0
17 files changed
+435 -101

No files matched your search

@@ -45,7 +45,7 @@ public class LiveRacesList extends Composite {
private final SortableRaceListColumn<LiveRaceDTO, ?> raceViewStateColumn = RaceListColumnFactory.getRaceViewStateColumn();
public RaceListLiveRaces(EventView.Presenter presenter, boolean showRegattaDetails) {
super(presenter, new RaceListColumnSet(1, 1));
super(presenter, new RaceListColumnSet(1, 1), false);
this.regattaNameColumn.setShowDetails(showRegattaDetails);
}
@@ -86,5 +86,20 @@ public class LiveRacesList extends Composite {
columnSet.addColumn(courseColumn);
columnSet.addColumn(fleetNameColumn);
}
@Override
public boolean hasWind() {
return false;
}
@Override
public boolean hasVideos() {
return false;
}
@Override
public boolean hasAudios() {
return false;
}
}
}
@@ -45,9 +45,9 @@ public abstract class AbstractRaceList<T extends RaceMetadataDTO<? extends Abstr
private final SortedCellTable<T> cellTable = new SortedCellTable<T>(0, CleanCellTableResources.INSTANCE);
private boolean tableColumnsInitialized = false;
protected AbstractRaceList(EventView.Presenter presenter, RaceListColumnSet columnSet) {
protected AbstractRaceList(EventView.Presenter presenter, RaceListColumnSet columnSet, boolean showNotTracked) {
CSS.ensureInjected();
this.raceViewerButtonColumn = RaceListColumnFactory.getRaceViewerButtonColumn(presenter);
this.raceViewerButtonColumn = RaceListColumnFactory.getRaceViewerButtonColumn(presenter, showNotTracked);
this.columnSet = columnSet;
this.cellTableContainer.setWidget(this.cellTable);
this.initTableStyle();
@@ -133,5 +133,10 @@ public abstract class AbstractRaceList<T extends RaceMetadataDTO<? extends Abstr
}
return filterableValues;
}
public abstract boolean hasWind();
public abstract boolean hasVideos();
public abstract boolean hasAudios();
}
@@ -488,7 +488,8 @@ public class RaceListColumnFactory {
};
}
public static <T extends RaceMetadataDTO<?>> SortableRaceListColumn<T, T> getRaceViewerButtonColumn(final EventView.Presenter presenter) {
public static <T extends RaceMetadataDTO<?>> SortableRaceListColumn<T, T> getRaceViewerButtonColumn(
final EventView.Presenter presenter, final boolean showNotTracked) {
InvertibleComparator<T> comparator = new InvertibleComparatorAdapter<T>() {
@Override
public int compare(T o1, T o2) {
@@ -503,7 +504,7 @@ public class RaceListColumnFactory {
return -o1.getTrackingState().compareTo(o2.getTrackingState());
}
};
return new SortableRaceListColumn<T, T>("", new RaceviewerLaunchPadCell<T>(presenter), comparator) {
return new SortableRaceListColumn<T, T>("", new RaceviewerLaunchPadCell<T>(presenter, showNotTracked), comparator) {
@Override
public String getHeaderStyle() {
return getStyleNamesString(CSS.raceslist_head_item(), CSS.raceslist_head_itembutton());
@@ -15,7 +15,8 @@ import com.sap.sailing.gwt.home.communication.race.RaceMetadataDTO;
import com.sap.sailing.gwt.home.shared.refresh.RefreshableWidget;
import com.sap.sse.gwt.dispatch.shared.commands.CollectionResult;
public class RaceListContainer<T extends RaceMetadataDTO<?>> extends Composite implements RefreshableWidget<CollectionResult<T>> {
public class RaceListContainer<T extends RaceMetadataDTO<?>> extends Composite
implements RefreshableWidget<CollectionResult<T>> {
private static RaceListContainerUiBinder uiBinder = GWT.create(RaceListContainerUiBinder.class);
@@ -26,6 +27,10 @@ public class RaceListContainer<T extends RaceMetadataDTO<?>> extends Composite i
@UiField DivElement infoUi;
@UiField DivElement noContentPlaceholderUi;
@UiField(provided = true) AbstractRaceList<T> raceListUi;
@UiField DivElement iconWind;
@UiField DivElement iconVideo;
@UiField DivElement iconAudio;
private String noContentPlaceholderText;
public RaceListContainer(String title, AbstractRaceList<T> raceList) {
@@ -55,11 +60,17 @@ public class RaceListContainer<T extends RaceMetadataDTO<?>> extends Composite i
noContentPlaceholderUi.getStyle().clearDisplay();
raceListUi.setVisible(false);
}
iconWind.getStyle().setDisplay(Display.NONE);
iconVideo.getStyle().setDisplay(Display.NONE);
iconAudio.getStyle().setDisplay(Display.NONE);
} else {
noContentPlaceholderUi.getStyle().setDisplay(Display.NONE);
getElement().getStyle().clearDisplay();
raceListUi.setVisible(true);
this.raceListUi.setTableData(data);
iconWind.getStyle().setDisplay(raceListUi.hasWind() ? Display.INLINE_BLOCK : Display.NONE);
iconVideo.getStyle().setDisplay(raceListUi.hasVideos() ? Display.INLINE_BLOCK : Display.NONE);
iconAudio.getStyle().setDisplay(raceListUi.hasAudios() ? Display.INLINE_BLOCK : Display.NONE);
}
}
@@ -1,14 +1,51 @@
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder" xmlns:g="urn:import:com.google.gwt.user.client.ui"
xmlns:s="urn:import:com.sap.sailing.gwt.home.client.shared"
xmlns:dp="urn:import:com.sap.sailing.gwt.home.desktop.partials">
<ui:with field="i18n" type="com.sap.sailing.gwt.ui.client.StringMessages" />
<ui:with field="res" type="com.sap.sailing.gwt.common.client.SharedResources" />
<ui:with field="local_res" type="com.sap.sailing.gwt.home.desktop.partials.racelist.RaceListResources" />
<g:HTMLPanel addStyleNames="{local_res.css.raceslistlive}">
<h3 ui:field="titleUi"></h3>
<div style="display: none;" ui:field="infoUi"></div>
<div style="display: none; font-weight: bold; font-style: italic;" ui:field="noContentPlaceholderUi"></div>
<dp:racelist.AbstractRaceList ui:field="raceListUi"/>
</g:HTMLPanel>
xmlns:s="urn:import:com.sap.sailing.gwt.home.client.shared"
xmlns:dp="urn:import:com.sap.sailing.gwt.home.desktop.partials">
<ui:with field="i18n" type="com.sap.sailing.gwt.ui.client.StringMessages" />
<ui:with field="res" type="com.sap.sailing.gwt.common.client.SharedResources" />
<ui:with field="local_res" type="com.sap.sailing.gwt.home.desktop.partials.racelist.RaceListResources" />
<ui:style gss="true">
.iconGPS, .iconWind, .iconVideo, .iconAudio{
position: relative;
display: none;
margin-left: 0.666666666666667em;
padding-left: 2.333333333333333em;
background-size: 1.666666666666667rem 1.666666666666667rem;
background-position: left;
background-repeat: no-repeat;
}
.iconGPS {
background-image:url('images/home/raw_gps_fixes.png');
}
.iconWind {
background-image:url('images/home/icon-wind.png');
}
.iconVideo {
background-image:url('images/home/icon-video.png');
border-left: 1px solid #ccc;
}
.iconAudio {
background-image:url('images/home/icon-audio.png');
border-left: 1px solid #ccc;
}
.legend {
text-align: right;
vertical-align: baseline;
line-height: 1.333em;
padding-right:0px;
margin: 0 0 .5em;
}
</ui:style>
<g:HTMLPanel addStyleNames="{local_res.css.raceslistlive}">
<h3 ui:field="titleUi" class="{res.mediaCss.column} {res.mediaCss.medium12} {res.mediaCss.large4}"/>
<div ui:field="legend" class="{res.mediaCss.column} {res.mediaCss.medium12} {res.mediaCss.large8} {style.legend}">
<div ui:field="iconWind" class="{style.iconWind}"><ui:text from='{i18n.eventRegattaRacesLegendWind}'/></div>
<div ui:field="iconVideo" class="{style.iconVideo}"><ui:text from='{i18n.eventRegattaRacesLegendVideo}'/></div>
<div ui:field="iconAudio" class="{style.iconAudio}"><ui:text from='{i18n.eventRegattaRacesLegendAudio}'/></div>
</div>
<div style="display: none;" ui:field="infoUi"></div>
<div style="display: none; font-weight: bold; font-style: italic;" ui:field="noContentPlaceholderUi"></div>
<dp:racelist.AbstractRaceList ui:field="raceListUi"/>
</g:HTMLPanel>
</ui:UiBinder>
@@ -45,9 +45,11 @@ public class RaceviewerLaunchPadCell<T extends RaceMetadataDTO<?>> extends Abstr
private final EventView.Presenter presenter;
private final PopupPanel panel = new PopupPanel(true, false);
private final boolean showNotTracked;
public RaceviewerLaunchPadCell(Presenter presenter) {
public RaceviewerLaunchPadCell(Presenter presenter, boolean showNotTracked) {
super(BrowserEvents.CLICK);
this.showNotTracked = showNotTracked;
local_res.css().ensureInjected();
this.presenter = presenter;
}
@@ -84,8 +86,10 @@ public class RaceviewerLaunchPadCell<T extends RaceMetadataDTO<?>> extends Abstr
String styleNames = data.isFinished() ? analyzeStyleNames : liveStyleNames;
sb.append(TEMPLATE.raceviewerLaunchPad(styleNames, iconStyleNames, I18N.raceDetailsToShow()));
}
} else if (showNotTracked) {
sb.append(TEMPLATE.raceNotTracked(notTrackedStyleNames, I18N.eventRegattaRaceNotTracked()));
} else {
sb.append(TEMPLATE.raceNotTracked(notTrackedStyleNames, I18N.eventRegattaRaceNotTracked()));
sb.append(TEMPLATE.raceNotTracked(notTrackedStyleNames, ""));
}
}
@@ -1,10 +1,15 @@
package com.sap.sailing.gwt.home.desktop.partials.regattaheader;
import com.google.gwt.core.client.GWT;
import com.google.gwt.core.client.Scheduler;
import com.google.gwt.core.client.Scheduler.ScheduledCommand;
import com.google.gwt.dom.client.AnchorElement;
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.DOM;
import com.google.gwt.user.client.Event;
import com.google.gwt.user.client.EventListener;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.UIObject;
import com.google.gwt.user.client.ui.Widget;
@@ -18,34 +23,88 @@ public class RegattaHeader extends Composite {
interface RegattaHeaderUiBinder extends UiBinder<Widget, RegattaHeader> {
}
@UiField RegattaHeaderResources local_res;
@UiField AnchorElement headerBodyUi;
@UiField AnchorElement headerArrowUi;
@UiField AnchorElement dataIndicatorsUi;
@UiField DivElement gpsDataIndicatorUi;
@UiField DivElement windDataIndicatorUi;
@UiField DivElement videoDataIndicatorUi;
@UiField DivElement audioDataIndicatorUi;
@UiField
RegattaHeaderResources local_res;
@UiField
AnchorElement headerBodyUi;
@UiField
AnchorElement headerArrowUi;
@UiField
AnchorElement dataIndicatorsUi;
@UiField
DivElement gpsDataIndicatorUi;
@UiField
DivElement windDataIndicatorUi;
@UiField
DivElement videoDataIndicatorUi;
@UiField
DivElement audioDataIndicatorUi;
public RegattaHeader(RegattaMetadataDTO regattaMetadata, boolean showStateMarker) {
initWidget(uiBinder.createAndBindUi(this));
headerBodyUi.appendChild(new RegattaHeaderBody(regattaMetadata, showStateMarker).getElement());
this.initDataIndicators(regattaMetadata.getRaceDataInfo());
// setup click listener for icon legend bubble here, it may be replaced by setRegattaNavigation later on
addLegendBubble(regattaMetadata.getRaceDataInfo());
}
private void addLegendBubble(final RaceDataInfo raceDataInfo) {
DOM.sinkEvents(dataIndicatorsUi, Event.ONCLICK | Event.ONMOUSEOVER | Event.ONMOUSEOUT);
Event.setEventListener(dataIndicatorsUi, new EventListener() {
private RegattaHeaderLegendPopup popup = null;
@Override
public void onBrowserEvent(Event event) {
if ((event.getTypeInt() == Event.ONCLICK || event.getTypeInt() == Event.ONMOUSEOVER)
&& (popup == null || !popup.isAttached())) {
popup = new RegattaHeaderLegendPopup(raceDataInfo);
popup.setVisible(false);
popup.show();
// Pausing until the event loop is clear appears to give the browser
// sufficient time to apply CSS styling. We use the popup's offset
// width and height to calculate the display position, but those
// dimensions are not accurate until styling has been applied.
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
@Override
public void execute() {
if (popup != null) {
// the arrow is ~16 pixels long
popup.setPopupPosition(dataIndicatorsUi.getAbsoluteLeft() - popup.getOffsetWidth() - 16,
RegattaHeader.this.getAbsoluteTop() + RegattaHeader.this.getOffsetHeight() / 2
- popup.getOffsetHeight() / 2);
popup.setVisible(true);
}
}
});
event.preventDefault();
event.stopPropagation();
}
if (event.getTypeInt() == Event.ONMOUSEOUT && popup != null) {
popup.hide();
popup = null;
event.preventDefault();
event.stopPropagation();
}
}
});
}
public void setRegattaNavigation(PlaceNavigation<?> placeNavigation) {
headerArrowUi.getStyle().clearDisplay();
dataIndicatorsUi.addClassName(local_res.css().regattaheader_indicators_next_to_arrow());
placeNavigation.configureAnchorElement(headerBodyUi);
placeNavigation.configureAnchorElement(headerArrowUi);
}
public void setRegattaRacesNavigation(PlaceNavigation<?> placeNavigation) {
placeNavigation.configureAnchorElement(dataIndicatorsUi);
}
private void initDataIndicators(RaceDataInfo raceDataInfo) {
String disabledStyle = local_res.css().regattaheader_indicator_disabled();
UIObject.setStyleName(gpsDataIndicatorUi, disabledStyle, !raceDataInfo.hasGPSData());
@@ -54,5 +113,4 @@ public class RegattaHeader extends Composite {
UIObject.setStyleName(audioDataIndicatorUi, disabledStyle, !raceDataInfo.hasAudioData());
}
}
@@ -1,25 +1,25 @@
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder" xmlns:g="urn:import:com.google.gwt.user.client.ui"
xmlns:s="urn:import:com.sap.sailing.gwt.home.client.shared">
<ui:with field="i18n" type="com.sap.sailing.gwt.ui.client.StringMessages" />
<ui:with field="res" type="com.sap.sailing.gwt.common.client.SharedResources" />
<ui:with field="local_res" type="com.sap.sailing.gwt.home.desktop.partials.regattaheader.RegattaHeaderResources" />
<g:HTMLPanel debugId="RegattaHeaderPanel">
<div>
<div class="{res.mediaCss.grid}">
<div class="{res.mediaCss.small12} {res.mediaCss.columns}">
<a class="{local_res.css.regattaheader} {local_res.css.regattaheaderpadding}" ui:field="headerBodyUi"></a>
xmlns:s="urn:import:com.sap.sailing.gwt.home.client.shared">
<ui:with field="i18n" type="com.sap.sailing.gwt.ui.client.StringMessages" />
<ui:with field="res" type="com.sap.sailing.gwt.common.client.SharedResources" />
<ui:with field="local_res" type="com.sap.sailing.gwt.home.desktop.partials.regattaheader.RegattaHeaderResources" />
<g:HTMLPanel debugId="RegattaHeaderPanel">
<div>
<div class="{res.mediaCss.grid}">
<div class="{res.mediaCss.small12} {res.mediaCss.columns}">
<a class="{local_res.css.regattaheader} {local_res.css.regattaheaderpadding}" ui:field="headerBodyUi"></a>
<a class="{local_res.css.regattaheader_indicators}" ui:field="dataIndicatorsUi">
<div>
<div style="background-image:url('images/home/raw_gps_fixes.png');" ui:field="gpsDataIndicatorUi"></div>
<div style="background-image:url('images/home/icon-wind.png');" ui:field="windDataIndicatorUi"></div>
<div style="background-image:url('images/home/icon-video.png');" ui:field="videoDataIndicatorUi"></div>
<div style="background-image:url('images/home/icon-audio.png');" ui:field="audioDataIndicatorUi"></div>
<div style="pointer-events: none;">
<div style="pointer-events: none; background-image:url('images/home/raw_gps_fixes.png');" ui:field="gpsDataIndicatorUi"></div>
<div style="pointer-events: none; background-image:url('images/home/icon-wind.png');" ui:field="windDataIndicatorUi"></div>
<div style="pointer-events: none; background-image:url('images/home/icon-video.png');" ui:field="videoDataIndicatorUi"></div>
<div style="pointer-events: none; background-image:url('images/home/icon-audio.png');" ui:field="audioDataIndicatorUi"></div>
</div>
</a>
<a class="{local_res.css.regattaheader_arrow}" style="display:none;" ui:field="headerArrowUi"></a>
</div>
</div>
</div>
</g:HTMLPanel>
<a class="{local_res.css.regattaheader_arrow}" style="display:none;" ui:field="headerArrowUi"></a>
</div>
</div>
</div>
</g:HTMLPanel>
</ui:UiBinder>
@@ -1,18 +1,18 @@
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder" xmlns:g="urn:import:com.google.gwt.user.client.ui"
xmlns:s="urn:import:com.sap.sailing.gwt.home.client.shared">
<ui:with field="i18n" type="com.sap.sailing.gwt.ui.client.StringMessages" />
<ui:with field="res" type="com.sap.sailing.gwt.common.client.SharedResources" />
<ui:with field="local_res" type="com.sap.sailing.gwt.home.desktop.partials.regattaheader.RegattaHeaderResources" />
<div>
<div class="{local_res.css.regattaheader_logo}" ui:field="logoUi"></div>
<div class="{local_res.css.regattaheader_content}">
<div class="{local_res.css.regattaheader_content_title}">
<span ui:field="nameUi"></span>
<div class="{res.mainCss.label}" ui:field="labelUi"></div>
</div>
<div class="{local_res.css.regattaheader_content_details}" ui:field="detailsItemContainerUi">
</div>
</div>
</div>
xmlns:s="urn:import:com.sap.sailing.gwt.home.client.shared">
<ui:with field="i18n" type="com.sap.sailing.gwt.ui.client.StringMessages" />
<ui:with field="res" type="com.sap.sailing.gwt.common.client.SharedResources" />
<ui:with field="local_res" type="com.sap.sailing.gwt.home.desktop.partials.regattaheader.RegattaHeaderResources" />
<div>
<div class="{local_res.css.regattaheader_logo}" ui:field="logoUi"></div>
<div class="{local_res.css.regattaheader_content}">
<div class="{local_res.css.regattaheader_content_title}">
<span ui:field="nameUi"></span>
<div class="{res.mainCss.label}" ui:field="labelUi"></div>
</div>
<div class="{local_res.css.regattaheader_content_details}" ui:field="detailsItemContainerUi">
</div>
</div>
</div>
</ui:UiBinder>
@@ -0,0 +1,55 @@
package com.sap.sailing.gwt.home.desktop.partials.regattaheader;
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.PopupPanel;
import com.google.gwt.user.client.ui.Widget;
import com.sap.sailing.gwt.home.communication.eventview.RegattaMetadataDTO.RaceDataInfo;
import com.sap.sailing.gwt.ui.client.StringMessages;
public class RegattaHeaderLegendPopup extends PopupPanel {
private static RegattaHeaderLegendPopupUiBinder uiBinder = GWT.create(RegattaHeaderLegendPopupUiBinder.class);
interface RegattaHeaderLegendPopupUiBinder extends UiBinder<Widget, RegattaHeaderLegendPopup> {
}
@UiField
DivElement txtGPS;
@UiField
DivElement txtWind;
@UiField
DivElement txtVideo;
@UiField
DivElement txtAudio;
@UiField
DivElement iconGPS;
@UiField
DivElement iconWind;
@UiField
DivElement iconVideo;
@UiField
DivElement iconAudio;
public RegattaHeaderLegendPopup(RaceDataInfo raceDataInfo) {
super(true);
setWidget(uiBinder.createAndBindUi(this));
txtGPS.setInnerText(
raceDataInfo.hasGPSData() ? StringMessages.INSTANCE.eventRegattaHeaderLegendGps()
: StringMessages.INSTANCE.eventRegattaHeaderLegendGpsNo());
txtWind.setInnerText(raceDataInfo.hasWindData() ? StringMessages.INSTANCE.eventRegattaHeaderLegendWind()
: StringMessages.INSTANCE.eventRegattaHeaderLegendWindNo());
txtVideo.setInnerText(raceDataInfo.hasVideoData() ? StringMessages.INSTANCE.eventRegattaHeaderLegendVideo()
: StringMessages.INSTANCE.eventRegattaHeaderLegendVideoNo());
txtAudio.setInnerText(raceDataInfo.hasAudioData() ? StringMessages.INSTANCE.eventRegattaHeaderLegendAudio()
: StringMessages.INSTANCE.eventRegattaHeaderLegendAudioNo());
iconGPS.getStyle().setOpacity(raceDataInfo.hasGPSData() ? 1.0 : 0.15);
iconWind.getStyle().setOpacity(raceDataInfo.hasWindData() ? 1.0 : 0.15);
iconVideo.getStyle().setOpacity(raceDataInfo.hasVideoData() ? 1.0 : 0.15);
iconAudio.getStyle().setOpacity(raceDataInfo.hasAudioData() ? 1.0 : 0.15);
}
}
@@ -0,0 +1,83 @@
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
xmlns:g="urn:import:com.google.gwt.user.client.ui">
<ui:with field="res" type="com.sap.sailing.gwt.common.client.SharedResources" />
<ui:style>
.iconGPS, .iconWind, .iconVideo, .iconAudio{
line-height: 1.5em;
position: relative;
height:1.666666666666667rem;
display: inline-block;
padding-left: 2.333333333333333em;
background-size: 1.666666666666667rem 1.666666666666667rem;
background-position: left bottom;
background-repeat: no-repeat;
}
.iconGPS {
background-image:url('images/home/raw_gps_fixes.png');
}
.iconWind {
margin-left: 0.666666666666667em;
background-image:url('images/home/icon-wind.png');
border-left: 1px solid #ccc;
}
.iconVideo {
background-image:url('images/home/icon-video.png');
padding-top: 0.277777777777778em;
}
.iconAudio {
margin-left: 0.666666666666667em;
background-image:url('images/home/icon-audio.png');
border-left: 1px solid #ccc;
padding-top: 0.277777777777778em;
}
.legend{
padding: .2em;
border-radius: .277777777777778em;
width:100%;
background-color:white;
border: 1px solid #ccc;
}
.legend:after, .legend:before {
left: 100%;
top: 50%;
border: solid transparent;
content: " ";
height: 0;
width: 0;
position: absolute;
// pointer-events: none;
}
.legend:after {
border-color: rgba(255, 255, 255, 0);
border-left-color: #ffffff;
border-width: .55em;
margin-top: -0.55em;
margin-left: -2px;
}
.legend:before {
border-color: rgba(204, 204, 204, 0);
border-left-color: #ccc;
border-width: 0.55em;
margin-top: -0.55em;
}
</ui:style>
<g:HTMLPanel styleName="{style.legend}">
<table>
<tr>
<td><div ui:field="iconGPS" class="{style.iconGPS}"/></td>
<td><div ui:field="txtGPS"/></td>
<td><div ui:field="iconWind" class="{style.iconWind}"/></td>
<td><div ui:field="txtWind"/></td>
</tr>
<tr>
<td><div ui:field="iconVideo" class="{style.iconVideo}"/></td>
<td><div ui:field="txtVideo"/></td>
<td><div ui:field="iconAudio" class="{style.iconAudio}"/></td>
<td><div ui:field="txtAudio"/></td>
</tr>
</table>
</g:HTMLPanel>
</ui:UiBinder>
@@ -196,9 +196,13 @@ public class RegattaRacesTabView extends Composite implements RegattaTabView<Reg
private final SortableRaceListColumn<RaceListRaceDTO, ?> videoCountColumn = RaceListColumnFactory.getVideoCountColumn();
private final SortableRaceListColumn<RaceListRaceDTO, ?> audioCountColumn = RaceListColumnFactory.getAudioCountColumn();
private final SortableRaceListColumn<RaceListRaceDTO, ?> winnerColumn = RaceListColumnFactory.getWinnerColumn();
private boolean hasWind;
private boolean hasVideos;
private boolean hasAudios;
public RaceListFinishedRaces(EventView.Presenter presenter) {
super(presenter, new RaceListColumnSet(1, 1));
super(presenter, new RaceListColumnSet(1, 1), true);
}
@Override
@@ -212,12 +216,15 @@ public class RegattaRacesTabView extends Composite implements RegattaTabView<Reg
// TODO: this.startTimeColumn.setShowTimeOnly(!RaceListDataUtil.hasDifferentStartDates(data));
this.startTimeColumn.setShowTimeOnly(false);
this.durationColumn.setShowDetails(RaceListDataUtil.hasDurations(data));
boolean hasWind = RaceListDataUtil.hasWind(data);
this.hasWind = RaceListDataUtil.hasWind(data);
this.hasVideos = RaceListDataUtil.hasVideos(data);
this.hasAudios = RaceListDataUtil.hasAudios(data);
this.windSpeedColumn.setShowDetails(hasWind);
this.windDirectionColumn.setShowDetails(hasWind);
this.windSourcesCountColumn.setShowDetails(RaceListDataUtil.hasWindSources(data));
this.videoCountColumn.setShowDetails(RaceListDataUtil.hasVideos(data));
this.audioCountColumn.setShowDetails(RaceListDataUtil.hasAudios(data));
this.videoCountColumn.setShowDetails(hasVideos);
this.audioCountColumn.setShowDetails(hasAudios);
this.winnerColumn.setShowDetails(RaceListDataUtil.hasWinner(data));
super.setTableData(data);
}
@@ -245,6 +252,21 @@ public class RegattaRacesTabView extends Composite implements RegattaTabView<Reg
columnSet.addColumn(audioCountColumn);
columnSet.addColumn(fleetNameColumn);
}
@Override
public boolean hasWind() {
return hasWind;
}
@Override
public boolean hasVideos() {
return hasVideos;
}
@Override
public boolean hasAudios() {
return hasAudios;
}
}
@@ -7,9 +7,9 @@
margin-bottom: 2em;
}
.temp {
font-weight: bold;
font-style: italic;
}
font-weight: bold;
font-style: italic;
}
</ui:style>
<g:HTMLPanel>
<div class="{res.mediaCss.grid}">
@@ -1762,5 +1762,16 @@ public interface StringMessages extends com.sap.sse.gwt.client.StringMessages,
String searchTagForImportedCompetitorPlaceholder();
String version(String version);
String replicables();
String eventRegattaRacesLegendWind();
String eventRegattaRacesLegendVideo();
String eventRegattaRacesLegendAudio();
String eventRegattaHeaderLegendGps();
String eventRegattaHeaderLegendGpsNo();
String eventRegattaHeaderLegendWind();
String eventRegattaHeaderLegendWindNo();
String eventRegattaHeaderLegendVideo();
String eventRegattaHeaderLegendVideoNo();
String eventRegattaHeaderLegendAudio();
String eventRegattaHeaderLegendAudioNo();
String set();
}
@@ -1735,4 +1735,15 @@ couldNotSaveCompetitorRegistrations=Could not save competitor registrations: {0}
searchTagForImportedCompetitorPlaceholder=Use, e.g., the race+fleet name
version=Version: {0}
replicables=Replicating objects
set=Set
set=Set
eventRegattaRacesLegendWind=# Wind sensors
eventRegattaRacesLegendVideo=# Video streams
eventRegattaRacesLegendAudio=# Audio Streams
eventRegattaHeaderLegendGps=Has tracking data
eventRegattaHeaderLegendWind=Has wind data
eventRegattaHeaderLegendVideo=Has video streams
eventRegattaHeaderLegendAudio=Has audio streams
eventRegattaHeaderLegendGpsNo=No tracking data
eventRegattaHeaderLegendWindNo=No wind data
eventRegattaHeaderLegendVideoNo=No video streams
eventRegattaHeaderLegendAudioNo=No audio streams
@@ -1,4 +1,3 @@
manage2Sail=Manage2Sail
raceCommitteeApp=Race Manager App
raceViewer=Race viewer
@@ -1721,4 +1720,15 @@ couldNotSaveCompetitorRegistrations=Teilnehmerregistrierung konnte nicht gespeic
searchTagForImportedCompetitorPlaceholder=Z.B. Renn- und Gruppenname
version=Version: {0}
replicables=Replizierte Objekte
set=Setzen
set=Setzen
eventRegattaRacesLegendWind=Nr. Windsensoren
eventRegattaRacesLegendVideo=Nr. Videostreams
eventRegattaRacesLegendAudio=Nr. Audiostreams
eventRegattaHeaderLegendGps=Hat Trackinginformationen
eventRegattaHeaderLegendWind=Hat Winddaten
eventRegattaHeaderLegendVideo=Hat Videostreams
eventRegattaHeaderLegendAudio=Hat Audiostreams
eventRegattaHeaderLegendGpsNo=Keine Trackinginformationen
eventRegattaHeaderLegendWindNo=Keine Winddaten
eventRegattaHeaderLegendVideoNo=Keine Videostreams
eventRegattaHeaderLegendAudioNo=Keine Audiostreams
@@ -250,31 +250,42 @@ public abstract class AbstractCompetitorRaceChart<SettingsType extends ChartSett
GetCompetitorsRaceDataAction getCompetitorsRaceDataAction = new GetCompetitorsRaceDataAction(sailingService,
selectedRaceIdentifier, competitorsToLoad, from, to, stepSize, selectedDataTypeToRetrieve,
leaderboardGroupName, leaderboardName);
asyncActionsExecutor.execute(getCompetitorsRaceDataAction, LOAD_COMPETITOR_CHART_DATA_CATEGORY,
new AsyncCallback<CompetitorsRaceDataDTO>() {
@Override
public void onSuccess(final CompetitorsRaceDataDTO result) {
hideLoading();
if (result != null) {
if (result.isEmpty() && chartContainsNoData()) {
setWidget(noDataFoundLabel);
} else {
updateChartSeries(result, selectedDataTypeToRetrieve, append,tholder);
}
} else {
if (!append) {
clearChart();
}
}
}
@Override
public void onFailure(Throwable caught) {
hideLoading();
errorReporter.reportError(stringMessages.errorFetchingChartData(caught.getMessage()),
timer.getPlayMode() == PlayModes.Live);
AsyncCallback<CompetitorsRaceDataDTO> dataLoadedCallback = new AsyncCallback<CompetitorsRaceDataDTO>() {
@Override
public void onSuccess(final CompetitorsRaceDataDTO result) {
hideLoading();
if (result != null) {
if (result.isEmpty() && chartContainsNoData()) {
setWidget(noDataFoundLabel);
} else {
updateChartSeries(result, selectedDataTypeToRetrieve, append, tholder);
}
});
} else {
if (!append) {
clearChart();
}
}
}
@Override
public void onFailure(Throwable caught) {
hideLoading();
errorReporter.reportError(stringMessages.errorFetchingChartData(caught.getMessage()),
timer.getPlayMode() == PlayModes.Live);
}
};
if (append) {
// this call is repeated, allow it to be throttled and dropped
asyncActionsExecutor.execute(getCompetitorsRaceDataAction, LOAD_COMPETITOR_CHART_DATA_CATEGORY,
dataLoadedCallback);
} else {
// ensure that non appending only once loading is reliable and cannot be dropped by not using
// asyncActionExecutor
getCompetitorsRaceDataAction.execute(dataLoadedCallback);
}
}
private boolean chartContainsNoData() {