Removed breaking dependency and made it so app doesn't need the breaking dependency any more.
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
package seng302.Controllers;
|
||||
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.layout.Pane;
|
||||
|
||||
import java.net.URL;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
/**
|
||||
* Created by Joseph on 22/05/2017.
|
||||
*/
|
||||
public class ArrowController extends Controller {
|
||||
|
||||
@Override
|
||||
public void initialize(URL location, ResourceBundle resources) {
|
||||
}
|
||||
}
|
||||
@@ -33,7 +33,7 @@ public class RaceController extends Controller {
|
||||
|
||||
private ResizableRaceCanvas raceMap;
|
||||
private ResizableRaceMap raceBoundaries;
|
||||
private Gauge arrow;
|
||||
@FXML Pane arrow;
|
||||
@FXML SplitPane race;
|
||||
@FXML StackPane arrowPane;
|
||||
@FXML CheckBox showFPS;
|
||||
@@ -116,7 +116,7 @@ public class RaceController extends Controller {
|
||||
//raceMap.setBoats(newRace.getStartingBoats());
|
||||
raceMap.draw();
|
||||
raceMap.setVisible(true);
|
||||
raceMap.setArrow(this.arrow);
|
||||
raceMap.setArrow(arrow.getChildren().get(0));
|
||||
|
||||
canvasBase.getChildren().add(0, raceMap);
|
||||
|
||||
@@ -230,42 +230,43 @@ public class RaceController extends Controller {
|
||||
}
|
||||
|
||||
private void makeArrow() {
|
||||
arrow = GaugeBuilder.create()
|
||||
.minValue(0)
|
||||
.maxValue(359)
|
||||
.startAngle(180)
|
||||
.angleRange(360)
|
||||
.autoScale(false)
|
||||
.customTickLabelsEnabled(true)
|
||||
.customTickLabels("N", "", "", "", "", "", "", "", "",
|
||||
"E", "", "", "", "", "", "", "", "",
|
||||
"S", "", "", "", "", "", "", "", "",
|
||||
"W", "", "", "", "", "", "", "", "")
|
||||
.customTickLabelFontSize(72)
|
||||
.needleBehavior(Gauge.NeedleBehavior.OPTIMIZED)
|
||||
.borderPaint(Color.web("#1f1e23"))
|
||||
.backgroundPaint(Color.web("#1f1e23"))
|
||||
.needleColor(Color.web("#dad9db"))
|
||||
.tickMarkColor(Color.web("#9f9fa1"))
|
||||
.tickLabelColor(Color.web("#dad9db"))
|
||||
.valueColor(Color.web("#dad9db"))
|
||||
.title("Wind direction")
|
||||
.titleColor(Color.web("#dad9db"))
|
||||
.knobType(Gauge.KnobType.FLAT)
|
||||
.knobColor(Gauge.BRIGHT_COLOR)
|
||||
.prefSize(125, 125)
|
||||
.maxWidth(125)
|
||||
.maxHeight(125)
|
||||
.build();
|
||||
|
||||
Label value = new Label("0°");
|
||||
value.setFont(Fonts.latoBold(72));
|
||||
value.setAlignment(Pos.CENTER);
|
||||
|
||||
arrow.valueProperty().addListener(o -> {
|
||||
value.setText(String.format("%f°", arrow.getValue()));
|
||||
});
|
||||
arrow.setValue(0);
|
||||
arrowPane.getChildren().add(arrow);
|
||||
// arrow = GaugeBuilder.create()
|
||||
// .minValue(0)
|
||||
// .maxValue(359)
|
||||
// .startAngle(180)
|
||||
// .angleRange(360)
|
||||
// .autoScale(false)
|
||||
// .customTickLabelsEnabled(true)
|
||||
// .customTickLabels("N", "", "", "", "", "", "", "", "",
|
||||
// "E", "", "", "", "", "", "", "", "",
|
||||
// "S", "", "", "", "", "", "", "", "",
|
||||
// "W", "", "", "", "", "", "", "", "")
|
||||
// .customTickLabelFontSize(72)
|
||||
// .needleBehavior(Gauge.NeedleBehavior.OPTIMIZED)
|
||||
// .borderPaint(Color.web("#1f1e23"))
|
||||
// .backgroundPaint(Color.web("#1f1e23"))
|
||||
// .needleColor(Color.web("#dad9db"))
|
||||
// .tickMarkColor(Color.web("#9f9fa1"))
|
||||
// .tickLabelColor(Color.web("#dad9db"))
|
||||
// .valueColor(Color.web("#dad9db"))
|
||||
// .title("Wind direction")
|
||||
// .titleColor(Color.web("#dad9db"))
|
||||
// .knobType(Gauge.KnobType.FLAT)
|
||||
// .knobColor(Gauge.BRIGHT_COLOR)
|
||||
// .prefSize(125, 125)
|
||||
// .maxWidth(125)
|
||||
// .maxHeight(125)
|
||||
// .build();
|
||||
//
|
||||
// Label value = new Label("0°");
|
||||
// value.setFont(Fonts.latoBold(72));
|
||||
// value.setAlignment(Pos.CENTER);
|
||||
//
|
||||
// arrow.valueProperty().addListener(o -> {
|
||||
// value.setText(String.format("%f°", arrow.getValue()));
|
||||
// });
|
||||
// arrow.setValue(0);
|
||||
// arrowPane.getChildren().add(arrow);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package seng302.Model;
|
||||
|
||||
import eu.hansolo.medusa.Gauge;
|
||||
import eu.hansolo.medusa.GaugeBuilder;
|
||||
import javafx.scene.Node;
|
||||
import javafx.scene.layout.Pane;
|
||||
import javafx.collections.ObservableList;
|
||||
import javafx.scene.paint.Color;
|
||||
@@ -34,7 +35,7 @@ public class ResizableRaceCanvas extends ResizableCanvas {
|
||||
private List<Color> colours;
|
||||
private final List<Marker> markers;
|
||||
private final RaceDataSource raceData;
|
||||
private Gauge arrow;
|
||||
private Node arrow;
|
||||
|
||||
public ResizableRaceCanvas(RaceDataSource raceData) {
|
||||
super();
|
||||
@@ -146,8 +147,8 @@ public class ResizableRaceCanvas extends ResizableCanvas {
|
||||
|
||||
private void displayFancyArrow(GraphCoordinate coordinate, double angle) {
|
||||
angle = angle % 360;
|
||||
if (arrow != null && arrow.getValue() != angle) {
|
||||
this.arrow.setValue(angle);
|
||||
if (arrow != null && arrow.getRotate() != angle) {
|
||||
arrow.setRotate(angle);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -341,7 +342,7 @@ public class ResizableRaceCanvas extends ResizableCanvas {
|
||||
));
|
||||
}
|
||||
|
||||
public void setArrow(Gauge arrow) {
|
||||
public void setArrow(Node arrow) {
|
||||
this.arrow = arrow;
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
@@ -19,6 +19,7 @@
|
||||
</rowConstraints>
|
||||
<children>
|
||||
<Pane prefHeight="200.0" prefWidth="400.0" GridPane.halignment="LEFT" GridPane.valignment="TOP">
|
||||
<fx:include fx:id="arrow" source="arrow.fxml" />
|
||||
<children>
|
||||
<Accordion>
|
||||
<panes>
|
||||
|
||||
Reference in New Issue
Block a user