summaryrefslogtreecommitdiffstats
path: root/src/de/fhswf/in/inf/java2/aufgabe05/MainApplication.java
diff options
context:
space:
mode:
authorStefan Suhren <suhren.stefan@fh-swf.de>2015-05-04 22:11:28 +0200
committerStefan Suhren <suhren.stefan@fh-swf.de>2015-05-04 22:11:28 +0200
commit3b5728de6f2d8d2852fbb86fa8cac21e6dccc19b (patch)
tree54965319a9aafeb294dac8e36e4ce1371ec76ef3 /src/de/fhswf/in/inf/java2/aufgabe05/MainApplication.java
parentaf7b9bd6a962b9a290fc5d78c08c83653961811f (diff)
downloadJava2-3b5728de6f2d8d2852fbb86fa8cac21e6dccc19b.tar.gz
Java2-3b5728de6f2d8d2852fbb86fa8cac21e6dccc19b.zip
Build a file browser looking like Finder
Diffstat (limited to 'src/de/fhswf/in/inf/java2/aufgabe05/MainApplication.java')
-rw-r--r--src/de/fhswf/in/inf/java2/aufgabe05/MainApplication.java82
1 files changed, 82 insertions, 0 deletions
diff --git a/src/de/fhswf/in/inf/java2/aufgabe05/MainApplication.java b/src/de/fhswf/in/inf/java2/aufgabe05/MainApplication.java
new file mode 100644
index 0000000..7978cb1
--- /dev/null
+++ b/src/de/fhswf/in/inf/java2/aufgabe05/MainApplication.java
@@ -0,0 +1,82 @@
+package de.fhswf.in.inf.java2.aufgabe05;
+
+import java.io.IOException;
+
+import javafx.application.Application;
+import javafx.fxml.FXMLLoader;
+import javafx.scene.Scene;
+import javafx.scene.control.SplitPane;
+import javafx.scene.layout.AnchorPane;
+import javafx.scene.layout.BorderPane;
+import javafx.stage.Stage;
+
+public class MainApplication extends Application
+{
+
+ private Stage primaryStage;
+ private BorderPane rootLayout;
+
+ @Override
+ public void start(Stage primaryStage)
+ {
+ this.primaryStage = primaryStage;
+ this.primaryStage.setTitle("ThemeChooser");
+
+ initRootLayout();
+
+ showDirectoryOverview();
+ }
+
+ private void initRootLayout()
+ {
+ try
+ {
+ // Load root layout from fxml file.
+ FXMLLoader loader = new FXMLLoader();
+ loader.setLocation(MainApplication.class.getResource("view/RootLayout.fxml"));
+ rootLayout = (BorderPane) loader.load();
+
+ // Show the scene containing the root layout.
+ Scene scene = new Scene(rootLayout);
+ primaryStage.setScene(scene);
+
+ // Give the controller access to the main app.
+ // RootLayoutController controller = loader.getController();
+ // controller.setMainApp(this);
+
+ primaryStage.show();
+ }
+ catch (IOException e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ private void showDirectoryOverview()
+ {
+ try
+ {
+ // Load person overview.
+ FXMLLoader loader = new FXMLLoader();
+ loader.setLocation(MainApplication.class
+ .getResource("view/DirectoryOverview.fxml"));
+ AnchorPane personOverview = (AnchorPane) loader.load();
+
+ // Set person overview into the center of root layout.
+ rootLayout.setCenter(personOverview);
+
+ // Give the controller access to the main app.
+ // DirectoryOverviewController controller = loader.getController();
+ // controller.setMainApp(this);
+ }
+ catch (IOException e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ public static void main(String[] args)
+ {
+ launch(args);
+ }
+}