From db88da52ee6dfce2af4abac2686acd895c987311 Mon Sep 17 00:00:00 2001 From: Nils Vreman <nils.vreman@gmail.com> Date: Thu, 25 Oct 2018 16:45:07 +0200 Subject: [PATCH] Added some more helptext as well as updated a bug with the tasklabel. --- gui/menu/help/TasksetTab.java | 4 ++-- gui/tasksetgui/TaskLabel.java | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/gui/menu/help/TasksetTab.java b/gui/menu/help/TasksetTab.java index 16f075d..87e0a40 100644 --- a/gui/menu/help/TasksetTab.java +++ b/gui/menu/help/TasksetTab.java @@ -13,8 +13,8 @@ public class TasksetTab extends TabPanel { private static final String[] fieldTexts = new String[] { "To add a task to the taskset, press the \"Add Task\" button, located in the panel titled \"Taskset\". Once this button is pressed, a dialog window will open to let you specify the attributes of the task to add. \nThis application will only allow for integer attributes to be specified. Other input (such as special characters or letters) will result in the task not being added to the taskset. \nAlthough it is possible to add a task with a deadline greater than the period, the scheduling algorithm will consider this an unschedulable task. Make sure to check this if the solution does not show. For information regarding priorities: Read the \"Priorities\" help-tab", - "Remove TasksText", - "Change TasksText", + "To remove a task from the taskset, press the task to remove. This highlights the task. When the task to be removed is highlighted, press the \"Remove Task\" button. The taskset will automatically shift the priorities of consecutive tasks to fit the scheduling policy.", + "To change a tasks attributes, simply click the attribute you want to change and enter a new value. To confirm the new value, either press <Enter> or click anywhere else in the window panel. If the value was not entered correctly (for example the field was left empty), the last known valid number will be substituted into the attribute box.", "Clear TasksetText", "PrioritiesText", "Load TasksetText", diff --git a/gui/tasksetgui/TaskLabel.java b/gui/tasksetgui/TaskLabel.java index 23c7dae..6053c2c 100644 --- a/gui/tasksetgui/TaskLabel.java +++ b/gui/tasksetgui/TaskLabel.java @@ -78,6 +78,8 @@ public class TaskLabel extends JTextField implements FocusListener { public void focusLost(FocusEvent e) { if (!previousText.equals(getText()) && getText().matches("[0-9]+")) { updateListener.update(); + } else { + setText(previousText); } } } -- GitLab