mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-21 19:50:01 +00:00
formatting; removed redundancies in switch/case
Change-Id: I9e1567b21fce2771d9211be8c12e1abd51cd6dcf
This commit is contained in:
1 parent
067516300b
commit
3802798fb2
6 files changed
+451
-455
No files matched your search
+115
-115
@@ -58,130 +58,130 @@ public abstract class AbstractMarkVectorGraphics implements MarkVectorGraphics {
|
||||
return markWidthInMeters;
|
||||
}
|
||||
|
||||
protected void drawMark(Context2d ctx, boolean isSelected, String color) {
|
||||
if (isSelected) {
|
||||
drawMarkSelection(ctx);
|
||||
}
|
||||
this.drawMarkBody(ctx, isSelected, color);
|
||||
}
|
||||
protected void drawMark(Context2d ctx, boolean isSelected, String color) {
|
||||
if (isSelected) {
|
||||
drawMarkSelection(ctx);
|
||||
}
|
||||
this.drawMarkBody(ctx, isSelected, color);
|
||||
}
|
||||
|
||||
protected void drawMarkSelection(Context2d ctx) {
|
||||
ctx.save();
|
||||
|
||||
this.setUpScaleAndTranslateForMarkSelection(ctx);
|
||||
|
||||
CanvasGradient g1=ctx.createLinearGradient(77.8,188,165,219);
|
||||
g1.addColorStop(0,"rgba(240, 240, 240, 1)");
|
||||
g1.addColorStop(1,"rgba(240, 240, 240, 0)");
|
||||
ctx.setFillStyle(g1);
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(170,181);
|
||||
ctx.translate(44.000168893718424,180.79369636814624);
|
||||
ctx.rotate(0);
|
||||
ctx.scale(1,1);
|
||||
ctx.arc(0,0,126,0.0016373311430805408,0.5254904360229328,false);
|
||||
ctx.scale(1,1);
|
||||
ctx.rotate(0);
|
||||
ctx.translate(-44.000168893718424,-180.79369636814624);
|
||||
ctx.lineTo(44.2,181);
|
||||
ctx.closePath();
|
||||
ctx.fill();
|
||||
ctx.stroke();
|
||||
ctx.save();
|
||||
|
||||
CanvasGradient g2=ctx.createLinearGradient(51,203,77.3,302);
|
||||
g2.addColorStop(0,"rgba(255, 255, 255, 1)");
|
||||
g2.addColorStop(1,"rgba(255, 255, 255, 0)");
|
||||
ctx.setFillStyle(g2);
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(107,290);
|
||||
ctx.translate(43.79222318749837,181.0010231680087);
|
||||
ctx.rotate(0);
|
||||
ctx.scale(1,1);
|
||||
ctx.arc(0,0,126,1.0452923752792398,1.5667663411841573,false);
|
||||
ctx.scale(1,1);
|
||||
ctx.rotate(0);
|
||||
ctx.translate(-43.79222318749837,-181.0010231680087);
|
||||
ctx.lineTo(44.2,181);
|
||||
ctx.closePath();
|
||||
ctx.fill();
|
||||
ctx.stroke();
|
||||
this.setUpScaleAndTranslateForMarkSelection(ctx);
|
||||
|
||||
CanvasGradient g3=ctx.createLinearGradient(26.8,197,-46.5,269);
|
||||
g3.addColorStop(0,"rgba(255, 255, 255, 1)");
|
||||
g3.addColorStop(1,"rgba(255, 255, 255, 0)");
|
||||
ctx.setFillStyle(g3);
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(-18.3,290);
|
||||
ctx.translate(43.72636289026038,180.32443158749652);
|
||||
ctx.rotate(0);
|
||||
ctx.scale(1,1);
|
||||
ctx.arc(0,0,126,2.0854951576078884,2.611791628699119,false);
|
||||
ctx.scale(1,1);
|
||||
ctx.rotate(0);
|
||||
ctx.translate(-43.72636289026038,-180.32443158749652);
|
||||
ctx.lineTo(44.2,181);
|
||||
ctx.closePath();
|
||||
ctx.fill();
|
||||
ctx.stroke();
|
||||
CanvasGradient g1 = ctx.createLinearGradient(77.8, 188, 165, 219);
|
||||
g1.addColorStop(0, "rgba(240, 240, 240, 1)");
|
||||
g1.addColorStop(1, "rgba(240, 240, 240, 0)");
|
||||
ctx.setFillStyle(g1);
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(170, 181);
|
||||
ctx.translate(44.000168893718424, 180.79369636814624);
|
||||
ctx.rotate(0);
|
||||
ctx.scale(1, 1);
|
||||
ctx.arc(0, 0, 126, 0.0016373311430805408, 0.5254904360229328, false);
|
||||
ctx.scale(1, 1);
|
||||
ctx.rotate(0);
|
||||
ctx.translate(-44.000168893718424, -180.79369636814624);
|
||||
ctx.lineTo(44.2, 181);
|
||||
ctx.closePath();
|
||||
ctx.fill();
|
||||
ctx.stroke();
|
||||
|
||||
CanvasGradient g4=ctx.createLinearGradient(18.7,172,-76.3,140);
|
||||
g4.addColorStop(0,"rgba(255, 255, 255, 1)");
|
||||
g4.addColorStop(1,"rgba(255, 255, 255, 0)");
|
||||
ctx.setFillStyle(g4);
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(-81.8,179);
|
||||
ctx.translate(44.19920011832349,178.55103503179944);
|
||||
ctx.rotate(0);
|
||||
ctx.scale(1,1);
|
||||
ctx.arc(0,0,126,3.1380294320163484,3.670248678643417,false);
|
||||
ctx.scale(1,1);
|
||||
ctx.rotate(0);
|
||||
ctx.translate(-44.19920011832349,-178.55103503179944);
|
||||
ctx.lineTo(44.2,179);
|
||||
ctx.closePath();
|
||||
ctx.fill();
|
||||
ctx.stroke();
|
||||
CanvasGradient g2 = ctx.createLinearGradient(51, 203, 77.3, 302);
|
||||
g2.addColorStop(0, "rgba(255, 255, 255, 1)");
|
||||
g2.addColorStop(1, "rgba(255, 255, 255, 0)");
|
||||
ctx.setFillStyle(g2);
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(107, 290);
|
||||
ctx.translate(43.79222318749837, 181.0010231680087);
|
||||
ctx.rotate(0);
|
||||
ctx.scale(1, 1);
|
||||
ctx.arc(0, 0, 126, 1.0452923752792398, 1.5667663411841573, false);
|
||||
ctx.scale(1, 1);
|
||||
ctx.rotate(0);
|
||||
ctx.translate(-43.79222318749837, -181.0010231680087);
|
||||
ctx.lineTo(44.2, 181);
|
||||
ctx.closePath();
|
||||
ctx.fill();
|
||||
ctx.stroke();
|
||||
|
||||
CanvasGradient g5=ctx.createLinearGradient(37.9,147,13.6,58.6);
|
||||
g5.addColorStop(0,"rgba(255, 255, 255, 1)");
|
||||
g5.addColorStop(1,"rgba(255, 255, 255, 0)");
|
||||
ctx.setFillStyle(g5);
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(-18.7,71.8);
|
||||
ctx.translate(44.160311222571984,180.99973110315514);
|
||||
ctx.rotate(0);
|
||||
ctx.scale(1,1);
|
||||
ctx.arc(0,0,126,-2.0931154263055687,-1.5728622903484606,false);
|
||||
ctx.scale(1,1);
|
||||
ctx.rotate(0);
|
||||
ctx.translate(-44.160311222571984,-180.99973110315514);
|
||||
ctx.lineTo(44.199999999999996,181);
|
||||
ctx.closePath();
|
||||
ctx.fill();
|
||||
ctx.stroke();
|
||||
CanvasGradient g3 = ctx.createLinearGradient(26.8, 197, -46.5, 269);
|
||||
g3.addColorStop(0, "rgba(255, 255, 255, 1)");
|
||||
g3.addColorStop(1, "rgba(255, 255, 255, 0)");
|
||||
ctx.setFillStyle(g3);
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(-18.3, 290);
|
||||
ctx.translate(43.72636289026038, 180.32443158749652);
|
||||
ctx.rotate(0);
|
||||
ctx.scale(1, 1);
|
||||
ctx.arc(0, 0, 126, 2.0854951576078884, 2.611791628699119, false);
|
||||
ctx.scale(1, 1);
|
||||
ctx.rotate(0);
|
||||
ctx.translate(-43.72636289026038, -180.32443158749652);
|
||||
ctx.lineTo(44.2, 181);
|
||||
ctx.closePath();
|
||||
ctx.fill();
|
||||
ctx.stroke();
|
||||
|
||||
CanvasGradient g6=ctx.createLinearGradient(80.8,139,134,91.9);
|
||||
g6.addColorStop(0,"rgba(240, 240, 240, 1)");
|
||||
g6.addColorStop(1,"rgba(240, 240, 240, 0)");
|
||||
ctx.setFillStyle(g6);
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(108,72.1);
|
||||
ctx.translate(43.50304481630927,180.3411325330301);
|
||||
ctx.rotate(0);
|
||||
ctx.scale(1,1);
|
||||
ctx.arc(0,0,126,-1.0334238189446499,-0.5175711746742696,false);
|
||||
ctx.scale(1,1);
|
||||
ctx.rotate(0);
|
||||
ctx.translate(-43.50304481630927,-180.3411325330301);
|
||||
ctx.lineTo(44.2,181);
|
||||
ctx.closePath();
|
||||
ctx.fill();
|
||||
ctx.stroke();
|
||||
CanvasGradient g4 = ctx.createLinearGradient(18.7, 172, -76.3, 140);
|
||||
g4.addColorStop(0, "rgba(255, 255, 255, 1)");
|
||||
g4.addColorStop(1, "rgba(255, 255, 255, 0)");
|
||||
ctx.setFillStyle(g4);
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(-81.8, 179);
|
||||
ctx.translate(44.19920011832349, 178.55103503179944);
|
||||
ctx.rotate(0);
|
||||
ctx.scale(1, 1);
|
||||
ctx.arc(0, 0, 126, 3.1380294320163484, 3.670248678643417, false);
|
||||
ctx.scale(1, 1);
|
||||
ctx.rotate(0);
|
||||
ctx.translate(-44.19920011832349, -178.55103503179944);
|
||||
ctx.lineTo(44.2, 179);
|
||||
ctx.closePath();
|
||||
ctx.fill();
|
||||
ctx.stroke();
|
||||
|
||||
ctx.translate(-49.5,17.2);
|
||||
ctx.restore();
|
||||
CanvasGradient g5 = ctx.createLinearGradient(37.9, 147, 13.6, 58.6);
|
||||
g5.addColorStop(0, "rgba(255, 255, 255, 1)");
|
||||
g5.addColorStop(1, "rgba(255, 255, 255, 0)");
|
||||
ctx.setFillStyle(g5);
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(-18.7, 71.8);
|
||||
ctx.translate(44.160311222571984, 180.99973110315514);
|
||||
ctx.rotate(0);
|
||||
ctx.scale(1, 1);
|
||||
ctx.arc(0, 0, 126, -2.0931154263055687, -1.5728622903484606, false);
|
||||
ctx.scale(1, 1);
|
||||
ctx.rotate(0);
|
||||
ctx.translate(-44.160311222571984, -180.99973110315514);
|
||||
ctx.lineTo(44.199999999999996, 181);
|
||||
ctx.closePath();
|
||||
ctx.fill();
|
||||
ctx.stroke();
|
||||
|
||||
CanvasGradient g6 = ctx.createLinearGradient(80.8, 139, 134, 91.9);
|
||||
g6.addColorStop(0, "rgba(240, 240, 240, 1)");
|
||||
g6.addColorStop(1, "rgba(240, 240, 240, 0)");
|
||||
ctx.setFillStyle(g6);
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(108, 72.1);
|
||||
ctx.translate(43.50304481630927, 180.3411325330301);
|
||||
ctx.rotate(0);
|
||||
ctx.scale(1, 1);
|
||||
ctx.arc(0, 0, 126, -1.0334238189446499, -0.5175711746742696, false);
|
||||
ctx.scale(1, 1);
|
||||
ctx.rotate(0);
|
||||
ctx.translate(-43.50304481630927, -180.3411325330301);
|
||||
ctx.lineTo(44.2, 181);
|
||||
ctx.closePath();
|
||||
ctx.fill();
|
||||
ctx.stroke();
|
||||
|
||||
ctx.translate(-49.5, 17.2);
|
||||
ctx.restore();
|
||||
}
|
||||
|
||||
|
||||
protected void setUpScaleAndTranslateForMarkSelection(Context2d ctx) {
|
||||
ctx.scale(1.2,1.2);
|
||||
ctx.translate(-10,-30);
|
||||
|
||||
+74
-74
@@ -7,82 +7,82 @@ import com.sap.sailing.domain.common.impl.MeterDistance;
|
||||
|
||||
public class BoatMarkVectorGraphics extends AbstractMarkVectorGraphics {
|
||||
|
||||
private final static Distance BOAT_MARK_HEIGHT_IN_METERS = new MeterDistance(6.2);
|
||||
private final static Distance BOAT_MARK_WIDTH_IN_METERS = new MeterDistance(3.5);
|
||||
private final static double BOAT_MARK_SELECTION_SCALE = 3.5;
|
||||
private final static double BOAT_MARK_SELECTION_TRANSLATE_X = -10;
|
||||
private final static double BOAT_MARK_SELECTION_TRANSLATE_Y = -30;
|
||||
private final static Distance BOAT_MARK_HEIGHT_IN_METERS = new MeterDistance(6.2);
|
||||
private final static Distance BOAT_MARK_WIDTH_IN_METERS = new MeterDistance(3.5);
|
||||
private final static double BOAT_MARK_SELECTION_SCALE = 3.5;
|
||||
private final static double BOAT_MARK_SELECTION_TRANSLATE_X = -10;
|
||||
private final static double BOAT_MARK_SELECTION_TRANSLATE_Y = -30;
|
||||
|
||||
public BoatMarkVectorGraphics(MarkType type, String color, String shape, String pattern) {
|
||||
super(type, color, shape, pattern);
|
||||
this.anchorPointX = BOAT_MARK_HEIGHT_IN_METERS.getMeters() / 2;
|
||||
this.anchorPointY = BOAT_MARK_WIDTH_IN_METERS.getMeters() / 2;
|
||||
this.markHeightInMeters = BOAT_MARK_HEIGHT_IN_METERS;
|
||||
this.markWidthInMeters = BOAT_MARK_WIDTH_IN_METERS;
|
||||
}
|
||||
|
||||
protected void setUpScaleAndTranslateForMarkSelection(Context2d ctx) {
|
||||
ctx.scale(BOAT_MARK_SELECTION_SCALE, BOAT_MARK_SELECTION_SCALE);
|
||||
public BoatMarkVectorGraphics(MarkType type, String color, String shape, String pattern) {
|
||||
super(type, color, shape, pattern);
|
||||
this.anchorPointX = BOAT_MARK_HEIGHT_IN_METERS.getMeters() / 2;
|
||||
this.anchorPointY = BOAT_MARK_WIDTH_IN_METERS.getMeters() / 2;
|
||||
this.markHeightInMeters = BOAT_MARK_HEIGHT_IN_METERS;
|
||||
this.markWidthInMeters = BOAT_MARK_WIDTH_IN_METERS;
|
||||
}
|
||||
|
||||
protected void setUpScaleAndTranslateForMarkSelection(Context2d ctx) {
|
||||
ctx.scale(BOAT_MARK_SELECTION_SCALE, BOAT_MARK_SELECTION_SCALE);
|
||||
ctx.translate(BOAT_MARK_SELECTION_TRANSLATE_X, BOAT_MARK_SELECTION_TRANSLATE_Y);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawMarkBody(Context2d ctx, boolean isSelected, String color) {
|
||||
ctx.beginPath();
|
||||
ctx.setFillStyle("#000000");
|
||||
ctx.setStrokeStyle("#FFFFFF");
|
||||
ctx.setLineWidth(30.0);
|
||||
ctx.setLineCap("butt");
|
||||
ctx.setLineJoin("miter");
|
||||
ctx.setMiterLimit(3.0);
|
||||
ctx.moveTo(33,30.36);
|
||||
ctx.quadraticCurveTo(103.47,18.96,194.65,18.55);
|
||||
ctx.quadraticCurveTo(285.83,18.13,370.62,34.74);
|
||||
ctx.quadraticCurveTo(455.42,51.34,520.29,87.99);
|
||||
ctx.quadraticCurveTo(585.16,124.64,603,187.36);
|
||||
ctx.quadraticCurveTo(584.67,244.84,520.84,277.54);
|
||||
ctx.quadraticCurveTo(457,310.24,372.97,324.79);
|
||||
ctx.quadraticCurveTo(288.94,339.34,197.37,339.08);
|
||||
ctx.quadraticCurveTo(105.8,338.81,32,330.36);
|
||||
ctx.lineTo(33,30.362205);
|
||||
ctx.fill();
|
||||
ctx.stroke();
|
||||
|
||||
ctx.setFillStyle("#FFFFFF");
|
||||
ctx.beginPath();
|
||||
ctx.beginPath();
|
||||
ctx.setLineWidth(1.0);
|
||||
ctx.setLineJoin("miter");
|
||||
ctx.setMiterLimit(4.0);
|
||||
ctx.moveTo(81,78);
|
||||
ctx.lineTo(349,78);
|
||||
ctx.lineTo(349,291);
|
||||
ctx.lineTo(81,291);
|
||||
ctx.lineTo(81,78);
|
||||
ctx.fill();
|
||||
ctx.stroke();
|
||||
|
||||
ctx.setFillStyle("#000000");
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(337,186.36);
|
||||
ctx.quadraticCurveTo(337,180.56,334.76,175.46);
|
||||
ctx.quadraticCurveTo(332.52,170.36,328.65,166.56);
|
||||
ctx.quadraticCurveTo(324.78,162.76,319.59,160.56);
|
||||
ctx.quadraticCurveTo(314.4,158.36,308.5,158.36);
|
||||
ctx.quadraticCurveTo(302.6,158.36,297.41,160.56);
|
||||
ctx.quadraticCurveTo(292.22,162.76,288.35,166.56);
|
||||
ctx.quadraticCurveTo(284.48,170.36,282.24,175.46);
|
||||
ctx.quadraticCurveTo(280,180.56,280,186.36);
|
||||
ctx.quadraticCurveTo(280,192.16,282.24,197.26);
|
||||
ctx.quadraticCurveTo(284.48,202.36,288.35,206.16);
|
||||
ctx.quadraticCurveTo(292.22,209.96,297.41,212.16);
|
||||
ctx.quadraticCurveTo(302.6,214.36,308.5,214.36);
|
||||
ctx.quadraticCurveTo(314.4,214.36,319.59,212.16);
|
||||
ctx.quadraticCurveTo(324.78,209.96,328.65,206.16);
|
||||
ctx.quadraticCurveTo(332.52,202.36,334.76,197.26);
|
||||
ctx.quadraticCurveTo(337,192.16,337,186.36);
|
||||
ctx.stroke();
|
||||
ctx.fill();
|
||||
ctx.beginPath();
|
||||
}
|
||||
@Override
|
||||
protected void drawMarkBody(Context2d ctx, boolean isSelected, String color) {
|
||||
ctx.beginPath();
|
||||
ctx.setFillStyle("#000000");
|
||||
ctx.setStrokeStyle("#FFFFFF");
|
||||
ctx.setLineWidth(30.0);
|
||||
ctx.setLineCap("butt");
|
||||
ctx.setLineJoin("miter");
|
||||
ctx.setMiterLimit(3.0);
|
||||
ctx.moveTo(33, 30.36);
|
||||
ctx.quadraticCurveTo(103.47, 18.96, 194.65, 18.55);
|
||||
ctx.quadraticCurveTo(285.83, 18.13, 370.62, 34.74);
|
||||
ctx.quadraticCurveTo(455.42, 51.34, 520.29, 87.99);
|
||||
ctx.quadraticCurveTo(585.16, 124.64, 603, 187.36);
|
||||
ctx.quadraticCurveTo(584.67, 244.84, 520.84, 277.54);
|
||||
ctx.quadraticCurveTo(457, 310.24, 372.97, 324.79);
|
||||
ctx.quadraticCurveTo(288.94, 339.34, 197.37, 339.08);
|
||||
ctx.quadraticCurveTo(105.8, 338.81, 32, 330.36);
|
||||
ctx.lineTo(33, 30.362205);
|
||||
ctx.fill();
|
||||
ctx.stroke();
|
||||
|
||||
ctx.setFillStyle("#FFFFFF");
|
||||
ctx.beginPath();
|
||||
ctx.beginPath();
|
||||
ctx.setLineWidth(1.0);
|
||||
ctx.setLineJoin("miter");
|
||||
ctx.setMiterLimit(4.0);
|
||||
ctx.moveTo(81, 78);
|
||||
ctx.lineTo(349, 78);
|
||||
ctx.lineTo(349, 291);
|
||||
ctx.lineTo(81, 291);
|
||||
ctx.lineTo(81, 78);
|
||||
ctx.fill();
|
||||
ctx.stroke();
|
||||
|
||||
ctx.setFillStyle("#000000");
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(337, 186.36);
|
||||
ctx.quadraticCurveTo(337, 180.56, 334.76, 175.46);
|
||||
ctx.quadraticCurveTo(332.52, 170.36, 328.65, 166.56);
|
||||
ctx.quadraticCurveTo(324.78, 162.76, 319.59, 160.56);
|
||||
ctx.quadraticCurveTo(314.4, 158.36, 308.5, 158.36);
|
||||
ctx.quadraticCurveTo(302.6, 158.36, 297.41, 160.56);
|
||||
ctx.quadraticCurveTo(292.22, 162.76, 288.35, 166.56);
|
||||
ctx.quadraticCurveTo(284.48, 170.36, 282.24, 175.46);
|
||||
ctx.quadraticCurveTo(280, 180.56, 280, 186.36);
|
||||
ctx.quadraticCurveTo(280, 192.16, 282.24, 197.26);
|
||||
ctx.quadraticCurveTo(284.48, 202.36, 288.35, 206.16);
|
||||
ctx.quadraticCurveTo(292.22, 209.96, 297.41, 212.16);
|
||||
ctx.quadraticCurveTo(302.6, 214.36, 308.5, 214.36);
|
||||
ctx.quadraticCurveTo(314.4, 214.36, 319.59, 212.16);
|
||||
ctx.quadraticCurveTo(324.78, 209.96, 328.65, 206.16);
|
||||
ctx.quadraticCurveTo(332.52, 202.36, 334.76, 197.26);
|
||||
ctx.quadraticCurveTo(337, 192.16, 337, 186.36);
|
||||
ctx.stroke();
|
||||
ctx.fill();
|
||||
ctx.beginPath();
|
||||
}
|
||||
}
|
||||
+206
-206
@@ -5,55 +5,35 @@ import com.sap.sailing.domain.common.MarkType;
|
||||
|
||||
public class BuoyMarkVectorGraphics extends AbstractMarkVectorGraphics implements MarkVectorGraphics {
|
||||
|
||||
public BuoyMarkVectorGraphics(MarkType type, String color, String shape, String pattern) {
|
||||
super(type, color, shape, pattern);
|
||||
}
|
||||
public BuoyMarkVectorGraphics(MarkType type, String color, String shape, String pattern) {
|
||||
super(type, color, shape, pattern);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawMarkBody(Context2d ctx, boolean isSelected, String color) {
|
||||
if (shape != null) {
|
||||
if (Shape.CYLINDER.name().equalsIgnoreCase(shape) && pattern != null
|
||||
&& Pattern.CHECKERED.name().equalsIgnoreCase(pattern)) {
|
||||
drawBuoyWithFinishFlag(ctx, isSelected, color);
|
||||
} else if (Shape.CONICAL.name().equalsIgnoreCase(shape)) {
|
||||
drawConicalBuoy(ctx, isSelected, color);
|
||||
} else {
|
||||
drawSimpleBuoy(ctx, isSelected, color);
|
||||
}
|
||||
} else {
|
||||
drawSimpleBuoy(ctx, isSelected, color);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawMarkBody(Context2d ctx, boolean isSelected, String color) {
|
||||
if (shape != null) {
|
||||
if (Shape.CYLINDER.name().equalsIgnoreCase(shape) && pattern != null
|
||||
&& Pattern.CHECKERED.name().equalsIgnoreCase(pattern)) {
|
||||
drawBuoyWithFinishFlag(ctx, isSelected, color);
|
||||
} else if (Shape.CONICAL.name().equalsIgnoreCase(shape)) {
|
||||
drawConicalBuoy(ctx, isSelected, color);
|
||||
} else {
|
||||
drawSimpleBuoy(ctx, isSelected, color);
|
||||
}
|
||||
} else {
|
||||
drawSimpleBuoy(ctx, isSelected, color);
|
||||
}
|
||||
}
|
||||
|
||||
void drawSimpleBuoy(Context2d ctx, boolean isSelected, String color) {
|
||||
ctx.setStrokeStyle("rgba(0,0,0,0)");
|
||||
|
||||
|
||||
ctx.save();
|
||||
ctx.setFillStyle(color);
|
||||
ctx.transform(12.5,0,0,12.5,-578,22.2);
|
||||
|
||||
ctx.transform(12.5, 0, 0, 12.5, -578, 22.2);
|
||||
|
||||
ctx.beginPath();
|
||||
ctx.arc(49.7,12.8,2.66,0,doublePi,false);
|
||||
ctx.closePath();
|
||||
ctx.fill();
|
||||
ctx.stroke();
|
||||
ctx.restore();
|
||||
|
||||
ctx.save();
|
||||
ctx.setFillStyle(DEFAULT_MARK_BG_COLOR);
|
||||
ctx.transform(12.5,0,0,12.5,-578,22.2);
|
||||
ctx.beginPath();
|
||||
ctx.arc(49.7,11.3,3.37,0,doublePi,false);
|
||||
ctx.closePath();
|
||||
ctx.fill();
|
||||
ctx.stroke();
|
||||
ctx.restore();
|
||||
|
||||
ctx.save();
|
||||
ctx.setFillStyle(color);
|
||||
ctx.transform(12.5,0,0,12.5,-578,22.2);
|
||||
ctx.beginPath();
|
||||
ctx.arc(49.6,10.6,2.66,0,doublePi,false);
|
||||
ctx.arc(49.7, 12.8, 2.66, 0, doublePi, false);
|
||||
ctx.closePath();
|
||||
ctx.fill();
|
||||
ctx.stroke();
|
||||
@@ -61,59 +41,79 @@ public class BuoyMarkVectorGraphics extends AbstractMarkVectorGraphics implement
|
||||
|
||||
ctx.save();
|
||||
ctx.setFillStyle(DEFAULT_MARK_BG_COLOR);
|
||||
ctx.transform(4.98,0,0,10.8,-205,50.4);
|
||||
ctx.transform(12.5, 0, 0, 12.5, -578, 22.2);
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(50.8,9.84);
|
||||
ctx.lineTo(48.5,9.84);
|
||||
ctx.lineTo(48.5,1.44);
|
||||
ctx.lineTo(50.8,1.9);
|
||||
ctx.lineTo(50.8,9.84);
|
||||
ctx.arc(49.7, 11.3, 3.37, 0, doublePi, false);
|
||||
ctx.closePath();
|
||||
ctx.fill();
|
||||
ctx.stroke();
|
||||
ctx.restore();
|
||||
|
||||
ctx.save();
|
||||
ctx.transform(12.5,0,0,12.5,-570,22.2);
|
||||
ctx.save();
|
||||
ctx.setFillStyle(color);
|
||||
ctx.transform(12.5, 0, 0, 12.5, -578, 22.2);
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(48.8,3.82);
|
||||
ctx.lineTo(48.8,-1.32);
|
||||
ctx.lineTo(57,1.05);
|
||||
ctx.lineTo(48.8,3.82);
|
||||
ctx.arc(49.6, 10.6, 2.66, 0, doublePi, false);
|
||||
ctx.closePath();
|
||||
ctx.fill();
|
||||
ctx.stroke();
|
||||
ctx.restore();
|
||||
|
||||
|
||||
ctx.save();
|
||||
ctx.setFillStyle(DEFAULT_MARK_BG_COLOR);
|
||||
ctx.transform(4.98, 0, 0, 10.8, -205, 50.4);
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(50.8, 9.84);
|
||||
ctx.lineTo(48.5, 9.84);
|
||||
ctx.lineTo(48.5, 1.44);
|
||||
ctx.lineTo(50.8, 1.9);
|
||||
ctx.lineTo(50.8, 9.84);
|
||||
ctx.closePath();
|
||||
ctx.fill();
|
||||
ctx.stroke();
|
||||
ctx.restore();
|
||||
|
||||
ctx.save();
|
||||
ctx.transform(12.5, 0, 0, 12.5, -570, 22.2);
|
||||
ctx.save();
|
||||
ctx.setFillStyle(color);
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(48.8, 3.82);
|
||||
ctx.lineTo(48.8, -1.32);
|
||||
ctx.lineTo(57, 1.05);
|
||||
ctx.lineTo(48.8, 3.82);
|
||||
ctx.closePath();
|
||||
ctx.fill();
|
||||
ctx.stroke();
|
||||
ctx.restore();
|
||||
|
||||
ctx.save();
|
||||
ctx.setFillStyle(DEFAULT_MARK_BG_COLOR);
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(48.5,4.16);
|
||||
ctx.lineTo(48.5,-1.65);
|
||||
ctx.lineTo(57.8,1.03);
|
||||
ctx.lineTo(48.5,4.16);
|
||||
ctx.moveTo(48.5, 4.16);
|
||||
ctx.lineTo(48.5, -1.65);
|
||||
ctx.lineTo(57.8, 1.03);
|
||||
ctx.lineTo(48.5, 4.16);
|
||||
ctx.closePath();
|
||||
ctx.moveTo(49,-0.994);
|
||||
ctx.lineTo(49,3.47);
|
||||
ctx.lineTo(56.2,1.07);
|
||||
ctx.lineTo(49,-0.994);
|
||||
ctx.moveTo(49, -0.994);
|
||||
ctx.lineTo(49, 3.47);
|
||||
ctx.lineTo(56.2, 1.07);
|
||||
ctx.lineTo(49, -0.994);
|
||||
ctx.closePath();
|
||||
ctx.fill();
|
||||
ctx.stroke();
|
||||
ctx.restore();
|
||||
ctx.restore();
|
||||
}
|
||||
|
||||
|
||||
private void drawBuoyWithFinishFlag(Context2d ctx, boolean isSelected, String color) {
|
||||
ctx.setStrokeStyle("rgba(0,0,0,0)");
|
||||
|
||||
ctx.save();
|
||||
ctx.setFillStyle(color);
|
||||
ctx.transform(12.5,0,0,12.5,-578,22.2);
|
||||
ctx.transform(12.5, 0, 0, 12.5, -578, 22.2);
|
||||
ctx.beginPath();
|
||||
ctx.arc(49.7,12.8,2.66,0,doublePi,false);
|
||||
ctx.arc(49.7, 12.8, 2.66, 0, doublePi, false);
|
||||
ctx.closePath();
|
||||
ctx.fill();
|
||||
ctx.stroke();
|
||||
@@ -121,50 +121,9 @@ public class BuoyMarkVectorGraphics extends AbstractMarkVectorGraphics implement
|
||||
|
||||
ctx.save();
|
||||
ctx.setFillStyle(DEFAULT_MARK_BG_COLOR);
|
||||
ctx.transform(12.5,0,0,12.5,-578,22.2);
|
||||
ctx.transform(12.5, 0, 0, 12.5, -578, 22.2);
|
||||
ctx.beginPath();
|
||||
ctx.arc(49.7,11.3,3.37,0,doublePi,false);
|
||||
ctx.closePath();
|
||||
ctx.fill();
|
||||
ctx.stroke();
|
||||
ctx.restore();
|
||||
|
||||
ctx.save();
|
||||
ctx.setFillStyle(color);
|
||||
ctx.transform(12.5,0,0,12.5,-578,22.2);
|
||||
ctx.beginPath();
|
||||
ctx.arc(49.6,10.6,2.66,0,doublePi,false);
|
||||
ctx.closePath();
|
||||
ctx.fill();
|
||||
ctx.stroke();
|
||||
ctx.restore();
|
||||
|
||||
ctx.save();
|
||||
ctx.setFillStyle(DEFAULT_MARK_BG_COLOR);
|
||||
ctx.transform(4.98,0,0,10.8,-205,50.4);
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(50.8,9.84);
|
||||
ctx.lineTo(48.5,9.84);
|
||||
ctx.lineTo(48.5,1.44);
|
||||
ctx.lineTo(50.8,1.9);
|
||||
ctx.lineTo(50.8,9.84);
|
||||
ctx.closePath();
|
||||
ctx.fill();
|
||||
ctx.stroke();
|
||||
ctx.restore();
|
||||
|
||||
ctx.save();
|
||||
ctx.setFillStyle(DEFAULT_MARK_BG_COLOR);
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(36.9,-0.5);
|
||||
ctx.lineTo(141.9,-0.5);
|
||||
ctx.quadraticCurveTo(141.9,-0.5,141.9,-0.5);
|
||||
ctx.lineTo(141.9,71.2);
|
||||
ctx.quadraticCurveTo(141.9,71.2,141.9,71.2);
|
||||
ctx.lineTo(36.9,71.2);
|
||||
ctx.quadraticCurveTo(36.9,71.2,36.9,71.2);
|
||||
ctx.lineTo(36.9,-0.5);
|
||||
ctx.quadraticCurveTo(36.9,-0.5,36.9,-0.5);
|
||||
ctx.arc(49.7, 11.3, 3.37, 0, doublePi, false);
|
||||
ctx.closePath();
|
||||
ctx.fill();
|
||||
ctx.stroke();
|
||||
@@ -172,16 +131,23 @@ public class BuoyMarkVectorGraphics extends AbstractMarkVectorGraphics implement
|
||||
|
||||
ctx.save();
|
||||
ctx.setFillStyle(color);
|
||||
ctx.transform(12.5, 0, 0, 12.5, -578, 22.2);
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(46,4.04);
|
||||
ctx.lineTo(76.3,4.04);
|
||||
ctx.quadraticCurveTo(76.3,4.04,76.3,4.04);
|
||||
ctx.lineTo(76.3,34.34);
|
||||
ctx.quadraticCurveTo(76.3,34.34,76.3,34.34);
|
||||
ctx.lineTo(46,34.34);
|
||||
ctx.quadraticCurveTo(46,34.34,46,34.34);
|
||||
ctx.lineTo(46,4.04);
|
||||
ctx.quadraticCurveTo(46,4.04,46,4.04);
|
||||
ctx.arc(49.6, 10.6, 2.66, 0, doublePi, false);
|
||||
ctx.closePath();
|
||||
ctx.fill();
|
||||
ctx.stroke();
|
||||
ctx.restore();
|
||||
|
||||
ctx.save();
|
||||
ctx.setFillStyle(DEFAULT_MARK_BG_COLOR);
|
||||
ctx.transform(4.98, 0, 0, 10.8, -205, 50.4);
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(50.8, 9.84);
|
||||
ctx.lineTo(48.5, 9.84);
|
||||
ctx.lineTo(48.5, 1.44);
|
||||
ctx.lineTo(50.8, 1.9);
|
||||
ctx.lineTo(50.8, 9.84);
|
||||
ctx.closePath();
|
||||
ctx.fill();
|
||||
ctx.stroke();
|
||||
@@ -190,15 +156,32 @@ public class BuoyMarkVectorGraphics extends AbstractMarkVectorGraphics implement
|
||||
ctx.save();
|
||||
ctx.setFillStyle(DEFAULT_MARK_BG_COLOR);
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(46.1,34.3);
|
||||
ctx.lineTo(76.4,34.3);
|
||||
ctx.quadraticCurveTo(76.4,34.3,76.4,34.3);
|
||||
ctx.lineTo(76.4,64.6);
|
||||
ctx.quadraticCurveTo(76.4,64.6,76.4,64.6);
|
||||
ctx.lineTo(46.1,64.6);
|
||||
ctx.quadraticCurveTo(46.1,64.6,46.1,64.6);
|
||||
ctx.lineTo(46.1,34.3);
|
||||
ctx.quadraticCurveTo(46.1,34.3,46.1,34.3);
|
||||
ctx.moveTo(36.9, -0.5);
|
||||
ctx.lineTo(141.9, -0.5);
|
||||
ctx.quadraticCurveTo(141.9, -0.5, 141.9, -0.5);
|
||||
ctx.lineTo(141.9, 71.2);
|
||||
ctx.quadraticCurveTo(141.9, 71.2, 141.9, 71.2);
|
||||
ctx.lineTo(36.9, 71.2);
|
||||
ctx.quadraticCurveTo(36.9, 71.2, 36.9, 71.2);
|
||||
ctx.lineTo(36.9, -0.5);
|
||||
ctx.quadraticCurveTo(36.9, -0.5, 36.9, -0.5);
|
||||
ctx.closePath();
|
||||
ctx.fill();
|
||||
ctx.stroke();
|
||||
ctx.restore();
|
||||
|
||||
ctx.save();
|
||||
ctx.setFillStyle(color);
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(46, 4.04);
|
||||
ctx.lineTo(76.3, 4.04);
|
||||
ctx.quadraticCurveTo(76.3, 4.04, 76.3, 4.04);
|
||||
ctx.lineTo(76.3, 34.34);
|
||||
ctx.quadraticCurveTo(76.3, 34.34, 76.3, 34.34);
|
||||
ctx.lineTo(46, 34.34);
|
||||
ctx.quadraticCurveTo(46, 34.34, 46, 34.34);
|
||||
ctx.lineTo(46, 4.04);
|
||||
ctx.quadraticCurveTo(46, 4.04, 46, 4.04);
|
||||
ctx.closePath();
|
||||
ctx.fill();
|
||||
ctx.stroke();
|
||||
@@ -207,66 +190,83 @@ public class BuoyMarkVectorGraphics extends AbstractMarkVectorGraphics implement
|
||||
ctx.save();
|
||||
ctx.setFillStyle(DEFAULT_MARK_BG_COLOR);
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(76,3.95);
|
||||
ctx.lineTo(106.3,3.95);
|
||||
ctx.quadraticCurveTo(106.3,3.95,106.3,3.95);
|
||||
ctx.lineTo(106.3,34.25);
|
||||
ctx.quadraticCurveTo(106.3,34.25,106.3,34.25);
|
||||
ctx.lineTo(76,34.25);
|
||||
ctx.quadraticCurveTo(76,34.25,76,34.25);
|
||||
ctx.lineTo(76,3.95);
|
||||
ctx.quadraticCurveTo(76,3.95,76,3.95);
|
||||
ctx.moveTo(46.1, 34.3);
|
||||
ctx.lineTo(76.4, 34.3);
|
||||
ctx.quadraticCurveTo(76.4, 34.3, 76.4, 34.3);
|
||||
ctx.lineTo(76.4, 64.6);
|
||||
ctx.quadraticCurveTo(76.4, 64.6, 76.4, 64.6);
|
||||
ctx.lineTo(46.1, 64.6);
|
||||
ctx.quadraticCurveTo(46.1, 64.6, 46.1, 64.6);
|
||||
ctx.lineTo(46.1, 34.3);
|
||||
ctx.quadraticCurveTo(46.1, 34.3, 46.1, 34.3);
|
||||
ctx.closePath();
|
||||
ctx.fill();
|
||||
ctx.stroke();
|
||||
ctx.restore();
|
||||
|
||||
ctx.save();
|
||||
ctx.setFillStyle(color);
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(76.1,34.2);
|
||||
ctx.lineTo(106.4,34.2);
|
||||
ctx.quadraticCurveTo(106.4,34.2,106.4,34.2);
|
||||
ctx.lineTo(106.4,64.5);
|
||||
ctx.quadraticCurveTo(106.4,64.5,106.4,64.5);
|
||||
ctx.lineTo(76.1,64.5);
|
||||
ctx.quadraticCurveTo(76.1,64.5,76.1,64.5);
|
||||
ctx.lineTo(76.1,34.2);
|
||||
ctx.quadraticCurveTo(76.1,34.2,76.1,34.2);
|
||||
ctx.closePath();
|
||||
ctx.fill();
|
||||
ctx.stroke();
|
||||
ctx.restore();
|
||||
|
||||
ctx.save();
|
||||
ctx.setFillStyle(color);
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(106,3.96);
|
||||
ctx.lineTo(136.3,3.96);
|
||||
ctx.quadraticCurveTo(136.3,3.96,136.3,3.96);
|
||||
ctx.lineTo(136.3,34.26);
|
||||
ctx.quadraticCurveTo(136.3,34.26,136.3,34.26);
|
||||
ctx.lineTo(106,34.26);
|
||||
ctx.quadraticCurveTo(106,34.26,106,34.26);
|
||||
ctx.lineTo(106,3.96);
|
||||
ctx.quadraticCurveTo(106,3.96,106,3.96);
|
||||
ctx.closePath();
|
||||
ctx.fill();
|
||||
ctx.stroke();
|
||||
ctx.restore();
|
||||
|
||||
|
||||
ctx.save();
|
||||
ctx.setFillStyle(DEFAULT_MARK_BG_COLOR);
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(106,34.3);
|
||||
ctx.lineTo(136.3,34.3);
|
||||
ctx.quadraticCurveTo(136.3,34.3,136.3,34.3);
|
||||
ctx.lineTo(136.3,64.6);
|
||||
ctx.quadraticCurveTo(136.3,64.6,136.3,64.6);
|
||||
ctx.lineTo(106,64.6);
|
||||
ctx.quadraticCurveTo(106,64.6,106,64.6);
|
||||
ctx.lineTo(106,34.3);
|
||||
ctx.quadraticCurveTo(106,34.3,106,34.3);
|
||||
ctx.moveTo(76, 3.95);
|
||||
ctx.lineTo(106.3, 3.95);
|
||||
ctx.quadraticCurveTo(106.3, 3.95, 106.3, 3.95);
|
||||
ctx.lineTo(106.3, 34.25);
|
||||
ctx.quadraticCurveTo(106.3, 34.25, 106.3, 34.25);
|
||||
ctx.lineTo(76, 34.25);
|
||||
ctx.quadraticCurveTo(76, 34.25, 76, 34.25);
|
||||
ctx.lineTo(76, 3.95);
|
||||
ctx.quadraticCurveTo(76, 3.95, 76, 3.95);
|
||||
ctx.closePath();
|
||||
ctx.fill();
|
||||
ctx.stroke();
|
||||
ctx.restore();
|
||||
|
||||
ctx.save();
|
||||
ctx.setFillStyle(color);
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(76.1, 34.2);
|
||||
ctx.lineTo(106.4, 34.2);
|
||||
ctx.quadraticCurveTo(106.4, 34.2, 106.4, 34.2);
|
||||
ctx.lineTo(106.4, 64.5);
|
||||
ctx.quadraticCurveTo(106.4, 64.5, 106.4, 64.5);
|
||||
ctx.lineTo(76.1, 64.5);
|
||||
ctx.quadraticCurveTo(76.1, 64.5, 76.1, 64.5);
|
||||
ctx.lineTo(76.1, 34.2);
|
||||
ctx.quadraticCurveTo(76.1, 34.2, 76.1, 34.2);
|
||||
ctx.closePath();
|
||||
ctx.fill();
|
||||
ctx.stroke();
|
||||
ctx.restore();
|
||||
|
||||
ctx.save();
|
||||
ctx.setFillStyle(color);
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(106, 3.96);
|
||||
ctx.lineTo(136.3, 3.96);
|
||||
ctx.quadraticCurveTo(136.3, 3.96, 136.3, 3.96);
|
||||
ctx.lineTo(136.3, 34.26);
|
||||
ctx.quadraticCurveTo(136.3, 34.26, 136.3, 34.26);
|
||||
ctx.lineTo(106, 34.26);
|
||||
ctx.quadraticCurveTo(106, 34.26, 106, 34.26);
|
||||
ctx.lineTo(106, 3.96);
|
||||
ctx.quadraticCurveTo(106, 3.96, 106, 3.96);
|
||||
ctx.closePath();
|
||||
ctx.fill();
|
||||
ctx.stroke();
|
||||
ctx.restore();
|
||||
|
||||
ctx.save();
|
||||
ctx.setFillStyle(DEFAULT_MARK_BG_COLOR);
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(106, 34.3);
|
||||
ctx.lineTo(136.3, 34.3);
|
||||
ctx.quadraticCurveTo(136.3, 34.3, 136.3, 34.3);
|
||||
ctx.lineTo(136.3, 64.6);
|
||||
ctx.quadraticCurveTo(136.3, 64.6, 136.3, 64.6);
|
||||
ctx.lineTo(106, 64.6);
|
||||
ctx.quadraticCurveTo(106, 64.6, 106, 64.6);
|
||||
ctx.lineTo(106, 34.3);
|
||||
ctx.quadraticCurveTo(106, 34.3, 106, 34.3);
|
||||
ctx.closePath();
|
||||
ctx.fill();
|
||||
ctx.stroke();
|
||||
@@ -279,9 +279,9 @@ public class BuoyMarkVectorGraphics extends AbstractMarkVectorGraphics implement
|
||||
|
||||
ctx.save();
|
||||
ctx.setFillStyle(color);
|
||||
ctx.transform(12.5,0,0,12.5,-578,22.2);
|
||||
ctx.transform(12.5, 0, 0, 12.5, -578, 22.2);
|
||||
ctx.beginPath();
|
||||
ctx.arc(49.7,12.8,2.66,0,doublePi,false);
|
||||
ctx.arc(49.7, 12.8, 2.66, 0, doublePi, false);
|
||||
ctx.closePath();
|
||||
ctx.fill();
|
||||
ctx.stroke();
|
||||
@@ -289,58 +289,58 @@ public class BuoyMarkVectorGraphics extends AbstractMarkVectorGraphics implement
|
||||
|
||||
ctx.save();
|
||||
ctx.setFillStyle(DEFAULT_MARK_BG_COLOR);
|
||||
ctx.transform(12.5,0,0,12.5,-578,22.2);
|
||||
ctx.transform(12.5, 0, 0, 12.5, -578, 22.2);
|
||||
ctx.beginPath();
|
||||
ctx.arc(49.7,11.3,3.37,0,doublePi,false);
|
||||
ctx.arc(49.7, 11.3, 3.37, 0, doublePi, false);
|
||||
ctx.closePath();
|
||||
ctx.fill();
|
||||
ctx.stroke();
|
||||
ctx.restore();
|
||||
|
||||
|
||||
ctx.save();
|
||||
ctx.setFillStyle(color);
|
||||
ctx.transform(12.5,0,0,12.5,-578,22.2);
|
||||
ctx.transform(12.5, 0, 0, 12.5, -578, 22.2);
|
||||
ctx.beginPath();
|
||||
ctx.arc(49.6,10.6,2.66,0,doublePi,false);
|
||||
ctx.arc(49.6, 10.6, 2.66, 0, doublePi, false);
|
||||
ctx.closePath();
|
||||
ctx.fill();
|
||||
ctx.stroke();
|
||||
ctx.restore();
|
||||
|
||||
|
||||
ctx.save();
|
||||
ctx.setFillStyle(DEFAULT_MARK_BG_COLOR);
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(36.9,98);
|
||||
ctx.lineTo(47.5,98);
|
||||
ctx.quadraticCurveTo(47.5,98,47.5,98);
|
||||
ctx.lineTo(47.5,154.5);
|
||||
ctx.quadraticCurveTo(47.5,154.5,47.5,154.5);
|
||||
ctx.lineTo(36.9,154.5);
|
||||
ctx.quadraticCurveTo(36.9,154.5,36.9,154.5);
|
||||
ctx.lineTo(36.9,98);
|
||||
ctx.quadraticCurveTo(36.9,98,36.9,98);
|
||||
ctx.moveTo(36.9, 98);
|
||||
ctx.lineTo(47.5, 98);
|
||||
ctx.quadraticCurveTo(47.5, 98, 47.5, 98);
|
||||
ctx.lineTo(47.5, 154.5);
|
||||
ctx.quadraticCurveTo(47.5, 154.5, 47.5, 154.5);
|
||||
ctx.lineTo(36.9, 154.5);
|
||||
ctx.quadraticCurveTo(36.9, 154.5, 36.9, 154.5);
|
||||
ctx.lineTo(36.9, 98);
|
||||
ctx.quadraticCurveTo(36.9, 98, 36.9, 98);
|
||||
ctx.closePath();
|
||||
ctx.fill();
|
||||
ctx.stroke();
|
||||
ctx.restore();
|
||||
|
||||
|
||||
ctx.save();
|
||||
ctx.setFillStyle(DEFAULT_MARK_BG_COLOR);
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(43.6,0.372);
|
||||
ctx.lineTo(87.3,102);
|
||||
ctx.lineTo(-0.714,102);
|
||||
ctx.moveTo(43.6, 0.372);
|
||||
ctx.lineTo(87.3, 102);
|
||||
ctx.lineTo(-0.714, 102);
|
||||
ctx.closePath();
|
||||
ctx.fill();
|
||||
ctx.stroke();
|
||||
ctx.restore();
|
||||
|
||||
|
||||
ctx.save();
|
||||
ctx.setFillStyle(color);
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(43.6,14.7);
|
||||
ctx.lineTo(78.5,96.6);
|
||||
ctx.lineTo(8.07,96.6);
|
||||
ctx.moveTo(43.6, 14.7);
|
||||
ctx.lineTo(78.5, 96.6);
|
||||
ctx.lineTo(8.07, 96.6);
|
||||
ctx.closePath();
|
||||
ctx.fill();
|
||||
ctx.stroke();
|
||||
|
||||
+34
-34
@@ -5,73 +5,73 @@ import com.sap.sailing.domain.common.MarkType;
|
||||
|
||||
public class LandMarkVectorGraphics extends AbstractMarkVectorGraphics implements MarkVectorGraphics {
|
||||
|
||||
public LandMarkVectorGraphics(MarkType type, String color, String shape, String pattern) {
|
||||
super(type, color, shape, pattern);
|
||||
}
|
||||
public LandMarkVectorGraphics(MarkType type, String color, String shape, String pattern) {
|
||||
super(type, color, shape, pattern);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawMarkBody(Context2d ctx, boolean isSelected, String color) {
|
||||
ctx.setStrokeStyle("rgba(0,0,0,0)");
|
||||
@Override
|
||||
protected void drawMarkBody(Context2d ctx, boolean isSelected, String color) {
|
||||
ctx.setStrokeStyle("rgba(0,0,0,0)");
|
||||
|
||||
ctx.save();
|
||||
ctx.setFillStyle(DEFAULT_MARK_BG_COLOR);
|
||||
ctx.transform(4.98,0,0,10.8,-205,50.4);
|
||||
ctx.transform(4.98, 0, 0, 10.8, -205, 50.4);
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(50.8,9.84);
|
||||
ctx.lineTo(48.5,9.84);
|
||||
ctx.lineTo(48.5,1.44);
|
||||
ctx.lineTo(50.8,1.9);
|
||||
ctx.lineTo(50.8,9.84);
|
||||
ctx.moveTo(50.8, 9.84);
|
||||
ctx.lineTo(48.5, 9.84);
|
||||
ctx.lineTo(48.5, 1.44);
|
||||
ctx.lineTo(50.8, 1.9);
|
||||
ctx.lineTo(50.8, 9.84);
|
||||
ctx.closePath();
|
||||
ctx.fill();
|
||||
ctx.stroke();
|
||||
ctx.restore();
|
||||
|
||||
ctx.save();
|
||||
ctx.transform(12.5,0,0,12.5,-570,22.2);
|
||||
ctx.transform(12.5, 0, 0, 12.5, -570, 22.2);
|
||||
ctx.save();
|
||||
ctx.setFillStyle(color);
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(48.8,3.82);
|
||||
ctx.lineTo(48.8,-1.32);
|
||||
ctx.lineTo(57,1.05);
|
||||
ctx.lineTo(48.8,3.82);
|
||||
ctx.moveTo(48.8, 3.82);
|
||||
ctx.lineTo(48.8, -1.32);
|
||||
ctx.lineTo(57, 1.05);
|
||||
ctx.lineTo(48.8, 3.82);
|
||||
ctx.closePath();
|
||||
ctx.fill();
|
||||
ctx.stroke();
|
||||
ctx.restore();
|
||||
|
||||
|
||||
ctx.save();
|
||||
ctx.setFillStyle(DEFAULT_MARK_BG_COLOR);
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(48.5,4.16);
|
||||
ctx.lineTo(48.5,-1.65);
|
||||
ctx.lineTo(57.8,1.03);
|
||||
ctx.lineTo(48.5,4.16);
|
||||
ctx.moveTo(48.5, 4.16);
|
||||
ctx.lineTo(48.5, -1.65);
|
||||
ctx.lineTo(57.8, 1.03);
|
||||
ctx.lineTo(48.5, 4.16);
|
||||
ctx.closePath();
|
||||
ctx.moveTo(49,-0.994);
|
||||
ctx.lineTo(49,3.47);
|
||||
ctx.lineTo(56.2,1.07);
|
||||
ctx.lineTo(49,-0.994);
|
||||
ctx.moveTo(49, -0.994);
|
||||
ctx.lineTo(49, 3.47);
|
||||
ctx.lineTo(56.2, 1.07);
|
||||
ctx.lineTo(49, -0.994);
|
||||
ctx.closePath();
|
||||
ctx.fill();
|
||||
ctx.stroke();
|
||||
ctx.restore();
|
||||
ctx.restore();
|
||||
|
||||
|
||||
ctx.save();
|
||||
ctx.setFillStyle(color);
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(83.9,209);
|
||||
ctx.bezierCurveTo(83.9,209,68.6,183,43.0,183);
|
||||
ctx.bezierCurveTo(12.3,183,7.1,209,7.1,209);
|
||||
ctx.lineTo(7.1,157);
|
||||
ctx.lineTo(83.9,157);
|
||||
ctx.lineTo(83.9,209);
|
||||
ctx.moveTo(83.9, 209);
|
||||
ctx.bezierCurveTo(83.9, 209, 68.6, 183, 43.0, 183);
|
||||
ctx.bezierCurveTo(12.3, 183, 7.1, 209, 7.1, 209);
|
||||
ctx.lineTo(7.1, 157);
|
||||
ctx.lineTo(83.9, 157);
|
||||
ctx.lineTo(83.9, 209);
|
||||
ctx.closePath();
|
||||
ctx.fill();
|
||||
ctx.stroke();
|
||||
ctx.restore();
|
||||
ctx.restore();
|
||||
}
|
||||
}
|
||||
}
|
||||
+3
-4
@@ -4,10 +4,9 @@ import com.google.gwt.canvas.dom.client.Context2d;
|
||||
import com.sap.sailing.domain.common.Distance;
|
||||
|
||||
public interface MarkVectorGraphics {
|
||||
void drawMarkToCanvas(Context2d ctx, boolean isSelected, double width, double height, double scaleFactor);
|
||||
|
||||
public void drawMarkToCanvas(Context2d ctx, boolean isSelected, double width, double height, double scaleFactor);
|
||||
Distance getMarkHeight();
|
||||
|
||||
public Distance getMarkHeight();
|
||||
|
||||
public Distance getMarkWidth();
|
||||
Distance getMarkWidth();
|
||||
}
|
||||
+19
-22
@@ -4,26 +4,23 @@ import com.sap.sailing.domain.common.MarkType;
|
||||
import com.sap.sailing.gwt.ui.shared.MarkDTO;
|
||||
|
||||
public class MarkVectorGraphicsFactory {
|
||||
|
||||
public MarkVectorGraphics getMarkVectorGraphics(MarkType markType, MarkDTO markDTO) {
|
||||
MarkVectorGraphics result;
|
||||
switch (markType) {
|
||||
case BUOY:
|
||||
result = new BuoyMarkVectorGraphics(markDTO.type, markDTO.color, markDTO.shape, markDTO.pattern);
|
||||
break;
|
||||
case STARTBOAT:
|
||||
result = new BoatMarkVectorGraphics(markDTO.type, markDTO.color, markDTO.shape, markDTO.pattern);
|
||||
break;
|
||||
case FINISHBOAT:
|
||||
result = new BoatMarkVectorGraphics(markDTO.type, markDTO.color, markDTO.shape, markDTO.pattern);
|
||||
break;
|
||||
case LANDMARK:
|
||||
result = new LandMarkVectorGraphics(markDTO.type, markDTO.color, markDTO.shape, markDTO.pattern);
|
||||
break;
|
||||
default:
|
||||
result = new BuoyMarkVectorGraphics(markDTO.type, markDTO.color, markDTO.shape, markDTO.pattern);
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
public MarkVectorGraphics getMarkVectorGraphics(MarkType markType, MarkDTO markDTO) {
|
||||
final MarkVectorGraphics result;
|
||||
switch (markType) {
|
||||
case BUOY:
|
||||
result = new BuoyMarkVectorGraphics(markDTO.type, markDTO.color, markDTO.shape, markDTO.pattern);
|
||||
break;
|
||||
case STARTBOAT:
|
||||
case FINISHBOAT:
|
||||
result = new BoatMarkVectorGraphics(markDTO.type, markDTO.color, markDTO.shape, markDTO.pattern);
|
||||
break;
|
||||
case LANDMARK:
|
||||
result = new LandMarkVectorGraphics(markDTO.type, markDTO.color, markDTO.shape, markDTO.pattern);
|
||||
break;
|
||||
default:
|
||||
result = new BuoyMarkVectorGraphics(markDTO.type, markDTO.color, markDTO.shape, markDTO.pattern);
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user