Author: tchemit Date: 2012-10-07 14:00:10 +0200 (Sun, 07 Oct 2012) New Revision: 85 Url: http://forge.codelutin.com/repositories/revision/jmexico/85 Log: fixes #1575: Improve editor (improve bindings) Modified: trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/InputDesignEditorModel.java Modified: trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/InputDesignEditorModel.java =================================================================== --- trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/InputDesignEditorModel.java 2012-10-07 11:38:35 UTC (rev 84) +++ trunk/jmexico-editor/src/main/java/fr/reseaumexico/editor/InputDesignEditorModel.java 2012-10-07 12:00:10 UTC (rev 85) @@ -65,7 +65,6 @@ protected final AbstractTableModel tableModel; public InputDesignEditorModel() { - tableModel = new InputDesignTableModel(); } @@ -96,26 +95,29 @@ inputDesign.getExperimentDesign().getFactor()); firePropertyChange(PROPERTY_INPUT_DESIGN, oldValue, inputDesign); - firePropertyChange(PROPERTY_SCENARIO_EXISTS, null, isScenarioExists()); - // notify table structure has changed after notify new model is in - tableModel.fireTableStructureChanged(); + fireScenarioModified(); } @Override public void scenarioAdded(InputDesignScenarioEvent event) { - tableModel.fireTableStructureChanged(); + fireScenarioModified(); } @Override public void scenarioRemoved(InputDesignScenarioEvent event) { - tableModel.fireTableStructureChanged(); + fireScenarioModified(); } public Collection<Scenario> getScenario() { return inputDesign == null ? null : inputDesign.getScenario(); } + protected void fireScenarioModified() { + firePropertyChange(PROPERTY_SCENARIO_EXISTS, null, isScenarioExists()); + tableModel.fireTableStructureChanged(); + } + protected class InputDesignTableModel extends AbstractTableModel { private static final long serialVersionUID = 1L;