Implemented a factory class that creates mark arrows as needed. Needs to integrated with the real world data and tested to work. Works with all test data so far.

#implement #story[1118]
This commit is contained in:
cir27
2017-08-14 03:44:46 +12:00
parent 126d8ea870
commit a185c9dc96
3 changed files with 105 additions and 44 deletions
@@ -2,6 +2,7 @@ package seng302.visualiser.fxObjects;
import javafx.application.Platform;
import javafx.scene.Group;
import javafx.scene.paint.Color;
import javafx.scene.paint.Paint;
import javafx.scene.shape.Circle;
@@ -11,18 +12,30 @@ import javafx.scene.shape.Circle;
public class Marker extends Group {
Circle mark = new Circle();
Paint colour = Color.BLACK;
Group enterArrow;
Group exitArrow;
public Marker() {
mark.setRadius(5);
mark.setCenterX(0);
mark.setCenterY(0);
Platform.runLater(() -> this.getChildren().add(mark));
}
public Marker(Paint colour) {
this();
this.colour = colour;
mark.setFill(colour);
}
public void constructArrows(MarkArrowFactory.RoundingSide roundingSide, double entryAngle, double exitAngle) {
enterArrow = MarkArrowFactory.constructEntryArrow(roundingSide, entryAngle, exitAngle, colour);
exitArrow = MarkArrowFactory.constructExitArrow(roundingSide, exitAngle, colour);
Platform.runLater(() -> this.getChildren().add(enterArrow));
// Platform.runLater(() -> this.getChildren().add(exitArrow));
}
public void showEnterArrow () {
Platform.runLater(() -> this.getChildren().setAll(enterArrow));
}