diff options
author | Eduardo Pedroni <ep625@york.ac.uk> | 2014-05-01 13:05:27 +0100 |
---|---|---|
committer | Eduardo Pedroni <ep625@york.ac.uk> | 2014-05-01 13:05:27 +0100 |
commit | 36f4393bcc9e55afa2334baa33e603ce839741a1 (patch) | |
tree | d9a1d55d0d3553193a3fc11a92f11515762d202f /src/jcgp/gui/settings/testcase | |
parent | 4c8de2402f2878cde7587c7f3bbf4ffaea86efd4 (diff) |
Did more commenting, implemented reflection and statistics
Diffstat (limited to 'src/jcgp/gui/settings/testcase')
-rw-r--r-- | src/jcgp/gui/settings/testcase/TestCaseTable.java | 15 |
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); |