Commit a1e9c5cb authored by Nils Vreman's avatar Nils Vreman
Browse files

Started working on text fields

parent a0aea9f1
......@@ -6,8 +6,8 @@ public class FileTab extends TabPanel {
"Save",
"Load"};
private static final String[] helpTexts = new String[] {
"Save",
"Load"};
"SaveText",
"LoadText"};
public FileTab() {
super(listOptions, helpTexts);
......
package gui.menu.help;
import javax.swing.JTextField;
import javax.swing.JTextArea;
import javax.swing.BorderFactory;
import javax.swing.border.BevelBorder;
import java.awt.Dimension;
public class HelpTextField extends JTextField {
public class HelpTextArea extends JTextArea {
public HelpTextField(String text) {
public HelpTextArea(String text) {
super(text);
setEditable(false);
setLineWrap(true);
setWrapStyleWord(true);
setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED));
setPreferredSize(new Dimension(380, 400));
}
}
......@@ -11,11 +11,11 @@ public class ScheduleTab extends TabPanel {
private static final String[] helpTexts = new String[] {
"Schedule",
"Solution",
"Check Solution",
"Clear Cells",
"Clear Strategy"};
"ScheduleText",
"SolutionText",
"Check SolutionText",
"Clear CellsText",
"Clear StrategyText"};
public ScheduleTab() {
super(listOptions, helpTexts);
......
......@@ -6,8 +6,8 @@ public class StrategyTab extends TabPanel {
"EDF",
"RMS"};
private static final String[] helpTexts = new String[] {
"EDF",
"RMS"};
"EDFText",
"RMSText"};
public StrategyTab() {
super(listOptions, helpTexts);
......
package gui.menu.help;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.JTextArea;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.util.Map;
......@@ -11,7 +11,7 @@ public abstract class TabPanel extends JPanel implements EventListener {
private final String[] listOptions;
private OptionList list;
private Map<String, JTextField> helpTexts = new HashMap<>();
private Map<String, JTextArea> helpTexts = new HashMap<>();
public TabPanel(String[] listOptions, String[] fieldTexts) {
super(new BorderLayout());
......@@ -22,12 +22,12 @@ public abstract class TabPanel extends JPanel implements EventListener {
list.setPreferredSize(new Dimension(120, 400));
for (int i = 0; i < listOptions.length; i++) {
JTextField htf = new HelpTextField(fieldTexts[i]);
JTextArea htf = new HelpTextArea(fieldTexts[i]);
helpTexts.put(listOptions[i], htf);
}
add(BorderLayout.WEST, list);
add(BorderLayout.CENTER, new HelpTextField(""));
add(BorderLayout.CENTER, new HelpTextArea(""));
}
public void update(String tab) {
......
......@@ -12,13 +12,13 @@ public class TasksetTab extends TabPanel {
"Save Taskset"};
private static final String[] fieldTexts = new String[] {
"Add Tasks",
"Remove Tasks",
"Change Tasks",
"Clear Taskset",
"Priorities",
"Load Taskset",
"Save Taskset"};
"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",
"Clear TasksetText",
"PrioritiesText",
"Load TasksetText",
"Save TasksetText"};
public TasksetTab() {
super(listOptions, fieldTexts);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment