Author: kmorin Date: 2013-03-01 18:12:08 +0100 (Fri, 01 Mar 2013) New Revision: 510 Url: http://forge.codelutin.com/projects/tutti/repository/revisions/510 Log: fixes #2039 [ESPECE] - Saisie mensurations : Enregistrement des modifications non pris en compte Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUI.css trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIHandler.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIModel.java Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java 2013-03-01 11:56:41 UTC (rev 509) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java 2013-03-01 17:12:08 UTC (rev 510) @@ -942,6 +942,7 @@ SpeciesBatchTableModel tableModel = getTableModel(); SpeciesBatchRowModel row = tableModel.getEntry(rowIndex); + int selectedRowCount = getTable().getSelectedRowCount(); if (row.isValid()) { @@ -959,25 +960,28 @@ // can split if selected batch is a leaf enableSplit = row.isBatchLeaf() + && selectedRowCount == 1 && row.getComputedNumber() == null; } if (enableRename) { // can rename if selected batch is a parent - enableRename = row.isBatchRoot(); + enableRename = row.isBatchRoot() + && selectedRowCount == 1; } if (enableRemove) { // can always remove the batch - enableRemove = true; + enableRemove = selectedRowCount == 1; } if (enableRemoveSub) { // can remove sub batch if selected batch is not a leaf - enableRemoveSub = !row.isBatchLeaf(); + enableRemoveSub = !row.isBatchLeaf() + && selectedRowCount == 1; } if (enableCreateMelag) { @@ -985,11 +989,12 @@ JXTable table = getTable(); // can add species to a melag if several root are selected - int[] selectedRows = table.getSelectedRows(); - if (selectedRows.length < 2) { + + if (selectedRowCount < 2) { enableCreateMelag = false; } else { + int[] selectedRows = table.getSelectedRows(); for (int selectedRowIndex : selectedRows) { SpeciesBatchRowModel selectedRow = tableModel.getEntry(selectedRowIndex); Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUI.css =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUI.css 2013-03-01 11:56:41 UTC (rev 509) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUI.css 2013-03-01 17:12:08 UTC (rev 510) @@ -8,15 +8,15 @@ * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as - * published by the Free Software Foundation, either version 3 of the + * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public + * + * You should have received a copy of the GNU General Public * License along with this program. If not, see * <http://www.gnu.org/licenses/gpl-3.0.html>. * #L% @@ -98,6 +98,7 @@ useFloat: true; showReset: true; numberPattern: {DECIMAL1_PATTERN}; + enabled: {model.getLengthStepCaracteristic() != null}; } #generateButton { @@ -170,7 +171,7 @@ } #dataFieldLayout { - selected: {model.isSimpleCountingMode() ? "noLengthCaracteristicPmfm" : "lengthCaracteristicPmfm"}; + selected: {model.isSimpleCountingMode() ? "noLengthCaracteristicPmfm" : "lengthCaracteristicPmfm"}; } #dataFieldPanel { Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIHandler.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIHandler.java 2013-03-01 11:56:41 UTC (rev 509) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIHandler.java 2013-03-01 17:12:08 UTC (rev 510) @@ -10,15 +10,15 @@ * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as - * published by the Free Software Foundation, either version 3 of the + * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public + * + * You should have received a copy of the GNU General Public * License along with this program. If not, see * <http://www.gnu.org/licenses/gpl-3.0.html>. * #L% @@ -329,6 +329,7 @@ Float minStep = model.getLengthStep(model.getMinStep()); Float maxStep = model.getLengthStep(model.getMaxStep()); + Caracteristic lengthStepCaracteristic = model.getLengthStepCaracteristic(); for (float i = minStep, step = model.getStep(); i <= maxStep; i += step) { if (!rowsByStep.containsKey(i)) { @@ -336,6 +337,7 @@ // add it SpeciesFrequencyRowModel newRow = tableModel.createNewRow(); newRow.setLengthStep(i); + newRow.setLengthStepCaracteristic(lengthStepCaracteristic); rowsByStep.put(i, newRow); } } Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIModel.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIModel.java 2013-03-01 11:56:41 UTC (rev 509) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIModel.java 2013-03-01 17:12:08 UTC (rev 510) @@ -10,15 +10,15 @@ * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as - * published by the Free Software Foundation, either version 3 of the + * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public + * + * You should have received a copy of the GNU General Public * License along with this program. If not, see * <http://www.gnu.org/licenses/gpl-3.0.html>. * #L% @@ -150,6 +150,7 @@ Object oldValue = getLengthStepCaracteristic(); this.lengthStepCaracteristic = lengthStepCaracteristic; firePropertyChange(PROPERTY_LENGHT_STEP_CARACTERISTIC, oldValue, lengthStepCaracteristic); + firePropertyChange(PROPERTY_CAN_GENERATE, null, isCanGenerate()); } public Float getMinStep() { @@ -201,7 +202,7 @@ } public boolean isCanGenerate() { - return minStep != null && maxStep != null && maxStep > minStep; + return minStep != null && maxStep != null && maxStep > minStep && lengthStepCaracteristic != null; } public SpeciesBatchRowModel getBatch() {
participants (1)
-
kmorin@users.forge.codelutin.com