branch feature/7157 updated (90e2034 -> 2c551fe)
This is an automated email from the git hooks/post-receive script. New change to branch feature/7157 in repository tutti. See http://git.codelutin.com/tutti.git from 90e2034 permettre d'accéder aux mensuration directement après avroi créé le lot (refs #7157) new 2c551fe permettre de mesurer le lot benthos tout juste créé (fixes #7157) The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit 2c551fe6c614543197e18d47da6d5aa4e4bc6c78 Author: Kevin Morin <morin@codelutin.com> Date: Mon Dec 21 16:19:26 2015 +0100 permettre de mesurer le lot benthos tout juste créé (fixes #7157) Summary of changes: .../filtered-resources/tutti-help-fr.properties | 3 ++- .../operation/catches/EditCatchesUIHandler.java | 15 ++++++++++++ .../benthos/create/CreateBenthosBatchUI.css | 10 ++++++++ .../benthos/create/CreateBenthosBatchUI.jaxx | 1 + ...=> CreateBenthosBatchAndFrequenciesAction.java} | 7 +++--- .../frequency/BenthosFrequencyCellComponent.java | 28 +++++++++++----------- .../resources/i18n/tutti-ui-swing_en_GB.properties | 3 +++ .../resources/i18n/tutti-ui-swing_fr_FR.properties | 3 +++ 8 files changed, 52 insertions(+), 18 deletions(-) copy tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/actions/{CreateBenthosBatchAndCloseAction.java => CreateBenthosBatchAndFrequenciesAction.java} (87%) -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch feature/7157 in repository tutti. See http://git.codelutin.com/tutti.git commit 2c551fe6c614543197e18d47da6d5aa4e4bc6c78 Author: Kevin Morin <morin@codelutin.com> Date: Mon Dec 21 16:19:26 2015 +0100 permettre de mesurer le lot benthos tout juste créé (fixes #7157) --- .../filtered-resources/tutti-help-fr.properties | 3 +- .../operation/catches/EditCatchesUIHandler.java | 15 +++++ .../benthos/create/CreateBenthosBatchUI.css | 10 ++++ .../benthos/create/CreateBenthosBatchUI.jaxx | 1 + .../CreateBenthosBatchAndFrequenciesAction.java | 65 ++++++++++++++++++++++ .../frequency/BenthosFrequencyCellComponent.java | 28 +++++----- .../resources/i18n/tutti-ui-swing_en_GB.properties | 3 + .../resources/i18n/tutti-ui-swing_fr_FR.properties | 3 + 8 files changed, 113 insertions(+), 15 deletions(-) diff --git a/tutti-ui-swing/src/main/filtered-resources/tutti-help-fr.properties b/tutti-ui-swing/src/main/filtered-resources/tutti-help-fr.properties index 1c9e5c0..8b42df9 100644 --- a/tutti-ui-swing/src/main/filtered-resources/tutti-help-fr.properties +++ b/tutti-ui-swing/src/main/filtered-resources/tutti-help-fr.properties @@ -1,5 +1,5 @@ #Generated by org.nuiton.jaxx.plugin.GenerateHelpIdsMojo -#Mon Dec 21 14:56:20 CET 2015 +#Mon Dec 21 16:17:42 CET 2015 tutti.config.help=config.html tutti.createAccidentalBatch.action.cancel.help=editFishingOperation.html\#captureCapturesAccidentellesActions tutti.createAccidentalBatch.action.saveAndClose.help=editFishingOperation.html\#captureCapturesAccidentellesActions @@ -15,6 +15,7 @@ tutti.createBenthosBatch.action.addSpecies.help=editFishingOperation.html\#captu tutti.createBenthosBatch.action.cancel.help=editFishingOperation.html\#captureBenthosActions tutti.createBenthosBatch.action.saveAndClose.help=editFishingOperation.html\#captureBenthosActions tutti.createBenthosBatch.action.saveAndContinue.help=editFishingOperation.html\#captureBenthosActions +tutti.createBenthosBatch.action.saveAndFrequencies.help= tutti.createBenthosBatch.field.batchCount.help=editFishingOperation.html\#captureBenthosFields tutti.createBenthosBatch.field.batchWeight.help=editFishingOperation.html\#captureBenthosFields tutti.createBenthosBatch.field.categoryField.help=editFishingOperation.html\#captureBenthosFields diff --git a/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIHandler.java b/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIHandler.java index 39201b7..c13cd6c 100644 --- a/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIHandler.java +++ b/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIHandler.java @@ -25,6 +25,7 @@ package fr.ifremer.tutti.ui.swing.content.operation.catches; import com.google.common.collect.Sets; import fr.ifremer.tutti.persistence.entities.referential.Species; import fr.ifremer.tutti.ui.swing.content.operation.catches.benthos.BenthosBatchRowModel; +import fr.ifremer.tutti.ui.swing.content.operation.catches.benthos.BenthosBatchTableModel; import fr.ifremer.tutti.ui.swing.content.operation.catches.benthos.frequency.BenthosFrequencyCellComponent; import fr.ifremer.tutti.ui.swing.content.operation.catches.benthos.frequency.BenthosFrequencyUI; import fr.ifremer.tutti.ui.swing.content.operation.catches.species.SpeciesBatchRowModel; @@ -540,6 +541,20 @@ public class EditCatchesUIHandler extends AbstractTuttiTabContainerUIHandler<Edi } } + public void editBenthosFrequencies() { + JXTable benthosTable = ui.getBenthosTabContent().getTable(); + int selectedRow = benthosTable.getSelectedRow(); + + TableColumn frequenciesColumn = benthosTable.getColumn(BenthosBatchTableModel.COMPUTED_NUMBER); + int frequenciesColumnIndex = benthosTable.getColumns(false).indexOf(frequenciesColumn); + + BenthosFrequencyCellComponent.FrequencyCellEditor frequencyCellEditor = + (BenthosFrequencyCellComponent.FrequencyCellEditor) benthosTable.getCellEditor(selectedRow, frequenciesColumnIndex); + + frequencyCellEditor.initEditor(benthosTable, selectedRow, frequenciesColumnIndex); + frequencyCellEditor.startEdit(); + } + public void editBenthosFrequencies(BenthosFrequencyCellComponent.FrequencyCellEditor editor) { BenthosFrequencyUI frequencyEditor = ui.getBenthosTabFrequencyEditor(); diff --git a/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUI.css b/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUI.css index 97d6683..b429da0 100644 --- a/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUI.css +++ b/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUI.css @@ -166,6 +166,16 @@ NumberEditor { _help: {"tutti.createBenthosBatch.action.saveAndClose.help"}; } +#saveAndFrequenciesButton { + actionIcon: save; + text: "tutti.createBenthosBatch.action.saveAndFrequencies"; + toolTipText: "tutti.createBenthosBatch.action.saveAndFrequencies.tip"; + i18nMnemonic: "tutti.createBenthosBatch.action.saveAndFrequencies.mnemonic"; + enabled: {model.isValid()}; + _simpleAction: {fr.ifremer.tutti.ui.swing.content.operation.catches.benthos.create.actions.CreateBenthosBatchAndFrequenciesAction.class}; + _help: {"tutti.createBenthosBatch.action.saveAndFrequencies.help"}; +} + #cancelButton { actionIcon: cancel; text: "tutti.createBenthosBatch.action.cancel"; diff --git a/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUI.jaxx b/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUI.jaxx index 9ff2abf..a244af8 100644 --- a/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUI.jaxx +++ b/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUI.jaxx @@ -160,5 +160,6 @@ public CreateBenthosBatchUI(EditCatchesUI parentUI) { <JButton id='cancelButton'/> <JButton id='saveAndContinueButton'/> <JButton id='saveAndCloseButton'/> + <JButton id='saveAndFrequenciesButton'/> </JPanel> </JPanel> diff --git a/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/actions/CreateBenthosBatchAndFrequenciesAction.java b/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/actions/CreateBenthosBatchAndFrequenciesAction.java new file mode 100644 index 0000000..94dbe1a --- /dev/null +++ b/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/actions/CreateBenthosBatchAndFrequenciesAction.java @@ -0,0 +1,65 @@ +package fr.ifremer.tutti.ui.swing.content.operation.catches.benthos.create.actions; + +/* + * #%L + * Tutti :: UI + * $Id:$ + * $HeadURL:$ + * %% + * Copyright (C) 2012 - 2015 Ifremer + * %% + * 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 + * 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 + * License along with this program. If not, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + +import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUI; +import fr.ifremer.tutti.ui.swing.content.operation.catches.benthos.create.CreateBenthosBatchUI; +import fr.ifremer.tutti.ui.swing.util.actions.SimpleActionSupport; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * Created on 3/7/15. + * + * @author Tony Chemit - chemit@codelutin.com + * @since 3.15 + */ +public class CreateBenthosBatchAndFrequenciesAction extends SimpleActionSupport<CreateBenthosBatchUI> { + + /** Logger. */ + private static final Log log = LogFactory.getLog(CreateBenthosBatchAndFrequenciesAction.class); + + private static final long serialVersionUID = 1L; + + public CreateBenthosBatchAndFrequenciesAction(CreateBenthosBatchUI ui) { + super(ui); + } + + @Override + protected void onActionPerformed(CreateBenthosBatchUI ui) { + + if (log.isDebugEnabled()) { + log.debug("Save and Close UI " + ui); + } + + EditCatchesUI parent = ui.getParentContainer(EditCatchesUI.class); + parent.getBenthosTabContent().getHandler().addBatch(ui.getModel()); + + // close dialog + ui.getHandler().onCloseUI(); + + parent.getHandler().editBenthosFrequencies(); + } +} diff --git a/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/frequency/BenthosFrequencyCellComponent.java b/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/frequency/BenthosFrequencyCellComponent.java index dad0276..73b252f 100644 --- a/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/frequency/BenthosFrequencyCellComponent.java +++ b/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/frequency/BenthosFrequencyCellComponent.java @@ -35,16 +35,12 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.nuiton.jaxx.application.swing.table.ColumnIdentifier; -import javax.swing.AbstractCellEditor; -import javax.swing.JTable; -import javax.swing.UIManager; +import javax.swing.*; import javax.swing.border.LineBorder; import javax.swing.table.DefaultTableCellRenderer; import javax.swing.table.TableCellEditor; import javax.swing.table.TableCellRenderer; -import java.awt.Color; -import java.awt.Component; -import java.awt.Font; +import java.awt.*; import java.awt.event.KeyAdapter; import java.awt.event.KeyEvent; import java.awt.event.MouseAdapter; @@ -192,6 +188,15 @@ public class BenthosFrequencyCellComponent extends DefaultTableCellRenderer { return previousSiblingRow; } + public void initEditor(JTable table, int row, int column) { + tableModel = (BenthosBatchTableModel) table.getModel(); + this.table = table; + columnIdentifier = BenthosBatchTableModel.COMPUTED_NUMBER; + rowIndex = row; + columnIndex = column; + editRow = tableModel.getEntry(row); + } + public void startEdit() { Preconditions.checkNotNull(tableModel, "No table model assigned."); @@ -296,20 +301,15 @@ public class BenthosFrequencyCellComponent extends DefaultTableCellRenderer { boolean isSelected, int row, int column) { - tableModel = (BenthosBatchTableModel) table.getModel(); - this.table = table; - columnIdentifier = BenthosBatchTableModel.COMPUTED_NUMBER; + + initEditor(table, row, column); + if (log.isDebugEnabled()) { log.debug("Set columnIdentifier (" + column + ") :: " + columnIdentifier.getPropertyName()); } ComputableData<Integer> data = (ComputableData<Integer>) value; component.setComputedOrNotText(data); - rowIndex = row; - columnIndex = column; - - editRow = tableModel.getEntry(row); - return component; } diff --git a/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.properties b/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.properties index 67ff152..d8f358b 100644 --- a/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.properties +++ b/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.properties @@ -221,6 +221,9 @@ tutti.createBenthosBatch.action.saveAndClose.tip= tutti.createBenthosBatch.action.saveAndContinue= tutti.createBenthosBatch.action.saveAndContinue.mnemonic= tutti.createBenthosBatch.action.saveAndContinue.tip= +tutti.createBenthosBatch.action.saveAndFrequencies= +tutti.createBenthosBatch.action.saveAndFrequencies.mnemonic= +tutti.createBenthosBatch.action.saveAndFrequencies.tip= tutti.createBenthosBatch.field.batchCount= tutti.createBenthosBatch.field.batchCount.tip= tutti.createBenthosBatch.field.batchWeight= diff --git a/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties b/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties index aa89919..1203551 100644 --- a/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties +++ b/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties @@ -203,6 +203,9 @@ tutti.createBenthosBatch.action.saveAndClose.tip=Enregistrer la création du lot tutti.createBenthosBatch.action.saveAndContinue=Créer tutti.createBenthosBatch.action.saveAndContinue.mnemonic=C tutti.createBenthosBatch.action.saveAndContinue.tip=Enregistrer la création du lot espèce et en saisir un autre +tutti.createBenthosBatch.action.saveAndFrequencies=Créer et Mesurer +tutti.createBenthosBatch.action.saveAndFrequencies.mnemonic=M +tutti.createBenthosBatch.action.saveAndFrequencies.tip=Enregistrer la création du lot espèce et saisir les mensurations de ce lot tutti.createBenthosBatch.field.batchCount=Nombre tutti.createBenthosBatch.field.batchCount.tip=Saisir le nombre d'individus dans le lot tutti.createBenthosBatch.field.batchWeight=Poids du lot -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
participants (1)
-
codelutin.com scm