mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 06:18:44 +00:00
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:
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user