From e7d7e8506a511d78f9e323ac09587f79ad503f42 Mon Sep 17 00:00:00 2001 From: Eduardo Pedroni Date: Sun, 13 Apr 2014 10:41:25 +0100 Subject: Performance suddenly decreased, looking into why --- src/jcgp/gui/settings/testcase/TestCaseTable.java | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 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 7e72cbd..b84f9ab 100644 --- a/src/jcgp/gui/settings/testcase/TestCaseTable.java +++ b/src/jcgp/gui/settings/testcase/TestCaseTable.java @@ -27,10 +27,12 @@ import jcgp.gui.GUI; */ public class TestCaseTable extends Stage { + private TableView> table; + public TestCaseTable(final TestCaseProblem problem, final GUI gui) { super(); - TableView> tv = new TableView>(); + table = new TableView>(); ObservableList> testCaseList = problem.getTestCases(); ArrayList, String>> inputs = new ArrayList, String>>(problem.getInputCount()); @@ -48,7 +50,7 @@ public class TestCaseTable extends Stage { } }); tc.setSortable(false); - tc.prefWidthProperty().bind(tv.widthProperty().divide(problem.getInputCount() + problem.getOutputCount())); + tc.prefWidthProperty().bind(table.widthProperty().divide(problem.getInputCount() + problem.getOutputCount())); } for (int o = 0; o < problem.getOutputCount(); o++) { @@ -62,15 +64,15 @@ public class TestCaseTable extends Stage { } }); tc.setSortable(false); - tc.prefWidthProperty().bind(tv.widthProperty().divide(problem.getInputCount() + problem.getOutputCount())); + tc.prefWidthProperty().bind(table.widthProperty().divide(problem.getInputCount() + problem.getOutputCount())); } - tv.getColumns().addAll(inputs); - tv.getColumns().addAll(outputs); + table.getColumns().addAll(inputs); + table.getColumns().addAll(outputs); - tv.setItems(testCaseList); + table.setItems(testCaseList); - tv.getSelectionModel().selectedItemProperty().addListener(new ChangeListener>() { + table.getSelectionModel().selectedItemProperty().addListener(new ChangeListener>() { @Override public void changed( ObservableValue> observable, TestCase oldValue, TestCase newValue) { @@ -85,6 +87,10 @@ public class TestCaseTable extends Stage { } }); - setScene(new Scene(tv)); + setScene(new Scene(table)); + } + + public TableView> getTable() { + return table; } } -- cgit v1.2.3