|
| 1 | +package org.snobot.coordinate_gui.game.infinite_recharge_at_home; |
| 2 | + |
| 3 | +import javafx.application.Application; |
| 4 | +import javafx.fxml.FXMLLoader; |
| 5 | +import javafx.scene.Scene; |
| 6 | +import javafx.scene.layout.Pane; |
| 7 | +import javafx.stage.Stage; |
| 8 | +import org.snobot.coordinate_gui.model.Coordinate; |
| 9 | +import org.snobot.coordinate_gui.model.Distance; |
| 10 | +import org.snobot.coordinate_gui.model.Position2dDistance; |
| 11 | +import org.snobot.coordinate_gui.ui.layers.BaseGuiController; |
| 12 | + |
| 13 | +import java.io.IOException; |
| 14 | + |
| 15 | +public final class StandaloneMain |
| 16 | +{ |
| 17 | + public static class PseudoMain extends Application |
| 18 | + { |
| 19 | + |
| 20 | + @Override |
| 21 | + public void start(Stage aPrimaryStage) throws IOException |
| 22 | + { |
| 23 | +// FXMLLoader loader = new FXMLLoader(getClass().getResource("barrel_roll_field.fxml")); |
| 24 | +// FXMLLoader loader = new FXMLLoader(getClass().getResource("bounce_field.fxml")); |
| 25 | +// FXMLLoader loader = new FXMLLoader(getClass().getResource("galactic_search_a.fxml")); |
| 26 | +// FXMLLoader loader = new FXMLLoader(getClass().getResource("galactic_search_b.fxml")); |
| 27 | +// FXMLLoader loader = new FXMLLoader(getClass().getResource("infinite_recharge_field.fxml")); |
| 28 | + FXMLLoader loader = new FXMLLoader(getClass().getResource("slalom_field.fxml")); |
| 29 | + |
| 30 | + Pane root = loader.load(); |
| 31 | + BaseGuiController robotController = loader.getController(); |
| 32 | + |
| 33 | + Scene scene = new Scene(root); |
| 34 | + aPrimaryStage.setScene(scene); |
| 35 | + |
| 36 | + aPrimaryStage.show(); |
| 37 | + |
| 38 | + |
| 39 | + robotController.addRobotPosition(new Coordinate(new Position2dDistance(Distance.fromFeet(0), Distance.fromFeet(0)), 0)); |
| 40 | + robotController.addRobotPosition(new Coordinate(new Position2dDistance(Distance.fromFeet(30), Distance.fromFeet(0)), 0)); |
| 41 | + robotController.addRobotPosition(new Coordinate(new Position2dDistance(Distance.fromFeet(30), Distance.fromFeet(15)), 0)); |
| 42 | + robotController.addRobotPosition(new Coordinate(new Position2dDistance(Distance.fromFeet(0), Distance.fromFeet(15)), 0)); |
| 43 | + |
| 44 | +// robotController.addRobotPosition(new Coordinate(new Position2dDistance(Distance.fromFeet(0), Distance.fromFeet(0)), 0)); |
| 45 | +// robotController.addRobotPosition(new Coordinate(new Position2dDistance(Distance.fromFeet(27), Distance.fromFeet(0)), 0)); |
| 46 | +// robotController.addRobotPosition(new Coordinate(new Position2dDistance(Distance.fromFeet(52), Distance.fromFeet(0)), 0)); |
| 47 | +// robotController.addRobotPosition(new Coordinate(new Position2dDistance(Distance.fromFeet(52), Distance.fromFeet(13.5)), 0)); |
| 48 | +// robotController.addRobotPosition(new Coordinate(new Position2dDistance(Distance.fromFeet(52), Distance.fromFeet(26)), 0)); |
| 49 | +// robotController.addRobotPosition(new Coordinate(new Position2dDistance(Distance.fromFeet(0), Distance.fromFeet(26)), 0)); |
| 50 | + } |
| 51 | + } |
| 52 | + |
| 53 | + private StandaloneMain() |
| 54 | + { |
| 55 | + |
| 56 | + } |
| 57 | + |
| 58 | + @SuppressWarnings("JavadocMethod") |
| 59 | + public static void main(String[] aArgs) |
| 60 | + { |
| 61 | + // JavaFX 11+ uses GTK3 by default, and has problems on some display |
| 62 | + // servers |
| 63 | + // This flag forces JavaFX to use GTK2 |
| 64 | + // System.setProperty("jdk.gtk.version", "2"); |
| 65 | + Application.launch(PseudoMain.class, aArgs); |
| 66 | + } |
| 67 | +} |
0 commit comments