# Conflicts:
#	src/main/java/seng302/Controllers/RaceController.java
main
cbt24 9 years ago
commit 85f4117666

@ -1,26 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="CompilerConfiguration"> <component name="CompilerConfiguration">
<resourceExtensions />
<wildcardResourcePatterns>
<entry name="!?*.java" />
<entry name="!?*.form" />
<entry name="!?*.class" />
<entry name="!?*.groovy" />
<entry name="!?*.scala" />
<entry name="!?*.flex" />
<entry name="!?*.kt" />
<entry name="!?*.clj" />
<entry name="!?*.aj" />
</wildcardResourcePatterns>
<annotationProcessing> <annotationProcessing>
<profile default="true" name="Default" enabled="false"> <profile name="Maven default annotation processors profile" enabled="true">
<processorPath useClasspath="true" />
</profile>
<profile default="false" name="Maven default annotation processors profile" enabled="true">
<sourceOutputDir name="target/generated-sources/annotations" /> <sourceOutputDir name="target/generated-sources/annotations" />
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" /> <sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
<outputRelativeToContentRoot value="true" /> <outputRelativeToContentRoot value="true" />
<module name="app" />
<module name="team-7" /> <module name="team-7" />
</profile> </profile>
</annotationProcessing> </annotationProcessing>

@ -25,7 +25,7 @@
</list> </list>
</option> </option>
</component> </component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK"> <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8 (1)" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" /> <output url="file://$PROJECT_DIR$/out" />
</component> </component>
<component name="SvnConfiguration"> <component name="SvnConfiguration">

@ -2,6 +2,7 @@
<project version="4"> <project version="4">
<component name="ProjectModuleManager"> <component name="ProjectModuleManager">
<modules> <modules>
<module fileurl="file://$PROJECT_DIR$/app.iml" filepath="$PROJECT_DIR$/app.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/team-7.iml" filepath="$PROJECT_DIR$/.idea/team-7.iml" /> <module fileurl="file://$PROJECT_DIR$/.idea/team-7.iml" filepath="$PROJECT_DIR$/.idea/team-7.iml" />
</modules> </modules>
</component> </component>

@ -1,5 +1,6 @@
package seng302.Controllers; package seng302.Controllers;
import javafx.beans.property.ReadOnlyObjectWrapper; import javafx.beans.property.ReadOnlyObjectWrapper;
import javafx.beans.value.ObservableValue; import javafx.beans.value.ObservableValue;
import javafx.collections.FXCollections; import javafx.collections.FXCollections;
@ -14,6 +15,7 @@ import javafx.scene.paint.Color;
import javafx.scene.paint.Paint; import javafx.scene.paint.Paint;
import javafx.util.Callback; import javafx.util.Callback;
import seng302.GPSCoordinate; import seng302.GPSCoordinate;
import javafx.scene.transform.Rotate;
import seng302.GraphCoordinate; import seng302.GraphCoordinate;
import seng302.Model.*; import seng302.Model.*;
import seng302.RaceMap; import seng302.RaceMap;
@ -63,6 +65,20 @@ public class RaceController extends Controller{
gc.fillOval(graphCoordinate.getX(), graphCoordinate.getY(), 10, 10); gc.fillOval(graphCoordinate.getX(), graphCoordinate.getY(), 10, 10);
} }
public void displayArrow(GraphCoordinate coordinate, int angle){
rotate(angle, coordinate.getX(),coordinate.getY());
gc.fillPolygon(new double[]{coordinate.getX()-12, coordinate.getX()-6, coordinate.getX(), coordinate.getX()-4, coordinate.getX()-4, coordinate.getX()-8, coordinate.getX()-8},
new double[]{coordinate.getY()-5, coordinate.getY()-20, coordinate.getY()-5, coordinate.getY()-5, coordinate.getY()+20, coordinate.getY()+20, coordinate.getY()-5},
7);
gc.restore();
}
private void rotate(double angle, double px, double py) {
Rotate r = new Rotate(angle, px, py);
gc.setTransform(r.getMxx(), r.getMyx(), r.getMxy(), r.getMyy(), r.getTx(), r.getTy());
}
public void updateInfoTable(Race race) { public void updateInfoTable(Race race) {
boatInfoTable.setItems(FXCollections.observableArrayList(race.getFinishingBoats())); boatInfoTable.setItems(FXCollections.observableArrayList(race.getFinishingBoats()));
@ -90,6 +106,8 @@ public class RaceController extends Controller{
(new Thread(race)).start(); (new Thread(race)).start();
this.gc = raceMap.getGraphicsContext2D();
this.map = new RaceMap(32.321989, -64.8553, 32.246, -64.831, (int)raceMap.getWidth(), (int)raceMap.getHeight()); this.map = new RaceMap(32.321989, -64.8553, 32.246, -64.831, (int)raceMap.getWidth(), (int)raceMap.getHeight());
this.gc = raceMap.getGraphicsContext2D(); this.gc = raceMap.getGraphicsContext2D();
@ -116,6 +134,13 @@ public class RaceController extends Controller{
GraphCoordinate startline2 = this.map.convertGPS(32.293771, -64.855242); GraphCoordinate startline2 = this.map.convertGPS(32.293771, -64.855242);
displayLine(startline1, startline2, Color.GREEN); displayLine(startline1, startline2, Color.GREEN);
//display wind direction arrow - specify origin point and angle
displayPoint(this.map.convertGPS(32.293771, -64.855242), Color.BLACK); displayPoint(this.map.convertGPS(32.293771, -64.855242), Color.BLACK);
displayArrow(new GraphCoordinate(500, 20), 100);
} }
} }

@ -11,7 +11,7 @@
<items> <items>
<AnchorPane fx:id="canvasBase" minHeight="0.0" minWidth="0.0"> <AnchorPane fx:id="canvasBase" minHeight="0.0" minWidth="0.0">
<children> <children>
<Canvas fx:id="raceMap" height="600.0" width="600.0" /> <Canvas fx:id="raceMap" height="600.0" width="600.0" AnchorPane.bottomAnchor="-202.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="-155.0" AnchorPane.topAnchor="0.0" />
</children> </children>
</AnchorPane> </AnchorPane>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="160.0" prefWidth="100.0"> <AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="160.0" prefWidth="100.0">

Loading…
Cancel
Save