Added the add voter panel to the PSD
The ad voter panel gives the ability to add new votervoting-station-gui
parent
3766478ffa
commit
9825b3409b
|
@ -25,7 +25,7 @@
|
|||
<children>
|
||||
<BorderPane prefHeight="102.0" prefWidth="714.0">
|
||||
<right>
|
||||
<Button mnemonicParsing="false" onMousePressed="#SearchTrigered" prefHeight="50.0" prefWidth="112.0" text="Search" BorderPane.alignment="CENTER" />
|
||||
<Button fx:id="SearchButton" mnemonicParsing="false" onMousePressed="#SearchTrigered" prefHeight="50.0" prefWidth="112.0" text="Search" BorderPane.alignment="CENTER" />
|
||||
</right>
|
||||
<bottom>
|
||||
<Separator prefWidth="200.0" BorderPane.alignment="CENTER" />
|
||||
|
@ -67,16 +67,17 @@
|
|||
<Separator orientation="VERTICAL" prefHeight="200.0" BorderPane.alignment="CENTER" />
|
||||
</right>
|
||||
</BorderPane>
|
||||
<Pane fx:id="StatusLog" onMousePressed="#OnStatusLogPressed" layoutX="788.0" layoutY="12.0" prefHeight="544.0" prefWidth="42.0">
|
||||
<Pane fx:id="StatusLog" layoutX="788.0" layoutY="12.0" onMousePressed="#OnStatusLogPressed" prefHeight="544.0" prefWidth="42.0">
|
||||
<children>
|
||||
<Button fx:id="StatusLogButton" layoutX="-251.0" layoutY="250.0" mnemonicParsing="false" onMousePressed="#OnStatusLogPressed" prefHeight="43.0" prefWidth="545.0" rotate="-90.0" text="Status Log" />
|
||||
</children>
|
||||
</Pane>
|
||||
<Pane fx:id="Settings" onMousePressed="#OnSettingsPressed" layoutX="20" layoutY="557.0" prefHeight="34.0" prefWidth="830.0">
|
||||
<Pane fx:id="Settings" layoutX="20" layoutY="557.0" onMousePressed="#OnSettingsPressed" prefHeight="34.0" prefWidth="830.0">
|
||||
<children>
|
||||
<Button fx:id="SettingsButton" mnemonicParsing="false" onMousePressed="#OnSettingsPressed" prefHeight="34.0" prefWidth="790.0" text="Settings" />
|
||||
</children>
|
||||
</Pane>
|
||||
<Pane fx:id="AddEditPane" layoutX="17.0" layoutY="120.0" prefHeight="428.0" prefWidth="749.0" />
|
||||
</children>
|
||||
</AnchorPane>
|
||||
</children>
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package polling_station_dashboard.java;
|
||||
|
||||
import javafx.stage.Stage;
|
||||
import polling_station_dashboard.search.SearchHandler;
|
||||
import polling_station_dashboard.search.addVoter.java.AddVoterLoader;
|
||||
import polling_station_dashboard.settings.java.SettingsVisualUpdater;
|
||||
import polling_station_dashboard.settings.java.settingsLoader;
|
||||
import polling_station_dashboard.statusLog.java.StatusLogLoader;
|
||||
|
@ -34,6 +36,10 @@ public class EventHandlerMapper {
|
|||
new StatusLogVisualUpdater(statusLogLoader.GetStatusLogInstance(), primaryStage);
|
||||
map.Add("StatusLogButton", statusLogVisualUpdater);
|
||||
map.Add("StatusLog", statusLogVisualUpdater);
|
||||
|
||||
// map add voter to search button triggered
|
||||
SearchHandler searchHandler = new SearchHandler(primaryStage);
|
||||
map.Add("SearchButton", searchHandler);
|
||||
return map;
|
||||
}
|
||||
|
||||
|
|
|
@ -2,19 +2,37 @@ package polling_station_dashboard.search;
|
|||
|
||||
import javafx.event.Event;
|
||||
import javafx.event.EventHandler;
|
||||
import javafx.stage.Stage;
|
||||
import polling_station_dashboard.search.VotersFetcher.VotersFetcher;
|
||||
import polling_station_dashboard.search.addVoter.java.AddVoterLoader;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by Vladimir Eliezer Tokarev on 12/06/2016.
|
||||
* SearchHandler trying to fetch wanted users by given strings (VotersFetcher) and then
|
||||
* Starts the eddit/add panel based on what the VotersFetcher Have fetched.
|
||||
*/
|
||||
public class SearchHandler implements EventHandler {
|
||||
|
||||
public class SearchHandler implements EventHandler, VotersFetcher {
|
||||
|
||||
private Stage currentStage;
|
||||
|
||||
public SearchHandler(Stage primaryStage){
|
||||
this.currentStage = primaryStage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handle(Event event) {
|
||||
try {
|
||||
AddVoterLoader addVoterLoader = new AddVoterLoader(currentStage);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object FetchVoters(List<String> filters) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,5 +8,5 @@ import java.util.List;
|
|||
*/
|
||||
public interface VotersFetcher {
|
||||
|
||||
Object FectchVoters(List<String> filters);
|
||||
Object FetchVoters(List<String> filters);
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<?import java.lang.*?>
|
||||
<?import javafx.scene.layout.*?>
|
||||
|
||||
<GridPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="250.0" prefWidth="783.0" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/8">
|
||||
<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">
|
||||
<columnConstraints>
|
||||
<ColumnConstraints />
|
||||
<ColumnConstraints />
|
||||
|
@ -90,7 +90,11 @@
|
|||
<ComboBox prefWidth="150.0" promptText="No" GridPane.columnIndex="1" GridPane.rowIndex="1" />
|
||||
<ComboBox prefWidth="150.0" promptText="Provisional" GridPane.columnIndex="1" GridPane.rowIndex="2" />
|
||||
<ComboBox prefWidth="150.0" promptText="IDC Maths" GridPane.columnIndex="1" GridPane.rowIndex="3" />
|
||||
<TextArea prefHeight="200.0" prefWidth="200.0" text="42342342" GridPane.columnIndex="1" />
|
||||
<BorderPane minHeight="40.0" prefHeight="40.0" prefWidth="200.0" GridPane.columnIndex="1">
|
||||
<center>
|
||||
<TextField text="434575845" BorderPane.alignment="CENTER" />
|
||||
</center>
|
||||
</BorderPane>
|
||||
</children>
|
||||
</GridPane>
|
||||
</children>
|
||||
|
@ -99,7 +103,7 @@
|
|||
<center>
|
||||
<ImageView BorderPane.alignment="CENTER">
|
||||
<image>
|
||||
<Image url="@../../../pictures/profile.png" />
|
||||
<Image url="@../../../../pictures/profile.png" />
|
||||
</image>
|
||||
</ImageView>
|
||||
</center>
|
|
@ -0,0 +1,7 @@
|
|||
package polling_station_dashboard.search.addVoter.java;
|
||||
|
||||
/**
|
||||
* Created by Vladimir Eliezer Tokarev on 11/06/2016.
|
||||
*/
|
||||
public class AddVoterController {
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package polling_station_dashboard.search.addVoter.java;
|
||||
|
||||
import javafx.fxml.FXMLLoader;
|
||||
import javafx.scene.Parent;
|
||||
import javafx.scene.layout.Pane;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* Created by Vladimir Eliezer Tokarev on 11/06/2016.
|
||||
* This class loads the add voter panel (which adds voters)
|
||||
*/
|
||||
public class AddVoterLoader {
|
||||
|
||||
private static final String POLLING_STATION_DASHBOARD_FXML_PATH = "../fxml/add_voter.fxml";
|
||||
|
||||
private Stage currentStage;
|
||||
|
||||
public AddVoterLoader (Stage primaryStage) throws IOException
|
||||
{
|
||||
currentStage = primaryStage;
|
||||
FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource(POLLING_STATION_DASHBOARD_FXML_PATH));
|
||||
Parent root = fxmlLoader.load();
|
||||
AddVoterController controller = fxmlLoader.getController();
|
||||
|
||||
Pane addEditPane = (Pane)currentStage.getScene().lookup("#AddEditPane");
|
||||
addEditPane.getChildren().add(root);
|
||||
}
|
||||
}
|
|
@ -1,7 +0,0 @@
|
|||
package polling_station_dashboard.search.votersEdit.java;
|
||||
|
||||
/**
|
||||
* Created by Vladimir Eliezer Tokarev on 11/06/2016.
|
||||
*/
|
||||
public class VoterEditController {
|
||||
}
|
|
@ -1,7 +0,0 @@
|
|||
package polling_station_dashboard.search.votersEdit.java;
|
||||
|
||||
/**
|
||||
* Created by Vladimir Eliezer Tokarev on 11/06/2016.
|
||||
*/
|
||||
public class VoterEditLoader {
|
||||
}
|
Loading…
Reference in New Issue