Created Status Log
Status log is inchage of representing the progress other people voting process.voting-station-gui
parent
c24c6bbbd5
commit
b0c4fff11a
|
@ -0,0 +1,65 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!-- Created By Vladimir Eliezer Tokarev !-->
|
||||
|
||||
<?import java.lang.*?>
|
||||
<?import javafx.scene.image.*?>
|
||||
<?import javafx.scene.control.*?>
|
||||
<?import javafx.scene.layout.*?>
|
||||
|
||||
<GridPane prefHeight="615.0" prefWidth="400.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1">
|
||||
<children>
|
||||
<BorderPane prefHeight="200.0" prefWidth="200.0">
|
||||
<center>
|
||||
<Label text="Status Log" BorderPane.alignment="CENTER" />
|
||||
</center>
|
||||
</BorderPane>
|
||||
<Accordion GridPane.rowIndex="1">
|
||||
<panes>
|
||||
<TitledPane animated="false" text="Voters In Progress">
|
||||
<content>
|
||||
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0">
|
||||
<children>
|
||||
<AnchorPane prefHeight="486.0" prefWidth="400.0" />
|
||||
<ScrollPane prefHeight="488.0" prefWidth="400.0" />
|
||||
</children>
|
||||
</AnchorPane>
|
||||
</content>
|
||||
</TitledPane>
|
||||
<TitledPane animated="false" text="Pending Upload">
|
||||
<content>
|
||||
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0">
|
||||
<children>
|
||||
<ScrollPane prefHeight="485.0" prefWidth="400.0">
|
||||
<content>
|
||||
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="200.0" prefWidth="200.0" />
|
||||
</content>
|
||||
</ScrollPane>
|
||||
</children>
|
||||
</AnchorPane>
|
||||
</content>
|
||||
</TitledPane>
|
||||
<TitledPane animated="false" text="Completed">
|
||||
<content>
|
||||
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0">
|
||||
<children>
|
||||
<ScrollPane prefHeight="486.0" prefWidth="400.0">
|
||||
<content>
|
||||
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="200.0" prefWidth="200.0" />
|
||||
</content>
|
||||
</ScrollPane>
|
||||
</children>
|
||||
</AnchorPane>
|
||||
</content>
|
||||
</TitledPane>
|
||||
</panes>
|
||||
</Accordion>
|
||||
</children>
|
||||
<columnConstraints>
|
||||
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
||||
</columnConstraints>
|
||||
<rowConstraints>
|
||||
<RowConstraints maxHeight="202.0" minHeight="0.0" prefHeight="54.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints maxHeight="561.0" minHeight="10.0" prefHeight="561.0" vgrow="SOMETIMES" />
|
||||
</rowConstraints>
|
||||
</GridPane>
|
|
@ -0,0 +1,18 @@
|
|||
package polling_station_dashboard.StatusLog.java;
|
||||
|
||||
import javafx.stage.Stage;
|
||||
|
||||
/**
|
||||
* Created by Vladimir Eliezer Tokarev on 04/06/2016.
|
||||
* This class represent status of other users progress in the voting process
|
||||
*/
|
||||
public class StatusLogController {
|
||||
|
||||
private Stage primaryStage;
|
||||
|
||||
|
||||
public void SetStage(Stage stage){
|
||||
primaryStage = stage;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
package polling_station_dashboard.StatusLog.java;
|
||||
|
||||
import javafx.fxml.FXMLLoader;
|
||||
import javafx.scene.layout.GridPane;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* Created by Vladimir Eliezer Tokarev on 04/06/2016.
|
||||
* Loads the status log object
|
||||
*/
|
||||
public class StatusLogLoader {
|
||||
|
||||
private static final String POLLING_STATION_DASHBOARD_FXML_PATH = "../fxml/status_log.fxml";
|
||||
|
||||
private Stage currentStage;
|
||||
private FXMLLoader fxmlLoader;
|
||||
|
||||
public StatusLogLoader (Stage primaryStage) throws IOException
|
||||
{
|
||||
currentStage = primaryStage;
|
||||
fxmlLoader = new FXMLLoader(getClass().getResource(POLLING_STATION_DASHBOARD_FXML_PATH));
|
||||
}
|
||||
|
||||
private GridPane GetStatusLogInstance() throws IOException {
|
||||
GridPane StatusLog = (GridPane) fxmlLoader.load();
|
||||
StatusLogController controller = fxmlLoader.getController();
|
||||
controller.SetStage(currentStage);
|
||||
|
||||
return StatusLog;
|
||||
}
|
||||
}
|
|
@ -67,9 +67,9 @@
|
|||
<Separator orientation="VERTICAL" prefHeight="200.0" BorderPane.alignment="CENTER" />
|
||||
</right>
|
||||
</BorderPane>
|
||||
<Pane layoutX="788.0" layoutY="12.0" prefHeight="544.0" prefWidth="42.0">
|
||||
<Pane fx:id="StatusLog" layoutX="788.0" layoutY="12.0" prefHeight="544.0" prefWidth="42.0">
|
||||
<children>
|
||||
<Button layoutX="-251.0" layoutY="250.0" mnemonicParsing="false" prefHeight="43.0" prefWidth="545.0" rotate="-90.0" text="Status Log" />
|
||||
<Button 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 layoutY="557.0" prefHeight="34.0" prefWidth="830.0">
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package polling_station_dashboard.java;
|
||||
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.layout.Pane;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
/**
|
||||
|
@ -9,8 +11,32 @@ public class PollingStationDashboardController {
|
|||
|
||||
private Stage currentStage;
|
||||
|
||||
private boolean statusLogOpened = false;
|
||||
|
||||
public void SetStage(Stage primaryStage)
|
||||
{
|
||||
this.currentStage = primaryStage;
|
||||
}
|
||||
|
||||
private void setStatusLog(){
|
||||
if (!statusLogOpened) {
|
||||
SetStatusLogSize(400);
|
||||
}
|
||||
else {
|
||||
SetStatusLogSize(-400);
|
||||
}
|
||||
statusLogOpened = !statusLogOpened;
|
||||
}
|
||||
|
||||
private void SetStatusLogSize(int expansionWidth) {
|
||||
currentStage.setWidth(currentStage.getWidth() + expansionWidth);
|
||||
Pane statusLogGrid = (Pane) currentStage.getScene().lookup("#StatusLog");
|
||||
statusLogGrid.setPrefWidth(expansionWidth);
|
||||
}
|
||||
|
||||
|
||||
@FXML
|
||||
private void OnStatusLogPressed() {
|
||||
setStatusLog();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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 = "../fxml/status_log.fxml";
|
||||
|
||||
private Stage currentStage;
|
||||
|
||||
|
@ -28,8 +28,6 @@ public class PollingStationDashboardLoader {
|
|||
currentStage.setScene(new Scene(root, 850, 615));
|
||||
currentStage.show();
|
||||
|
||||
|
||||
System.out.println("heyeyeye");
|
||||
controller.SetStage(currentStage);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue