mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-11-15 06:49:56 +00:00
Merge branch 'bug4115_3'
Conflicts: java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/shared/racemap/RaceMap.java
This commit is contained in:
commit
50908e53a4
11 files changed
+314
-101
No files matched your search
+12
-1
@@ -56,6 +56,9 @@ public class BoatOverlay extends CanvasOverlayV3 {
|
||||
private Integer lastHeight;
|
||||
private Size lastScale;
|
||||
private Color lastColor;
|
||||
|
||||
public static enum DisplayMode { DEFAULT, SELECTED, NOT_SELECTED };
|
||||
private DisplayMode displayMode;
|
||||
|
||||
/**
|
||||
* Remembers the old drawing angle as passed to {@link #setCanvasRotation(double)} to minimize rotation angle upon
|
||||
@@ -91,7 +94,7 @@ public class BoatOverlay extends CanvasOverlayV3 {
|
||||
setCanvasSize(canvasWidth, canvasHeight);
|
||||
}
|
||||
if (needToDraw(boatFix.legType, boatFix.tack, isSelected(), canvasWidth, canvasHeight, boatSizeScaleFactor, color)) {
|
||||
boatVectorGraphics.drawBoatToCanvas(getCanvas().getContext2d(), boatFix.legType, boatFix.tack, isSelected(),
|
||||
boatVectorGraphics.drawBoatToCanvas(getCanvas().getContext2d(), boatFix.legType, boatFix.tack, getDisplayMode(),
|
||||
canvasWidth, canvasHeight, boatSizeScaleFactor, color);
|
||||
lastLegType = boatFix.legType;
|
||||
lastTack = boatFix.tack;
|
||||
@@ -186,4 +189,12 @@ public class BoatOverlay extends CanvasOverlayV3 {
|
||||
}
|
||||
}
|
||||
|
||||
public DisplayMode getDisplayMode() {
|
||||
return displayMode;
|
||||
}
|
||||
|
||||
public void setDisplayMode(DisplayMode displayMode) {
|
||||
this.displayMode = displayMode;
|
||||
}
|
||||
|
||||
}
|
||||
+45
-17
@@ -100,6 +100,7 @@ import com.sap.sailing.gwt.ui.client.SailingServiceAsync;
|
||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
import com.sap.sailing.gwt.ui.client.WindSourceTypeFormatter;
|
||||
import com.sap.sailing.gwt.ui.client.shared.filter.QuickRankProvider;
|
||||
import com.sap.sailing.gwt.ui.client.shared.racemap.BoatOverlay.DisplayMode;
|
||||
import com.sap.sailing.gwt.ui.client.shared.racemap.QuickRanksDTOProvider.QuickRanksListener;
|
||||
import com.sap.sailing.gwt.ui.client.shared.racemap.RaceCompetitorSet.CompetitorsForRaceDefinedListener;
|
||||
import com.sap.sailing.gwt.ui.client.shared.racemap.RaceMapHelpLinesSettings.HelpLineTypes;
|
||||
@@ -152,6 +153,7 @@ public class RaceMap extends AbstractCompositeComponent<RaceMapSettings> impleme
|
||||
private static final Color LOWLIGHTED_TAIL_COLOR = new RGBColor(200, 200, 200);
|
||||
public static final String GET_RACE_MAP_DATA_CATEGORY = "getRaceMapData";
|
||||
public static final String GET_WIND_DATA_CATEGORY = "getWindData";
|
||||
private static final double LOWLIGHTED_TAIL_OPACITY = 0.3;
|
||||
|
||||
private static final String COMPACT_HEADER_STYLE = "compactHeader";
|
||||
public static final Color WATER_COLOR = new RGBColor(0, 67, 125);
|
||||
@@ -1940,12 +1942,12 @@ public class RaceMap extends AbstractCompositeComponent<RaceMapSettings> impleme
|
||||
if (boatOverlay == null) {
|
||||
boatOverlay = createBoatOverlay(RaceMapOverlaysZIndexes.BOATS_ZINDEX, competitorDTO, displayHighlighted(competitorDTO));
|
||||
boatOverlays.put(competitorDTO, boatOverlay);
|
||||
boatOverlay.setSelected(displayHighlighted(competitorDTO));
|
||||
boatOverlay.setDisplayMode(displayHighlighted(competitorDTO));
|
||||
boatOverlay.setBoatFix(lastBoatFix, timeForPositionTransitionMillis);
|
||||
boatOverlay.addToMap();
|
||||
} else {
|
||||
usedExistingCanvas = true;
|
||||
boatOverlay.setSelected(displayHighlighted(competitorDTO));
|
||||
boatOverlay.setDisplayMode(displayHighlighted(competitorDTO));
|
||||
boatOverlay.setBoatFix(lastBoatFix, timeForPositionTransitionMillis);
|
||||
boatOverlay.draw();
|
||||
}
|
||||
@@ -1954,8 +1956,29 @@ public class RaceMap extends AbstractCompositeComponent<RaceMapSettings> impleme
|
||||
return usedExistingCanvas;
|
||||
}
|
||||
|
||||
private boolean displayHighlighted(CompetitorDTO competitorDTO) {
|
||||
return !settings.isShowOnlySelectedCompetitors() && competitorSelection.isSelected(competitorDTO);
|
||||
private DisplayMode displayHighlighted(CompetitorDTO competitorDTO) {
|
||||
boolean competitorisSelected = competitorSelection.isSelected(competitorDTO);
|
||||
if(!settings.isShowOnlySelectedCompetitors()){
|
||||
if(competitorisSelected){
|
||||
return DisplayMode.SELECTED;
|
||||
}
|
||||
else{
|
||||
if(isSomeOtherCompetitorSelected()){
|
||||
return DisplayMode.NOT_SELECTED;
|
||||
}
|
||||
else{
|
||||
return DisplayMode.DEFAULT;
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
return competitorSelection.isSelected(competitorDTO) ? DisplayMode.SELECTED : DisplayMode.DEFAULT;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private boolean isSomeOtherCompetitorSelected(){
|
||||
return Util.size(competitorSelection.getSelectedCompetitors()) > 0;
|
||||
}
|
||||
|
||||
private class CourseMarkInfoWindowClickHandler implements ClickMapHandler {
|
||||
@@ -1995,9 +2018,9 @@ public class RaceMap extends AbstractCompositeComponent<RaceMapSettings> impleme
|
||||
}
|
||||
}
|
||||
|
||||
private BoatOverlay createBoatOverlay(int zIndex, final CompetitorDTO competitorDTO, boolean highlighted) {
|
||||
private BoatOverlay createBoatOverlay(int zIndex, final CompetitorDTO competitorDTO, DisplayMode displayMode) {
|
||||
final BoatOverlay boatCanvas = new BoatOverlay(map, zIndex, competitorDTO, competitorSelection.getColor(competitorDTO, raceIdentifier), coordinateSystem);
|
||||
boatCanvas.setSelected(highlighted);
|
||||
boatCanvas.setDisplayMode(displayMode);
|
||||
boatCanvas.addClickHandler(new ClickMapHandler() {
|
||||
@Override
|
||||
public void onEvent(ClickMapEvent event) {
|
||||
@@ -2423,7 +2446,7 @@ public class RaceMap extends AbstractCompositeComponent<RaceMapSettings> impleme
|
||||
// only change highlighting
|
||||
BoatOverlay boatCanvas = boatOverlays.get(competitor);
|
||||
if (boatCanvas != null) {
|
||||
boatCanvas.setSelected(displayHighlighted(competitor));
|
||||
boatCanvas.setDisplayMode(displayHighlighted(competitor));
|
||||
boatCanvas.draw();
|
||||
showCompetitorInfoOnMap(timer.getTime(), -1, competitorSelection.getSelectedFilteredCompetitors());
|
||||
} else {
|
||||
@@ -2473,7 +2496,7 @@ public class RaceMap extends AbstractCompositeComponent<RaceMapSettings> impleme
|
||||
// "lowlight" currently selected competitor
|
||||
BoatOverlay boatCanvas = boatOverlays.get(competitor);
|
||||
if (boatCanvas != null) {
|
||||
boatCanvas.setSelected(displayHighlighted(competitor));
|
||||
boatCanvas.setDisplayMode(displayHighlighted(competitor));
|
||||
boatCanvas.draw();
|
||||
}
|
||||
showCompetitorInfoOnMap(timer.getTime(), -1, competitorSelection.getSelectedFilteredCompetitors());
|
||||
@@ -2738,22 +2761,27 @@ public class RaceMap extends AbstractCompositeComponent<RaceMapSettings> impleme
|
||||
}
|
||||
|
||||
@Override
|
||||
public PolylineOptions createTailStyle(CompetitorDTO competitor, boolean isHighlighted) {
|
||||
public PolylineOptions createTailStyle(CompetitorDTO competitor, DisplayMode displayMode) {
|
||||
PolylineOptions options = PolylineOptions.newInstance();
|
||||
options.setClickable(true);
|
||||
options.setGeodesic(true);
|
||||
options.setStrokeOpacity(1.0);
|
||||
boolean noCompetitorSelected = Util.isEmpty(competitorSelection.getSelectedCompetitors());
|
||||
if (isHighlighted || noCompetitorSelected || getSettings().isShowOnlySelectedCompetitors()) {
|
||||
|
||||
switch(displayMode){
|
||||
case DEFAULT:
|
||||
options.setStrokeColor(competitorSelection.getColor(competitor, raceIdentifier).getAsHtml());
|
||||
} else {
|
||||
options.setStrokeColor(LOWLIGHTED_TAIL_COLOR.getAsHtml());
|
||||
}
|
||||
if (isHighlighted) {
|
||||
options.setStrokeWeight(2);
|
||||
} else {
|
||||
options.setStrokeWeight(1);
|
||||
break;
|
||||
case SELECTED:
|
||||
options.setStrokeColor(competitorSelection.getColor(competitor, raceIdentifier).getAsHtml());
|
||||
options.setStrokeWeight(2);
|
||||
break;
|
||||
case NOT_SELECTED:
|
||||
options.setStrokeColor(LOWLIGHTED_TAIL_COLOR.getAsHtml());
|
||||
options.setStrokeOpacity(LOWLIGHTED_TAIL_OPACITY);
|
||||
break;
|
||||
}
|
||||
|
||||
options.setZindex(RaceMapOverlaysZIndexes.BOATTAILS_ZINDEX);
|
||||
return options;
|
||||
}
|
||||
|
||||
+2
-1
@@ -6,6 +6,7 @@ import com.google.gwt.maps.client.base.LatLng;
|
||||
import com.google.gwt.maps.client.overlays.Polyline;
|
||||
import com.google.gwt.maps.client.overlays.PolylineOptions;
|
||||
import com.sap.sailing.domain.common.dto.CompetitorDTO;
|
||||
import com.sap.sailing.gwt.ui.client.shared.racemap.BoatOverlay.DisplayMode;
|
||||
|
||||
/**
|
||||
* Creates tails and their styles for the map.
|
||||
@@ -16,5 +17,5 @@ import com.sap.sailing.domain.common.dto.CompetitorDTO;
|
||||
public interface TailFactory {
|
||||
Polyline createTail(CompetitorDTO competitor, List<LatLng> points);
|
||||
|
||||
PolylineOptions createTailStyle(CompetitorDTO competitor, boolean isHighlighted);
|
||||
PolylineOptions createTailStyle(CompetitorDTO competitor, DisplayMode displayMode);
|
||||
}
|
||||
+5
-3
@@ -9,6 +9,7 @@ import com.google.gwt.maps.client.base.Size;
|
||||
import com.sap.sailing.domain.common.BoatClassMasterdata;
|
||||
import com.sap.sailing.domain.common.LegType;
|
||||
import com.sap.sailing.domain.common.Tack;
|
||||
import com.sap.sailing.gwt.ui.client.shared.racemap.BoatOverlay.DisplayMode;
|
||||
import com.sap.sse.common.Color;
|
||||
|
||||
/**
|
||||
@@ -28,6 +29,7 @@ import com.sap.sse.common.Color;
|
||||
public abstract class BoatClassVectorGraphics {
|
||||
protected static final String SAIL_FILLCOLOR = "#888888";
|
||||
protected static final String SAIL_STROKECOLOR = "#000000";
|
||||
protected static final double BOAT_NOT_SELECTED_OPACITY = 0.3;
|
||||
|
||||
/** the minimal length of the hull in pixel when the boat is drawn */
|
||||
private static final double MIN_HULL_LENGTH_IN_PX = 25;
|
||||
@@ -55,7 +57,7 @@ public abstract class BoatClassVectorGraphics {
|
||||
return Collections.unmodifiableSet(compatibleBoatClasses);
|
||||
}
|
||||
|
||||
protected abstract void drawBoat(Context2d ctx, boolean isSelected, String color);
|
||||
protected abstract void drawBoat(Context2d ctx, DisplayMode displayMode, String color);
|
||||
|
||||
protected abstract void drawDownwindPortTackSails(Context2d ctx);
|
||||
|
||||
@@ -111,14 +113,14 @@ public abstract class BoatClassVectorGraphics {
|
||||
}
|
||||
}
|
||||
|
||||
public void drawBoatToCanvas(Context2d ctx, LegType legType, Tack tack, boolean isSelected, double width,
|
||||
public void drawBoatToCanvas(Context2d ctx, LegType legType, Tack tack, DisplayMode displayMode, double width,
|
||||
double height, Size scaleFactor, Color color) {
|
||||
ctx.save();
|
||||
ctx.clearRect(0, 0, width, height);
|
||||
ctx.translate(width / 2.0, height / 2.0);
|
||||
ctx.scale(scaleFactor.getWidth(), scaleFactor.getHeight());
|
||||
ctx.translate(-hullLengthInPx / 2.0, -beamInPx / 2.0);
|
||||
drawBoat(ctx, isSelected, color.getAsHtml());
|
||||
drawBoat(ctx, displayMode, color.getAsHtml());
|
||||
drawSails(ctx, legType, tack);
|
||||
ctx.restore();
|
||||
}
|
||||
|
||||
+29
-9
@@ -2,6 +2,7 @@ package com.sap.sailing.gwt.ui.shared.racemap;
|
||||
|
||||
import com.google.gwt.canvas.dom.client.Context2d;
|
||||
import com.sap.sailing.domain.common.BoatClassMasterdata;
|
||||
import com.sap.sailing.gwt.ui.client.shared.racemap.BoatOverlay.DisplayMode;
|
||||
|
||||
public class DinghyWithSpinnakerVectorGraphics extends BoatClassVectorGraphics {
|
||||
|
||||
@@ -10,18 +11,28 @@ public class DinghyWithSpinnakerVectorGraphics extends BoatClassVectorGraphics {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawBoat(Context2d ctx, boolean isSelected, String color) {
|
||||
protected void drawBoat(Context2d ctx, DisplayMode displayMode, String color) {
|
||||
|
||||
ctx.translate(0,-823);
|
||||
|
||||
//draw hull
|
||||
if(isSelected) {
|
||||
ctx.setFillStyle(color);
|
||||
ctx.setStrokeStyle(color);
|
||||
} else {
|
||||
|
||||
switch (displayMode){
|
||||
case DEFAULT:
|
||||
ctx.setFillStyle ("#FFFFFF");
|
||||
ctx.setStrokeStyle("#FFFFFF");
|
||||
break;
|
||||
case SELECTED:
|
||||
ctx.setFillStyle (color);
|
||||
ctx.setStrokeStyle(color);
|
||||
break;
|
||||
case NOT_SELECTED:
|
||||
ctx.setGlobalAlpha(BOAT_NOT_SELECTED_OPACITY);
|
||||
ctx.setFillStyle ("#FFFFFF");
|
||||
ctx.setStrokeStyle("#FFFFFF");
|
||||
break;
|
||||
}
|
||||
|
||||
ctx.setLineWidth(1.0);
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(7,871);
|
||||
@@ -32,13 +43,22 @@ public class DinghyWithSpinnakerVectorGraphics extends BoatClassVectorGraphics {
|
||||
ctx.stroke();
|
||||
|
||||
//draw cockpit
|
||||
if(isSelected) {
|
||||
ctx.setFillStyle ("#FFFFFF");
|
||||
ctx.setStrokeStyle("#FFFFFF");
|
||||
} else {
|
||||
switch (displayMode){
|
||||
case DEFAULT:
|
||||
ctx.setFillStyle(color);
|
||||
ctx.setStrokeStyle(color);
|
||||
break;
|
||||
case SELECTED:
|
||||
ctx.setFillStyle ("#FFFFFF");
|
||||
ctx.setStrokeStyle("#FFFFFF");
|
||||
break;
|
||||
case NOT_SELECTED:
|
||||
ctx.setGlobalAlpha(BOAT_NOT_SELECTED_OPACITY);
|
||||
ctx.setFillStyle(color);
|
||||
ctx.setStrokeStyle(color);
|
||||
break;
|
||||
}
|
||||
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(15,970);
|
||||
ctx.lineTo(14,899);
|
||||
|
||||
+47
-16
@@ -3,6 +3,7 @@ package com.sap.sailing.gwt.ui.shared.racemap;
|
||||
import com.google.gwt.canvas.dom.client.Context2d;
|
||||
import com.google.gwt.canvas.dom.client.Context2d.LineJoin;
|
||||
import com.sap.sailing.domain.common.BoatClassMasterdata;
|
||||
import com.sap.sailing.gwt.ui.client.shared.racemap.BoatOverlay.DisplayMode;
|
||||
|
||||
public class Extreme40VectorGraphics extends BoatClassVectorGraphics {
|
||||
|
||||
@@ -11,15 +12,25 @@ public class Extreme40VectorGraphics extends BoatClassVectorGraphics {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawBoat(Context2d ctx, boolean isSelected, String color) {
|
||||
protected void drawBoat(Context2d ctx, DisplayMode displayMode, String color) {
|
||||
// outer net
|
||||
if(isSelected) {
|
||||
ctx.setFillStyle(color);
|
||||
ctx.setStrokeStyle(color);
|
||||
} else {
|
||||
|
||||
switch (displayMode){
|
||||
case DEFAULT:
|
||||
ctx.setFillStyle ("#FFFFFF");
|
||||
ctx.setStrokeStyle("#FFFFFF");
|
||||
break;
|
||||
case SELECTED:
|
||||
ctx.setFillStyle (color);
|
||||
ctx.setStrokeStyle(color);
|
||||
break;
|
||||
case NOT_SELECTED:
|
||||
ctx.setGlobalAlpha(BOAT_NOT_SELECTED_OPACITY);
|
||||
ctx.setFillStyle ("#FFFFFF");
|
||||
ctx.setStrokeStyle("#FFFFFF");
|
||||
break;
|
||||
}
|
||||
|
||||
ctx.setLineWidth(1.0);
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(195,72);
|
||||
@@ -35,14 +46,24 @@ public class Extreme40VectorGraphics extends BoatClassVectorGraphics {
|
||||
ctx.fill();
|
||||
ctx.stroke();
|
||||
|
||||
// inner net
|
||||
if(isSelected) {
|
||||
ctx.setFillStyle("#FFFFFF");
|
||||
ctx.setStrokeStyle("#FFFFFF");
|
||||
} else {
|
||||
ctx.setFillStyle(color);
|
||||
// inner net
|
||||
switch (displayMode){
|
||||
case DEFAULT:
|
||||
ctx.setFillStyle (color);
|
||||
ctx.setStrokeStyle(color);
|
||||
break;
|
||||
case SELECTED:
|
||||
ctx.setFillStyle ("#FFFFFF");
|
||||
ctx.setStrokeStyle("#FFFFFF");
|
||||
break;
|
||||
case NOT_SELECTED:
|
||||
ctx.setGlobalAlpha(BOAT_NOT_SELECTED_OPACITY);
|
||||
ctx.setFillStyle (color);
|
||||
ctx.setStrokeStyle(color);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
ctx.setLineWidth(1.0);
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(271,163);
|
||||
@@ -59,13 +80,23 @@ public class Extreme40VectorGraphics extends BoatClassVectorGraphics {
|
||||
ctx.stroke();
|
||||
|
||||
// hull - left and right part
|
||||
if(isSelected) {
|
||||
ctx.setFillStyle(color);
|
||||
ctx.setStrokeStyle(color);
|
||||
} else {
|
||||
ctx.setFillStyle("#FFFFFF");
|
||||
|
||||
switch (displayMode){
|
||||
case DEFAULT:
|
||||
ctx.setFillStyle ("#FFFFFF");
|
||||
ctx.setStrokeStyle("#000000");
|
||||
break;
|
||||
case SELECTED:
|
||||
ctx.setFillStyle (color);
|
||||
ctx.setStrokeStyle(color);
|
||||
break;
|
||||
case NOT_SELECTED:
|
||||
ctx.setGlobalAlpha(BOAT_NOT_SELECTED_OPACITY);
|
||||
ctx.setFillStyle ("#FFFFFF");
|
||||
ctx.setStrokeStyle("#000000");
|
||||
break;
|
||||
}
|
||||
|
||||
ctx.setLineWidth(5.0);
|
||||
ctx.setLineJoin(LineJoin.ROUND);
|
||||
ctx.beginPath();
|
||||
|
||||
+45
-14
@@ -3,6 +3,7 @@ package com.sap.sailing.gwt.ui.shared.racemap;
|
||||
import com.google.gwt.canvas.dom.client.Context2d;
|
||||
import com.google.gwt.canvas.dom.client.Context2d.LineJoin;
|
||||
import com.sap.sailing.domain.common.BoatClassMasterdata;
|
||||
import com.sap.sailing.gwt.ui.client.shared.racemap.BoatOverlay.DisplayMode;
|
||||
|
||||
/**
|
||||
* Graphics for a GC32 - currently same as {@link Extreme40VectorGraphics} but
|
||||
@@ -17,15 +18,25 @@ public class GC32VectorGraphics extends BoatClassVectorGraphics {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawBoat(Context2d ctx, boolean isSelected, String color) {
|
||||
protected void drawBoat(Context2d ctx, DisplayMode displayMode, String color) {
|
||||
// outer net
|
||||
if(isSelected) {
|
||||
ctx.setFillStyle(color);
|
||||
ctx.setStrokeStyle(color);
|
||||
} else {
|
||||
|
||||
switch (displayMode){
|
||||
case DEFAULT:
|
||||
ctx.setFillStyle ("#FFFFFF");
|
||||
ctx.setStrokeStyle("#FFFFFF");
|
||||
break;
|
||||
case SELECTED:
|
||||
ctx.setFillStyle (color);
|
||||
ctx.setStrokeStyle(color);
|
||||
break;
|
||||
case NOT_SELECTED:
|
||||
ctx.setGlobalAlpha(BOAT_NOT_SELECTED_OPACITY);
|
||||
ctx.setFillStyle ("#FFFFFF");
|
||||
ctx.setStrokeStyle("#FFFFFF");
|
||||
break;
|
||||
}
|
||||
|
||||
ctx.setLineWidth(1.0);
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(195,72);
|
||||
@@ -42,13 +53,23 @@ public class GC32VectorGraphics extends BoatClassVectorGraphics {
|
||||
ctx.stroke();
|
||||
|
||||
// inner net
|
||||
if(isSelected) {
|
||||
ctx.setFillStyle("#FFFFFF");
|
||||
ctx.setStrokeStyle("#FFFFFF");
|
||||
} else {
|
||||
ctx.setFillStyle(color);
|
||||
|
||||
switch (displayMode){
|
||||
case DEFAULT:
|
||||
ctx.setFillStyle (color);
|
||||
ctx.setStrokeStyle(color);
|
||||
break;
|
||||
case SELECTED:
|
||||
ctx.setFillStyle ("#FFFFFF");
|
||||
ctx.setStrokeStyle("#FFFFFF");
|
||||
break;
|
||||
case NOT_SELECTED:
|
||||
ctx.setGlobalAlpha(BOAT_NOT_SELECTED_OPACITY);
|
||||
ctx.setFillStyle (color);
|
||||
ctx.setStrokeStyle(color);
|
||||
break;
|
||||
}
|
||||
|
||||
ctx.setLineWidth(1.0);
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(271,163);
|
||||
@@ -65,13 +86,23 @@ public class GC32VectorGraphics extends BoatClassVectorGraphics {
|
||||
ctx.stroke();
|
||||
|
||||
// hull - left and right part
|
||||
if(isSelected) {
|
||||
|
||||
switch (displayMode){
|
||||
case DEFAULT:
|
||||
ctx.setFillStyle ("#FFFFFF");
|
||||
ctx.setStrokeStyle("#FFFFFF");
|
||||
break;
|
||||
case SELECTED:
|
||||
ctx.setFillStyle(color);
|
||||
ctx.setStrokeStyle(color);
|
||||
} else {
|
||||
ctx.setFillStyle("#FFFFFF");
|
||||
ctx.setStrokeStyle("#000000");
|
||||
break;
|
||||
case NOT_SELECTED:
|
||||
ctx.setGlobalAlpha(BOAT_NOT_SELECTED_OPACITY);
|
||||
ctx.setFillStyle ("#FFFFFF");
|
||||
ctx.setStrokeStyle("#FFFFFF");
|
||||
break;
|
||||
}
|
||||
|
||||
ctx.setLineWidth(5.0);
|
||||
ctx.setLineJoin(LineJoin.ROUND);
|
||||
ctx.beginPath();
|
||||
|
||||
+32
-10
@@ -2,6 +2,7 @@ package com.sap.sailing.gwt.ui.shared.racemap;
|
||||
|
||||
import com.google.gwt.canvas.dom.client.Context2d;
|
||||
import com.sap.sailing.domain.common.BoatClassMasterdata;
|
||||
import com.sap.sailing.gwt.ui.client.shared.racemap.BoatOverlay.DisplayMode;
|
||||
|
||||
public class KeelBoatWithGennakerVectorGraphics extends BoatClassVectorGraphics {
|
||||
|
||||
@@ -10,18 +11,28 @@ public class KeelBoatWithGennakerVectorGraphics extends BoatClassVectorGraphics
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawBoat(Context2d ctx, boolean isSelected, String color) {
|
||||
protected void drawBoat(Context2d ctx, DisplayMode displayMode, String color) {
|
||||
|
||||
ctx.translate(0,-803);
|
||||
|
||||
//draw hull
|
||||
if(isSelected) {
|
||||
ctx.setFillStyle(color);
|
||||
ctx.setStrokeStyle(color);
|
||||
} else {
|
||||
|
||||
switch (displayMode){
|
||||
case DEFAULT:
|
||||
ctx.setFillStyle ("#FFFFFF");
|
||||
ctx.setStrokeStyle("#FFFFFF");
|
||||
break;
|
||||
case SELECTED:
|
||||
ctx.setFillStyle(color);
|
||||
ctx.setStrokeStyle(color);
|
||||
break;
|
||||
case NOT_SELECTED:
|
||||
ctx.setGlobalAlpha(BOAT_NOT_SELECTED_OPACITY);
|
||||
ctx.setFillStyle ("#FFFFFF");
|
||||
ctx.setStrokeStyle("#FFFFFF");
|
||||
break;
|
||||
}
|
||||
|
||||
ctx.setLineWidth(1.0);
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(2.4885714,1009.9999);
|
||||
@@ -53,13 +64,24 @@ public class KeelBoatWithGennakerVectorGraphics extends BoatClassVectorGraphics
|
||||
ctx.stroke();
|
||||
|
||||
//draw cockpit
|
||||
if(isSelected) {
|
||||
ctx.setFillStyle ("#FFFFFF");
|
||||
ctx.setStrokeStyle("#FFFFFF");
|
||||
} else {
|
||||
ctx.setFillStyle(color);
|
||||
|
||||
switch (displayMode){
|
||||
case DEFAULT:
|
||||
ctx.setFillStyle (color);
|
||||
ctx.setStrokeStyle(color);
|
||||
break;
|
||||
case SELECTED:
|
||||
ctx.setFillStyle("#FFFFFF");
|
||||
ctx.setStrokeStyle("#FFFFFF");
|
||||
break;
|
||||
case NOT_SELECTED:
|
||||
ctx.setGlobalAlpha(BOAT_NOT_SELECTED_OPACITY);
|
||||
ctx.setFillStyle (color);
|
||||
ctx.setStrokeStyle(color);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
ctx.setLineWidth(1.0);
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(343.42857,966.99996);
|
||||
|
||||
+27
-8
@@ -2,6 +2,7 @@ package com.sap.sailing.gwt.ui.shared.racemap;
|
||||
|
||||
import com.google.gwt.canvas.dom.client.Context2d;
|
||||
import com.sap.sailing.domain.common.BoatClassMasterdata;
|
||||
import com.sap.sailing.gwt.ui.client.shared.racemap.BoatOverlay.DisplayMode;
|
||||
|
||||
public class LaserVectorGraphics extends BoatClassVectorGraphics {
|
||||
|
||||
@@ -10,14 +11,23 @@ public class LaserVectorGraphics extends BoatClassVectorGraphics {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawBoat(Context2d ctx, boolean isSelected, String color) {
|
||||
protected void drawBoat(Context2d ctx, DisplayMode displayMode, String color) {
|
||||
// outer part of the hull
|
||||
if(isSelected) {
|
||||
ctx.setFillStyle(color);
|
||||
ctx.setStrokeStyle(color);
|
||||
} else {
|
||||
|
||||
switch (displayMode){
|
||||
case DEFAULT:
|
||||
ctx.setFillStyle ("#FFFFFF");
|
||||
ctx.setStrokeStyle("#FFFFFF");
|
||||
break;
|
||||
case SELECTED:
|
||||
ctx.setFillStyle(color);
|
||||
ctx.setStrokeStyle(color);
|
||||
break;
|
||||
case NOT_SELECTED:
|
||||
ctx.setGlobalAlpha(BOAT_NOT_SELECTED_OPACITY);
|
||||
ctx.setFillStyle ("#FFFFFF");
|
||||
ctx.setStrokeStyle("#FFFFFF");
|
||||
break;
|
||||
}
|
||||
|
||||
ctx.setLineWidth(2.0);
|
||||
@@ -33,12 +43,21 @@ public class LaserVectorGraphics extends BoatClassVectorGraphics {
|
||||
ctx.stroke();
|
||||
|
||||
// inner part of the hull
|
||||
if(isSelected) {
|
||||
|
||||
switch (displayMode){
|
||||
case DEFAULT:
|
||||
ctx.setFillStyle (color);
|
||||
ctx.setStrokeStyle(color);
|
||||
break;
|
||||
case SELECTED:
|
||||
ctx.setFillStyle ("#FFFFFF");
|
||||
ctx.setStrokeStyle("#FFFFFF");
|
||||
} else {
|
||||
ctx.setFillStyle(color);
|
||||
break;
|
||||
case NOT_SELECTED:
|
||||
ctx.setGlobalAlpha(BOAT_NOT_SELECTED_OPACITY);
|
||||
ctx.setFillStyle (color);
|
||||
ctx.setStrokeStyle(color);
|
||||
break;
|
||||
}
|
||||
|
||||
ctx.setLineWidth(1.0);
|
||||
|
||||
+41
-12
@@ -3,6 +3,7 @@ package com.sap.sailing.gwt.ui.shared.racemap;
|
||||
import com.google.gwt.canvas.dom.client.Context2d;
|
||||
import com.google.gwt.canvas.dom.client.Context2d.LineJoin;
|
||||
import com.sap.sailing.domain.common.BoatClassMasterdata;
|
||||
import com.sap.sailing.gwt.ui.client.shared.racemap.BoatOverlay.DisplayMode;
|
||||
|
||||
public class SmallMultihullVectorGraphics extends BoatClassVectorGraphics {
|
||||
|
||||
@@ -11,14 +12,23 @@ public class SmallMultihullVectorGraphics extends BoatClassVectorGraphics {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawBoat(Context2d ctx, boolean isSelected, String color) {
|
||||
protected void drawBoat(Context2d ctx, DisplayMode displayMode, String color) {
|
||||
// outer net
|
||||
if(isSelected) {
|
||||
ctx.setFillStyle(color);
|
||||
ctx.setStrokeStyle(color);
|
||||
} else {
|
||||
|
||||
switch (displayMode){
|
||||
case DEFAULT:
|
||||
ctx.setFillStyle ("#FFFFFF");
|
||||
ctx.setStrokeStyle("#FFFFFF");
|
||||
break;
|
||||
case SELECTED:
|
||||
ctx.setFillStyle(color);
|
||||
ctx.setStrokeStyle(color);
|
||||
break;
|
||||
case NOT_SELECTED:
|
||||
ctx.setGlobalAlpha(BOAT_NOT_SELECTED_OPACITY);
|
||||
ctx.setFillStyle ("#FFFFFF");
|
||||
ctx.setStrokeStyle("#FFFFFF");
|
||||
break;
|
||||
}
|
||||
|
||||
ctx.setLineWidth(1.0);
|
||||
@@ -37,13 +47,23 @@ public class SmallMultihullVectorGraphics extends BoatClassVectorGraphics {
|
||||
ctx.stroke();
|
||||
|
||||
// inner net
|
||||
if(isSelected) {
|
||||
|
||||
switch (displayMode){
|
||||
case DEFAULT:
|
||||
ctx.setFillStyle (color);
|
||||
ctx.setStrokeStyle(color);
|
||||
break;
|
||||
case SELECTED:
|
||||
ctx.setFillStyle("#FFFFFF");
|
||||
ctx.setStrokeStyle("#FFFFFF");
|
||||
} else {
|
||||
ctx.setFillStyle(color);
|
||||
break;
|
||||
case NOT_SELECTED:
|
||||
ctx.setGlobalAlpha(BOAT_NOT_SELECTED_OPACITY);
|
||||
ctx.setFillStyle (color);
|
||||
ctx.setStrokeStyle(color);
|
||||
break;
|
||||
}
|
||||
|
||||
ctx.setLineWidth(1.0);
|
||||
|
||||
ctx.beginPath();
|
||||
@@ -61,12 +81,21 @@ public class SmallMultihullVectorGraphics extends BoatClassVectorGraphics {
|
||||
ctx.stroke();
|
||||
|
||||
// hull - left and right part
|
||||
if(isSelected) {
|
||||
ctx.setFillStyle(color);
|
||||
ctx.setStrokeStyle(color);
|
||||
} else {
|
||||
|
||||
switch (displayMode){
|
||||
case DEFAULT:
|
||||
ctx.setFillStyle("#FFFFFF");
|
||||
ctx.setStrokeStyle("#000000");
|
||||
break;
|
||||
case SELECTED:
|
||||
ctx.setFillStyle(color);
|
||||
ctx.setStrokeStyle(color);
|
||||
break;
|
||||
case NOT_SELECTED:
|
||||
ctx.setGlobalAlpha(BOAT_NOT_SELECTED_OPACITY);
|
||||
ctx.setFillStyle("#FFFFFF");
|
||||
ctx.setStrokeStyle("#000000");
|
||||
break;
|
||||
}
|
||||
|
||||
ctx.setLineWidth(5.0);
|
||||
|
||||
+29
-10
@@ -3,6 +3,7 @@ package com.sap.sailing.gwt.ui.shared.racemap;
|
||||
import com.google.gwt.canvas.dom.client.Context2d;
|
||||
import com.google.gwt.canvas.dom.client.Context2d.LineJoin;
|
||||
import com.sap.sailing.domain.common.BoatClassMasterdata;
|
||||
import com.sap.sailing.gwt.ui.client.shared.racemap.BoatOverlay.DisplayMode;
|
||||
|
||||
public class _49erVectorGraphics extends BoatClassVectorGraphics {
|
||||
|
||||
@@ -11,13 +12,23 @@ public class _49erVectorGraphics extends BoatClassVectorGraphics {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawBoat(Context2d ctx, boolean isSelected, String color) {
|
||||
if(isSelected) {
|
||||
ctx.setFillStyle(color);
|
||||
ctx.setStrokeStyle(color);
|
||||
} else {
|
||||
protected void drawBoat(Context2d ctx, DisplayMode displayMode, String color) {
|
||||
// draw hull
|
||||
|
||||
switch (displayMode){
|
||||
case DEFAULT:
|
||||
ctx.setFillStyle ("#FFFFFF");
|
||||
ctx.setStrokeStyle("#FFFFFF");
|
||||
break;
|
||||
case SELECTED:
|
||||
ctx.setFillStyle (color);
|
||||
ctx.setStrokeStyle(color);
|
||||
break;
|
||||
case NOT_SELECTED:
|
||||
ctx.setGlobalAlpha(BOAT_NOT_SELECTED_OPACITY);
|
||||
ctx.setFillStyle ("#FFFFFF");
|
||||
ctx.setStrokeStyle("#FFFFFF");
|
||||
break;
|
||||
}
|
||||
|
||||
ctx.setLineJoin(LineJoin.ROUND);
|
||||
@@ -61,13 +72,21 @@ public class _49erVectorGraphics extends BoatClassVectorGraphics {
|
||||
ctx.lineTo(226,68.5);
|
||||
ctx.fill();
|
||||
ctx.stroke();
|
||||
|
||||
if(isSelected) {
|
||||
ctx.setFillStyle ("#FFFFFF");
|
||||
ctx.setStrokeStyle("#FFFFFF");
|
||||
} else {
|
||||
|
||||
switch (displayMode){
|
||||
case DEFAULT:
|
||||
ctx.setFillStyle(color);
|
||||
ctx.setStrokeStyle(color);
|
||||
break;
|
||||
case SELECTED:
|
||||
ctx.setFillStyle ("#FFFFFF");
|
||||
ctx.setStrokeStyle("#FFFFFF");
|
||||
break;
|
||||
case NOT_SELECTED:
|
||||
ctx.setGlobalAlpha(BOAT_NOT_SELECTED_OPACITY);
|
||||
ctx.setFillStyle(color);
|
||||
ctx.setStrokeStyle(color);
|
||||
break;
|
||||
}
|
||||
|
||||
ctx.beginPath();
|
||||
|
||||
Reference in new issue
Block a user