aboutsummaryrefslogtreecommitdiffstats
path: root/src/jcgp/gui/settings/testcase
diff options
context:
space:
mode:
Diffstat (limited to 'src/jcgp/gui/settings/testcase')
-rw-r--r--src/jcgp/gui/settings/testcase/TestCaseTable.java15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/jcgp/gui/settings/testcase/TestCaseTable.java b/src/jcgp/gui/settings/testcase/TestCaseTable.java
index d7b2e2b..d4c1ff9 100644
--- a/src/jcgp/gui/settings/testcase/TestCaseTable.java
+++ b/src/jcgp/gui/settings/testcase/TestCaseTable.java
@@ -16,6 +16,7 @@ import javafx.stage.WindowEvent;
import javafx.util.Callback;
import jcgp.backend.modules.problem.TestCaseProblem;
import jcgp.backend.modules.problem.TestCaseProblem.TestCase;
+import jcgp.backend.resources.Resources;
import jcgp.gui.GUI;
/**
@@ -31,14 +32,16 @@ public class TestCaseTable extends Stage {
public TestCaseTable(final TestCaseProblem<Object> testCaseProblem, final GUI gui) {
super();
+ Resources resources = gui.getExperiment().getResources();
+
table = new TableView<TestCase<Object>>();
ObservableList<TestCase<Object>> testCaseList = testCaseProblem.getTestCases();
- ArrayList<TableColumn<TestCase<Object>, String>> inputs = new ArrayList<TableColumn<TestCase<Object>, String>>(testCaseProblem.getInputCount());
- ArrayList<TableColumn<TestCase<Object>, String>> outputs = new ArrayList<TableColumn<TestCase<Object>, String>>(testCaseProblem.getOutputCount());
+ ArrayList<TableColumn<TestCase<Object>, String>> inputs = new ArrayList<TableColumn<TestCase<Object>, String>>(resources.inputs());
+ ArrayList<TableColumn<TestCase<Object>, String>> outputs = new ArrayList<TableColumn<TestCase<Object>, String>>(resources.outputs());
TableColumn<TestCase<Object>, String> tc;
- for (int i = 0; i < testCaseProblem.getInputCount(); i++) {
+ for (int i = 0; i < resources.inputs(); i++) {
tc = new TableColumn<TestCase<Object>, String>("I: " + i);
inputs.add(tc);
final int index = i;
@@ -49,10 +52,10 @@ public class TestCaseTable extends Stage {
}
});
tc.setSortable(false);
- tc.prefWidthProperty().bind(table.widthProperty().divide(testCaseProblem.getInputCount() + testCaseProblem.getOutputCount()));
+ tc.prefWidthProperty().bind(table.widthProperty().divide(resources.inputs() + resources.outputs()));
}
- for (int o = 0; o < testCaseProblem.getOutputCount(); o++) {
+ for (int o = 0; o < resources.outputs(); o++) {
tc = new TableColumn<TestCase<Object>, String>("O: " + o);
outputs.add(tc);
final int index = o;
@@ -63,7 +66,7 @@ public class TestCaseTable extends Stage {
}
});
tc.setSortable(false);
- tc.prefWidthProperty().bind(table.widthProperty().divide(testCaseProblem.getInputCount() + testCaseProblem.getOutputCount()));
+ tc.prefWidthProperty().bind(table.widthProperty().divide(resources.inputs() + resources.outputs()));
}
table.getColumns().addAll(inputs);