diff --git a/classes/production/voting-booth-gui/main/ChainBuilder.class b/classes/production/voting-booth-gui/main/ChainBuilder.class new file mode 100644 index 0000000..a938de0 Binary files /dev/null and b/classes/production/voting-booth-gui/main/ChainBuilder.class differ diff --git a/classes/production/voting-booth-gui/main/Main.class b/classes/production/voting-booth-gui/main/Main.class new file mode 100644 index 0000000..f7205a7 Binary files /dev/null and b/classes/production/voting-booth-gui/main/Main.class differ diff --git a/classes/production/voting-booth-gui/main/TwoWayNode.class b/classes/production/voting-booth-gui/main/TwoWayNode.class new file mode 100644 index 0000000..c1cc023 Binary files /dev/null and b/classes/production/voting-booth-gui/main/TwoWayNode.class differ diff --git a/classes/production/voting-booth-gui/main/welcome_splash/Main.class b/classes/production/voting-booth-gui/main/welcome_splash/Main.class deleted file mode 100644 index f782c79..0000000 Binary files a/classes/production/voting-booth-gui/main/welcome_splash/Main.class and /dev/null differ diff --git a/classes/production/voting-booth-gui/main/welcome_splash/WelcomeSplashController.class b/classes/production/voting-booth-gui/main/welcome_splash/WelcomeSplashController.class new file mode 100644 index 0000000..361d833 Binary files /dev/null and b/classes/production/voting-booth-gui/main/welcome_splash/WelcomeSplashController.class differ diff --git a/classes/production/voting-booth-gui/main/welcome_splash/WelcomeSplashLoader.class b/classes/production/voting-booth-gui/main/welcome_splash/WelcomeSplashLoader.class index ae33b2f..52a9f57 100644 Binary files a/classes/production/voting-booth-gui/main/welcome_splash/WelcomeSplashLoader.class and b/classes/production/voting-booth-gui/main/welcome_splash/WelcomeSplashLoader.class differ diff --git a/classes/production/voting-booth-gui/main/welcome_splash/welcome_splash_screen.fxml b/classes/production/voting-booth-gui/main/welcome_splash/welcome_splash_screen.fxml index 8490224..33e001c 100644 --- a/classes/production/voting-booth-gui/main/welcome_splash/welcome_splash_screen.fxml +++ b/classes/production/voting-booth-gui/main/welcome_splash/welcome_splash_screen.fxml @@ -5,7 +5,7 @@ - + diff --git a/voting-booth-gui/src/main/ChainBuilder.java b/voting-booth-gui/src/main/ChainBuilder.java index c45e021..ba4dfef 100644 --- a/voting-booth-gui/src/main/ChainBuilder.java +++ b/voting-booth-gui/src/main/ChainBuilder.java @@ -1,5 +1,6 @@ package main; +import javafx.scene.Scene; import javafx.stage.Stage; import main.welcome_splash.WelcomeSplashLoader; @@ -19,7 +20,10 @@ public class ChainBuilder { WelcomeSplashLoader welcomeSplashLoader = new WelcomeSplashLoader(primaryStage); TwoWayNode welcomeSplashController = welcomeSplashLoader.GetWelcomeSplash(); - + /** + * all other two way nodes initilaized + */ + primaryStage.setScene(new Scene(welcomeSplashController.GetNode())); } } diff --git a/voting-booth-gui/src/main/Main.java b/voting-booth-gui/src/main/Main.java index 35672a0..93d7dd8 100644 --- a/voting-booth-gui/src/main/Main.java +++ b/voting-booth-gui/src/main/Main.java @@ -2,16 +2,17 @@ package main; import javafx.application.Application; import javafx.stage.Stage; -import main.welcome_splash.WelcomeSplashLoader; /** * Created by Vladimir Eliezer Tokarev on 8/27/2016. + * Main calls to ChainBuilder which initilizes all the TwoWayNode's */ public class Main extends Application { @Override - public void start(Stage primaryStage) throws Exception{ - new WelcomeSplashLoader(primaryStage); + public void start(Stage primaryStage) throws Exception + { + ChainBuilder.Build(primaryStage); primaryStage.setTitle("Meerkat Polling Station"); primaryStage.show(); } diff --git a/voting-booth-gui/src/main/TwoWayNode.java b/voting-booth-gui/src/main/TwoWayNode.java index e20e326..87c2b14 100644 --- a/voting-booth-gui/src/main/TwoWayNode.java +++ b/voting-booth-gui/src/main/TwoWayNode.java @@ -7,35 +7,50 @@ import javafx.stage.Stage; * Created by Vladimir Eliezer Tokarev on 8/27/2016. * Two Way node gives the ability to set next and previous objects */ -public interface TwoWayNode { +public abstract class TwoWayNode { - /** - * GetNode return the paren node that represents current object - * @return Paren object - */ - Parent GetNode(); + protected Parent next; + protected Parent previous; + protected Stage currentStage; + protected Parent currentNode; /** * Sets which next TwoWayNode * @param nextObject */ - void SetNext(TwoWayNode nextObject); + public void SetNext(TwoWayNode nextObject) { + this.next = nextObject.GetNode(); + } /** * Sets which previous TwoWayNode * @param previousObject */ - void SetPrevious(TwoWayNode previousObject); + public void SetPrevious(TwoWayNode previousObject) { + this.previous = previousObject.GetNode(); + } /** * Sets the stage of current object * @param primaryStage */ - void SetStage(Stage primaryStage); + public void SetStage(Stage primaryStage) { + this.currentStage = primaryStage; + } /** * Sets the current parent node * @param parent */ - void SetParent(Parent parent); + public void SetParent(Parent parent) { + this.currentNode = parent; + } + + /** + * GetNode return the paren node that represents current object + * @return Paren object + */ + public Parent GetNode() { + return this.currentNode; + } } diff --git a/voting-booth-gui/src/main/straight_channel_section/StraightChannelSectionController.java b/voting-booth-gui/src/main/straight_channel_section/StraightChannelSectionController.java new file mode 100644 index 0000000..7a56b36 --- /dev/null +++ b/voting-booth-gui/src/main/straight_channel_section/StraightChannelSectionController.java @@ -0,0 +1,13 @@ +package main.straight_channel_section; + +import javafx.scene.Parent; +import javafx.stage.Stage; +import main.TwoWayNode; + +/** + * Created by Vladimir Eliezer Tokarev on 8/27/2016. + * StraightChannelSectionController handle the behavior of welcome splash class + */ +public class StraightChannelSectionController extends TwoWayNode { + +} diff --git a/voting-booth-gui/src/main/straight_channel_section/StraightChannelSectionLoader.java b/voting-booth-gui/src/main/straight_channel_section/StraightChannelSectionLoader.java new file mode 100644 index 0000000..22ae227 --- /dev/null +++ b/voting-booth-gui/src/main/straight_channel_section/StraightChannelSectionLoader.java @@ -0,0 +1,45 @@ +package main.straight_channel_section; + +import javafx.fxml.FXMLLoader; +import javafx.scene.Parent; +import javafx.stage.Stage; +import main.TwoWayNode; +import main.welcome_splash.WelcomeSplashController; + +import java.io.IOException; + +/** + * Created by Vladimir Eliezer Tokarev on 8/27/2016. + * StraightChannelSectionLoader creates starlight channel section object and sets its controller + */ +public class StraightChannelSectionLoader { + private static final String STRAIGHT_CHANNEL_LOADER_FXML_PATH = "straight_channel_section.fxml"; + + private Stage currentStage; + private FXMLLoader fxmlLoader; + + public StraightChannelSectionLoader(Stage primaryStage) throws IOException + { + // Parent splashScreenOnBootRoot = FXMLLoader.load(getClass().getResource(SPLASH_SCREEN_ON_BOOT_FXML_PATH)); + fxmlLoader = new FXMLLoader(getClass().getResource(STRAIGHT_CHANNEL_LOADER_FXML_PATH)); + currentStage = primaryStage; + // currentStage.setScene(new Scene(splashScreenOnBootRoot)); + } + + /** + * Creates welcome splash parent node and sets it to the controller + * @return TwoWayNode + * @throws IOException + */ + public TwoWayNode GetStraightChannelSection() throws IOException { + Parent straightChannelSection = fxmlLoader.load(); + StraightChannelSectionController controller = fxmlLoader.getController(); + + // set the controller to be functional TwoWayNode + controller.SetParent(welcomeSplash); + controller.SetStage(currentStage); + + return controller; + } + +} diff --git a/voting-booth-gui/src/main/welcome_splash/WelcomeSplashController.java b/voting-booth-gui/src/main/welcome_splash/WelcomeSplashController.java index 999a510..51f8c14 100644 --- a/voting-booth-gui/src/main/welcome_splash/WelcomeSplashController.java +++ b/voting-booth-gui/src/main/welcome_splash/WelcomeSplashController.java @@ -8,38 +8,5 @@ import main.TwoWayNode; * Created by Vladimir Eliezer Tokarev on 8/27/2016. * WelcomeSplashController handle the behavior of welcome splash class */ -public class WelcomeSplashController implements TwoWayNode { - - private Parent next; - private Parent previous; - private Stage currentSrage; - private Parent currentNode; - - - @Override - public void SetNext(TwoWayNode nextObject) { - this.next = nextObject.GetNode(); - } - - @Override - public void SetPrevious(TwoWayNode previousObject) { - this.previous = previousObject.GetNode(); - } - - @Override - public void SetStage(Stage primaryStage) { - this.currentSrage = primaryStage; - } - - @Override - public void SetParent(Parent parent) { - this.currentNode = parent; - } - - @Override - public Parent GetNode() { - return this.currentNode; - } - - +public class WelcomeSplashController extends TwoWayNode { } diff --git a/voting-booth-gui/src/main/welcome_splash/WelcomeSplashLoader.java b/voting-booth-gui/src/main/welcome_splash/WelcomeSplashLoader.java index 085a8cb..ed8ba64 100644 --- a/voting-booth-gui/src/main/welcome_splash/WelcomeSplashLoader.java +++ b/voting-booth-gui/src/main/welcome_splash/WelcomeSplashLoader.java @@ -14,7 +14,7 @@ import java.io.IOException; * WelcomeSplashLoader creates welcome spalash object and sets its controller */ public class WelcomeSplashLoader { - private static final String SPLASH_SCREEN_ON_BOOT_FXML_PATH = "welcome_splash_screen.fxml"; + private static final String WELCOME_SPLASH_FXML_PATH = "welcome_splash_screen.fxml"; private Stage currentStage; private FXMLLoader fxmlLoader; @@ -22,7 +22,7 @@ public class WelcomeSplashLoader { public WelcomeSplashLoader(Stage primaryStage) throws IOException { // Parent splashScreenOnBootRoot = FXMLLoader.load(getClass().getResource(SPLASH_SCREEN_ON_BOOT_FXML_PATH)); - fxmlLoader = new FXMLLoader(getClass().getResource(SPLASH_SCREEN_ON_BOOT_FXML_PATH)); + fxmlLoader = new FXMLLoader(getClass().getResource(WELCOME_SPLASH_FXML_PATH)); currentStage = primaryStage; // currentStage.setScene(new Scene(splashScreenOnBootRoot)); }