Set up 'polling-station-gui' as a proper gradle subproject; fix directory structure

voting-station-gui
Tal Moran 2016-06-28 02:12:26 +03:00
parent 72d5e8aca1
commit b21051f321
43 changed files with 279 additions and 54 deletions

View File

@ -0,0 +1,222 @@
plugins {
id "us.kirchmeier.capsule" version "1.0.1"
id 'com.google.protobuf' version '0.7.0'
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'maven-publish'
// Uncomment the lines below to define an application
// (this will also allow you to build a "fatCapsule" which includes
// the entire application, including all dependencies in a single jar)
apply plugin: 'application'
mainClassName='splash_screen_on_boot.Main'
// Is this a snapshot version?
ext { isSnapshot = false }
ext {
groupId = 'org.factcenter.meerkat'
nexusRepository = "https://cs.idc.ac.il/nexus/content/groups/${isSnapshot ? 'unstable' : 'public'}/"
// Credentials for IDC nexus repositories (needed only for using unstable repositories and publishing)
// Should be set in ${HOME}/.gradle/gradle.properties
nexusUser = project.hasProperty('nexusUser') ? project.property('nexusUser') : ""
nexusPassword = project.hasProperty('nexusPassword') ? project.property('nexusPassword') : ""
}
description = "GUI For polling station"
// Your project version
version = "0.0"
version += "${isSnapshot ? '-SNAPSHOT' : ''}"
dependencies {
// Meerkat common
compile project(':meerkat-common')
// Logging
compile 'org.slf4j:slf4j-api:1.7.7'
runtime 'ch.qos.logback:logback-classic:1.1.2'
runtime 'ch.qos.logback:logback-core:1.1.2'
// Google protobufs
compile 'com.google.protobuf:protobuf-java:3.+'
testCompile 'junit:junit:4.+'
runtime 'org.codehaus.groovy:groovy:2.4.+'
}
/*==== You probably don't have to edit below this line =======*/
// Setup test configuration that can appear as a dependency in
// other subprojects
configurations {
testOutput.extendsFrom (testCompile)
}
task testJar(type: Jar, dependsOn: testClasses) {
classifier = 'tests'
from sourceSets.test.output
}
artifacts {
testOutput testJar
}
// The run task added by the application plugin
// is also of type JavaExec.
tasks.withType(JavaExec) {
// Assign all Java system properties from
// the command line to the JavaExec task.
systemProperties System.properties
}
protobuf {
// Configure the protoc executable
protoc {
// Download from repositories
artifact = 'com.google.protobuf:protoc:3.+'
}
}
idea {
module {
project.sourceSets.each { sourceSet ->
def srcDir = "${protobuf.generatedFilesBaseDir}/$sourceSet.name/java"
println "Adding $srcDir"
// add protobuf generated sources to generated source dir.
if ("test".equals(sourceSet.name)) {
testSourceDirs += file(srcDir)
} else {
sourceDirs += file(srcDir)
}
generatedSourceDirs += file(srcDir)
}
// Don't exclude build directory
excludeDirs -= file(buildDir)
}
}
/*===================================
* "Fat" Build targets
*===================================*/
if (project.hasProperty('mainClassName') && (mainClassName != null)) {
task mavenCapsule(type: MavenCapsule) {
description = "Generate a capsule jar that automatically downloads and caches dependencies when run."
applicationClass mainClassName
destinationDir = buildDir
}
task fatCapsule(type: FatCapsule) {
description = "Generate a single capsule jar containing everything. Use -Pfatmain=... to override main class"
destinationDir = buildDir
def fatMain = hasProperty('fatmain') ? fatmain : mainClassName
applicationClass fatMain
def testJar = hasProperty('test')
if (hasProperty('fatmain')) {
appendix = "fat-${fatMain}"
} else {
appendix = "fat"
}
if (testJar) {
from sourceSets.test.output
}
}
}
/*===================================
* Repositories
*===================================*/
repositories {
// Prefer the local nexus repository (it may have 3rd party artifacts not found in mavenCentral)
maven {
url nexusRepository
if (isSnapshot) {
credentials { username
password
username nexusUser
password nexusPassword
}
}
}
// Use local maven repository
mavenLocal()
// Use 'maven central' for other dependencies.
mavenCentral()
}
task "info" << {
println "Project: ${project.name}"
println "Description: ${project.description}"
println "--------------------------"
println "GroupId: $groupId"
println "Version: $version (${isSnapshot ? 'snapshot' : 'release'})"
println ""
}
info.description 'Print some information about project parameters'
/*===================================
* Publishing
*===================================*/
publishing {
publications {
mavenJava(MavenPublication) {
groupId project.groupId
pom.withXml {
asNode().appendNode('description', project.description)
}
from project.components.java
}
}
repositories {
maven {
url "https://cs.idc.ac.il/nexus/content/repositories/${project.isSnapshot ? 'snapshots' : 'releases'}"
credentials { username
password
username nexusUser
password nexusPassword
}
}
}
}

1
polling-station-gui/gradlew vendored Symbolic link
View File

@ -0,0 +1 @@
../gradlew

View File

@ -1,4 +1,4 @@
package polling_station_dashboard.java;
package polling_station_dashboard;
import javafx.event.Event;
import javafx.event.EventHandler;

View File

@ -1,12 +1,12 @@
package polling_station_dashboard.java;
package polling_station_dashboard;
import javafx.stage.Stage;
import polling_station_dashboard.search.SearchHandler;
import polling_station_dashboard.search.votersFetcher.DummyVotersFetcher;
import polling_station_dashboard.settings.java.SettingsVisualUpdater;
import polling_station_dashboard.settings.java.settingsLoader;
import polling_station_dashboard.statusLog.java.StatusLogLoader;
import polling_station_dashboard.statusLog.java.StatusLogVisualUpdater;
import polling_station_dashboard.settings.SettingsVisualUpdater;
import polling_station_dashboard.settings.settingsLoader;
import polling_station_dashboard.statusLog.StatusLogLoader;
import polling_station_dashboard.statusLog.StatusLogVisualUpdater;
import java.io.IOException;

View File

@ -1,4 +1,4 @@
package polling_station_dashboard.java;
package polling_station_dashboard;
import javafx.fxml.FXML;
import javafx.scene.input.MouseEvent;

View File

@ -1,4 +1,4 @@
package polling_station_dashboard.java;
package polling_station_dashboard;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
@ -13,7 +13,7 @@ import java.io.IOException;
*/
public class PollingStationDashboardLoader {
private static final String POLLING_STATION_DASHBOARD_FXML_PATH = "../fxml/polling_station_dashboard.fxml";
private static final String POLLING_STATION_DASHBOARD_FXML_PATH = "/view/dashboard/polling_station_dashboard.fxml";
private Stage currentStage;

View File

@ -5,13 +5,12 @@ import javafx.event.EventHandler;
import javafx.scene.control.TextField;
import javafx.scene.layout.Pane;
import javafx.stage.Stage;
import polling_station_dashboard.search.submitVoter.java.SubmitVoterLoader;
import polling_station_dashboard.search.submitVoter.SubmitVoterLoader;
import polling_station_dashboard.search.votersFetcher.VotersFetcher;
import polling_station_dashboard.search.addVoter.java.AddVoterLoader;
import polling_station_dashboard.search.addVoter.AddVoterLoader;
import javafx.scene.control.Button;
import java.io.IOException;
import java.lang.reflect.Array;
import java.util.*;
/**

View File

@ -1,4 +1,4 @@
package polling_station_dashboard.search.addVoter.java;
package polling_station_dashboard.search.addVoter;
import javafx.fxml.FXML;
import javafx.scene.layout.Pane;

View File

@ -1,4 +1,4 @@
package polling_station_dashboard.search.addVoter.java;
package polling_station_dashboard.search.addVoter;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
@ -13,7 +13,7 @@ import java.io.IOException;
*/
public class AddVoterLoader {
private static final String ADD_VOTER_FXML_PATH = "../fxml/add_voter.fxml";
private static final String ADD_VOTER_FXML_PATH = "/view/dashboard/add_voter.fxml";
private Stage currentStage;

View File

@ -1,4 +1,4 @@
package polling_station_dashboard.search.submitVoter.java;
package polling_station_dashboard.search.submitVoter;
import javafx.fxml.FXML;
import javafx.scene.layout.Pane;

View File

@ -1,4 +1,4 @@
package polling_station_dashboard.search.submitVoter.java;
package polling_station_dashboard.search.submitVoter;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
@ -15,7 +15,7 @@ import java.util.HashMap;
*/
public class SubmitVoterLoader {
private static final String SUBMIT_VOTER_FXML_PATH = "../fxml/submit_voter.fxml";
private static final String SUBMIT_VOTER_FXML_PATH = "/view/dashboard/submit_voter.fxml";
private Stage currentStage;
private FXMLLoader fxmlLoader;

View File

@ -1,4 +1,4 @@
package polling_station_dashboard.settings.java;
package polling_station_dashboard.settings;
import javafx.event.Event;
import javafx.event.EventHandler;

View File

@ -1,4 +1,4 @@
package polling_station_dashboard.settings.java;
package polling_station_dashboard.settings;
import javafx.stage.Stage;

View File

@ -1,4 +1,4 @@
package polling_station_dashboard.settings.java;
package polling_station_dashboard.settings;
import javafx.fxml.FXMLLoader;
import javafx.scene.layout.GridPane;
@ -12,7 +12,7 @@ import java.io.IOException;
*/
public class settingsLoader {
private static final String SETTINGS_FXML_PATH = "../fxml/settings.fxml";
private static final String SETTINGS_FXML_PATH = "/view/dashboard/settings.fxml";
private Stage currentStage;
private FXMLLoader fxmlLoader;

View File

@ -1,4 +1,4 @@
package polling_station_dashboard.statusLog.java;
package polling_station_dashboard.statusLog;
import javafx.stage.Stage;

View File

@ -1,4 +1,4 @@
package polling_station_dashboard.statusLog.java;
package polling_station_dashboard.statusLog;
import javafx.fxml.FXMLLoader;
import javafx.scene.layout.GridPane;
@ -12,7 +12,7 @@ import java.io.IOException;
*/
public class StatusLogLoader {
private static final String STATUS_LOG_FXML_PATH = "../fxml/status_log.fxml";
private static final String STATUS_LOG_FXML_PATH = "/view/dashboard/status_log.fxml";
private Stage currentStage;
private FXMLLoader fxmlLoader;

View File

@ -1,4 +1,4 @@
package polling_station_dashboard.statusLog.java;
package polling_station_dashboard.statusLog;
import javafx.event.Event;
import javafx.event.EventHandler;

View File

@ -1,8 +1,8 @@
package set_up_complete.java;
package set_up_complete;
import javafx.fxml.FXML;
import javafx.stage.Stage;
import polling_station_dashboard.java.PollingStationDashboardLoader;
import polling_station_dashboard.PollingStationDashboardLoader;
import java.io.IOException;

View File

@ -1,4 +1,4 @@
package set_up_complete.java;
package set_up_complete;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
@ -12,7 +12,7 @@ import java.io.IOException;
* SetUpCompleteLoader represent the end state of subscription to bulletin board
*/
public class SetUpCompleteLoader {
private static final String SET_UP_COMPLETE_FXML_PATH = "../fxml/set_up_complete.fxml";
private static final String SET_UP_COMPLETE_FXML_PATH = "/view/setup/set_up_complete.fxml";
private Stage currentStage;

View File

@ -1,4 +1,4 @@
package splash_screen_on_boot.java;
package splash_screen_on_boot;
import javafx.application.Application;
import javafx.stage.Stage;
@ -12,7 +12,7 @@ public class Main extends Application {
@Override
public void start(Stage primaryStage) throws Exception{
new SplashScreenOnBootLoader(primaryStage);
primaryStage.setTitle("Meerkat");
primaryStage.setTitle("Meerkat Polling Station");
primaryStage.show();
}

View File

@ -1,13 +1,15 @@
package splash_screen_on_boot.java;
package splash_screen_on_boot;
import javafx.concurrent.Task;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
import uploading_to_bulletin_board.java.UploadingToBulletinBoardLoader;
import uploading_to_bulletin_board.UploadingToBulletinBoardLoader;
import java.io.IOException;
import java.net.URL;
import java.util.ResourceBundle;
/**
* Created by Vladimir Eliezer Tokarev on 28/05/2016.
@ -15,14 +17,14 @@ import java.io.IOException;
*/
public class SplashScreenOnBootLoader {
private static final String SPALSH_SCREEN_ON_BOOT_FXML_PATH = "../fxml/spalsh_screen_on_boot.fxml";
private static final String SPLASH_SCREEN_ON_BOOT_FXML_PATH = "/view/splash/splash_screen_on_boot.fxml";
private static final int TWO_SECONDS_TIMEOUT_IN_MILLISECONDS = 1000;
private Stage currentStage;
public SplashScreenOnBootLoader(Stage primaryStage) throws IOException
{
Parent splashScreenOnBootRoot = FXMLLoader.load(getClass().getResource(SPALSH_SCREEN_ON_BOOT_FXML_PATH));
Parent splashScreenOnBootRoot = FXMLLoader.load(getClass().getResource(SPLASH_SCREEN_ON_BOOT_FXML_PATH));
currentStage = primaryStage;
currentStage.setScene(new Scene(splashScreenOnBootRoot, 565, 365));
IntroSleep();

View File

@ -1,8 +1,8 @@
package uploading_to_bulletin_board.java;
package uploading_to_bulletin_board;
import javafx.fxml.FXML;
import javafx.stage.Stage;
import set_up_complete.java.SetUpCompleteLoader;
import set_up_complete.SetUpCompleteLoader;
import java.io.IOException;

View File

@ -1,4 +1,4 @@
package uploading_to_bulletin_board.java;
package uploading_to_bulletin_board;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
@ -12,7 +12,7 @@ import java.io.IOException;
* UploadingToBulletinBoardLoader uploads the given code to the bulletin board
*/
public class UploadingToBulletinBoardLoader {
private static final String UPLOADING_TO_BULLETIN_BOARD_FXM_PATH = "../fxml/uploading_to_bulletin_board.fxml";
private static final String UPLOADING_TO_BULLETIN_BOARD_FXM_PATH = "/view/uploading/uploading_to_bulletin_board.fxml";
private Stage currentStage;

View File

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 371 B

After

Width:  |  Height:  |  Size: 371 B

View File

Before

Width:  |  Height:  |  Size: 407 B

After

Width:  |  Height:  |  Size: 407 B

View File

Before

Width:  |  Height:  |  Size: 384 B

After

Width:  |  Height:  |  Size: 384 B

View File

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

Before

Width:  |  Height:  |  Size: 996 B

After

Width:  |  Height:  |  Size: 996 B

View File

Before

Width:  |  Height:  |  Size: 930 B

After

Width:  |  Height:  |  Size: 930 B

View File

@ -6,7 +6,7 @@
<?import javafx.scene.layout.*?>
<GridPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="250.0" prefWidth="753.0"
xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="polling_station_dashboard.search.addVoter.java.AddVoterController">
xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="polling_station_dashboard.search.addVoter.AddVoterController">
<columnConstraints>
<ColumnConstraints />
<ColumnConstraints />
@ -102,7 +102,7 @@
<center>
<ImageView BorderPane.alignment="CENTER">
<image>
<Image url="@../../../../pictures/profile.png" />
<Image url="@/images/profile.png" />
</image>
</ImageView>
</center>

View File

@ -6,7 +6,7 @@
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<GridPane alignment="center" hgap="10" vgap="10" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="polling_station_dashboard.java.PollingStationDashboardController">
<GridPane alignment="center" hgap="10" vgap="10" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="polling_station_dashboard.PollingStationDashboardController">
<columnConstraints>
<ColumnConstraints />
<ColumnConstraints />
@ -32,7 +32,7 @@
<left>
<ImageView fitHeight="65.0" fitWidth="66.0" BorderPane.alignment="CENTER">
<image>
<Image url="@../../pictures/barcode.png" />
<Image url="@/images/barcode.png" />
</image>
</ImageView>
</left>

View File

@ -6,7 +6,7 @@
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<GridPane fx:id="SettingsGridPane" prefHeight="70.0" prefWidth="850.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="polling_station_dashboard.settings.java.settingsController">
<GridPane fx:id="SettingsGridPane" prefHeight="70.0" prefWidth="850.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="polling_station_dashboard.settings.settingsController">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="177.0" minWidth="10.0" prefWidth="177.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="172.0" minWidth="10.0" prefWidth="144.0" />
@ -32,7 +32,7 @@
<right>
<ImageView BorderPane.alignment="CENTER">
<image>
<Image url="@../../../pictures/bullets.png" />
<Image url="@/images/bullets.png" />
</image>
</ImageView>
</right>

View File

@ -7,7 +7,7 @@
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<GridPane fx:id="StatusLogGridPane" prefHeight="615.0" prefWidth="400.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="polling_station_dashboard.statusLog.java.StatusLogController">
<GridPane fx:id="StatusLogGridPane" prefHeight="615.0" prefWidth="400.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="polling_station_dashboard.statusLog.StatusLogController">
<children>
<BorderPane prefHeight="200.0" prefWidth="200.0">
<center>
@ -16,7 +16,7 @@
<left>
<ImageView BorderPane.alignment="CENTER">
<image>
<Image url="@../../../pictures/blacktriangle.png" />
<Image url="@/images/blacktriangle.png" />
</image>
<BorderPane.margin>
<Insets left="10.0" />

View File

@ -6,7 +6,7 @@
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<GridPane fx:id="SubmitVoterPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="250.0" prefWidth="753.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="polling_station_dashboard.search.submitVoter.java.SubmitVoterController">
<GridPane fx:id="SubmitVoterPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="250.0" prefWidth="753.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="polling_station_dashboard.search.submitVoter.SubmitVoterController">
<columnConstraints>
<ColumnConstraints />
<ColumnConstraints />
@ -101,7 +101,7 @@
<center>
<ImageView BorderPane.alignment="CENTER">
<image>
<Image url="@../../../../pictures/profile.png" />
<Image url="@/images/profile.png" />
</image>
</ImageView>
</center>

View File

@ -7,7 +7,7 @@
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<GridPane alignment="center" hgap="10" prefHeight="267.0" prefWidth="541.0" vgap="10" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="set_up_complete.java.SetUpCompleteController">
<GridPane alignment="center" hgap="10" prefHeight="267.0" prefWidth="541.0" vgap="10" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="set_up_complete.SetUpCompleteController">
<columnConstraints>
<ColumnConstraints />
<ColumnConstraints />

View File

@ -54,7 +54,7 @@
<center>
<ImageView fx:id="LoadingGif" BorderPane.alignment="CENTER">
<image>
<Image url="@../../gifs/loadingGif.gif" />
<Image url="@/images/loadingGif.gif" />
</image>
</ImageView>
</center>

View File

@ -13,7 +13,7 @@
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Label?>
<GridPane alignment="center" hgap="10" vgap="10" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="uploading_to_bulletin_board.java.UploadingToBulletinBoardController">
<GridPane alignment="center" hgap="10" vgap="10" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="uploading_to_bulletin_board.UploadingToBulletinBoardController">
<columnConstraints>
<ColumnConstraints />
<ColumnConstraints />
@ -134,7 +134,7 @@
<top>
<ImageView fx:id="LoadingGif" BorderPane.alignment="CENTER">
<image>
<Image url="@../../gifs/VerticalLoading.gif" />
<Image url="@/images/VerticalLoading.gif" />
</image>
</ImageView>
</top>

View File

@ -6,4 +6,5 @@ include 'polling-station'
include 'restful-api-common'
include 'bulletin-board-client'
include 'distributed-key-generation'
include 'polling-station-gui'