Add 'manage schedule externally' setting
This commit is contained in:
parent
5e362673d4
commit
b4ade494d0
@ -7,8 +7,10 @@ import java.io.File;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
|
import javafx.beans.property.BooleanProperty;
|
||||||
import javafx.beans.property.IntegerProperty;
|
import javafx.beans.property.IntegerProperty;
|
||||||
import javafx.beans.property.ObjectProperty;
|
import javafx.beans.property.ObjectProperty;
|
||||||
|
import javafx.beans.property.SimpleBooleanProperty;
|
||||||
import javafx.beans.property.SimpleIntegerProperty;
|
import javafx.beans.property.SimpleIntegerProperty;
|
||||||
import javafx.beans.property.SimpleObjectProperty;
|
import javafx.beans.property.SimpleObjectProperty;
|
||||||
import javafx.beans.property.SimpleStringProperty;
|
import javafx.beans.property.SimpleStringProperty;
|
||||||
@ -17,6 +19,7 @@ import javafx.collections.FXCollections;
|
|||||||
import javafx.collections.ObservableList;
|
import javafx.collections.ObservableList;
|
||||||
import javafx.event.Event;
|
import javafx.event.Event;
|
||||||
import javafx.fxml.FXML;
|
import javafx.fxml.FXML;
|
||||||
|
import javafx.scene.control.CheckBox;
|
||||||
import javafx.scene.control.DatePicker;
|
import javafx.scene.control.DatePicker;
|
||||||
import javafx.scene.control.ListView;
|
import javafx.scene.control.ListView;
|
||||||
import javafx.scene.control.RadioButton;
|
import javafx.scene.control.RadioButton;
|
||||||
@ -25,12 +28,15 @@ import javafx.scene.control.SpinnerValueFactory;
|
|||||||
import javafx.scene.control.TextField;
|
import javafx.scene.control.TextField;
|
||||||
import javafx.scene.control.TextInputDialog;
|
import javafx.scene.control.TextInputDialog;
|
||||||
import javafx.scene.control.ToggleGroup;
|
import javafx.scene.control.ToggleGroup;
|
||||||
|
import javafx.scene.input.KeyEvent;
|
||||||
|
import javafx.scene.input.KeyCode;
|
||||||
import javafx.scene.Node;
|
import javafx.scene.Node;
|
||||||
import javafx.stage.Stage;
|
import javafx.stage.Stage;
|
||||||
|
|
||||||
public class MainSettingsController {
|
public class MainSettingsController {
|
||||||
private IntegerProperty digitsPerGroup = new SimpleIntegerProperty();
|
private IntegerProperty digitsPerGroup = new SimpleIntegerProperty();
|
||||||
private StringProperty externalProgramCommand = new SimpleStringProperty();
|
private StringProperty externalProgramCommand = new SimpleStringProperty();
|
||||||
|
private BooleanProperty manageScheduleExternally = new SimpleBooleanProperty();
|
||||||
private IntegerProperty messageLength = new SimpleIntegerProperty();
|
private IntegerProperty messageLength = new SimpleIntegerProperty();
|
||||||
private ObjectProperty<StationSettings.MessageMethod> messageMethod = new SimpleObjectProperty<>();
|
private ObjectProperty<StationSettings.MessageMethod> messageMethod = new SimpleObjectProperty<>();
|
||||||
private ObjectProperty<StationSettings.MessagePeriod> messagePeriod = new SimpleObjectProperty<>();
|
private ObjectProperty<StationSettings.MessagePeriod> messagePeriod = new SimpleObjectProperty<>();
|
||||||
@ -56,6 +62,9 @@ public class MainSettingsController {
|
|||||||
@FXML
|
@FXML
|
||||||
private TextField externalProgramCommandField;
|
private TextField externalProgramCommandField;
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
private CheckBox manageScheduleExternallyCheckBox;
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
private Spinner<Integer> messageLengthSpinner;
|
private Spinner<Integer> messageLengthSpinner;
|
||||||
|
|
||||||
@ -100,6 +109,7 @@ public class MainSettingsController {
|
|||||||
@FXML
|
@FXML
|
||||||
private void initialize() {
|
private void initialize() {
|
||||||
externalProgramCommandField.textProperty().bindBidirectional(externalProgramCommand);
|
externalProgramCommandField.textProperty().bindBidirectional(externalProgramCommand);
|
||||||
|
manageScheduleExternallyCheckBox.selectedProperty().bindBidirectional(manageScheduleExternally);
|
||||||
stationNameField.textProperty().bindBidirectional(stationName);
|
stationNameField.textProperty().bindBidirectional(stationName);
|
||||||
stationAddressField.textProperty().bindBidirectional(stationAddress);
|
stationAddressField.textProperty().bindBidirectional(stationAddress);
|
||||||
passwordField.textProperty().bindBidirectional(password);
|
passwordField.textProperty().bindBidirectional(password);
|
||||||
@ -198,6 +208,7 @@ public class MainSettingsController {
|
|||||||
settings.setAddress(stationAddress.get());
|
settings.setAddress(stationAddress.get());
|
||||||
settings.setDigitsPerGroup(digitsPerGroup.get());
|
settings.setDigitsPerGroup(digitsPerGroup.get());
|
||||||
settings.setExternalProgramCommand(externalProgramCommand.get());
|
settings.setExternalProgramCommand(externalProgramCommand.get());
|
||||||
|
settings.setManageScheduleExternally(manageScheduleExternally.get());
|
||||||
settings.setMessageLength(messageLength.get());
|
settings.setMessageLength(messageLength.get());
|
||||||
settings.setMessageMethod(messageMethod.get());
|
settings.setMessageMethod(messageMethod.get());
|
||||||
settings.setMessagePeriod(messagePeriod.get());
|
settings.setMessagePeriod(messagePeriod.get());
|
||||||
@ -230,6 +241,7 @@ public class MainSettingsController {
|
|||||||
stationName.set(settings.getName());
|
stationName.set(settings.getName());
|
||||||
digitsPerGroup.set(settings.getDigitsPerGroup());
|
digitsPerGroup.set(settings.getDigitsPerGroup());
|
||||||
externalProgramCommand.set(settings.getExternalProgramCommand());
|
externalProgramCommand.set(settings.getExternalProgramCommand());
|
||||||
|
manageScheduleExternally.set(settings.getManageScheduleExternally());
|
||||||
messageLength.set(settings.getMessageLength());
|
messageLength.set(settings.getMessageLength());
|
||||||
messageMethod.set(settings.getMessageMethod());
|
messageMethod.set(settings.getMessageMethod());
|
||||||
messagePeriod.set(settings.getMessagePeriod());
|
messagePeriod.set(settings.getMessagePeriod());
|
||||||
|
@ -132,7 +132,7 @@
|
|||||||
</Label>
|
</Label>
|
||||||
<AnchorPane prefHeight="152.0" prefWidth="578.0">
|
<AnchorPane prefHeight="152.0" prefWidth="578.0">
|
||||||
<children>
|
<children>
|
||||||
<CheckBox layoutX="395.0" mnemonicParsing="false" text="Manage schedule externally" AnchorPane.rightAnchor="14.5" />
|
<CheckBox fx:id="manageScheduleExternallyCheckBox" layoutX="395.0" mnemonicParsing="false" text="Manage schedule externally" AnchorPane.rightAnchor="14.5" />
|
||||||
<RadioButton fx:id="dailyRadioButton" layoutX="14.0" layoutY="8.0" mnemonicParsing="false" text="Daily">
|
<RadioButton fx:id="dailyRadioButton" layoutX="14.0" layoutY="8.0" mnemonicParsing="false" text="Daily">
|
||||||
<toggleGroup>
|
<toggleGroup>
|
||||||
<ToggleGroup fx:id="messagePeriodGroup" />
|
<ToggleGroup fx:id="messagePeriodGroup" />
|
||||||
|
@ -7,6 +7,7 @@ public class StationSettings {
|
|||||||
private String address;
|
private String address;
|
||||||
private int digitsPerGroup;
|
private int digitsPerGroup;
|
||||||
private String externalProgramCommand;
|
private String externalProgramCommand;
|
||||||
|
private boolean manageScheduleExternally;
|
||||||
private int messageLength;
|
private int messageLength;
|
||||||
private MessageMethod messageMethod;
|
private MessageMethod messageMethod;
|
||||||
private MessagePeriod messagePeriod;
|
private MessagePeriod messagePeriod;
|
||||||
@ -61,6 +62,14 @@ public class StationSettings {
|
|||||||
externalProgramCommand = newExternalProgramCommand;
|
externalProgramCommand = newExternalProgramCommand;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean getManageScheduleExternally() {
|
||||||
|
return manageScheduleExternally;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setManageScheduleExternally(boolean newManageScheduleExternally) {
|
||||||
|
manageScheduleExternally = newManageScheduleExternally;
|
||||||
|
}
|
||||||
|
|
||||||
public int getMessageLength() {
|
public int getMessageLength() {
|
||||||
return messageLength;
|
return messageLength;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user