mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 06:18:44 +00:00
Laylines now working upon selecting a boat. Still need to make their visibility togglable
Currently just paints upon clicking tags: #story[956]
This commit is contained in:
@@ -282,7 +282,6 @@ public class RaceViewController extends Thread implements ImportantAnnotationDel
|
|||||||
updateWindDirection();
|
updateWindDirection();
|
||||||
updateOrder();
|
updateOrder();
|
||||||
updateBoatSelectionComboBox();
|
updateBoatSelectionComboBox();
|
||||||
updateLaylines();
|
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -410,9 +409,8 @@ public class RaceViewController extends Thread implements ImportantAnnotationDel
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void updateLaylines() {
|
private void updateLaylines(BoatGroup bg) {
|
||||||
|
|
||||||
for (BoatGroup bg : includedCanvasController.getBoatGroups()) {
|
|
||||||
System.out.println("========" + bg.getBoat().getBoatName() + "=========");
|
System.out.println("========" + bg.getBoat().getBoatName() + "=========");
|
||||||
Mark nextMark = getNextMark(bg);
|
Mark nextMark = getNextMark(bg);
|
||||||
Boolean isUpwind = null;
|
Boolean isUpwind = null;
|
||||||
@@ -445,7 +443,7 @@ public class RaceViewController extends Thread implements ImportantAnnotationDel
|
|||||||
Double resultingAngle = angleAndSpeed.keySet().iterator().next();
|
Double resultingAngle = angleAndSpeed.keySet().iterator().next();
|
||||||
|
|
||||||
|
|
||||||
Point2D boatCurrentPos = new Point2D(bg.getLayoutX(), bg.getLayoutY());
|
Point2D boatCurrentPos = new Point2D(bg.getBoatLayoutX(), bg.getBoatLayoutY());
|
||||||
Point2D gateMidPoint = markPoint1.midpoint(markPoint2);
|
Point2D gateMidPoint = markPoint1.midpoint(markPoint2);
|
||||||
Integer lineFuncResult = GeometryUtils.lineFunction(boatCurrentPos, gateMidPoint, markPoint2);
|
Integer lineFuncResult = GeometryUtils.lineFunction(boatCurrentPos, gateMidPoint, markPoint2);
|
||||||
if (lineFuncResult == 1) {
|
if (lineFuncResult == 1) {
|
||||||
@@ -463,7 +461,6 @@ public class RaceViewController extends Thread implements ImportantAnnotationDel
|
|||||||
|
|
||||||
System.out.println();
|
System.out.println();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -628,6 +625,7 @@ public class RaceViewController extends Thread implements ImportantAnnotationDel
|
|||||||
if (bg.getBoat().getHullID().equals(yacht.getHullID())) {
|
if (bg.getBoat().getHullID().equals(yacht.getHullID())) {
|
||||||
bg.setIsSelected(true);
|
bg.setIsSelected(true);
|
||||||
selectedBoat = yacht;
|
selectedBoat = yacht;
|
||||||
|
updateLaylines(bg);
|
||||||
} else {
|
} else {
|
||||||
bg.setIsSelected(false);
|
bg.setIsSelected(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,6 +59,8 @@ public class BoatGroup extends Group {
|
|||||||
private Text estTimeToNextMarkObject;
|
private Text estTimeToNextMarkObject;
|
||||||
private Text legTimeObject;
|
private Text legTimeObject;
|
||||||
private Wake wake;
|
private Wake wake;
|
||||||
|
private Line leftLayLine;
|
||||||
|
private Line rightLayline;
|
||||||
private Double distanceTravelled = 0.0;
|
private Double distanceTravelled = 0.0;
|
||||||
private Point2D lastPoint;
|
private Point2D lastPoint;
|
||||||
private boolean destinationSet;
|
private boolean destinationSet;
|
||||||
@@ -158,10 +160,13 @@ public class BoatGroup extends Group {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
leftLayLine = new Line();
|
||||||
|
rightLayline = new Line();
|
||||||
|
|
||||||
wake = new Wake(0, -BOAT_HEIGHT);
|
wake = new Wake(0, -BOAT_HEIGHT);
|
||||||
super.getChildren()
|
super.getChildren()
|
||||||
.addAll(teamNameObject, velocityObject, boatPoly, estTimeToNextMarkObject,
|
.addAll(teamNameObject, velocityObject, boatPoly, estTimeToNextMarkObject,
|
||||||
legTimeObject);
|
legTimeObject, leftLayLine, rightLayline);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -414,6 +419,7 @@ public class BoatGroup extends Group {
|
|||||||
setWakeVisible(isSelected);
|
setWakeVisible(isSelected);
|
||||||
setEstTimeToNextMarkObjectVisible(isSelected);
|
setEstTimeToNextMarkObjectVisible(isSelected);
|
||||||
setLegTimeObjectVisible(isSelected);
|
setLegTimeObjectVisible(isSelected);
|
||||||
|
setLayLinesVisible(isSelected);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -441,6 +447,11 @@ public class BoatGroup extends Group {
|
|||||||
wake.setVisible(visible);
|
wake.setVisible(visible);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setLayLinesVisible(Boolean visible) {
|
||||||
|
leftLayLine.setVisible(visible);
|
||||||
|
rightLayline.setVisible(visible);
|
||||||
|
}
|
||||||
|
|
||||||
public Yacht getBoat() {
|
public Yacht getBoat() {
|
||||||
return boat;
|
return boat;
|
||||||
}
|
}
|
||||||
@@ -467,6 +478,16 @@ public class BoatGroup extends Group {
|
|||||||
return group;
|
return group;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public Double getBoatLayoutX() {
|
||||||
|
return boatPoly.getLayoutX();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public Double getBoatLayoutY() {
|
||||||
|
return boatPoly.getLayoutY();
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isStopped() {
|
public boolean isStopped() {
|
||||||
return isStopped;
|
return isStopped;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user