started working on the gui
This commit is contained in:
parent
22711c30f7
commit
84381bc165
2
.idea/gradle.xml
generated
2
.idea/gradle.xml
generated
@ -5,7 +5,7 @@
|
|||||||
<option name="linkedExternalProjectsSettings">
|
<option name="linkedExternalProjectsSettings">
|
||||||
<GradleProjectSettings>
|
<GradleProjectSettings>
|
||||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||||
<option name="gradleHome" value="" />
|
<option name="gradleHome" value="/usr/share/java/gradle" />
|
||||||
<option name="modules">
|
<option name="modules">
|
||||||
<set>
|
<set>
|
||||||
<option value="$PROJECT_DIR$" />
|
<option value="$PROJECT_DIR$" />
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id("java")
|
java
|
||||||
|
application
|
||||||
|
id("org.openjfx.javafxplugin") version "0.1.0"
|
||||||
}
|
}
|
||||||
|
|
||||||
group = "dev.ksan"
|
group = "dev.ksan"
|
||||||
@ -23,3 +25,15 @@ dependencies {
|
|||||||
tasks.test {
|
tasks.test {
|
||||||
useJUnitPlatform()
|
useJUnitPlatform()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
javafx {
|
||||||
|
version = "25"
|
||||||
|
modules("javafx.controls", "javafx.fxml")
|
||||||
|
}
|
||||||
|
|
||||||
|
application {
|
||||||
|
mainClass.set("dev.ksan.Main")
|
||||||
|
}
|
||||||
|
tasks.withType<JavaExec> {
|
||||||
|
jvmArgs("--enable-native-access=javafx.graphics")
|
||||||
|
}
|
||||||
38
src/main/java/dev/ksan/GUI/HomeView.java
Normal file
38
src/main/java/dev/ksan/GUI/HomeView.java
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
package dev.ksan.GUI;
|
||||||
|
|
||||||
|
import javafx.geometry.Pos;
|
||||||
|
import javafx.scene.Scene;
|
||||||
|
import javafx.scene.control.Button;
|
||||||
|
import javafx.scene.control.Label;
|
||||||
|
import javafx.scene.layout.VBox;
|
||||||
|
import javafx.stage.Stage;
|
||||||
|
|
||||||
|
public class HomeView {
|
||||||
|
|
||||||
|
private final Stage stage;
|
||||||
|
|
||||||
|
public HomeView(Stage stage) {
|
||||||
|
this.stage = stage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void show() {
|
||||||
|
Label title = new Label("E-Voting");
|
||||||
|
title.setStyle("-fx-font-size: 32px; -fx-font-weight: bold;");
|
||||||
|
|
||||||
|
Button loginBtn = new Button("Login");
|
||||||
|
Button registerBtn = new Button("Register");
|
||||||
|
|
||||||
|
loginBtn.setPrefWidth(200);
|
||||||
|
registerBtn.setPrefWidth(200);
|
||||||
|
|
||||||
|
loginBtn.setOnAction(e -> System.out.println("Go to Login"));
|
||||||
|
registerBtn.setOnAction(e -> System.out.println("Go to Register"));
|
||||||
|
|
||||||
|
VBox layout = new VBox(20, title, loginBtn, registerBtn);
|
||||||
|
layout.setAlignment(Pos.CENTER);
|
||||||
|
|
||||||
|
stage.setScene(new Scene(layout, 500, 400));
|
||||||
|
stage.setTitle("Home");
|
||||||
|
stage.show();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,6 +1,13 @@
|
|||||||
package dev.ksan;
|
package dev.ksan;
|
||||||
|
|
||||||
import dev.ksan.CASystem.*;
|
import dev.ksan.CASystem.*;
|
||||||
|
import dev.ksan.GUI.HomeView;
|
||||||
|
import dev.ksan.ui.HomeController;
|
||||||
|
import javafx.application.Application;
|
||||||
|
import javafx.fxml.FXMLLoader;
|
||||||
|
import javafx.scene.Scene;
|
||||||
|
import javafx.scene.control.Button;
|
||||||
|
import javafx.stage.Stage;
|
||||||
import org.bouncycastle.jce.provider.BouncyCastleProvider;
|
import org.bouncycastle.jce.provider.BouncyCastleProvider;
|
||||||
|
|
||||||
import java.security.KeyPair;
|
import java.security.KeyPair;
|
||||||
@ -10,7 +17,7 @@ import java.security.cert.X509Certificate;
|
|||||||
import static dev.ksan.CASystem.CA.publicKeyToPem;
|
import static dev.ksan.CASystem.CA.publicKeyToPem;
|
||||||
|
|
||||||
|
|
||||||
public class Main {
|
public class Main extends javafx.application.Application {
|
||||||
static{
|
static{
|
||||||
Security.addProvider(new BouncyCastleProvider());
|
Security.addProvider(new BouncyCastleProvider());
|
||||||
}
|
}
|
||||||
@ -51,8 +58,27 @@ public class Main {
|
|||||||
|
|
||||||
CAInitializer.initializeIfNeeded();
|
CAInitializer.initializeIfNeeded();
|
||||||
|
|
||||||
ConsoleApp app = new ConsoleApp();
|
|
||||||
app.start();
|
launch();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void start(Stage stage) throws Exception {
|
||||||
|
try {
|
||||||
|
FXMLLoader loader = new FXMLLoader(getClass().getResource("/fxml/HomeView.fxml"));
|
||||||
|
Scene scene = new Scene(loader.load(), 800, 600);
|
||||||
|
|
||||||
|
HomeController controller = loader.getController();
|
||||||
|
controller.setStage(stage); // pass stage for navigation
|
||||||
|
|
||||||
|
stage.setScene(scene);
|
||||||
|
stage.setTitle("Home");
|
||||||
|
stage.show();
|
||||||
|
}
|
||||||
|
catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
50
src/main/java/dev/ksan/ui/HomeController.java
Normal file
50
src/main/java/dev/ksan/ui/HomeController.java
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
package dev.ksan.ui;
|
||||||
|
|
||||||
|
|
||||||
|
import javafx.fxml.FXML;
|
||||||
|
import javafx.fxml.FXMLLoader;
|
||||||
|
import javafx.scene.Scene;
|
||||||
|
import javafx.scene.control.Button;
|
||||||
|
import javafx.stage.Stage;
|
||||||
|
|
||||||
|
public class HomeController {
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
private Button loginButton;
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
private Button registerButton;
|
||||||
|
|
||||||
|
private Stage stage;
|
||||||
|
|
||||||
|
public void setStage(Stage stage) {
|
||||||
|
this.stage = stage;
|
||||||
|
}
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
public void initialize() {
|
||||||
|
loginButton.setOnAction(e -> System.out.println("Go to login"));
|
||||||
|
registerButton.setOnAction(e -> goToRegister());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void goToRegister() {
|
||||||
|
try {
|
||||||
|
FXMLLoader loader = new FXMLLoader(getClass().getResource("/fxml/RegisterTypeView.fxml"));
|
||||||
|
Scene oldScene = stage.getScene();
|
||||||
|
Scene scene = new Scene(loader.load(),
|
||||||
|
oldScene.getWidth(),
|
||||||
|
oldScene.getHeight()
|
||||||
|
);
|
||||||
|
|
||||||
|
RegisterTypeController controller = loader.getController();
|
||||||
|
controller.setStage(stage);
|
||||||
|
|
||||||
|
stage.setScene(scene);
|
||||||
|
stage.setTitle("Register");
|
||||||
|
} catch (Exception ex) {
|
||||||
|
ex.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
34
src/main/java/dev/ksan/ui/RegisterOrganizerController.java
Normal file
34
src/main/java/dev/ksan/ui/RegisterOrganizerController.java
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
package dev.ksan.ui;
|
||||||
|
|
||||||
|
import javafx.fxml.FXML;
|
||||||
|
import javafx.scene.control.Button;
|
||||||
|
import javafx.scene.control.PasswordField;
|
||||||
|
import javafx.scene.control.TextField;
|
||||||
|
import javafx.stage.Stage;
|
||||||
|
|
||||||
|
public class RegisterOrganizerController {
|
||||||
|
|
||||||
|
private Stage stage;
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
private TextField nameField;
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
private TextField idField;
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
private PasswordField passwordField;
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
private PasswordField confirmPasswordField;
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
private Button registerButton;
|
||||||
|
|
||||||
|
public Stage getStage() {
|
||||||
|
return stage;
|
||||||
|
}
|
||||||
|
public void setStage(Stage stage) {
|
||||||
|
this.stage = stage;
|
||||||
|
}
|
||||||
|
}
|
||||||
67
src/main/java/dev/ksan/ui/RegisterTypeController.java
Normal file
67
src/main/java/dev/ksan/ui/RegisterTypeController.java
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
package dev.ksan.ui;
|
||||||
|
|
||||||
|
import javafx.fxml.FXML;
|
||||||
|
import javafx.fxml.FXMLLoader;
|
||||||
|
import javafx.scene.Scene;
|
||||||
|
import javafx.scene.control.Button;
|
||||||
|
import javafx.stage.Stage;
|
||||||
|
|
||||||
|
public class RegisterTypeController {
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
private Button voterButton;
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
private Button organizerButton;
|
||||||
|
|
||||||
|
private Stage stage;
|
||||||
|
|
||||||
|
public void setStage(Stage stage) {
|
||||||
|
this.stage = stage;
|
||||||
|
}
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
public void initialize() {
|
||||||
|
voterButton.setOnAction(e -> goToVoter());
|
||||||
|
organizerButton.setOnAction(e -> goToOrganizer());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void goToVoter() {
|
||||||
|
try {
|
||||||
|
FXMLLoader loader = new FXMLLoader(getClass().getResource("/fxml/RegisterVoterView.fxml"));
|
||||||
|
Scene oldScene = stage.getScene();
|
||||||
|
Scene scene = new Scene(loader.load(),
|
||||||
|
oldScene.getWidth(),
|
||||||
|
oldScene.getHeight()
|
||||||
|
);
|
||||||
|
|
||||||
|
RegisterVoterController controller = loader.getController();
|
||||||
|
controller.setStage(stage);
|
||||||
|
|
||||||
|
stage.setScene(scene);
|
||||||
|
stage.setTitle("Register Voter");
|
||||||
|
} catch (Exception ex) {
|
||||||
|
ex.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void goToOrganizer() {
|
||||||
|
try {
|
||||||
|
FXMLLoader loader = new FXMLLoader(getClass().getResource("/fxml/RegisterOrganizerView.fxml"));
|
||||||
|
Scene oldScene = stage.getScene();
|
||||||
|
Scene scene = new Scene(loader.load(),
|
||||||
|
oldScene.getWidth(),
|
||||||
|
oldScene.getHeight()
|
||||||
|
);
|
||||||
|
|
||||||
|
RegisterOrganizerController controller = loader.getController();
|
||||||
|
controller.setStage(stage);
|
||||||
|
|
||||||
|
stage.setScene(scene);
|
||||||
|
stage.setTitle("Register Organizer");
|
||||||
|
} catch (Exception ex) {
|
||||||
|
ex.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
43
src/main/java/dev/ksan/ui/RegisterVoterController.java
Normal file
43
src/main/java/dev/ksan/ui/RegisterVoterController.java
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
package dev.ksan.ui;
|
||||||
|
|
||||||
|
import javafx.fxml.FXML;
|
||||||
|
import javafx.scene.control.Button;
|
||||||
|
import javafx.scene.control.PasswordField;
|
||||||
|
import javafx.scene.control.TextField;
|
||||||
|
import javafx.stage.Stage;
|
||||||
|
|
||||||
|
public class RegisterVoterController {
|
||||||
|
|
||||||
|
private Stage stage;
|
||||||
|
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
private TextField nameField;
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
private TextField surnameField;
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
private TextField usernameField;
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
private PasswordField passwordField;
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
private PasswordField confirmPasswordField;
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
private Button registerButton;
|
||||||
|
|
||||||
|
|
||||||
|
public void setStage(Stage stage) {
|
||||||
|
this.stage = stage;
|
||||||
|
}
|
||||||
|
public Stage getStage() {
|
||||||
|
return stage;
|
||||||
|
}
|
||||||
|
@FXML
|
||||||
|
public void initialize() {
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
33
src/main/resources/fxml/HomeView.fxml
Normal file
33
src/main/resources/fxml/HomeView.fxml
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<?import javafx.geometry.Insets?>
|
||||||
|
<?import javafx.scene.control.Button?>
|
||||||
|
<?import javafx.scene.layout.BorderPane?>
|
||||||
|
<?import javafx.scene.layout.VBox?>
|
||||||
|
<?import javafx.scene.text.Font?>
|
||||||
|
<?import javafx.scene.text.Text?>
|
||||||
|
|
||||||
|
|
||||||
|
<BorderPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/23.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="dev.ksan.ui.HomeController">
|
||||||
|
<center>
|
||||||
|
<VBox alignment="CENTER" prefHeight="200.0" prefWidth="100.0" BorderPane.alignment="CENTER">
|
||||||
|
<children>
|
||||||
|
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="E-Voting" textAlignment="CENTER">
|
||||||
|
<font>
|
||||||
|
<Font name="Hack Bold Italic" size="56.0" />
|
||||||
|
</font>
|
||||||
|
</Text>
|
||||||
|
<Button fx:id="loginButton" maxWidth="150.0" mnemonicParsing="false" text="Login">
|
||||||
|
<VBox.margin>
|
||||||
|
<Insets top="15.0" />
|
||||||
|
</VBox.margin>
|
||||||
|
</Button>
|
||||||
|
<Button fx:id="registerButton" maxWidth="150.0" mnemonicParsing="false" text="Register">
|
||||||
|
<VBox.margin>
|
||||||
|
<Insets top="15.0" />
|
||||||
|
</VBox.margin>
|
||||||
|
</Button>
|
||||||
|
</children>
|
||||||
|
</VBox>
|
||||||
|
</center>
|
||||||
|
</BorderPane>
|
||||||
14
src/main/resources/fxml/LoginView.fxml
Normal file
14
src/main/resources/fxml/LoginView.fxml
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<?import java.lang.*?>
|
||||||
|
<?import java.util.*?>
|
||||||
|
<?import javafx.scene.*?>
|
||||||
|
<?import javafx.scene.control.*?>
|
||||||
|
<?import javafx.scene.layout.*?>
|
||||||
|
|
||||||
|
<AnchorPane xmlns="http://javafx.com/javafx"
|
||||||
|
xmlns:fx="http://javafx.com/fxml"
|
||||||
|
fx:controller="fxml.LoginView"
|
||||||
|
prefHeight="400.0" prefWidth="600.0">
|
||||||
|
|
||||||
|
</AnchorPane>
|
||||||
74
src/main/resources/fxml/RegisterOrganizerView.fxml
Normal file
74
src/main/resources/fxml/RegisterOrganizerView.fxml
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<?import javafx.geometry.Insets?>
|
||||||
|
<?import javafx.scene.control.Button?>
|
||||||
|
<?import javafx.scene.control.PasswordField?>
|
||||||
|
<?import javafx.scene.control.TextField?>
|
||||||
|
<?import javafx.scene.layout.BorderPane?>
|
||||||
|
<?import javafx.scene.layout.ColumnConstraints?>
|
||||||
|
<?import javafx.scene.layout.GridPane?>
|
||||||
|
<?import javafx.scene.layout.RowConstraints?>
|
||||||
|
<?import javafx.scene.layout.VBox?>
|
||||||
|
<?import javafx.scene.text.Font?>
|
||||||
|
<?import javafx.scene.text.Text?>
|
||||||
|
|
||||||
|
|
||||||
|
<BorderPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/23.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="dev.ksan.ui.RegisterOrganizerController">
|
||||||
|
<center>
|
||||||
|
<VBox alignment="CENTER" prefHeight="200.0" prefWidth="100.0" BorderPane.alignment="CENTER">
|
||||||
|
<children>
|
||||||
|
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="E-Voting">
|
||||||
|
<font>
|
||||||
|
<Font name="Hack Bold Italic" size="46.0" />
|
||||||
|
</font>
|
||||||
|
</Text>
|
||||||
|
<GridPane>
|
||||||
|
<columnConstraints>
|
||||||
|
<ColumnConstraints halignment="RIGHT" hgrow="SOMETIMES" maxWidth="194.0" minWidth="10.0" prefWidth="153.0" />
|
||||||
|
<ColumnConstraints hgrow="SOMETIMES" maxWidth="247.0" minWidth="10.0" prefWidth="247.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>
|
||||||
|
<children>
|
||||||
|
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="Organization name:">
|
||||||
|
<GridPane.margin>
|
||||||
|
<Insets right="10.0" />
|
||||||
|
</GridPane.margin>
|
||||||
|
</Text>
|
||||||
|
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="Id:" GridPane.rowIndex="1">
|
||||||
|
<GridPane.margin>
|
||||||
|
<Insets right="10.0" />
|
||||||
|
</GridPane.margin>
|
||||||
|
</Text>
|
||||||
|
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="Password:" GridPane.rowIndex="2">
|
||||||
|
<GridPane.margin>
|
||||||
|
<Insets right="10.0" />
|
||||||
|
</GridPane.margin>
|
||||||
|
</Text>
|
||||||
|
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="Confirm Password:" GridPane.rowIndex="3">
|
||||||
|
<GridPane.margin>
|
||||||
|
<Insets right="10.0" />
|
||||||
|
</GridPane.margin>
|
||||||
|
</Text>
|
||||||
|
<TextField fx:id="nameField" GridPane.columnIndex="1" />
|
||||||
|
<TextField fx:id="idField" GridPane.columnIndex="1" GridPane.rowIndex="1" />
|
||||||
|
<PasswordField fx:id="passwordField" GridPane.columnIndex="1" GridPane.rowIndex="2" />
|
||||||
|
<PasswordField fx:id="confirmPasswordField" GridPane.columnIndex="1" GridPane.rowIndex="3" />
|
||||||
|
</children>
|
||||||
|
<VBox.margin>
|
||||||
|
<Insets left="100.0" right="100.0" />
|
||||||
|
</VBox.margin>
|
||||||
|
</GridPane>
|
||||||
|
<Button fx:id="registerButton" mnemonicParsing="false" text="Register">
|
||||||
|
<VBox.margin>
|
||||||
|
<Insets top="10.0" />
|
||||||
|
</VBox.margin>
|
||||||
|
</Button>
|
||||||
|
</children>
|
||||||
|
</VBox>
|
||||||
|
</center>
|
||||||
|
</BorderPane>
|
||||||
77
src/main/resources/fxml/RegisterTypeView.fxml
Normal file
77
src/main/resources/fxml/RegisterTypeView.fxml
Normal file
@ -0,0 +1,77 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<?import javafx.geometry.Insets?>
|
||||||
|
<?import javafx.scene.control.Button?>
|
||||||
|
<?import javafx.scene.image.Image?>
|
||||||
|
<?import javafx.scene.image.ImageView?>
|
||||||
|
<?import javafx.scene.layout.BorderPane?>
|
||||||
|
<?import javafx.scene.layout.HBox?>
|
||||||
|
<?import javafx.scene.layout.VBox?>
|
||||||
|
<?import javafx.scene.text.Font?>
|
||||||
|
<?import javafx.scene.text.Text?>
|
||||||
|
|
||||||
|
<BorderPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/23.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="dev.ksan.ui.RegisterTypeController">
|
||||||
|
<center>
|
||||||
|
<VBox alignment="CENTER" prefHeight="200.0" prefWidth="100.0" BorderPane.alignment="CENTER">
|
||||||
|
<children>
|
||||||
|
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="Account type:" textAlignment="CENTER">
|
||||||
|
<font>
|
||||||
|
<Font name="Hack Bold" size="39.0" />
|
||||||
|
</font>
|
||||||
|
<VBox.margin>
|
||||||
|
<Insets bottom="30.0" />
|
||||||
|
</VBox.margin>
|
||||||
|
</Text>
|
||||||
|
<HBox alignment="CENTER" prefHeight="100.0" prefWidth="200.0">
|
||||||
|
<children>
|
||||||
|
<VBox alignment="CENTER" prefHeight="200.0" prefWidth="100.0">
|
||||||
|
<children>
|
||||||
|
<ImageView fitHeight="117.0" fitWidth="136.0" pickOnBounds="true" preserveRatio="true">
|
||||||
|
<image>
|
||||||
|
<Image url="@../images/voterimg.png" />
|
||||||
|
</image>
|
||||||
|
</ImageView>
|
||||||
|
<Button fx:id="voterButton" mnemonicParsing="false" text="Voter">
|
||||||
|
<VBox.margin>
|
||||||
|
<Insets top="5.0" />
|
||||||
|
</VBox.margin>
|
||||||
|
</Button>
|
||||||
|
</children>
|
||||||
|
<HBox.margin>
|
||||||
|
<Insets left="15.0" />
|
||||||
|
</HBox.margin>
|
||||||
|
</VBox>
|
||||||
|
<ImageView fitHeight="55.0" fitWidth="94.0" pickOnBounds="true">
|
||||||
|
<image>
|
||||||
|
<Image url="@../images/arrows.png" />
|
||||||
|
</image>
|
||||||
|
<HBox.margin>
|
||||||
|
<Insets left="50.0" right="50.0" />
|
||||||
|
</HBox.margin>
|
||||||
|
</ImageView>
|
||||||
|
<VBox alignment="CENTER" prefHeight="200.0" prefWidth="100.0">
|
||||||
|
<children>
|
||||||
|
<ImageView fitHeight="121.0" fitWidth="150.0" pickOnBounds="true" preserveRatio="true">
|
||||||
|
<image>
|
||||||
|
<Image url="@../images/organizerimg.png" />
|
||||||
|
</image>
|
||||||
|
<VBox.margin>
|
||||||
|
<Insets />
|
||||||
|
</VBox.margin>
|
||||||
|
</ImageView>
|
||||||
|
<Button fx:id="organizerButton" mnemonicParsing="false" text="Organizer">
|
||||||
|
<VBox.margin>
|
||||||
|
<Insets top="5.0" />
|
||||||
|
</VBox.margin>
|
||||||
|
</Button>
|
||||||
|
</children>
|
||||||
|
<HBox.margin>
|
||||||
|
<Insets right="15.0" />
|
||||||
|
</HBox.margin>
|
||||||
|
</VBox>
|
||||||
|
</children>
|
||||||
|
</HBox>
|
||||||
|
</children>
|
||||||
|
</VBox>
|
||||||
|
</center>
|
||||||
|
</BorderPane>
|
||||||
104
src/main/resources/fxml/RegisterVoterView.fxml
Normal file
104
src/main/resources/fxml/RegisterVoterView.fxml
Normal file
@ -0,0 +1,104 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<?import javafx.geometry.Insets?>
|
||||||
|
<?import javafx.scene.control.Button?>
|
||||||
|
<?import javafx.scene.control.PasswordField?>
|
||||||
|
<?import javafx.scene.control.TextField?>
|
||||||
|
<?import javafx.scene.layout.BorderPane?>
|
||||||
|
<?import javafx.scene.layout.ColumnConstraints?>
|
||||||
|
<?import javafx.scene.layout.GridPane?>
|
||||||
|
<?import javafx.scene.layout.RowConstraints?>
|
||||||
|
<?import javafx.scene.layout.VBox?>
|
||||||
|
<?import javafx.scene.text.Font?>
|
||||||
|
<?import javafx.scene.text.Text?>
|
||||||
|
|
||||||
|
|
||||||
|
<BorderPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/23.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="dev.ksan.ui.RegisterVoterController">
|
||||||
|
<center>
|
||||||
|
<VBox alignment="CENTER" prefHeight="200.0" prefWidth="100.0" BorderPane.alignment="CENTER">
|
||||||
|
<children>
|
||||||
|
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="E-Voting" textAlignment="CENTER">
|
||||||
|
<VBox.margin>
|
||||||
|
<Insets bottom="35.0" />
|
||||||
|
</VBox.margin>
|
||||||
|
<font>
|
||||||
|
<Font name="Hack Bold Italic" size="44.0" />
|
||||||
|
</font>
|
||||||
|
</Text>
|
||||||
|
<GridPane>
|
||||||
|
<columnConstraints>
|
||||||
|
<ColumnConstraints halignment="RIGHT" hgrow="SOMETIMES" maxWidth="219.0" minWidth="10.0" prefWidth="150.0" />
|
||||||
|
<ColumnConstraints hgrow="SOMETIMES" maxWidth="307.0" minWidth="10.0" prefWidth="300.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>
|
||||||
|
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="Name:">
|
||||||
|
<GridPane.margin>
|
||||||
|
<Insets right="15.0" />
|
||||||
|
</GridPane.margin>
|
||||||
|
</Text>
|
||||||
|
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="Surname:" GridPane.rowIndex="1">
|
||||||
|
<GridPane.margin>
|
||||||
|
<Insets right="15.0" />
|
||||||
|
</GridPane.margin>
|
||||||
|
</Text>
|
||||||
|
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="Username:" GridPane.rowIndex="2">
|
||||||
|
<GridPane.margin>
|
||||||
|
<Insets right="15.0" />
|
||||||
|
</GridPane.margin>
|
||||||
|
</Text>
|
||||||
|
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="Password:" GridPane.rowIndex="3">
|
||||||
|
<GridPane.margin>
|
||||||
|
<Insets right="15.0" />
|
||||||
|
</GridPane.margin>
|
||||||
|
</Text>
|
||||||
|
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="Confirm Password:" GridPane.rowIndex="4">
|
||||||
|
<GridPane.margin>
|
||||||
|
<Insets right="15.0" />
|
||||||
|
</GridPane.margin>
|
||||||
|
</Text>
|
||||||
|
<TextField fx:id="nameField" GridPane.columnIndex="1">
|
||||||
|
<GridPane.margin>
|
||||||
|
<Insets right="100.0" />
|
||||||
|
</GridPane.margin>
|
||||||
|
</TextField>
|
||||||
|
<TextField fx:id="surnameField" GridPane.columnIndex="1" GridPane.rowIndex="1">
|
||||||
|
<GridPane.margin>
|
||||||
|
<Insets right="100.0" />
|
||||||
|
</GridPane.margin>
|
||||||
|
</TextField>
|
||||||
|
<TextField fx:id="usernameField" GridPane.columnIndex="1" GridPane.rowIndex="2">
|
||||||
|
<GridPane.margin>
|
||||||
|
<Insets right="100.0" />
|
||||||
|
</GridPane.margin>
|
||||||
|
</TextField>
|
||||||
|
<PasswordField fx:id="passwordField" GridPane.columnIndex="1" GridPane.rowIndex="3">
|
||||||
|
<GridPane.margin>
|
||||||
|
<Insets right="100.0" />
|
||||||
|
</GridPane.margin>
|
||||||
|
</PasswordField>
|
||||||
|
<PasswordField fx:id="passwordConfirmField" GridPane.columnIndex="1" GridPane.rowIndex="4">
|
||||||
|
<GridPane.margin>
|
||||||
|
<Insets right="100.0" />
|
||||||
|
</GridPane.margin>
|
||||||
|
</PasswordField>
|
||||||
|
</children>
|
||||||
|
<VBox.margin>
|
||||||
|
<Insets left="100.0" right="50.0" />
|
||||||
|
</VBox.margin>
|
||||||
|
</GridPane>
|
||||||
|
<Button fx:id="registerButton" mnemonicParsing="false" text="Register">
|
||||||
|
<VBox.margin>
|
||||||
|
<Insets left="100.0" top="10.0" />
|
||||||
|
</VBox.margin>
|
||||||
|
</Button>
|
||||||
|
</children>
|
||||||
|
</VBox>
|
||||||
|
</center>
|
||||||
|
</BorderPane>
|
||||||
BIN
src/main/resources/images/arrows.png
Normal file
BIN
src/main/resources/images/arrows.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.5 KiB |
BIN
src/main/resources/images/organizerimg.jpg
Normal file
BIN
src/main/resources/images/organizerimg.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 167 KiB |
BIN
src/main/resources/images/organizerimg.png
Normal file
BIN
src/main/resources/images/organizerimg.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 172 KiB |
BIN
src/main/resources/images/voterimg.jpg
Normal file
BIN
src/main/resources/images/voterimg.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 78 KiB |
BIN
src/main/resources/images/voterimg.png
Normal file
BIN
src/main/resources/images/voterimg.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 178 KiB |
Loading…
x
Reference in New Issue
Block a user