Initial commit for project
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.fxml.FXMLLoader;
|
||||
import javafx.fxml.Initializable;
|
||||
import javafx.scene.Parent;
|
||||
import javafx.scene.Scene;
|
||||
|
||||
import javafx.stage.Stage;
|
||||
|
||||
|
||||
/**
|
||||
* Created by samschofield on 7/03/17.
|
||||
*/
|
||||
public class Main extends Application {
|
||||
|
||||
public void start(Stage stage) throws Exception {
|
||||
|
||||
FXMLLoader loader = new FXMLLoader(getClass().getResource("scenes/main.fxml"));
|
||||
Parent root = loader.load();
|
||||
Scene scene = new Scene(root, 500, 400);
|
||||
stage.setTitle("UC RSS");
|
||||
stage.setScene(scene);
|
||||
stage.show();
|
||||
}
|
||||
|
||||
/**
|
||||
* Replace Scene Content with fxml file code from oracle.
|
||||
* @param fxml
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public Initializable replaceSceneContent(SceneCode fxml) throws Exception {
|
||||
FXMLLoader loader = new FXMLLoader();
|
||||
InputStream in = getClass().getClassLoader().getResourceAsStream(fxml.getFilePath());
|
||||
Parent page;
|
||||
try {
|
||||
page = (Parent) loader.load(in);
|
||||
} finally {
|
||||
in.close();
|
||||
}
|
||||
while(mainContainer.getChildren().size() > 1) {
|
||||
mainContainer.getChildren().remove(1);
|
||||
}
|
||||
mainContainer.getChildren().add(page);
|
||||
//change session code to fit with the serialisation
|
||||
session.setSceneDisplayed(fxml);
|
||||
return (Initializable) loader.getController();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package controllers;
|
||||
|
||||
import javafx.fxml.Initializable;
|
||||
|
||||
import java.net.URL;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
/**
|
||||
* Created by samschofield on 15/03/17.
|
||||
*/
|
||||
public class MainController implements Initializable {
|
||||
|
||||
@Override
|
||||
public void initialize(URL location, ResourceBundle resources) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package model;
|
||||
|
||||
/**
|
||||
* Created by fwy13 on 4/04/17.
|
||||
*/
|
||||
public enum SceneCode {
|
||||
MAIN()
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.scene.text.*?>
|
||||
<?import javafx.scene.control.*?>
|
||||
<?import javafx.scene.layout.*?>
|
||||
|
||||
<GridPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="controllers.MainController">
|
||||
<columnConstraints>
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="332.0" minWidth="10.0" prefWidth="218.0" />
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="307.0" minWidth="10.0" prefWidth="304.0" />
|
||||
</columnConstraints>
|
||||
<rowConstraints>
|
||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
</rowConstraints>
|
||||
<children>
|
||||
<Label text="Welcome to the UC Ride Sharing System" GridPane.columnSpan="2" GridPane.halignment="CENTER">
|
||||
<font>
|
||||
<Font size="22.0" />
|
||||
</font>
|
||||
</Label>
|
||||
</children>
|
||||
</GridPane>
|
||||
@@ -0,0 +1,12 @@
|
||||
|
||||
import cucumber.api.CucumberOptions;
|
||||
import cucumber.api.junit.Cucumber;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
/**
|
||||
* Created by samschofield on 4/03/17.
|
||||
*/
|
||||
@RunWith(Cucumber.class)
|
||||
@CucumberOptions(features = "src/test/java/features")
|
||||
public class RunCucumberTests {
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package steps;
|
||||
|
||||
import cucumber.api.PendingException;
|
||||
import cucumber.api.java.en.Given;
|
||||
import cucumber.api.java.en.Then;
|
||||
import cucumber.api.java.en.When;
|
||||
|
||||
|
||||
/**
|
||||
* Created by sam on 11/03/17.
|
||||
*/
|
||||
public class PlaceholderSteps {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user