Merge remote-tracking branch 'server/master'

This commit is contained in:
Axel Uhl committed 2015-12-03 16:10:16 +01:00
commit ac7f3de28d
12 files changed
+158 -23

No files matched your search

@@ -40,18 +40,18 @@ public class AddWindFixDialog extends DataEntryDialog<WindDTO> {
if(windDTO.trueWindSpeedInKnots == null) {
errorMessage = stringMessages.pleaseEnterAValue();
} else if(windDTO.trueWindSpeedInKnots != null && (windDTO.trueWindSpeedInKnots < 0.0 || windDTO.trueWindSpeedInKnots > 100.0)) {
errorMessage = stringMessages.valueMustBeBetweenMinMax(stringMessages.speedInKnots(), "0", "100");
errorMessage = stringMessages.valueMustBeBetweenMinMax(stringMessages.speedInKnots(), 0, 100);
} else if(windDTO.trueWindFromDeg == null){
errorMessage = stringMessages.pleaseEnterAValue();
} else if(windDTO.trueWindFromDeg != null && (windDTO.trueWindFromDeg < 0.0 || windDTO.trueWindFromDeg > 360.0)){
errorMessage = stringMessages.valueMustBeBetweenMinMax(stringMessages.fromDeg(), "0", "360");
errorMessage = stringMessages.valueMustBeBetweenMinMax(stringMessages.fromDeg(), 0, 360);
} else if(windDTO.measureTimepoint == null) {
errorMessage = stringMessages.pleaseEnterAValue();
} else if(windDTO.position != null) {
if(windDTO.position.getLatDeg() < -90.0 || windDTO.position.getLatDeg() > 90.0){
errorMessage = stringMessages.valueMustBeBetweenMinMax(stringMessages.latitude(), "-90", "90");
errorMessage = stringMessages.valueMustBeBetweenMinMax(stringMessages.latitude(), -90, 90);
} else if(windDTO.position.getLngDeg() < -180.0 || windDTO.position.getLngDeg() > 180.0){
errorMessage = stringMessages.valueMustBeBetweenMinMax(stringMessages.longitude(), "-180", "180");
errorMessage = stringMessages.valueMustBeBetweenMinMax(stringMessages.longitude(), -180, 180);
}
}
@@ -436,7 +436,8 @@ public interface StringMessages extends com.sap.sse.gwt.client.StringMessages, c
String overallDetailsToShow();
String hhmmssUnit();
String actionAddWindData();
String valueMustBeBetweenMinMax(String name, String minValue, String maxValue);
String valueMustBeBetweenMinMax(String name, int minValue, int maxValue);
String valueMustBeGreaterThan(String name, String minValue);
String optional();
String pleaseEnterAValue();
String latitude();
@@ -1444,4 +1445,6 @@ public interface StringMessages extends com.sap.sse.gwt.client.StringMessages, c
String requiresValidRegatta();
String couldNotObtainRace(String regattaLikeName, String raceColumnName, String fleetName, String technicalErrorMessage);
String errorTryingToCreateEmbeddedMap(String message);
String transparentBufferLineOnHover();
String bufferLineStrokeWeight();
}
@@ -456,6 +456,7 @@ totalAverageSpeedOverGroundTooltip=Average speed over ground across the regatta.
hhmmssUnit=hh:mm:ss
actionAddWindData=Add wind data
valueMustBeBetweenMinMax=The value of ''{0}'' must be between {1} and {2}.
valueMustBeGreaterThan=The value of ''{0}'' must be greater than {1}.
optional=optional
pleaseEnterAValue=Please enter a value.
latitude=Latitude
@@ -1410,4 +1411,6 @@ selectALeaderboardGroup=Select a leaderboard group...
pleaseSelect=Please select
requiresValidRegatta=This page requires a valid regatta, race column and fleet name to identify the race to show.
couldNotObtainRace=Could not obtain a race with name {1} for fleet {2} for a regatta with name {0}: {3}
errorTryingToCreateEmbeddedMap=Error trying to create the embedded map: {0}
errorTryingToCreateEmbeddedMap=Error trying to create the embedded map: {0}
transparentBufferLineOnHover=Transparent buffer lines on hover of helplines
bufferLineStrokeWeight=Buffer line stroke weight
@@ -456,7 +456,8 @@ totalAverageSpeedOverGround=\u2205 FüG
totalAverageSpeedOverGroundTooltip=Durchschnittliche Fahrt über Grund über die gesamte Regatta.
hhmmssUnit=hh:mm:ss
actionAddWindData=Winddaten hinzufügen
valueMustBeBetweenMinMax=Der Wert von ''{0}'' muß zwischen {1} und {2} sein.
valueMustBeBetweenMinMax=Der Wert von ''{0}'' muss zwischen {1} und {2} sein.
valueMustBeGreaterThan=Der Wert von ''{0}'' muss größer als {1} sein.
optional=optional
pleaseEnterAValue=Bitte geben Sie einen Wert ein.
latitude=Breite
@@ -1401,4 +1402,6 @@ selectALeaderboardGroup=Bitte eine Ranglisten-Gruppe auswählen...
pleaseSelect=Bitte auswählen
requiresValidRegatta=Diese Seite benötigt eine gültige Regatta, Rennspalte und einen gültigen Gruppennamen um die anzuzeigende Wettfahrt zu identifizieren.
couldNotObtainRace=Wettfahrt namens {1} für Gruppe {2} in einer Regatta names {0} konnte nicht gefunden werden: {3}
errorTryingToCreateEmbeddedMap=Fehler beim Erstellen der eingebetteten Karte: {0}
errorTryingToCreateEmbeddedMap=Fehler beim Erstellen der eingebetteten Karte: {0}
transparentBufferLineOnHover=Transparente Pufferlinien bei Maus über Hilfslinien
bufferLineStrokeWeight=Linienbreite der Pufferlinien
@@ -440,6 +440,7 @@ totalAverageSpeedOverGroundTooltip=Средняя скорость относи
hhmmssUnit=чч:мм:сс
actionAddWindData=Добавить данные о ветре
valueMustBeBetweenMinMax=Значение ''{0}''должно быть в пределах от {1} до {2}.
valueMustBeGreaterThan=The value of ''{0}'' must be greater than {1}.
optional=Дополнительно
pleaseEnterAValue=Введите, пожалуйста, значение.
latitude=Широта
@@ -1340,4 +1341,6 @@ selectALeaderboardGroup=Select a leaderboard group...
pleaseSelect=Please select
requiresValidRegatta=This page requires a valid regatta, race column and fleet name to identify the race to show.
couldNotObtainRace=Could not obtain a race with name {1} for fleet {2} for a regatta with name {0}: {3}
errorTryingToCreateEmbeddedMap=Error trying to create the embedded map: {0}
errorTryingToCreateEmbeddedMap=Error trying to create the embedded map: {0}
transparentBufferLineOnHover=Transparent buffer lines on hover of helplines
bufferLineStrokeWeight=Buffer line stroke weight
@@ -538,6 +538,7 @@ connectors=Connectors
dampeningInterval=Dampening Interval
trackBasedEstimationWindSourceTypeTooltip=Calculated data from the competitor tracks
valueMustBeBetweenMinMax=The value of ''{0}'' must be between {1} and {2}.
valueMustBeGreaterThan=The value of ''{0}'' must be greater than {1}.
orMultipleEmails=or multiple E-Mails separated by comma
searchEvents=Search for events
explainNoConnectionsFromReplicas=No connections from a replica found. You can connect replicas by using their AdminConsole.
@@ -1355,4 +1356,6 @@ selectALeaderboardGroup=Select a leaderboard group...
pleaseSelect=Please select
requiresValidRegatta=This page requires a valid regatta, race column and fleet name to identify the race to show.
couldNotObtainRace=Could not obtain a race with name {1} for fleet {2} for a regatta with name {0}: {3}
errorTryingToCreateEmbeddedMap=Error trying to create the embedded map: {0}
errorTryingToCreateEmbeddedMap=Error trying to create the embedded map: {0}
transparentBufferLineOnHover=Transparent buffer lines on hover of helplines
bufferLineStrokeWeight=Buffer line stroke weight
@@ -0,0 +1,57 @@
package com.sap.sailing.gwt.ui.client.shared.racemap;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.maps.client.events.click.ClickMapHandler;
import com.google.gwt.maps.client.events.mouseout.MouseOutMapEvent;
import com.google.gwt.maps.client.events.mouseout.MouseOutMapHandler;
import com.google.gwt.maps.client.events.mouseover.MouseOverMapEvent;
import com.google.gwt.maps.client.events.mouseover.MouseOverMapHandler;
import com.google.gwt.maps.client.overlays.Polyline;
import com.google.gwt.maps.client.overlays.PolylineOptions;
public class Hoverline {
private static final double TRANSPARENT = 0;
private static final double VISIBLE = 0.2d;
private final Polyline hoverline;
private final PolylineOptions options;
public Hoverline(final Polyline polyline, PolylineOptions polylineOptions, final RaceMap map) {
this.options = PolylineOptions.newInstance();
this.options.setClickable(polylineOptions.getClickable());
this.options.setGeodesic(polylineOptions.getGeodesic());
this.options.setMap(polyline.getMap());
this.options.setPath(polyline.getPath());
this.options.setStrokeColor(polylineOptions.getStrokeColor());
this.options.setZindex(polylineOptions.getZindex());
this.hoverline = Polyline.newInstance(this.options);
this.hoverline.setVisible(false);
polyline.addMouseOverHandler(new MouseOverMapHandler() {
@Override
public void onEvent(MouseOverMapEvent event) {
options.setStrokeOpacity(map.getSettings().getTransparentHoverlines() ? TRANSPARENT : VISIBLE);
options.setStrokeWeight(map.getSettings().getHoverlineStrokeWeight());
options.setVisible(true);
hoverline.setOptions(options);
}
});
hoverline.addMouseOutMoveHandler(new MouseOutMapHandler() {
@Override
public void onEvent(MouseOutMapEvent event) {
hoverline.setVisible(false);
}
});
}
public HandlerRegistration addClickHandler(ClickMapHandler handler) {
return this.hoverline.addClickHandler(handler);
}
public HandlerRegistration addMouseOutMoveHandler(MouseOutMapHandler handler) {
return this.hoverline.addMouseOutMoveHandler(handler);
}
public HandlerRegistration addMouseOverHandler(MouseOverMapHandler handler) {
return this.hoverline.addMouseOverHandler(handler);
}
}
@@ -1158,7 +1158,6 @@ public class RaceMap extends AbsolutePanel implements TimeListener, CompetitorSe
Polyline tail = fixesAndTails.getTail(competitorDTO);
if (tail == null) {
tail = fixesAndTails.createTailAndUpdateIndices(competitorDTO, tailsFromTime, tailsToTime, this);
tail.setMap(map);
} else {
fixesAndTails.updateTail(tail, competitorDTO, tailsFromTime, tailsToTime,
(int) (timeForPositionTransitionMillis==-1?-1:timeForPositionTransitionMillis/2));
@@ -1305,17 +1304,18 @@ public class RaceMap extends AbsolutePanel implements TimeListener, CompetitorSe
pointsAsArray.insertAt(0, advantageLinePos1);
pointsAsArray.insertAt(1, advantageLinePos2);
advantageLine.setPath(pointsAsArray);
advantageLine.setMap(map);
Hoverline advantageHoverline = new Hoverline(advantageLine, options, this);
advantageLineMouseOverHandler = new AdvantageLineMouseOverMapHandler(
bearingOfCombinedWindInDeg, new Date(windFix.measureTimepoint));
advantageLine.addMouseOverHandler(advantageLineMouseOverHandler);
advantageLine.addMouseOutMoveHandler(new MouseOutMapHandler() {
advantageHoverline.addMouseOutMoveHandler(new MouseOutMapHandler() {
@Override
public void onEvent(MouseOutMapEvent event) {
map.setTitle("");
}
});
advantageLine.setMap(map);
} else {
advantageLine.getPath().removeAt(1);
advantageLine.getPath().removeAt(0);
@@ -1561,20 +1561,20 @@ public class RaceMap extends AbsolutePanel implements TimeListener, CompetitorSe
pointsAsArray = MVCArray.newInstance();
lineToShowOrRemoveOrUpdate = Polyline.newInstance(options);
lineToShowOrRemoveOrUpdate.setPath(pointsAsArray);
lineToShowOrRemoveOrUpdate.setMap(map);
Hoverline lineToShowOrRemoveOrUpdateHoverline = new Hoverline(lineToShowOrRemoveOrUpdate, options, this);
lineToShowOrRemoveOrUpdate.addMouseOverHandler(new MouseOverMapHandler() {
@Override
public void onEvent(MouseOverMapEvent event) {
map.setTitle(lineInfoProvider.getLineInfo());
}
});
lineToShowOrRemoveOrUpdate.addMouseOutMoveHandler(new MouseOutMapHandler() {
lineToShowOrRemoveOrUpdateHoverline.addMouseOutMoveHandler(new MouseOutMapHandler() {
@Override
public void onEvent(MouseOutMapEvent event) {
map.setTitle("");
}
});
lineToShowOrRemoveOrUpdate.setMap(map);
} else {
pointsAsArray = lineToShowOrRemoveOrUpdate.getPath();
pointsAsArray.removeAt(1);
@@ -2328,6 +2328,12 @@ public class RaceMap extends AbsolutePanel implements TimeListener, CompetitorSe
updateCoordinateSystemFromSettings();
requiredRedraw = true;
}
if (newSettings.getTransparentHoverlines() != settings.getTransparentHoverlines()) {
settings.setTransparentHoverlines(newSettings.getTransparentHoverlines());
}
if (newSettings.getHoverlineStrokeWeight() != settings.getHoverlineStrokeWeight()) {
settings.setHoverlineStrokeWeight(newSettings.getHoverlineStrokeWeight());
}
if (requiredRedraw) {
redraw();
}
@@ -2493,23 +2499,25 @@ public class RaceMap extends AbsolutePanel implements TimeListener, CompetitorSe
public Polyline createTail(final CompetitorDTO competitor, List<LatLng> points) {
PolylineOptions options = createTailStyle(competitor, displayHighlighted(competitor));
Polyline result = Polyline.newInstance(options);
MVCArray<LatLng> pointsAsArray = MVCArray.newInstance(points.toArray(new LatLng[0]));
result.setPath(pointsAsArray);
result.addClickHandler(new ClickMapHandler() {
result.setMap(map);
Hoverline resultHoverline = new Hoverline(result, options, this);
final ClickMapHandler clickHandler = new ClickMapHandler() {
@Override
public void onEvent(ClickMapEvent event) {
showCompetitorInfoWindow(competitor, event.getMouseEvent().getLatLng());
}
});
};
result.addClickHandler(clickHandler);
resultHoverline.addClickHandler(clickHandler);
result.addMouseOverHandler(new MouseOverMapHandler() {
@Override
public void onEvent(MouseOverMapEvent event) {
map.setTitle(competitor.getSailID() + ", " + competitor.getName());
}
});
result.addMouseOutMoveHandler(new MouseOutMapHandler() {
resultHoverline.addMouseOutMoveHandler(new MouseOutMapHandler() {
@Override
public void onEvent(MouseOutMapEvent event) {
map.setTitle("");
@@ -19,6 +19,10 @@ public class RaceMapSettings extends AbstractSettings {
private RaceMapZoomSettings zoomSettings;
private RaceMapHelpLinesSettings helpLinesSettings;
private boolean transparentHoverlines = true;
private int hoverlineStrokeWeight = 10;
private long tailLengthInMilliseconds = 100000l;
@@ -55,6 +59,8 @@ public class RaceMapSettings extends AbstractSettings {
public RaceMapSettings(RaceMapSettings settings) {
this.buoyZoneRadiusInMeters = settings.buoyZoneRadiusInMeters;
this.helpLinesSettings = new RaceMapHelpLinesSettings(settings.getHelpLinesSettings().getVisibleHelpLineTypes());
this.transparentHoverlines = settings.transparentHoverlines;
this.hoverlineStrokeWeight = settings.hoverlineStrokeWeight;
this.maneuverTypesToShow = settings.maneuverTypesToShow;
this.showDouglasPeuckerPoints = settings.showDouglasPeuckerPoints;
this.showOnlySelectedCompetitors = settings.showOnlySelectedCompetitors;
@@ -153,6 +159,22 @@ public class RaceMapSettings extends AbstractSettings {
public void setHelpLinesSettings(RaceMapHelpLinesSettings helpLinesSettings) {
this.helpLinesSettings = helpLinesSettings;
}
public boolean getTransparentHoverlines() {
return this.transparentHoverlines;
}
public void setTransparentHoverlines(boolean transparentHoverlines) {
this.transparentHoverlines = transparentHoverlines;
}
public int getHoverlineStrokeWeight() {
return this.hoverlineStrokeWeight;
}
public void setHoverlineStrokeWeight(int hoverlineStrokeWeight) {
this.hoverlineStrokeWeight = hoverlineStrokeWeight;
}
public boolean isShowSelectedCompetitorsInfo() {
return showSelectedCompetitorsInfo;
@@ -24,11 +24,14 @@ import com.sap.sailing.gwt.ui.client.StringMessages;
import com.sap.sailing.gwt.ui.client.shared.racemap.RaceMapHelpLinesSettings.HelpLineTypes;
import com.sap.sailing.gwt.ui.client.shared.racemap.RaceMapZoomSettings.ZoomTypes;
import com.sap.sse.common.Util;
import com.sap.sse.gwt.client.controls.IntegerBox;
import com.sap.sse.gwt.client.dialog.DataEntryDialog;
import com.sap.sse.gwt.client.dialog.DataEntryDialog.Validator;
import com.sap.sse.gwt.client.shared.components.SettingsDialogComponent;
public class RaceMapSettingsDialogComponent implements SettingsDialogComponent<RaceMapSettings> {
private static final int MAX_BUOY_ZONE_RADIUS_IN_METERS = 100;
private static final int MAX_STROKE_WEIGHT = 33;
//Initializing the lists to prevent a null pointer exception in the first validation call
private List<Util.Pair<CheckBox, ManeuverType>> checkboxAndManeuverType = new ArrayList<Util.Pair<CheckBox, ManeuverType>>();
private List<Util.Pair<CheckBox, ZoomTypes>> checkboxAndZoomType = new ArrayList<Util.Pair<CheckBox,ZoomTypes>>();
@@ -43,6 +46,8 @@ public class RaceMapSettingsDialogComponent implements SettingsDialogComponent<R
private CheckBox showSelectedCompetitorsInfoCheckBox;
private LongBox tailLengthBox;
private DoubleBox buoyZoneRadiusBox;
private CheckBox transparentHoverlines;
private IntegerBox hoverlineStrokeWeight;
private boolean showViewSimulation;
private final StringMessages stringMessages;
@@ -211,6 +216,17 @@ public class RaceMapSettingsDialogComponent implements SettingsDialogComponent<R
vp.add(createHelpLineCheckBox(dialog, HelpLineTypes.STARTLINETOFIRSTMARKTRIANGLE));
vp.add(createHelpLineCheckBox(dialog, HelpLineTypes.COURSEGEOMETRY));
transparentHoverlines = dialog.createCheckbox(stringMessages.transparentBufferLineOnHover());
transparentHoverlines.setValue(initialSettings.getTransparentHoverlines());
vp.add(transparentHoverlines);
HorizontalPanel hoverlineStrokeWeightPanel = new HorizontalPanel();
Label hoverlineStrokeWeightLabel = new Label(stringMessages.bufferLineStrokeWeight() + ":");
hoverlineStrokeWeightPanel.add(hoverlineStrokeWeightLabel);
hoverlineStrokeWeight = dialog.createIntegerBox(initialSettings.getHoverlineStrokeWeight(), 3);
hoverlineStrokeWeightPanel.add(hoverlineStrokeWeight);
vp.add(hoverlineStrokeWeightPanel);
return vp;
}
@@ -267,6 +283,8 @@ public class RaceMapSettingsDialogComponent implements SettingsDialogComponent<R
result.setBuoyZoneRadiusInMeters(value);
}
}
result.setTransparentHoverlines(transparentHoverlines.getValue());
result.setHoverlineStrokeWeight(hoverlineStrokeWeight.getValue());
return result;
}
@@ -304,8 +322,10 @@ public class RaceMapSettingsDialogComponent implements SettingsDialogComponent<R
if (valueToValidate.getHelpLinesSettings().isVisible(HelpLineTypes.BOATTAILS) && valueToValidate.getTailLengthInMilliseconds() <= 0) {
errorMessage = stringMessages.tailLengthMustBePositive();
} else if (valueToValidate.getHelpLinesSettings().isVisible(HelpLineTypes.BUOYZONE)
&& (valueToValidate.getBuoyZoneRadiusInMeters() < 0.0 || valueToValidate.getBuoyZoneRadiusInMeters() > 100.0)) {
errorMessage = stringMessages.valueMustBeBetweenMinMax(stringMessages.buoyZone(), "0", "100");
&& (valueToValidate.getBuoyZoneRadiusInMeters() < 0 || valueToValidate.getBuoyZoneRadiusInMeters() > MAX_BUOY_ZONE_RADIUS_IN_METERS)) {
errorMessage = stringMessages.valueMustBeBetweenMinMax(stringMessages.buoyZone(), 0, 100);
} else if (valueToValidate.getHoverlineStrokeWeight() < 0 || valueToValidate.getHoverlineStrokeWeight() > MAX_STROKE_WEIGHT) {
errorMessage = stringMessages.valueMustBeBetweenMinMax(stringMessages.bufferLineStrokeWeight(), 0, MAX_STROKE_WEIGHT);
}
return errorMessage;
}
@@ -4,6 +4,16 @@
<div id="mainContent">
<h4 class="articleHeadline">What's New - SAP Sailing Analytics</h4>
<div class="innerContent">
<h5 class="articleSubheadline">December 2015</h5>
<ul class="bulletList">
<li>New line hover behavior in race map. When the mouse is moved onto a line, for example the start line, a transparent,
wider line is activated behind it that acts as a buffer for the thin line, where the text displayed by the hover is still shown.
This makes it easier to hover over the lines. These wider lines can be made semi transparent instead of transparent
by unticking the corresponding checkbox in the settings of the race map. Furthermore the stroke weight of the wider lines can be
configured in the same settings dialog.
</li>
</ul>
<h5 class="articleSubheadline">November 2015</h5>
<ul class="bulletList">
@@ -7,6 +7,9 @@ import com.google.gwt.text.client.IntegerParser;
import com.google.gwt.text.shared.Renderer;
import com.google.gwt.user.client.ui.ValueBox;
/**
* Renders integers in their box without any separators, non-localized, plain.
*/
public class IntegerBox extends ValueBox<Integer> {
private static final Renderer<Integer> RENDERER = new Renderer<Integer>() {
public String render(Integer object) {