diff --git a/src/com/olexyn/ensync/ui/Controller.java b/src/com/olexyn/ensync/Controller.java similarity index 99% rename from src/com/olexyn/ensync/ui/Controller.java rename to src/com/olexyn/ensync/Controller.java index 404e8f1..507055f 100644 --- a/src/com/olexyn/ensync/ui/Controller.java +++ b/src/com/olexyn/ensync/Controller.java @@ -1,4 +1,4 @@ -package com.olexyn.ensync.ui; +package com.olexyn.ensync; import javafx.concurrent.Task; diff --git a/src/com/olexyn/ensync/Main.java b/src/com/olexyn/ensync/Main.java index a6f00b1..b9f5a44 100644 --- a/src/com/olexyn/ensync/Main.java +++ b/src/com/olexyn/ensync/Main.java @@ -1,16 +1,34 @@ package com.olexyn.ensync; +import javafx.application.Application; +import javafx.fxml.FXMLLoader; +import javafx.scene.Parent; +import javafx.scene.Scene; +import javafx.stage.Stage; -public class Main { +public class Main extends Application { + - public static void main(String[] args) { - new Flow().start(); + @Override + public void start(Stage primaryStage) throws Exception { + Parent root = FXMLLoader.load(getClass().getResource("layout.fxml")); + Scene scene = new Scene(root, 430, 500); - } + primaryStage.setTitle("mucc"); + primaryStage.setScene(scene); + primaryStage.show(); } + + + + public static void main(String[] args) { + launch(args); + + } +} diff --git a/src/com/olexyn/ensync/layout.fxml b/src/com/olexyn/ensync/layout.fxml new file mode 100644 index 0000000..28b57c3 --- /dev/null +++ b/src/com/olexyn/ensync/layout.fxml @@ -0,0 +1,124 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<?import javafx.scene.control.cell.*?> +<?import java.lang.*?> +<?import javafx.scene.control.*?> +<?import javafx.scene.layout.*?> +<?import javafx.geometry.*?> +<?import javafx.scene.control.*?> +<?import javafx.scene.layout.*?> +<?import javafx.scene.text.*?> +<?import javafx.scene.control.cell.PropertyValueFactory?> + +<AnchorPane 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="com.olexyn.ensync.TableAppController"> + <children> + <ScrollPane fitToHeight="true" fitToWidth="true" prefHeight="400.0" prefWidth="600.0"> + <content> + <TabPane prefHeight="200.0" prefWidth="200.0" tabClosingPolicy="UNAVAILABLE"> + <tabs> + <Tab text="SyncMap 1"> + <content> + <GridPane> + <columnConstraints> + <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> + <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.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> + <TableView fx:id="table" prefHeight="200.0" prefWidth="200.0" GridPane.columnSpan="2147483647"> + <columns> + <TableColumn prefWidth="98.0" text="First Name"> + + <cellValueFactory> + + <PropertyValueFactory property="firstName" /> + + </cellValueFactory> + + </TableColumn> + + <TableColumn prefWidth="111.0" text="Surname"> + + <cellValueFactory> + + <PropertyValueFactory property="surname" /> + + </cellValueFactory> + + </TableColumn> + + <TableColumn fx:id="dateOfBirthColumn" prefWidth="99.0" text="Date of Birth"> + + <cellValueFactory> + + <PropertyValueFactory property="dateOfBirth" /> + + </cellValueFactory> + + </TableColumn> + + <TableColumn prefWidth="106.0" text="Occupation"> + + <cellValueFactory> + + <PropertyValueFactory property="occupation" /> + + </cellValueFactory> + + </TableColumn> + + <TableColumn fx:id="salaryColumn" prefWidth="84.0" text="Salary"> + + <cellValueFactory> + + <PropertyValueFactory property="salary" /> + + </cellValueFactory> + + </TableColumn> + </columns> + </TableView> + <AnchorPane GridPane.rowIndex="2" VBox.vgrow="ALWAYS"> + <children> + <GridPane layoutX="14.0" prefHeight="146.0" prefWidth="333.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="14.0"> + <columnConstraints> + <ColumnConstraints hgrow="SOMETIMES" maxWidth="295.0" minWidth="10.0" prefWidth="85.0" /> + <ColumnConstraints hgrow="SOMETIMES" maxWidth="507.0" minWidth="10.0" prefWidth="248.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 minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> + <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> + </rowConstraints> + <children> + <Label text="First Name" /> + <Label text="Surname" GridPane.rowIndex="1" /> + <Label text="Date of Birth" GridPane.rowIndex="2" /> + <Label text="Occupation" GridPane.rowIndex="3" /> + <Label text="Salary" GridPane.rowIndex="4" /> + <TextField fx:id="firstNameTextField" GridPane.columnIndex="1" /> + <TextField fx:id="surnameTextField" GridPane.columnIndex="1" GridPane.rowIndex="1" /> + <TextField fx:id="dateOfBirthTextField" GridPane.columnIndex="1" GridPane.rowIndex="2" /> + <TextField fx:id="occupationTextField" GridPane.columnIndex="1" GridPane.rowIndex="3" /> + <TextField fx:id="salaryTextField" GridPane.columnIndex="1" GridPane.rowIndex="4" /> + </children> + </GridPane> + <Button fx:id="submitButton" layoutX="371.0" layoutY="2.0" mnemonicParsing="false" onAction="#submit" text="Submit" AnchorPane.bottomAnchor="115.0" AnchorPane.leftAnchor="371.0" /> + </children> + </AnchorPane> + </children> + </GridPane> + </content> + </Tab> + </tabs> + </TabPane> + </content> + </ScrollPane> + </children> +</AnchorPane> diff --git a/src/com/olexyn/ensync/ui/UI.java b/src/com/olexyn/ensync/ui/UI.java deleted file mode 100644 index f94a943..0000000 --- a/src/com/olexyn/ensync/ui/UI.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.olexyn.ensync.ui; - -import javafx.application.Application; -import javafx.fxml.FXMLLoader; -import javafx.scene.Parent; -import javafx.scene.Scene; -import javafx.stage.Stage; - - -public class UI extends Application { - - - - - @Override - public void start(Stage primaryStage) throws Exception { - Parent root = FXMLLoader.load(getClass().getResource("layout.fxml")); - Scene scene = new Scene(root, 430, 500); - - - - primaryStage.setTitle("mucc"); - primaryStage.setScene(scene); - primaryStage.show(); - } - - - public static void main(String[] args) { - launch(args); - - } -} diff --git a/src/com/olexyn/ensync/ui/layout.fxml b/src/com/olexyn/ensync/ui/layout.fxml deleted file mode 100644 index c4d85ae..0000000 --- a/src/com/olexyn/ensync/ui/layout.fxml +++ /dev/null @@ -1,177 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<?import java.lang.*?> -<?import javafx.scene.control.*?> -<?import javafx.scene.layout.*?> -<?import javafx.geometry.*?> -<?import javafx.scene.control.*?> -<?import javafx.scene.layout.*?> -<?import javafx.scene.text.*?> - -<AnchorPane xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="app.Controller"> - <children> - <ScrollPane prefHeight="442.0" prefWidth="439.0" AnchorPane.bottomAnchor="-342.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="-339.0" AnchorPane.topAnchor="0.0"> - <content> - <GridPane fx:id="outerGridPane" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"> - <columnConstraints> - <ColumnConstraints hgrow="ALWAYS" /> - <ColumnConstraints /> - </columnConstraints> - <rowConstraints> - <RowConstraints maxHeight="40.0" minHeight="40.0" prefHeight="40.0" vgrow="SOMETIMES" /> - <RowConstraints minHeight="10.0" vgrow="SOMETIMES" /> - </rowConstraints> - <children> - <TabPane fx:id="tabPane" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" GridPane.columnSpan="2" GridPane.hgrow="ALWAYS" GridPane.rowIndex="1" GridPane.vgrow="ALWAYS"> - <tabs> - <Tab text="Scan Disk Image"> - <content> - <GridPane hgap="10.0" vgap="10.0"> - <columnConstraints> - <ColumnConstraints hgrow="ALWAYS" minWidth="10.0" prefWidth="100.0" /> - <ColumnConstraints hgrow="NEVER" minWidth="10.0" prefWidth="100.0" /> - </columnConstraints> - <rowConstraints> - <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="ALWAYS" /> - <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="ALWAYS" /> - <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="ALWAYS" /> - </rowConstraints> - <children> - <Label text="Not Implemented Yet." GridPane.columnSpan="2" GridPane.rowIndex="1" /> - </children> - <padding> - <Insets bottom="20.0" left="20.0" right="20.0" top="20.0" /> - </padding> - </GridPane> - </content> - </Tab> - <Tab text="Retreive Sub-Files"> - <content> - <GridPane hgap="10.0" vgap="10.0"> - <columnConstraints> - <ColumnConstraints hgrow="ALWAYS" /> - <ColumnConstraints hgrow="NEVER" maxWidth="80.0" minWidth="80.0" prefWidth="80.0" /> - </columnConstraints> - <rowConstraints> - <RowConstraints vgrow="NEVER" /> - <RowConstraints vgrow="NEVER" /> - <RowConstraints vgrow="NEVER" /> - <RowConstraints maxHeight="20.0" minHeight="20.0" prefHeight="20.0" vgrow="NEVER" /> - <RowConstraints vgrow="NEVER" /> - <RowConstraints vgrow="NEVER" /> - <RowConstraints maxHeight="20.0" minHeight="20.0" prefHeight="20.0" vgrow="NEVER" /> - <RowConstraints vgrow="NEVER" /> - </rowConstraints> - <children> - <Text text="Load PDF Files." GridPane.columnIndex="0" GridPane.rowIndex="1" /> - <Text fx:id="loadPdfState" text="__" GridPane.columnIndex="1" GridPane.rowIndex="1" /> - <Text text="Split PDF Files." GridPane.columnIndex="0" GridPane.rowIndex="2" /> - <Text fx:id="splitPdfState" text="__" GridPane.columnIndex="1" GridPane.rowIndex="2" /> - <Text text="Number fo Files:" GridPane.columnIndex="0" GridPane.rowIndex="4" /> - <Text fx:id="baseFileCount" text="__" GridPane.columnIndex="1" GridPane.rowIndex="4" /> - <Text text="Number of PDF Sub-Files:" GridPane.columnIndex="0" GridPane.rowIndex="5" /> - <Text fx:id="subFileCount" text="__" GridPane.columnIndex="1" GridPane.rowIndex="5" /> - <Button onAction="#loadBaseDir" text="Load" GridPane.columnIndex="0" GridPane.halignment="RIGHT" GridPane.rowIndex="7" /> - <Button onAction="#splitPdf" text="Split" GridPane.columnIndex="1" GridPane.rowIndex="7" /> - <Text text="Task"> - <font> - <Font name="System Bold" size="13.0" /> - </font> - </Text> - <Text text="State" GridPane.columnIndex="1"> - <font> - <Font name="System Bold" size="13.0" /> - </font> - </Text> - </children> - <padding> - <Insets bottom="25.0" left="25.0" right="25.0" top="25.0" /> - </padding> - </GridPane> - </content> - </Tab> - <Tab text="Delete Duplicates"> - <content> - <GridPane alignment="center" hgap="10" vgap="10"> - <padding> - <Insets bottom="25.0" left="25.0" right="25.0" top="25.0" /> - </padding> - <children> - - <Text text="Task"> - <font> - <Font name="System Bold" size="13.0" /> - </font> - </Text> - - - <Text text="State" GridPane.columnIndex="1"> - <font> - <Font name="System Bold" size="13.0" /> - </font> - </Text> - - <Text text="Load Directory." GridPane.rowIndex="1" /> - - <Text fx:id="loadDirState" text="__" GridPane.columnIndex="1" GridPane.rowIndex="1" /> - - <Text text="Calculate Md5." GridPane.rowIndex="2" /> - - <Text fx:id="calcMd5State" text="__" GridPane.columnIndex="1" GridPane.rowIndex="2" /> - - <Text text="Sort Files." GridPane.rowIndex="3" /> - <Text fx:id="sortFileState" text="__" GridPane.columnIndex="1" GridPane.rowIndex="3" /> - <Text text="Find Duplicates." GridPane.rowIndex="4" /> - <Text fx:id="findDuplicateState" text="__" GridPane.columnIndex="1" GridPane.rowIndex="4" /> - <Text text="Delete Duplicates." GridPane.rowIndex="5" /> - <Text fx:id="delDuplicateState" text="__" GridPane.columnIndex="1" GridPane.rowIndex="5" /> - <Button onAction="#loadDuplicateDir" text="Load" GridPane.halignment="RIGHT" GridPane.rowIndex="10" /> - <Text text="Number of Files:" GridPane.rowIndex="7" /> - <Text text="Number of Duplicates:" GridPane.rowIndex="8" /> - <Button onAction="#deleteDuplicates" text="Delete" GridPane.columnIndex="1" GridPane.rowIndex="10" /> - <Text fx:id="fileNrCount" strokeType="OUTSIDE" strokeWidth="0.0" text="__" GridPane.columnIndex="1" GridPane.rowIndex="7" /> - <Text fx:id="doubleNrCount" strokeType="OUTSIDE" strokeWidth="0.0" text="__" GridPane.columnIndex="1" GridPane.rowIndex="8" /> - </children> - <columnConstraints> - <ColumnConstraints hgrow="ALWAYS" /> - <ColumnConstraints hgrow="NEVER" maxWidth="80.0" minWidth="80.0" prefWidth="80.0" /> - </columnConstraints> - <rowConstraints> - <RowConstraints vgrow="NEVER" /> - <RowConstraints vgrow="NEVER" /> - <RowConstraints vgrow="NEVER" /> - <RowConstraints vgrow="NEVER" /> - <RowConstraints vgrow="NEVER" /> - <RowConstraints vgrow="NEVER" /> - <RowConstraints minHeight="20.0" prefHeight="20.0" vgrow="NEVER" /> - <RowConstraints vgrow="NEVER" /> - <RowConstraints vgrow="NEVER" /> - <RowConstraints minHeight="20.0" prefHeight="20.0" vgrow="NEVER" /> - <RowConstraints vgrow="NEVER" /> - <RowConstraints vgrow="ALWAYS" /> - </rowConstraints> - - - </GridPane> - </content> - </Tab> - </tabs> - </TabPane> - - - <TextField fx:id="directoryField" text="Select Directory."> - <GridPane.margin> - <Insets bottom="20.0" left="20.0" top="20.0" /> - </GridPane.margin> - </TextField> - <Button onAction="#openDir" text="Open..." GridPane.columnIndex="1"> - <GridPane.margin> - <Insets right="20.0" /> - </GridPane.margin> - </Button> - </children> - </GridPane> - </content> - </ScrollPane> - </children> -</AnchorPane>