Archived
0

добавился счетчик ля подсчета гонорара

This commit is contained in:
2018-06-03 13:13:32 +03:00
parent 34cb7adc05
commit d49bbbf9ea
3 changed files with 17 additions and 13 deletions

View File

@@ -25,7 +25,7 @@ public class Main extends Application {
private Scene loadScene(Stage stage) throws IOException { private Scene loadScene(Stage stage) throws IOException {
FXMLLoader loader = new FXMLLoader(getClass().getResource("single_layout.fxml")); FXMLLoader loader = new FXMLLoader(getClass().getResource("single_layout.fxml"));
Scene scene = new Scene(loader.load(), 350-10, 174-10); Scene scene = new Scene(loader.load(), 350-10, 203-10);
MainController controller = loader.getController(); MainController controller = loader.getController();
controller.setStage(stage); controller.setStage(stage);
return scene; return scene;

View File

@@ -2,10 +2,7 @@ package ru.dmitriymx.corrector1s.gui;
import javafx.event.ActionEvent; import javafx.event.ActionEvent;
import javafx.fxml.FXML; import javafx.fxml.FXML;
import javafx.scene.control.Button; import javafx.scene.control.*;
import javafx.scene.control.CheckBox;
import javafx.scene.control.ProgressIndicator;
import javafx.scene.control.TextField;
import javafx.scene.layout.Pane; import javafx.scene.layout.Pane;
import javafx.stage.FileChooser; import javafx.stage.FileChooser;
import javafx.stage.Stage; import javafx.stage.Stage;
@@ -13,7 +10,6 @@ import javafx.stage.Stage;
import java.io.File; import java.io.File;
import java.nio.file.Files; import java.nio.file.Files;
import java.nio.file.Paths; import java.nio.file.Paths;
import java.util.Timer;
public class MainController { public class MainController {
private Stage stage; private Stage stage;
@@ -35,6 +31,9 @@ public class MainController {
private ProgressIndicator progressBar; private ProgressIndicator progressBar;
@FXML @FXML
private Button btnStartCorrect; private Button btnStartCorrect;
@FXML
private Spinner<Integer> gonorar;
private SpinnerValueFactory<Integer> gonorarValueFactory = new SpinnerValueFactory.IntegerSpinnerValueFactory(1, 100, 9);
private FileChooser buildFileChooser(TextField textField) { private FileChooser buildFileChooser(TextField textField) {
FileChooser fileChooser = new FileChooser(); FileChooser fileChooser = new FileChooser();
@@ -57,6 +56,8 @@ public class MainController {
@FXML @FXML
public void initialize() { public void initialize() {
gonorar.setValueFactory(gonorarValueFactory);
saveAsCheckBox.selectedProperty().addListener((observable, oldValue, newValue) -> { saveAsCheckBox.selectedProperty().addListener((observable, oldValue, newValue) -> {
saveAsFilePath.setDisable(!newValue); saveAsFilePath.setDisable(!newValue);
btnSaveAsFilePath.setDisable(!newValue); btnSaveAsFilePath.setDisable(!newValue);

View File

@@ -5,14 +5,15 @@
<?import javafx.scene.control.CheckBox?> <?import javafx.scene.control.CheckBox?>
<?import javafx.scene.control.Label?> <?import javafx.scene.control.Label?>
<?import javafx.scene.control.ProgressIndicator?> <?import javafx.scene.control.ProgressIndicator?>
<?import javafx.scene.control.Spinner?>
<?import javafx.scene.control.TextField?> <?import javafx.scene.control.TextField?>
<?import javafx.scene.image.Image?> <?import javafx.scene.image.Image?>
<?import javafx.scene.image.ImageView?> <?import javafx.scene.image.ImageView?>
<?import javafx.scene.layout.Pane?> <?import javafx.scene.layout.Pane?>
<?import javafx.scene.text.Font?> <?import javafx.scene.text.Font?>
<Pane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="174.0" prefWidth="350.0" xmlns="http://javafx.com/javafx/8.0.121" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ru.dmitriymx.corrector1s.gui.MainController"> <Pane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="203.0" prefWidth="350.0" xmlns="http://javafx.com/javafx/8.0.111" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ru.dmitriymx.corrector1s.gui.MainController">
<Pane fx:id="mainPane" prefHeight="174.0" prefWidth="350.0"> <Pane fx:id="mainPane" prefHeight="203.0" prefWidth="350.0">
<padding> <padding>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" /> <Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
</padding> </padding>
@@ -22,16 +23,18 @@
<Label layoutX="132.0" layoutY="10.0" text="Исходный файл" /> <Label layoutX="132.0" layoutY="10.0" text="Исходный файл" />
<TextField fx:id="sourceFilePath" layoutX="132.0" layoutY="32.0" prefHeight="25.0" prefWidth="178.0" /> <TextField fx:id="sourceFilePath" layoutX="132.0" layoutY="32.0" prefHeight="25.0" prefWidth="178.0" />
<Button fx:id="btnSourceFilePath" layoutX="313.0" layoutY="32.0" mnemonicParsing="false" text="..." /> <Button fx:id="btnSourceFilePath" layoutX="313.0" layoutY="32.0" mnemonicParsing="false" text="..." />
<CheckBox fx:id="saveAsCheckBox" layoutX="133.0" layoutY="67.0" mnemonicParsing="false" text="Сохранить как..." /> <CheckBox fx:id="saveAsCheckBox" layoutX="132.0" layoutY="95.0" mnemonicParsing="false" text="Сохранить как..." />
<TextField fx:id="saveAsFilePath" disable="true" layoutX="132.0" layoutY="89.0" prefHeight="25.0" prefWidth="178.0" /> <TextField fx:id="saveAsFilePath" disable="true" layoutX="131.0" layoutY="117.0" prefHeight="25.0" prefWidth="178.0" />
<Button fx:id="btnSaveAsFilePath" disable="true" layoutX="313.0" layoutY="89.0" mnemonicParsing="false" text="..." /> <Button fx:id="btnSaveAsFilePath" disable="true" layoutX="312.0" layoutY="117.0" mnemonicParsing="false" text="..." />
<Button fx:id="btnStartCorrect" layoutX="14.0" layoutY="134.0" mnemonicParsing="false" prefHeight="25.0" prefWidth="324.0" text="Преобразовать"> <Button fx:id="btnStartCorrect" layoutX="13.0" layoutY="162.0" mnemonicParsing="false" prefHeight="25.0" prefWidth="324.0" text="Преобразовать">
<font> <font>
<Font name="System Bold" size="12.0" /> <Font name="System Bold" size="12.0" />
</font> </font>
</Button> </Button>
<Label layoutX="132.0" layoutY="66.0" text="Гонорар" />
<Spinner fx:id="gonorar" editable="true" layoutX="186.0" layoutY="62.0" prefHeight="25.0" prefWidth="77.0" />
</Pane> </Pane>
<Pane fx:id="waitPane" prefHeight="174.0" prefWidth="350.0" visible="false"> <Pane fx:id="waitPane" prefHeight="203.0" prefWidth="350.0" visible="false">
<ProgressIndicator fx:id="progressBar" layoutX="157.0" layoutY="62.0" prefHeight="50.0" prefWidth="36.0" progress="1.0" /> <ProgressIndicator fx:id="progressBar" layoutX="157.0" layoutY="62.0" prefHeight="50.0" prefWidth="36.0" progress="1.0" />
</Pane> </Pane>
</Pane> </Pane>