ui for hotkeys scheduler

This commit is contained in:
sirjonasxx 2019-01-30 17:20:46 +01:00
parent fc7b86dc95
commit b634d3e51a
2 changed files with 62 additions and 94 deletions

View File

@ -40,6 +40,8 @@ public class Scheduler extends SubForm {
public Button btn_save; public Button btn_save;
public Button btn_load; public Button btn_load;
public CheckBox cbx_hotkeys;
private ScheduleItem isBeingEdited = null; private ScheduleItem isBeingEdited = null;
private List<ScheduleItem> scheduleItemList = new ArrayList<>(); private List<ScheduleItem> scheduleItemList = new ArrayList<>();

View File

@ -2,6 +2,7 @@
<?import javafx.geometry.Insets?> <?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?> <?import javafx.scene.control.Button?>
<?import javafx.scene.control.CheckBox?>
<?import javafx.scene.control.Label?> <?import javafx.scene.control.Label?>
<?import javafx.scene.control.RadioButton?> <?import javafx.scene.control.RadioButton?>
<?import javafx.scene.control.ScrollPane?> <?import javafx.scene.control.ScrollPane?>
@ -12,161 +13,126 @@
<?import javafx.scene.layout.RowConstraints?> <?import javafx.scene.layout.RowConstraints?>
<?import javafx.scene.layout.VBox?> <?import javafx.scene.layout.VBox?>
<GridPane maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="262.0" prefWidth="565.0" <GridPane maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="262.0" prefWidth="565.0" xmlns="http://javafx.com/javafx/8.0.112" xmlns:fx="http://javafx.com/fxml/1" fx:controller="gearth.ui.scheduler.Scheduler">
xmlns="http://javafx.com/javafx/8.0.112" xmlns:fx="http://javafx.com/fxml/1"
fx:controller="gearth.ui.scheduler.Scheduler">
<columnConstraints> <columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="1.7976931348623157E308" minWidth="10.0" prefWidth="277.0"/> <ColumnConstraints hgrow="SOMETIMES" maxWidth="1.7976931348623157E308" minWidth="10.0" prefWidth="277.0" />
</columnConstraints> </columnConstraints>
<rowConstraints> <rowConstraints>
<RowConstraints maxHeight="220.0" minHeight="10.0" prefHeight="183.0" vgrow="SOMETIMES"/> <RowConstraints maxHeight="220.0" minHeight="10.0" prefHeight="183.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="185.0" minHeight="10.0" prefHeight="79.0" vgrow="SOMETIMES"/> <RowConstraints maxHeight="185.0" minHeight="10.0" prefHeight="79.0" vgrow="SOMETIMES" />
</rowConstraints> </rowConstraints>
<ScrollPane fx:id="scrollpane" hbarPolicy="NEVER" maxHeight="1.7976931348623157E308" <ScrollPane fx:id="scrollpane" hbarPolicy="NEVER" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" style="-fx-border-color: #888888; -fx-background: #FFFFFF; -fx-border-radius: 4px;" vbarPolicy="ALWAYS">
maxWidth="1.7976931348623157E308"
style="-fx-border-color: #888888; -fx-background: #FFFFFF; -fx-border-radius: 4px;"
vbarPolicy="ALWAYS">
<GridPane.margin> <GridPane.margin>
<Insets bottom="8.0" left="17.0" right="17.0" top="17.0"/> <Insets bottom="8.0" left="17.0" right="17.0" top="17.0" />
</GridPane.margin> </GridPane.margin>
<VBox fx:id="schedulecontainer" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308"> <VBox fx:id="schedulecontainer" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308">
<GridPane fx:id="header" gridLinesVisible="true"> <GridPane fx:id="header" gridLinesVisible="true">
<columnConstraints> <columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="163.0" minWidth="10.0" <ColumnConstraints hgrow="SOMETIMES" maxWidth="163.0" minWidth="10.0" percentWidth="10.0" prefWidth="57.0" />
percentWidth="10.0" prefWidth="57.0"/> <ColumnConstraints hgrow="SOMETIMES" maxWidth="190.0" minWidth="10.0" percentWidth="39.0" prefWidth="189.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="190.0" minWidth="10.0" <ColumnConstraints hgrow="SOMETIMES" maxWidth="118.0" minWidth="10.0" percentWidth="16.0" prefWidth="66.0" />
percentWidth="39.0" prefWidth="189.0"/> <ColumnConstraints hgrow="SOMETIMES" maxWidth="100.0" minWidth="10.0" percentWidth="18.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="118.0" minWidth="10.0" <ColumnConstraints hgrow="SOMETIMES" maxWidth="100.0" minWidth="10.0" percentWidth="15.0" prefWidth="100.0" />
percentWidth="16.0" prefWidth="66.0"/>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="100.0" minWidth="10.0"
percentWidth="18.0" prefWidth="100.0"/>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="100.0" minWidth="10.0"
percentWidth="15.0" prefWidth="100.0"/>
</columnConstraints> </columnConstraints>
<rowConstraints> <rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/> <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints> </rowConstraints>
<VBox.margin> <VBox.margin>
<Insets bottom="-2.0" left="-2.0" right="-2.0" top="-2.0"/> <Insets bottom="-2.0" left="-2.0" right="-2.0" top="-2.0" />
</VBox.margin> </VBox.margin>
<Label alignment="CENTER" maxHeight="1.7976931348623157E308" <Label alignment="CENTER" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" style="-fx-text-fill: #666666; -fx-background-color: #F7F7F7;" text="Index" />
maxWidth="1.7976931348623157E308" <Label alignment="CENTER" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" style="-fx-text-fill: #666666; -fx-background-color: #F7F7F7;" text="Packet" GridPane.columnIndex="1" />
style="-fx-text-fill: #666666; -fx-background-color: #F7F7F7;" text="Index"/> <Label alignment="CENTER" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" style="-fx-text-fill: #666666; -fx-background-color: #F7F7F7;" text="Interval" GridPane.columnIndex="2" />
<Label alignment="CENTER" maxHeight="1.7976931348623157E308" <Label alignment="CENTER" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" style="-fx-text-fill: #666666; -fx-background-color: #F7F7F7;" text="Destination" GridPane.columnIndex="3" />
maxWidth="1.7976931348623157E308" <Label alignment="CENTER" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" style="-fx-text-fill: #666666; -fx-background-color: #F7F7F7;" text="Edit" GridPane.columnIndex="4" />
style="-fx-text-fill: #666666; -fx-background-color: #F7F7F7;" text="Packet"
GridPane.columnIndex="1"/>
<Label alignment="CENTER" maxHeight="1.7976931348623157E308"
maxWidth="1.7976931348623157E308"
style="-fx-text-fill: #666666; -fx-background-color: #F7F7F7;" text="Interval"
GridPane.columnIndex="2"/>
<Label alignment="CENTER" maxHeight="1.7976931348623157E308"
maxWidth="1.7976931348623157E308"
style="-fx-text-fill: #666666; -fx-background-color: #F7F7F7;" text="Destination"
GridPane.columnIndex="3"/>
<Label alignment="CENTER" maxHeight="1.7976931348623157E308"
maxWidth="1.7976931348623157E308"
style="-fx-text-fill: #666666; -fx-background-color: #F7F7F7;" text="Edit"
GridPane.columnIndex="4"/>
</GridPane> </GridPane>
</VBox> </VBox>
</ScrollPane> </ScrollPane>
<GridPane maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" vgap="3.0" GridPane.rowIndex="1"> <GridPane maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" vgap="3.0" GridPane.rowIndex="1">
<columnConstraints> <columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="1.7976931348623157E308" minWidth="10.0" <ColumnConstraints hgrow="SOMETIMES" maxWidth="1.7976931348623157E308" minWidth="10.0" prefWidth="349.0" />
prefWidth="349.0"/>
</columnConstraints> </columnConstraints>
<rowConstraints> <rowConstraints>
<RowConstraints maxHeight="1.7976931348623157E308" minHeight="10.0" prefHeight="30.0" <RowConstraints maxHeight="1.7976931348623157E308" minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
vgrow="SOMETIMES"/> <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
</rowConstraints> </rowConstraints>
<GridPane.margin> <GridPane.margin>
<Insets bottom="10.0" left="17.0" right="17.0"/> <Insets bottom="10.0" left="17.0" right="17.0" />
</GridPane.margin> </GridPane.margin>
<GridPane hgap="7.0"> <GridPane hgap="7.0">
<columnConstraints> <columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="63.0" minWidth="63.0" prefWidth="63.0"/> <ColumnConstraints hgrow="SOMETIMES" maxWidth="63.0" minWidth="63.0" prefWidth="63.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="1.7976931348623157E308" minWidth="10.0" <ColumnConstraints hgrow="SOMETIMES" maxWidth="1.7976931348623157E308" minWidth="20.0" prefWidth="264.0" />
prefWidth="468.0"/> <ColumnConstraints hgrow="SOMETIMES" maxWidth="18.0" minWidth="18.0" prefWidth="18.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="1.7976931348623157E308" minWidth="70.0" <ColumnConstraints hgrow="SOMETIMES" maxWidth="88.0" minWidth="88.0" prefWidth="88.0" />
prefWidth="70.0"/> <ColumnConstraints hgrow="SOMETIMES" maxWidth="43.0" minWidth="43.0" prefWidth="43.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="1.7976931348623157E308" minWidth="35.0" <ColumnConstraints hgrow="SOMETIMES" maxWidth="43.0" minWidth="43.0" prefWidth="43.0" />
prefWidth="35.0"/>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="1.7976931348623157E308" minWidth="35.0"
prefWidth="35.0"/>
</columnConstraints> </columnConstraints>
<rowConstraints> <rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/> <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints> </rowConstraints>
<TextField fx:id="txt_packet" text="[0][0][0][2][0][0]" GridPane.columnIndex="1"> <TextField fx:id="txt_packet" prefHeight="25.0" prefWidth="251.0" text="[0][0][0][2][0][0]" GridPane.columnIndex="1">
<GridPane.margin> <GridPane.margin>
<Insets left="-7.0"/> <Insets left="-7.0" />
</GridPane.margin> </GridPane.margin>
</TextField> </TextField>
<Label maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" text="Packet:" <Label maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" text="Packet:" textFill="#000000bb">
textFill="#000000bb">
<GridPane.margin> <GridPane.margin>
<Insets left="3.0"/> <Insets left="3.0" />
</GridPane.margin> </GridPane.margin>
</Label> </Label>
<Button fx:id="btn_clear" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" <Button fx:id="btn_clear" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" mnemonicParsing="false" onAction="#clearBtnClicked" text="Clear" GridPane.columnIndex="3" />
mnemonicParsing="false" onAction="#clearBtnClicked" text="Clear" <Button fx:id="btn_save" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" mnemonicParsing="false" onAction="#saveBtnClicked" text="S" GridPane.columnIndex="4" />
GridPane.columnIndex="2"/> <Button fx:id="btn_load" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" mnemonicParsing="false" onAction="#loadBtnClicked" text="L" GridPane.columnIndex="5" />
<Button fx:id="btn_save" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308"
mnemonicParsing="false" onAction="#saveBtnClicked" text="S" GridPane.columnIndex="3"/>
<Button fx:id="btn_load" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308"
mnemonicParsing="false" onAction="#loadBtnClicked" text="L" GridPane.columnIndex="4"/>
</GridPane> </GridPane>
<GridPane prefHeight="33.0" prefWidth="502.0" GridPane.rowIndex="1"> <GridPane prefHeight="33.0" prefWidth="502.0" GridPane.rowIndex="1">
<columnConstraints> <columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="63.0" minWidth="0.0" prefWidth="63.0"/> <ColumnConstraints hgrow="SOMETIMES" maxWidth="63.0" minWidth="63.0" prefWidth="63.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="488.0" minWidth="10.0" prefWidth="80.0"/> <ColumnConstraints hgrow="SOMETIMES" maxWidth="80.0" minWidth="80.0" prefWidth="80.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="102.0" minWidth="10.0" prefWidth="102.0"/> <ColumnConstraints hgrow="SOMETIMES" maxWidth="50.0" minWidth="50.0" prefWidth="50.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="107.0" minWidth="10.0" prefWidth="107.0"/> <ColumnConstraints hgrow="SOMETIMES" maxWidth="60.0" minWidth="60.0" prefWidth="60.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="488.0" minWidth="10.0" prefWidth="181.0"/> <ColumnConstraints hgrow="SOMETIMES" maxWidth="1.7976931348623157E308" minWidth="50.0" prefWidth="50.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="220.0" minWidth="220.0" prefWidth="220.0" />
</columnConstraints> </columnConstraints>
<rowConstraints> <rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/> <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints> </rowConstraints>
<GridPane.margin> <GridPane.margin>
<Insets/> <Insets />
</GridPane.margin> </GridPane.margin>
<TextField fx:id="txt_delay" text="500+0" GridPane.columnIndex="1"> <TextField fx:id="txt_delay" text="500+0" GridPane.columnIndex="1">
<GridPane.margin> <GridPane.margin>
<Insets right="5.0"/> <Insets right="5.0" />
</GridPane.margin> </GridPane.margin>
</TextField> </TextField>
<Label maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" text="Interval:" <Label maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" text="Interval:" textFill="#000000bb">
textFill="#000000bb">
<GridPane.margin> <GridPane.margin>
<Insets left="3.0"/> <Insets left="3.0" />
</GridPane.margin> </GridPane.margin>
</Label> </Label>
<Button fx:id="btn_addoredit" maxHeight="1.7976931348623157E308" <Button fx:id="btn_addoredit" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" mnemonicParsing="false" onAction="#scheduleBtnClicked" text="Add" GridPane.columnIndex="4">
maxWidth="1.7976931348623157E308" mnemonicParsing="false" onAction="#scheduleBtnClicked"
text="Add to scheduler" GridPane.columnIndex="4">
<GridPane.margin> <GridPane.margin>
<Insets bottom="2.0" left="5.0" top="2.0"/> <Insets bottom="2.0" left="5.0" top="2.0" />
</GridPane.margin> </GridPane.margin>
</Button> </Button>
<RadioButton fx:id="rb_incoming" maxHeight="1.7976931348623157E308" <RadioButton fx:id="rb_incoming" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" mnemonicParsing="false" text="In" GridPane.columnIndex="2">
maxWidth="1.7976931348623157E308" mnemonicParsing="false" text="Incoming"
GridPane.columnIndex="2">
<GridPane.margin> <GridPane.margin>
<Insets left="10.0"/> <Insets left="5.0" />
</GridPane.margin> </GridPane.margin>
<toggleGroup> <toggleGroup>
<ToggleGroup fx:id="scheduler_dest"/> <ToggleGroup fx:id="scheduler_dest" />
</toggleGroup> </toggleGroup>
</RadioButton> </RadioButton>
<RadioButton fx:id="rb_outgoing" maxHeight="1.7976931348623157E308" <RadioButton fx:id="rb_outgoing" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" mnemonicParsing="false" text="Out" toggleGroup="$scheduler_dest" GridPane.columnIndex="3">
maxWidth="1.7976931348623157E308" mnemonicParsing="false" text="Outgoing"
toggleGroup="$scheduler_dest" GridPane.columnIndex="3">
<GridPane.margin> <GridPane.margin>
<Insets left="10.0"/> <Insets left="5.0" />
</GridPane.margin> </GridPane.margin>
</RadioButton> </RadioButton>
<CheckBox fx:id="cbx_hotkeys" mnemonicParsing="false" text="Enable hotkeys (Ctrl+Alt+Index)" textFill="#4d4d4d" GridPane.columnIndex="5">
<GridPane.margin>
<Insets left="32.0" />
</GridPane.margin>
</CheckBox>
</GridPane> </GridPane>
</GridPane> </GridPane>
</GridPane> </GridPane>