Added a string message for values that need to be greater than something, added an error when the hoverline weight is smaller than 0 or bigger than 33, fixed a bug with the hoverlines loosing their options when jumping in time and remove the hoverlines hashset again, because it would have caused problems with not anymore used hoverlines collecting in the set and not being removed

This commit is contained in:
U-GLOBAL\D060458 committed 2015-11-30 18:17:37 +01:00
1 parent e266980549
commit 5969464fed
7 files changed
+32 -25

No files matched your search

@@ -437,6 +437,7 @@ public interface StringMessages extends com.sap.sse.gwt.client.StringMessages, c
String hhmmssUnit();
String actionAddWindData();
String valueMustBeBetweenMinMax(String name, String minValue, String maxValue);
String valueMustBeGreaterThan(String name, String minValue);
String optional();
String pleaseEnterAValue();
String latitude();
@@ -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
@@ -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
@@ -440,6 +440,7 @@ totalAverageSpeedOverGroundTooltip=Средняя скорость относи
hhmmssUnit=чч:мм:сс
actionAddWindData=Добавить данные о ветре
valueMustBeBetweenMinMax=Значение ''{0}''должно быть в пределах от {1} до {2}.
valueMustBeGreaterThan=The value of ''{0}'' must be greater than {1}.
optional=Дополнительно
pleaseEnterAValue=Введите, пожалуйста, значение.
latitude=Широта
@@ -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.
@@ -1,8 +1,5 @@
package com.sap.sailing.gwt.ui.client.shared.racemap;
import java.util.HashSet;
import java.util.Set;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.maps.client.MapWidget;
import com.google.gwt.maps.client.base.LatLng;
@@ -18,25 +15,25 @@ import com.google.gwt.maps.client.overlays.PolylineOptions;
class Hoverline {
private static final double TRANSPARENT = 0;
private static final double VISIBLE = 0.2d;
private static final Set<Hoverline> hoverlines = new HashSet<>();
private static boolean transparent = true;
private static int weight = 10;
private Polyline hoverline;
private PolylineOptions options;
public Hoverline(final Polyline polyline, PolylineOptions options) {
hoverlines.add(this);
public Hoverline(final Polyline polyline, PolylineOptions polylineOptions) {
this.options = PolylineOptions.newInstance();
this.options.setClickable(options.getClickable());
this.options.setGeodesic(options.getGeodesic());
this.options.setMap(options.getMap());
this.options.setPath(options.getPath_JsArray());
this.options.setStrokeColor(options.getStrokeColor());
this.options.setStrokeOpacity(TRANSPARENT);
this.options.setStrokeWeight(10);
this.options.setVisible(options.getVisible());
this.options.setZindex(options.getZindex());
this.options.setClickable(polylineOptions.getClickable());
this.options.setGeodesic(polylineOptions.getGeodesic());
this.options.setMap(polylineOptions.getMap());
this.options.setPath(polylineOptions.getPath_JsArray());
this.options.setStrokeColor(polylineOptions.getStrokeColor());
this.options.setStrokeOpacity(Hoverline.transparent ? TRANSPARENT : VISIBLE);
this.options.setStrokeWeight(weight);
this.options.setVisible(polylineOptions.getVisible());
this.options.setZindex(polylineOptions.getZindex());
hoverline = Polyline.newInstance(this.options);
@@ -45,8 +42,13 @@ class Hoverline {
polyline.addMouseOverHandler(new MouseOverMapHandler() {
@Override
public void onEvent(MouseOverMapEvent event) {
options.setStrokeOpacity(Hoverline.getOpacity());
options.setStrokeWeight(weight);
hoverline.setOptions(options);
hoverline.setMap(polyline.getMap());
hoverline.setPath(polyline.getPath());
hoverline.setVisible(true);
}
});
@@ -65,17 +67,11 @@ class Hoverline {
}
public static void setTransparent(boolean transparent) {
for (Hoverline hoverline : hoverlines) {
hoverline.options.setStrokeOpacity(transparent ? TRANSPARENT : VISIBLE);
hoverline.hoverline.setOptions(hoverline.options);
}
Hoverline.transparent = transparent;
}
public static void setStrokeWeight(int weight) {
for (Hoverline hoverline : hoverlines) {
hoverline.options.setStrokeWeight(weight);
hoverline.hoverline.setOptions(hoverline.options);
}
Hoverline.weight = weight;
}
public MVCArray<LatLng> getPath() {
@@ -98,4 +94,8 @@ class Hoverline {
public HandlerRegistration addMouseOverHandler(MouseOverMapHandler handler) {
return this.hoverline.addMouseOverHandler(handler);
}
private static double getOpacity() {
return Hoverline.transparent ? TRANSPARENT : VISIBLE;
}
}
@@ -322,6 +322,8 @@ public class RaceMapSettingsDialogComponent implements SettingsDialogComponent<R
} else if (valueToValidate.getHelpLinesSettings().isVisible(HelpLineTypes.BUOYZONE)
&& (valueToValidate.getBuoyZoneRadiusInMeters() < 0.0 || valueToValidate.getBuoyZoneRadiusInMeters() > 100.0)) {
errorMessage = stringMessages.valueMustBeBetweenMinMax(stringMessages.buoyZone(), "0", "100");
} else if (valueToValidate.getHoverlineStrokeWeight() < 0d || valueToValidate.getHoverlineStrokeWeight() > 33d) {
errorMessage = stringMessages.valueMustBeBetweenMinMax(stringMessages.bufferLineStrokeWeight(), "0", "33");
}
return errorMessage;
}