From 36f4393bcc9e55afa2334baa33e603ce839741a1 Mon Sep 17 00:00:00 2001 From: Eduardo Pedroni Date: Thu, 1 May 2014 13:05:27 +0100 Subject: Did more commenting, implemented reflection and statistics --- src/jcgp/gui/settings/testcase/TestCaseTable.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'src/jcgp/gui/settings/testcase') 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 testCaseProblem, final GUI gui) { super(); + Resources resources = gui.getExperiment().getResources(); + table = new TableView>(); ObservableList> testCaseList = testCaseProblem.getTestCases(); - ArrayList, String>> inputs = new ArrayList, String>>(testCaseProblem.getInputCount()); - ArrayList, String>> outputs = new ArrayList, String>>(testCaseProblem.getOutputCount()); + ArrayList, String>> inputs = new ArrayList, String>>(resources.inputs()); + ArrayList, String>> outputs = new ArrayList, String>>(resources.outputs()); TableColumn, String> tc; - for (int i = 0; i < testCaseProblem.getInputCount(); i++) { + for (int i = 0; i < resources.inputs(); i++) { tc = new TableColumn, 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, 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); -- cgit v1.2.3