diff --git a/src/main/protocol/HPacket.java b/src/main/protocol/HPacket.java
index 0f14b2d..1ba4e95 100644
--- a/src/main/protocol/HPacket.java
+++ b/src/main/protocol/HPacket.java
@@ -758,7 +758,7 @@ public class HPacket {
if (resultTest[i] != null) expression.append(resultTest[i]);
}
- return expression.toString();
+ return expression.toString().replace("{i:0}{b:false}{b:true}", "{s:}{i:1}");
}
public static void main(String[] args) {
diff --git a/src/main/ui/G-Earth.fxml b/src/main/ui/G-Earth.fxml
index 2dea4ee..45f238c 100644
--- a/src/main/ui/G-Earth.fxml
+++ b/src/main/ui/G-Earth.fxml
@@ -29,10 +29,26 @@
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/ui/GEarthController.java b/src/main/ui/GEarthController.java
index 68a5ffb..33bf7fe 100644
--- a/src/main/ui/GEarthController.java
+++ b/src/main/ui/GEarthController.java
@@ -4,8 +4,12 @@ import javafx.scene.layout.Pane;
import javafx.stage.Stage;
import main.protocol.HConnection;
import main.ui.connection.Connection;
+import main.ui.extensions.Extensions;
+import main.ui.info.Info;
import main.ui.injection.Injection;
import main.ui.logger.Logger;
+import main.ui.scheduler.Scheduler;
+import main.ui.settings.Settings;
import main.ui.tools.Tools;
public class GEarthController {
@@ -17,6 +21,11 @@ public class GEarthController {
public Injection injectionController;
public Logger loggerController;
public Tools toolsController;
+ public Scheduler schedulerController;
+ public Settings settingsController;
+ public Info infoController;
+ public Extensions extensionsController;
+
public Pane mover;
public GEarthController() {
@@ -28,6 +37,12 @@ public class GEarthController {
injectionController.setParentController(this);
loggerController.setParentController(this);
toolsController.setParentController(this);
+ schedulerController.setParentController(this);
+ settingsController.setParentController(this);
+ infoController.setParentController(this);
+ extensionsController.setParentController(this);
+
+
//custom header bar
// final Point[] startpos = {null};
// final Double[] xx = {0.0};
diff --git a/src/main/ui/extensions/Extensions.fxml b/src/main/ui/extensions/Extensions.fxml
new file mode 100644
index 0000000..310ec13
--- /dev/null
+++ b/src/main/ui/extensions/Extensions.fxml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/ui/extensions/Extensions.java b/src/main/ui/extensions/Extensions.java
new file mode 100644
index 0000000..3c22e8c
--- /dev/null
+++ b/src/main/ui/extensions/Extensions.java
@@ -0,0 +1,9 @@
+package main.ui.extensions;
+
+import main.ui.SubForm;
+
+/**
+ * Created by Jonas on 06/04/18.
+ */
+public class Extensions extends SubForm {
+}
diff --git a/src/main/ui/info/Info.fxml b/src/main/ui/info/Info.fxml
new file mode 100644
index 0000000..45ff5f1
--- /dev/null
+++ b/src/main/ui/info/Info.fxml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/ui/info/Info.java b/src/main/ui/info/Info.java
new file mode 100644
index 0000000..73b565a
--- /dev/null
+++ b/src/main/ui/info/Info.java
@@ -0,0 +1,9 @@
+package main.ui.info;
+
+import main.ui.SubForm;
+
+/**
+ * Created by Jonas on 06/04/18.
+ */
+public class Info extends SubForm {
+}
diff --git a/src/main/ui/injection/Injection.java b/src/main/ui/injection/Injection.java
index 7071c36..a15d79a 100644
--- a/src/main/ui/injection/Injection.java
+++ b/src/main/ui/injection/Injection.java
@@ -19,12 +19,9 @@ public class Injection extends SubForm {
public Button btn_sendToClient;
protected void onParentSet() {
- getHConnection().addStateChangeListener((oldState, newState) -> Platform.runLater(() ->
- updateUI()));
+ getHConnection().addStateChangeListener((oldState, newState) -> Platform.runLater(this::updateUI));
- inputPacket.textProperty().addListener(event -> { Platform.runLater(() ->
- updateUI());
- });
+ inputPacket.textProperty().addListener(event -> Platform.runLater(this::updateUI));
}
private void updateUI() {
diff --git a/src/main/ui/scheduler/Interval.java b/src/main/ui/scheduler/Interval.java
new file mode 100644
index 0000000..86ca020
--- /dev/null
+++ b/src/main/ui/scheduler/Interval.java
@@ -0,0 +1,56 @@
+package main.ui.scheduler;
+
+/**
+ * Created by Jonas on 11/04/18.
+ */
+public class Interval {
+
+ private int offset;
+ private int delay;
+
+ public Interval(int offset, int delay) {
+ this.offset = offset;
+ this.delay = delay;
+ }
+
+ public Interval(String interval) {
+ String[] split = interval.split("\\+");
+
+ if (split.length == 0 || split.length > 2) {
+ delay = -1;
+ offset = -1;
+ return;
+ }
+ if (!Scheduler.stringIsNumber(split[0]) || (split.length == 2 && !Scheduler.stringIsNumber(split[1]))) {
+ delay = -1;
+ offset = -1;
+ return;
+ }
+
+ delay = Integer.parseInt(split[0]);
+ offset = split.length == 2 ? Integer.parseInt(split[1]) : 0;
+
+ if (delay <= 0 || offset < 0 || offset > delay) {
+ delay = -1;
+ offset = -1;
+ }
+ }
+
+
+ public int getDelay() {
+ return delay;
+ }
+
+ public int getOffset() {
+ return offset;
+ }
+
+ public String toString() {
+ return delay + "+" + offset;
+ }
+
+ public static boolean isValid(String s) {
+ Interval test = new Interval(s);
+ return (test.delay != -1);
+ }
+}
diff --git a/src/main/ui/scheduler/ScheduleItem.java b/src/main/ui/scheduler/ScheduleItem.java
new file mode 100644
index 0000000..fc6a74c
--- /dev/null
+++ b/src/main/ui/scheduler/ScheduleItem.java
@@ -0,0 +1,93 @@
+package main.ui.scheduler;
+
+import javafx.beans.InvalidationListener;
+import javafx.beans.property.SimpleBooleanProperty;
+import javafx.beans.property.SimpleIntegerProperty;
+import javafx.beans.property.SimpleObjectProperty;
+import main.protocol.HMessage;
+import main.protocol.HPacket;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Created by Jonas on 07/04/18.
+ */
+public class ScheduleItem {
+
+ private SimpleIntegerProperty indexProperty;
+ private SimpleBooleanProperty pausedProperty;
+ private SimpleObjectProperty delayProperty;
+ private SimpleObjectProperty packetProperty;
+ private SimpleObjectProperty destinationProperty;
+
+ ScheduleItem (int index, boolean paused, Interval delay, HPacket packet, HMessage.Side destination) {
+ this.indexProperty = new SimpleIntegerProperty(index);
+ this.pausedProperty = new SimpleBooleanProperty(paused);
+ this.delayProperty = new SimpleObjectProperty<>(delay);
+ this.packetProperty = new SimpleObjectProperty<>(packet);
+ this.destinationProperty = new SimpleObjectProperty<>(destination);
+ }
+
+ public SimpleIntegerProperty getIndexProperty() {
+ return indexProperty;
+ }
+
+ public SimpleBooleanProperty getPausedProperty() {
+ return pausedProperty;
+ }
+
+ public SimpleObjectProperty getDelayProperty() {
+ return delayProperty;
+ }
+
+ public SimpleObjectProperty getPacketProperty() {
+ return packetProperty;
+ }
+
+ public SimpleObjectProperty getDestinationProperty() {
+ return destinationProperty;
+ }
+
+
+ private List onDeleteListeners = new ArrayList<>();
+ public void onDelete(InvalidationListener listener) {
+ onDeleteListeners.add(listener);
+ }
+ public void delete() {
+ for (int i = onDeleteListeners.size() - 1; i >= 0; i--) {
+ onDeleteListeners.get(i).invalidated(null);
+ }
+ }
+
+ private List onEditListeners = new ArrayList<>();
+ public void onEdit(InvalidationListener listener) {
+ onEditListeners.add(listener);
+ }
+ public void edit() {
+ for (int i = onEditListeners.size() - 1; i >= 0; i--) {
+ onEditListeners.get(i).invalidated(null);
+ }
+ }
+
+ private List onIsupdatedListeners = new ArrayList<>();
+ public void onIsupdated(InvalidationListener listener) {
+ onIsupdatedListeners.add(listener);
+ }
+ public void isUpdatedTrigger() {
+ for (int i = onIsupdatedListeners.size() - 1; i >= 0; i--) {
+ onIsupdatedListeners.get(i).invalidated(null);
+ }
+ }
+
+ private List OnIsBeingUpdatedListeners = new ArrayList<>();
+ public void onIsBeingUpdated(InvalidationListener listener) {
+ OnIsBeingUpdatedListeners.add(listener);
+ }
+ public void onIsBeingUpdatedTrigger() {
+ for (int i = OnIsBeingUpdatedListeners.size() - 1; i >= 0; i--) {
+ OnIsBeingUpdatedListeners.get(i).invalidated(null);
+ }
+ }
+
+}
diff --git a/src/main/ui/scheduler/ScheduleItemContainer.java b/src/main/ui/scheduler/ScheduleItemContainer.java
new file mode 100644
index 0000000..8028927
--- /dev/null
+++ b/src/main/ui/scheduler/ScheduleItemContainer.java
@@ -0,0 +1,106 @@
+package main.ui.scheduler;
+
+import javafx.beans.InvalidationListener;
+import javafx.beans.Observable;
+import javafx.event.EventHandler;
+import javafx.geometry.Insets;
+import javafx.geometry.Pos;
+import javafx.scene.control.Label;
+import javafx.scene.control.ScrollPane;
+import javafx.scene.input.MouseEvent;
+import javafx.scene.layout.*;
+import javafx.scene.text.Font;
+import main.ui.scheduler.buttons.DeleteButton;
+import main.ui.scheduler.buttons.EditButton;
+import main.ui.scheduler.buttons.PauseResumeButton;
+
+/**
+ * Created by Jonas on 07/04/18.
+ */
+public class ScheduleItemContainer extends GridPane {
+
+ public static final int[] columnWidths = {10, 39, 16, 18, 15};
+ ScheduleItem item;
+
+ Label indexLabel;
+ Label packetLabel;
+ Label delayLabel;
+ Label destinationLabel;
+
+ VBox parent;
+
+ ScheduleItemContainer(ScheduleItem item, VBox parent, ScrollPane scrollPane) {
+ super();
+ setGridLinesVisible(true);
+ VBox.setMargin(this, new Insets(2, -2, -2, -2));
+
+ setPrefWidth(scrollPane.getWidth());
+ setPrefHeight(23);
+ scrollPane.widthProperty().addListener(observable -> setPrefWidth(scrollPane.getWidth()));
+ this.parent = parent;
+ this.item = item;
+ initialize();
+ }
+
+ private void initialize() {
+ RowConstraints rowConstraints = new RowConstraints(23);
+ getRowConstraints().addAll(rowConstraints);
+
+ for (int i = 0; i < columnWidths.length; i++) {
+ ColumnConstraints columnConstraints = new ColumnConstraints(20);
+ columnConstraints.setPercentWidth(columnWidths[i]);
+ getColumnConstraints().add(columnConstraints);
+ }
+
+ indexLabel = initNewLabelColumn(item.getIndexProperty().get()+"");
+ packetLabel = initNewLabelColumn(item.getPacketProperty().get().toString());
+ delayLabel = initNewLabelColumn(item.getDelayProperty().get()+"");
+ destinationLabel = initNewLabelColumn(item.getDestinationProperty().get().name());
+
+ add(indexLabel, 0, 0);
+ add(packetLabel, 1, 0);
+ add(delayLabel, 2, 0);
+ add(destinationLabel, 3, 0);
+
+// getChildren().addAll(indexLabel, packetLabel, delayLabel, destinationLabel);
+
+ item.getIndexProperty().addListener(observable -> indexLabel.setText(item.getIndexProperty().get()+""));
+ item.getPacketProperty().addListener(observable -> packetLabel.setText(item.getPacketProperty().get().toString()));
+ item.getDelayProperty().addListener(observable -> delayLabel.setText(item.getDelayProperty().get()+""));
+ item.getDestinationProperty().addListener(observable -> destinationLabel.setText(item.getDestinationProperty().get().name()));
+
+ EditButton editButton = new EditButton();
+ DeleteButton deleteButton = new DeleteButton();
+ PauseResumeButton pauseResumeButton = new PauseResumeButton(item.getPausedProperty().get());
+ editButton.show();
+ deleteButton.show();
+ editButton.addEventHandler(MouseEvent.MOUSE_CLICKED, event -> item.edit());
+ deleteButton.addEventHandler(MouseEvent.MOUSE_CLICKED, event -> item.delete());
+ pauseResumeButton.onClick(observable -> item.getPausedProperty().set(pauseResumeButton.isPaused()));
+ HBox buttonsBox = new HBox(pauseResumeButton, editButton, deleteButton);
+ buttonsBox.setSpacing(10);
+ buttonsBox.setAlignment(Pos.CENTER);
+ GridPane.setMargin(buttonsBox, new Insets(0, 5, 0, 5));
+ add(buttonsBox, 4, 0);
+
+ parent.getChildren().add(this);
+
+
+ GridPane this2 = this;
+ item.onDelete(observable -> parent.getChildren().remove(this2));
+ item.onIsBeingUpdated(observable -> setStyle("-fx-background-color: #faebcc;"));
+ item.onIsupdated(observable -> setStyle("-fx-background-color: #ffffff;"));
+ }
+
+ private Label initNewLabelColumn(String text) {
+ Label label = new Label();
+// label.setMaxWidth(Double.MAX_VALUE);
+// label.setMinHeight(Double.MAX_VALUE);
+// label.setAlignment(Pos.CENTER);
+ label.setFont(new Font(12));
+ GridPane.setMargin(label, new Insets(0, 0, 0, 5));
+ label.setText(text);
+ return label;
+ }
+
+}
diff --git a/src/main/ui/scheduler/Scheduler.fxml b/src/main/ui/scheduler/Scheduler.fxml
new file mode 100644
index 0000000..3cebc8f
--- /dev/null
+++ b/src/main/ui/scheduler/Scheduler.fxml
@@ -0,0 +1,135 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/ui/scheduler/Scheduler.java b/src/main/ui/scheduler/Scheduler.java
new file mode 100644
index 0000000..082c695
--- /dev/null
+++ b/src/main/ui/scheduler/Scheduler.java
@@ -0,0 +1,161 @@
+package main.ui.scheduler;
+
+import javafx.application.Platform;
+import javafx.beans.InvalidationListener;
+import javafx.beans.Observable;
+import javafx.event.ActionEvent;
+import javafx.scene.control.*;
+import javafx.scene.layout.GridPane;
+import javafx.scene.layout.VBox;
+import main.protocol.HMessage;
+import main.protocol.HPacket;
+import main.ui.SubForm;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Created by Jonas on 06/04/18.
+ */
+public class Scheduler extends SubForm {
+
+ private static final Interval defaultInterval = new Interval(0, 500);
+ private static final HPacket defaultPacket = new HPacket(0);
+
+ public VBox schedulecontainer;
+ public GridPane header;
+ public ScrollPane scrollpane;
+
+ public Button btn_addoredit;
+
+ public TextField txt_delay;
+ public ToggleGroup scheduler_dest;
+ public TextField txt_packet;
+ public RadioButton rb_incoming;
+ public RadioButton rb_outgoing;
+
+ private ScheduleItem isBeingEdited = null;
+
+ private List scheduleItemList = new ArrayList<>();
+
+
+ public void initialize() {
+ scrollpane.widthProperty().addListener(observable -> header.setPrefWidth(scrollpane.getWidth()));
+ scheduler_dest.selectToggle(scheduler_dest.getToggles().get(0));
+
+ txt_packet.textProperty().addListener(event -> Platform.runLater(this::updateUI));
+ txt_delay.textProperty().addListener(event -> Platform.runLater(this::updateUI));
+
+ updateUI();
+
+ new Thread(() -> {
+ long i = 0;
+ while (true) {
+ try {
+ Thread.sleep(1);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+
+ for (ScheduleItem item : scheduleItemList) {
+ if (!item.getPausedProperty().get()) {
+ Interval cur = item.getDelayProperty().get();
+ if (i % cur.getDelay() == cur.getOffset()) {
+ getHConnection().sendToServerAsync(item.getPacketProperty().get());
+ }
+ }
+
+ }
+
+ i++;
+ }
+ }).start();
+
+ }
+
+ public static boolean stringIsNumber(String str) {
+ try {
+ Integer.parseInt(str);
+ return true;
+ }
+ catch (Exception e){
+ return false;
+ }
+ }
+
+ private void updateUI() {
+ btn_addoredit.setDisable(!Interval.isValid(txt_delay.getText()) || new HPacket(txt_packet.getText()).isCorrupted());
+ }
+
+ public void scheduleBtnClicked(ActionEvent actionEvent) {
+ if (isBeingEdited == null) {
+ HPacket packet = new HPacket(txt_packet.getText());
+ if (packet.isCorrupted()) return;
+
+ ScheduleItem newItem = new ScheduleItem(
+ scheduleItemList.size(),
+ false,
+ new Interval(txt_delay.getText()),
+ new HPacket(txt_packet.getText()),
+ rb_incoming.isSelected() ? HMessage.Side.TOCLIENT : HMessage.Side.TOSERVER);
+
+ new ScheduleItemContainer(newItem, schedulecontainer, scrollpane);
+ scheduleItemList.add(newItem);
+
+
+ newItem.onDelete(observable -> {
+ if (isBeingEdited == newItem) {
+ setInputDefault();
+ isBeingEdited = null;
+ }
+ scheduleItemList.remove(newItem);
+ for (int i = 0; i < scheduleItemList.size(); i++) {
+ scheduleItemList.get(i).getIndexProperty().set(i);
+ }
+ });
+ newItem.onEdit(observable -> {
+ if (isBeingEdited != null) {
+ isBeingEdited.isUpdatedTrigger();
+ }
+
+ if (isBeingEdited != newItem) {
+ txt_packet.setText(newItem.getPacketProperty().get().toString());
+ txt_delay.setText(newItem.getDelayProperty().get().toString());
+ rb_incoming.setSelected(newItem.getDestinationProperty().get() == HMessage.Side.TOCLIENT);
+ rb_outgoing.setSelected(newItem.getDestinationProperty().get() == HMessage.Side.TOSERVER);
+
+ isBeingEdited = newItem;
+ btn_addoredit.setText("Edit schedule item"); //Add to scheduler
+ updateUI();
+ newItem.onIsBeingUpdatedTrigger();
+ }
+ else {
+ setInputDefault();
+ isBeingEdited.isUpdatedTrigger();
+ isBeingEdited = null;
+ }
+ });
+ }
+ else {
+
+ isBeingEdited.getPacketProperty().set(new HPacket(txt_packet.getText()));
+ isBeingEdited.getDelayProperty().set(new Interval(txt_delay.getText()));
+ isBeingEdited.getDestinationProperty().set(rb_incoming.isSelected() ? HMessage.Side.TOCLIENT : HMessage.Side.TOSERVER);
+ isBeingEdited.isUpdatedTrigger();
+
+ isBeingEdited = null;
+ setInputDefault();
+ }
+
+ }
+
+ private void setInputDefault() {
+ txt_delay.setText(defaultInterval.toString());
+ txt_packet.setText(defaultPacket.toString());
+ rb_incoming.setSelected(true);
+ rb_outgoing.setSelected(false);
+
+ btn_addoredit.setText("Add to scheduler");
+ updateUI();
+ }
+}
diff --git a/src/main/ui/scheduler/buttons/BoxButton.java b/src/main/ui/scheduler/buttons/BoxButton.java
new file mode 100644
index 0000000..18ea782
--- /dev/null
+++ b/src/main/ui/scheduler/buttons/BoxButton.java
@@ -0,0 +1,53 @@
+package main.ui.scheduler.buttons;
+
+import javafx.event.EventHandler;
+import javafx.scene.Cursor;
+import javafx.scene.image.Image;
+import javafx.scene.image.ImageView;
+import javafx.scene.input.MouseEvent;
+import javafx.scene.layout.StackPane;
+
+public class BoxButton extends StackPane {
+
+ private ImageView imageView;
+ private Image image;
+ private Image imageOnHover;
+ private boolean isVisible;
+
+ //paths zijn relatief aan deze classpath
+ public BoxButton(String imagePath, String imageOnHoverPath) {
+ this.image = new Image(getClass().getResourceAsStream(imagePath));
+ this.imageOnHover = new Image(getClass().getResourceAsStream(imageOnHoverPath));
+ this.imageView = new ImageView();
+
+ setCursor(Cursor.DEFAULT);
+ getChildren().add(imageView);
+ setOnMouseEntered(onMouseHover);
+ setOnMouseExited(onMouseHoverDone);
+ }
+
+ public void show() {
+ imageView.setImage(image);
+ isVisible = true;
+ }
+
+ public void dispose() {
+ imageView.setImage(null);
+ isVisible = false;
+ }
+
+ private EventHandler onMouseHover =
+ t -> {
+ if (isVisible) {
+ imageView.setImage(imageOnHover);
+ }
+ };
+
+ private EventHandler onMouseHoverDone =
+ t -> {
+ if (isVisible) {
+ imageView.setImage(image);
+ }
+ };
+
+}
diff --git a/src/main/ui/scheduler/buttons/ButtonDelete.png b/src/main/ui/scheduler/buttons/ButtonDelete.png
new file mode 100644
index 0000000..48b0bc8
Binary files /dev/null and b/src/main/ui/scheduler/buttons/ButtonDelete.png differ
diff --git a/src/main/ui/scheduler/buttons/ButtonDeleteHover.png b/src/main/ui/scheduler/buttons/ButtonDeleteHover.png
new file mode 100644
index 0000000..20f3859
Binary files /dev/null and b/src/main/ui/scheduler/buttons/ButtonDeleteHover.png differ
diff --git a/src/main/ui/scheduler/buttons/ButtonEdit.png b/src/main/ui/scheduler/buttons/ButtonEdit.png
new file mode 100644
index 0000000..4a07972
Binary files /dev/null and b/src/main/ui/scheduler/buttons/ButtonEdit.png differ
diff --git a/src/main/ui/scheduler/buttons/ButtonEditHover.png b/src/main/ui/scheduler/buttons/ButtonEditHover.png
new file mode 100644
index 0000000..1e31814
Binary files /dev/null and b/src/main/ui/scheduler/buttons/ButtonEditHover.png differ
diff --git a/src/main/ui/scheduler/buttons/ButtonPause.png b/src/main/ui/scheduler/buttons/ButtonPause.png
new file mode 100644
index 0000000..75de062
Binary files /dev/null and b/src/main/ui/scheduler/buttons/ButtonPause.png differ
diff --git a/src/main/ui/scheduler/buttons/ButtonPauseHover.png b/src/main/ui/scheduler/buttons/ButtonPauseHover.png
new file mode 100644
index 0000000..c7c1952
Binary files /dev/null and b/src/main/ui/scheduler/buttons/ButtonPauseHover.png differ
diff --git a/src/main/ui/scheduler/buttons/ButtonResume.png b/src/main/ui/scheduler/buttons/ButtonResume.png
new file mode 100644
index 0000000..6adb81f
Binary files /dev/null and b/src/main/ui/scheduler/buttons/ButtonResume.png differ
diff --git a/src/main/ui/scheduler/buttons/ButtonResumeHover.png b/src/main/ui/scheduler/buttons/ButtonResumeHover.png
new file mode 100644
index 0000000..55ffaaa
Binary files /dev/null and b/src/main/ui/scheduler/buttons/ButtonResumeHover.png differ
diff --git a/src/main/ui/scheduler/buttons/DeleteButton.java b/src/main/ui/scheduler/buttons/DeleteButton.java
new file mode 100644
index 0000000..8f221e0
--- /dev/null
+++ b/src/main/ui/scheduler/buttons/DeleteButton.java
@@ -0,0 +1,8 @@
+package main.ui.scheduler.buttons;
+
+public class DeleteButton extends BoxButton {
+
+ public DeleteButton() {
+ super("ButtonDelete.png", "ButtonDeleteHover.png");
+ }
+}
diff --git a/src/main/ui/scheduler/buttons/EditButton.java b/src/main/ui/scheduler/buttons/EditButton.java
new file mode 100644
index 0000000..c0739a0
--- /dev/null
+++ b/src/main/ui/scheduler/buttons/EditButton.java
@@ -0,0 +1,8 @@
+package main.ui.scheduler.buttons;
+
+public class EditButton extends BoxButton {
+
+ public EditButton() {
+ super("ButtonEdit.png", "ButtonEditHover.png");
+ }
+}
diff --git a/src/main/ui/scheduler/buttons/PauseResumeButton.java b/src/main/ui/scheduler/buttons/PauseResumeButton.java
new file mode 100644
index 0000000..baf9c4e
--- /dev/null
+++ b/src/main/ui/scheduler/buttons/PauseResumeButton.java
@@ -0,0 +1,91 @@
+package main.ui.scheduler.buttons;
+
+import javafx.beans.InvalidationListener;
+import javafx.event.EventHandler;
+import javafx.scene.Cursor;
+import javafx.scene.image.Image;
+import javafx.scene.image.ImageView;
+import javafx.scene.input.MouseEvent;
+import javafx.scene.layout.StackPane;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Created by Jonas on 11/04/18.
+ */
+public class PauseResumeButton extends StackPane{
+
+ private boolean isPaused[] = {false};
+
+
+ private ImageView imageView;
+ private Image imagePause;
+ private Image imagePauseOnHover;
+
+ private Image imageResume;
+ private Image imageResumeOnHover;
+
+ private List clickListeners = new ArrayList<>();
+
+ public PauseResumeButton(boolean isPaused) {
+ this.isPaused[0] = isPaused;
+
+ this.imagePause = new Image(getClass().getResourceAsStream("ButtonPause.png"));
+ this.imagePauseOnHover = new Image(getClass().getResourceAsStream("ButtonPauseHover.png"));
+ this.imageResume = new Image(getClass().getResourceAsStream("ButtonResume.png"));
+ this.imageResumeOnHover = new Image(getClass().getResourceAsStream("ButtonResumeHover.png"));
+ this.imageView = new ImageView();
+
+ setCursor(Cursor.DEFAULT);
+ getChildren().add(imageView);
+ setOnMouseEntered(onMouseHover);
+ setOnMouseExited(onMouseHoverDone);
+
+ imageView.setImage(isPaused() ? imageResume : imagePause);
+
+ PauseResumeButton thiss = this;
+ setEventHandler(MouseEvent.MOUSE_CLICKED, event -> {
+ thiss.isPaused[0] = !thiss.isPaused[0];
+ imageView.setImage(isPaused() ? imageResumeOnHover : imagePauseOnHover);
+
+ for (int i = clickListeners.size() - 1; i >= 0; i--) {
+ clickListeners.get(i).invalidated(null);
+ }
+ });
+ }
+
+ public boolean isPaused() {
+ return isPaused[0];
+ }
+
+ public void onClick(InvalidationListener listener) {
+ clickListeners.add(listener);
+ }
+
+
+ private EventHandler onMouseHover =
+ t -> imageView.setImage(isPaused() ? imageResumeOnHover : imagePauseOnHover);
+
+ private EventHandler onMouseHoverDone =
+ t -> imageView.setImage(isPaused() ? imageResume : imagePause);
+
+
+// private ImageView imageView;
+// private Image image;
+// private Image imageOnHover;
+// private boolean isVisible;
+//
+// //paths zijn relatief aan deze classpath
+// public BoxButton(String imagePath, String imageOnHoverPath) {
+// this.image = new Image(getClass().getResourceAsStream(imagePath));
+// this.imageOnHover = new Image(getClass().getResourceAsStream(imageOnHoverPath));
+// this.imageView = new ImageView();
+//
+// setCursor(Cursor.DEFAULT);
+// getChildren().add(imageView);
+// setOnMouseEntered(onMouseHover);
+// setOnMouseExited(onMouseHoverDone);
+// }
+
+}
diff --git a/src/main/ui/settings/Settings.fxml b/src/main/ui/settings/Settings.fxml
new file mode 100644
index 0000000..848b826
--- /dev/null
+++ b/src/main/ui/settings/Settings.fxml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/ui/settings/Settings.java b/src/main/ui/settings/Settings.java
new file mode 100644
index 0000000..e4e5a65
--- /dev/null
+++ b/src/main/ui/settings/Settings.java
@@ -0,0 +1,9 @@
+package main.ui.settings;
+
+import main.ui.SubForm;
+
+/**
+ * Created by Jonas on 06/04/18.
+ */
+public class Settings extends SubForm {
+}