mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-28 14:57:12 +00:00
Merge branch 'master' into bug1662-timer
This commit is contained in:
commit
fddf3d047c
19 files changed
+195
-40
No files matched your search
+1
-1
@@ -21,7 +21,7 @@ public abstract class AbstractSpeedImpl implements Speed {
|
||||
|
||||
@Override
|
||||
public Duration getDuration(Distance distance) {
|
||||
return new MillisecondsDurationImpl((long) (1000 * distance.getMeters() / getMetersPerSecond()));
|
||||
return distance == null ? null : new MillisecondsDurationImpl((long) (1000 * distance.getMeters() / getMetersPerSecond()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+6
-7
@@ -4,7 +4,6 @@ import java.util.logging.Logger;
|
||||
|
||||
import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sailing.domain.common.tracking.GPSFixMoving;
|
||||
import com.sap.sailing.domain.common.tracking.impl.GPSFixMovingImpl;
|
||||
import com.sap.sailing.domain.tracking.DynamicTrackedRace;
|
||||
import com.sap.sailing.domain.tracking.DynamicTrackedRegatta;
|
||||
import com.sap.sailing.domain.tractracadapter.DomainFactory;
|
||||
@@ -57,13 +56,13 @@ public class RawPositionReceiver extends AbstractReceiverWithQueue<IRaceCompetit
|
||||
IRace race = event.getA().getRace();
|
||||
DynamicTrackedRace trackedRace = getTrackedRace(race);
|
||||
if (trackedRace != null) {
|
||||
GPSFixMoving fix = getDomainFactory().createGPSFixMoving(event.getB());
|
||||
if (getSimulator() != null) {
|
||||
fix = new GPSFixMovingImpl(fix.getPosition(), getSimulator().delay(
|
||||
fix.getTimePoint()), fix.getSpeed());
|
||||
}
|
||||
final GPSFixMoving fix = getDomainFactory().createGPSFixMoving(event.getB());
|
||||
Competitor competitor = getDomainFactory().getOrCreateCompetitor(event.getA().getCompetitor());
|
||||
trackedRace.recordFix(competitor, fix);
|
||||
if (getSimulator() != null) {
|
||||
getSimulator().scheduleCompetitorPosition(competitor, fix);
|
||||
} else {
|
||||
trackedRace.recordFix(competitor, fix);
|
||||
}
|
||||
} else {
|
||||
logger.warning("Couldn't find tracked race for race " + race.getName()
|
||||
+ ". Dropping raw position event " + event);
|
||||
|
||||
+20
-6
@@ -162,7 +162,7 @@ public class Simulator {
|
||||
|
||||
/**
|
||||
* If {@link #advanceInMillis} is already set to a non-negative value, it is left alone, and
|
||||
* {@link #delay(TimePoint)} is called. Otherwise, <code>time</code> is taken to be the original start time of the
|
||||
* {@link #advance(TimePoint)} is called. Otherwise, <code>time</code> is taken to be the original start time of the
|
||||
* race which is then used to compute {@link #advanceInMillis} such that
|
||||
* <code>time.asMillis() + advanceInMillis == System.currentTimeMillis()</code>.
|
||||
*/
|
||||
@@ -238,21 +238,35 @@ public class Simulator {
|
||||
// deliver an empty list now
|
||||
trackedRace.updateMarkPassings(competitor, markPassings);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void scheduleCompetitorPosition(final Competitor competitor, GPSFixMoving competitorFix) {
|
||||
final RecordGPSFix<Competitor> recorder = (c, f)->trackedRace.recordFix(c, f);
|
||||
scheduleFixRecording(competitor, competitorFix, recorder);
|
||||
}
|
||||
|
||||
@FunctionalInterface
|
||||
private static interface RecordGPSFix<T> {
|
||||
void recordFix(T objectForFix, GPSFixMoving fix);
|
||||
}
|
||||
|
||||
public void scheduleMarkPosition(final Mark mark, GPSFixMoving markFix) {
|
||||
final TimePoint transformedTimepoint = advance(markFix.getTimePoint());
|
||||
final GPSFixMoving transformedMarkFix = new GPSFixMovingImpl(markFix.getPosition(), transformedTimepoint, markFix.getSpeed());
|
||||
final RecordGPSFix<Mark> recorder = (m, f)->trackedRace.recordFix(mark, f);
|
||||
scheduleFixRecording(mark, markFix, recorder);
|
||||
}
|
||||
|
||||
private <T> void scheduleFixRecording(final T object, GPSFixMoving fix, final RecordGPSFix<T> recorder) {
|
||||
final TimePoint transformedTimepoint = advance(fix.getTimePoint());
|
||||
final GPSFixMoving transformedMarkFix = new GPSFixMovingImpl(fix.getPosition(), transformedTimepoint, fix.getSpeed());
|
||||
long waitTime = getWaitTimeInMillisUntil(transformedMarkFix.getTimePoint());
|
||||
if (waitTime <= 0) {
|
||||
trackedRace.recordFix(mark, transformedMarkFix);
|
||||
recorder.recordFix(object, transformedMarkFix);
|
||||
} else {
|
||||
timer.schedule(new TimerTask() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
trackedRace.recordFix(mark, transformedMarkFix);
|
||||
recorder.recordFix(object, transformedMarkFix);
|
||||
} catch (Exception e) {
|
||||
logger.throwing(Simulator.class.getName(), "scheduleMarkPosition", e);
|
||||
}
|
||||
|
||||
@@ -43,4 +43,6 @@ public interface Course extends CourseBase {
|
||||
void update(Iterable<Util.Pair<ControlPoint, PassingInstruction>> newControlPoints, DomainFactory baseDomainFactory) throws PatchFailedException;
|
||||
|
||||
int getNumberOfWaypoints();
|
||||
|
||||
Leg getLeg(int zeroBasedIndexOfWaypoint);
|
||||
}
|
||||
@@ -246,6 +246,11 @@ public class CourseImpl extends NamedImpl implements Course {
|
||||
return waypoints.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Leg getLeg(int zeroBasedIndexOfWaypoint) {
|
||||
return legs.get(zeroBasedIndexOfWaypoint);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
lockForRead();
|
||||
|
||||
+2
-2
@@ -1146,11 +1146,11 @@ public abstract class TrackedRaceImpl extends TrackedRaceWithWindEssentials impl
|
||||
int indexOfWaypoint = getRace().getCourse().getIndexOfWaypoint(startOfLeg);
|
||||
if (indexOfWaypoint == -1) {
|
||||
throw new IllegalArgumentException("Waypoint " + startOfLeg + " not found in " + getRace().getCourse());
|
||||
} else if (indexOfWaypoint == Util.size(getRace().getCourse().getWaypoints()) - 1) {
|
||||
} else if (indexOfWaypoint == getRace().getCourse().getNumberOfWaypoints() - 1) {
|
||||
throw new IllegalArgumentException("Waypoint " + startOfLeg + " isn't start of any leg in "
|
||||
+ getRace().getCourse());
|
||||
}
|
||||
return trackedLegs.get(race.getCourse().getLegs().get(indexOfWaypoint));
|
||||
return trackedLegs.get(race.getCourse().getLeg(indexOfWaypoint));
|
||||
} finally {
|
||||
getRace().getCourse().unlockAfterRead();
|
||||
}
|
||||
|
||||
+4
-4
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+4
-1
@@ -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();
|
||||
}
|
||||
+4
-1
@@ -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
|
||||
+5
-2
@@ -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
|
||||
+4
-1
@@ -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
|
||||
+4
-1
@@ -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
|
||||
+57
@@ -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);
|
||||
}
|
||||
}
|
||||
+19
-11
@@ -1160,7 +1160,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));
|
||||
@@ -1308,17 +1307,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().setAt(0, advantageLinePos1);
|
||||
advantageLine.getPath().setAt(1, advantageLinePos2);
|
||||
@@ -1563,20 +1563,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);
|
||||
@@ -2330,6 +2330,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();
|
||||
}
|
||||
@@ -2495,23 +2501,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("");
|
||||
|
||||
+22
@@ -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;
|
||||
|
||||
+22
-2
@@ -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;
|
||||
}
|
||||
|
||||
+10
@@ -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) {
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
<Arg name="threadpool">
|
||||
<New id="threadpool" class="org.eclipse.jetty.util.thread.QueuedThreadPool">
|
||||
<Arg name="minThreads" type="int">10</Arg>
|
||||
<Arg name="maxThreads" type="int">3000</Arg>
|
||||
<Arg name="maxThreads" type="int">64</Arg>
|
||||
<Arg name="idleTimeout" type="int">25000</Arg>
|
||||
<Set name="detailedDump">false</Set>
|
||||
</New>
|
||||
|
||||
Reference in new issue
Block a user