2016-05-28 10:50:22 -04:00
|
|
|
package polling_station_dashboard.java;
|
|
|
|
|
2016-06-04 06:01:06 -04:00
|
|
|
import javafx.fxml.FXML;
|
|
|
|
import javafx.scene.layout.Pane;
|
2016-05-28 11:00:40 -04:00
|
|
|
import javafx.stage.Stage;
|
|
|
|
|
2016-05-28 10:50:22 -04:00
|
|
|
/**
|
|
|
|
* Created by Vladimir Eliezer Tokarev on 28/05/2016.
|
|
|
|
*/
|
|
|
|
public class PollingStationDashboardController {
|
2016-05-28 11:00:40 -04:00
|
|
|
|
|
|
|
private Stage currentStage;
|
|
|
|
|
2016-06-04 06:01:06 -04:00
|
|
|
private boolean statusLogOpened = false;
|
|
|
|
|
2016-05-28 11:00:40 -04:00
|
|
|
public void SetStage(Stage primaryStage)
|
|
|
|
{
|
|
|
|
this.currentStage = primaryStage;
|
|
|
|
}
|
2016-06-04 06:01:06 -04:00
|
|
|
|
|
|
|
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();
|
|
|
|
}
|
2016-05-28 10:50:22 -04:00
|
|
|
}
|