Author: tchemit Date: 2012-12-20 14:30:24 +0100 (Thu, 20 Dec 2012) New Revision: 94 Url: http://forge.codelutin.com/projects/tutti/repository/revisions/94 Log: refs #1804: Onglet captures Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/AbstractTuttiBatchUIModel.java Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/AbstractTuttiBatchTableUIHandler.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.jaxx trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationsUI.css trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationsUI.jaxx trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationsUIHandler.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/accidental/AccidentalBatchUI.jaxx trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/accidental/AccidentalBatchUIHandler.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/accidental/AccidentalBatchUIModel.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/benthos/BenthosBatchUI.css trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/benthos/BenthosBatchUI.jaxx trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/benthos/BenthosBatchUIHandler.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/benthos/BenthosBatchUIModel.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.css trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.jaxx trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIHandler.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIModel.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/macrowaste/MacroWasteBatchUI.css trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/macrowaste/MacroWasteBatchUI.jaxx trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/macrowaste/MacroWasteBatchUIHandler.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/macrowaste/MacroWasteBatchUIModel.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/plankton/PlanktonBatchUI.css trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/plankton/PlanktonBatchUI.jaxx trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/plankton/PlanktonBatchUIHandler.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/plankton/PlanktonBatchUIModel.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/species/SpeciesBatchUI.css trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/species/SpeciesBatchUI.jaxx trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/species/SpeciesBatchUIHandler.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/species/SpeciesBatchUIModel.java trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/AbstractTuttiBatchTableUIHandler.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/AbstractTuttiBatchTableUIHandler.java 2012-12-20 11:29:15 UTC (rev 93) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/AbstractTuttiBatchTableUIHandler.java 2012-12-20 13:30:24 UTC (rev 94) @@ -32,7 +32,7 @@ import fr.ifremer.tutti.persistence.entities.data.FishingOperation; import fr.ifremer.tutti.service.PersistenceService; import fr.ifremer.tutti.ui.swing.AbstractTuttiBeanUIModel; -import fr.ifremer.tutti.ui.swing.util.TuttiBeanMonitor; +import fr.ifremer.tutti.ui.swing.TuttiUI; import fr.ifremer.tutti.ui.swing.util.TuttiUIUtil; import fr.ifremer.tutti.ui.swing.util.table.AbstractTuttiTableModel; import fr.ifremer.tutti.ui.swing.util.table.AbstractTuttiTableUIHandler; @@ -85,20 +85,10 @@ */ protected final PersistenceService persistenceService; - /** - * To monitor changes on the fishing operation. - * - * @since 0.2 - */ - protected final TuttiBeanMonitor<M> fishingOperationMonitor; - - protected AbstractTuttiBatchTableUIHandler(FishingOperationsUI parentUi, - String[] fishingProperties, + protected AbstractTuttiBatchTableUIHandler(TuttiUI<?,?> parentUi, String... properties) { super(parentUi.getHandler().getContext(), properties); this.persistenceService = context.getService(PersistenceService.class); - this.fishingOperationMonitor = new TuttiBeanMonitor<M>( - fishingProperties); } public final void saveSelectedRowIfRequired(FocusEvent event) { Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/AbstractTuttiBatchUIModel.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/AbstractTuttiBatchUIModel.java (rev 0) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/AbstractTuttiBatchUIModel.java 2012-12-20 13:30:24 UTC (rev 94) @@ -0,0 +1,79 @@ +package fr.ifremer.tutti.ui.swing.content.operation; + +/* + * #%L + * Tutti :: UI + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2012 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 com.google.common.collect.Sets; +import fr.ifremer.tutti.persistence.entities.data.FishingOperation; +import fr.ifremer.tutti.ui.swing.AbstractTuttiBeanUIModel; +import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUIModel; +import fr.ifremer.tutti.ui.swing.util.table.AbstractTuttiTableUIModel; + +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; +import java.util.Set; + +/** + * Abstract model for ui in batch tabs. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.3 + */ +public class AbstractTuttiBatchUIModel<R extends AbstractTuttiBeanUIModel, B extends AbstractTuttiBatchUIModel<R, B>> extends AbstractTuttiTableUIModel<FishingOperation, R, B> { + + private static final long serialVersionUID = 1L; + + /** + * Fishing Operation to prapagate to catches model. + * + * @since 0.3 + */ + protected final Set<String> propagateProperties; + + /** + * Editing fishing catches model. + * + * @since 0.3 + */ + protected final EditCatchesUIModel catchesUIModel; + + protected AbstractTuttiBatchUIModel(EditCatchesUIModel catchesUIModel, + String... properties) { + super(FishingOperation.class, null, null); + this.catchesUIModel = catchesUIModel; + propagateProperties = Sets.newHashSet(properties); + catchesUIModel.addPropertyChangeListener(new PropertyChangeListener() { + @Override + public void propertyChange(PropertyChangeEvent evt) { + if (propagateProperties.contains(evt.getPropertyName())) { + firePropertyChange(evt.getPropertyName(), evt.getOldValue(), evt.getNewValue()); + } + } + }); + } + + public final FishingOperation getFishingOperation() { + return catchesUIModel == null ? null : catchesUIModel.getFishingOperation(); + } +} Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/AbstractTuttiBatchUIModel.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.jaxx =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.jaxx 2012-12-20 11:29:15 UTC (rev 93) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.jaxx 2012-12-20 13:30:24 UTC (rev 94) @@ -63,8 +63,6 @@ handler.beforeInitUI(); } -public void selectFishingOperation(FishingOperation fishingOperation) { handler.selectFishingOperation(fishingOperation); } - protected void $afterCompleteSetup() { handler.afterInitUI(); } ]]></script> @@ -268,8 +266,6 @@ <row> <cell columns='6'> <JPanel layout='{new GridLayout(1,0)}'> - <JButton id='importPupitriButton' - onActionPerformed='handler.importPupitri()'/> <JButton id='importCasinoButton' onActionPerformed='handler.importCasino()'/> </JPanel> @@ -279,13 +275,6 @@ <!-- Saisisseur --> <row weighty='0.3'> <cell columns='6'> - <!-- <JScrollPane id='saisisseurPane' - columnHeaderView="{saisisseurHeader}" - onFocusGained='saisisseurList.requestFocus()'> - <JList id='saisisseurList' - onValueChanged='handler.selectListData(event, "saisisseur")'/> - <BeanListHeader id='saisisseurHeader' genericType='Person'/> - </JScrollPane>--> <BeanDoubleList id='saisisseurList' genericType='Person'/> </cell> </row> @@ -307,14 +296,12 @@ title='tutti.label.tab.fishingOperation.gearShooting'> <GearShootingTabUI id='gearShootingTabContent' constructorParams='this'/> - </tab> <tab id='environmentTab' title='tutti.label.tab.fishingOperation.environment'> <EnvironmentTabUI id='environmentTabContent' constructorParams='this'/> - </tab> <tab id='traitHydrologyTabContent' Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java 2012-12-20 11:29:15 UTC (rev 93) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java 2012-12-20 13:30:24 UTC (rev 94) @@ -329,12 +329,29 @@ if (empty) { - model.fromBean(new FishingOperation()); - } else { + bean = new FishingOperation(); + } - model.fromBean(bean); + FishingOperationLocation strata = bean.getStrata(); + FishingOperationLocation subStrata = bean.getSubStrata(); + FishingOperationLocation location = bean.getLocation(); + + model.fromBean(bean); + + if (strata != null) { + ui.getStrataComboBox().setSelectedItem(strata); } + if (subStrata != null) { + ui.getSubStrataComboBox().setSelectedItem(subStrata); + } + + if (location != null) { + ui.getLocationComboBox().setSelectedItem(location); + } + + model.setFishingOperation(bean); + // update saisissuer selection List<Person> saisisseur = model.getSaisisseur(); ui.getSaisisseurList().getModel().setSelected(saisisseur); @@ -386,6 +403,7 @@ public void save() { // get fishingOperation to save + FishingOperation toSave = getModel().toBean(); if (log.isInfoEnabled()) { Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel.java 2012-12-20 11:29:15 UTC (rev 93) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel.java 2012-12-20 13:30:24 UTC (rev 94) @@ -144,11 +144,13 @@ protected String comment; protected List<Person> saisisseur; - + protected Map<Object, Object> gearShootingParameters; - + protected Map<Object, Object> environmentParameters; + protected FishingOperation fishingOperation; + protected Map<Object, Object> hydrologyParameters; protected static Binder<EditFishingOperationUIModel, FishingOperation> toBeanBinder = @@ -162,6 +164,14 @@ super(FishingOperation.class, fromBeanBinder, toBeanBinder); } + public FishingOperation getFishingOperation() { + return fishingOperation; + } + + public void setFishingOperation(FishingOperation fishingOperation) { + this.fishingOperation = fishingOperation; + } + public boolean isEmpty() { return empty; } @@ -359,6 +369,11 @@ firePropertyChange(PROPERTY_SAISISSEUR, null, saisisseur); } + @Override + protected FishingOperation newEntity() { + return fishingOperation; + } + public Map<Object, Object> getGearShootingParameters() { return gearShootingParameters; } @@ -378,11 +393,11 @@ this.environmentParameters = environmentParameters; firePropertyChange(PROPERTY_ENVIRONMENT_PARAMETERS, oldValue, environmentParameters); } - + public Map<Object, Object> getHydrologyParameters() { return hydrologyParameters; } - + public void setHydrologyParameters(Map<Object, Object> hydrologyParameters) { Object oldValue = getHydrologyParameters(); this.hydrologyParameters = hydrologyParameters; Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationsUI.css =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationsUI.css 2012-12-20 11:29:15 UTC (rev 93) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationsUI.css 2012-12-20 13:30:24 UTC (rev 94) @@ -41,28 +41,3 @@ #catchesTab { enabled: {model.getSelectedFishingOperation() != null}; } - -#speciesTab { - enabled: {model.getSelectedFishingOperation() != null}; -} - -#benthosTab { - enabled: {model.getSelectedFishingOperation() != null}; -} - -#planktonTab { - enabled: {model.getSelectedFishingOperation() != null}; -} - -#macroDechetTab { - enabled: {model.getSelectedFishingOperation() != null}; -} - -#accidentelTab { - enabled: {model.getSelectedFishingOperation() != null}; -} - -#observationIndividuelTab { - enabled: {false}; - /*enabled: {model.getSelectedFishingOperation() != null};*/ -} Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationsUI.jaxx =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationsUI.jaxx 2012-12-20 11:29:15 UTC (rev 93) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationsUI.jaxx 2012-12-20 13:30:24 UTC (rev 94) @@ -28,11 +28,6 @@ fr.ifremer.tutti.persistence.entities.data.FishingOperation fr.ifremer.tutti.ui.swing.TuttiUIContext - fr.ifremer.tutti.ui.swing.content.operation.accidental.AccidentalBatchUI - fr.ifremer.tutti.ui.swing.content.operation.benthos.BenthosBatchUI - fr.ifremer.tutti.ui.swing.content.operation.macrowaste.MacroWasteBatchUI - fr.ifremer.tutti.ui.swing.content.operation.plankton.PlanktonBatchUI - fr.ifremer.tutti.ui.swing.content.operation.species.SpeciesBatchUI fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUI jaxx.runtime.swing.editor.bean.BeanComboBox @@ -80,24 +75,6 @@ <tab id='catchesTab' title='tutti.label.tab.catches'> <EditCatchesUI id='catchesTabContent' constructorParams='this'/> </tab> - <tab id='speciesTab' title='tutti.label.tab.species'> - <SpeciesBatchUI id='speciesTabContent' constructorParams='this'/> - </tab> - <tab id='benthosTab' title='tutti.label.tab.benthos'> - <BenthosBatchUI id='benthosTabContent' constructorParams='this'/> - </tab> - <tab id='planktonTab' title='tutti.label.tab.plancton'> - <PlanktonBatchUI id='planktonTabContent' constructorParams='this'/> - </tab> - <tab id='macroDechetTab' title='tutti.label.tab.macroDechet'> - <MacroWasteBatchUI id='macroDechetTabContent' constructorParams='this'/> - </tab> - <tab id='accidentelTab' title='tutti.label.tab.accidentel'> - <AccidentalBatchUI id='accidentelTabContent' constructorParams='this'/> - </tab> - <tab id='observationIndividuelTab' title='tutti.label.tab.observationIndividuel'> - <JLabel text='tutti.to.be.done' horizontalAlignment='{JLabel.CENTER}'/> - </tab> </JTabbedPane> </JPanel> \ No newline at end of file Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationsUIHandler.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationsUIHandler.java 2012-12-20 11:29:15 UTC (rev 93) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationsUIHandler.java 2012-12-20 13:30:24 UTC (rev 94) @@ -30,9 +30,11 @@ import fr.ifremer.tutti.service.PersistenceService; import fr.ifremer.tutti.ui.swing.AbstractTuttiUIHandler; import fr.ifremer.tutti.ui.swing.TuttiUIContext; +import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUIModel; import org.apache.commons.lang3.time.DateUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.nuiton.util.decorator.Decorator; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; @@ -41,6 +43,8 @@ import java.util.Date; import java.util.List; +import static org.nuiton.i18n.I18n._; + /** * Handler of UI {@link FishingOperationsUI}. * @@ -72,6 +76,8 @@ } FishingOperationsUIModel model = new FishingOperationsUIModel(); + EditCatchesUIModel catchesUIModel = new EditCatchesUIModel(); + String cruiseId = context.getCruiseId(); // load existing cruise @@ -88,6 +94,7 @@ } ui.setContextValue(model); + ui.setContextValue(catchesUIModel); } @Override @@ -176,15 +183,28 @@ public void stateChanged(ChangeEvent e) { } }); + + String fishingOperationText; + + if (fishingOperation == null) { + fishingOperationText = ""; + } else { + Decorator<FishingOperation> decorator = + getDecorator(FishingOperation.class, null); + + fishingOperationText = + _("tutti.label.traitReminder", + decorator.toString(fishingOperation)); + } + // propagate fishingOperation to his tabs - ui.getFishingOperationTabContent().selectFishingOperation(fishingOperation); - ui.getCatchesTabContent().selectFishingOperation(fishingOperation); - ui.getSpeciesTabContent().selectFishingOperation(fishingOperation); - ui.getBenthosTabContent().selectFishingOperation(fishingOperation); - ui.getPlanktonTabContent().selectFishingOperation(fishingOperation); - ui.getMacroDechetTabContent().selectFishingOperation(fishingOperation); - ui.getAccidentelTabContent().selectFishingOperation(fishingOperation); + ui.getFishingOperationTabContent().getHandler().selectFishingOperation(fishingOperation + ); + ui.getCatchesTabContent().getHandler().selectFishingOperation(fishingOperation, + fishingOperationText); + + // repaint tabs ui.getTabPane().repaint(); // ui.getObservationIndividuelTabContent().selectFishingOperation(selectedFishingOperation); Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/accidental/AccidentalBatchUI.jaxx =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/accidental/AccidentalBatchUI.jaxx 2012-12-20 11:29:15 UTC (rev 93) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/accidental/AccidentalBatchUI.jaxx 2012-12-20 13:30:24 UTC (rev 94) @@ -25,10 +25,9 @@ implements='fr.ifremer.tutti.ui.swing.TuttiUI<AccidentalBatchUIModel, AccidentalBatchUIHandler>'> <import> - fr.ifremer.tutti.persistence.entities.data.FishingOperation - + fr.ifremer.tutti.ui.swing.TuttiUI fr.ifremer.tutti.ui.swing.TuttiUIContext - fr.ifremer.tutti.ui.swing.content.operation.FishingOperationsUI + fr.ifremer.tutti.ui.swing.util.editor.LongTextEditorUI fr.ifremer.tutti.ui.swing.util.editor.AttachmentEditorUI @@ -45,31 +44,26 @@ <script><![CDATA[ -public AccidentalBatchUI(FishingOperationsUI parentUI) { +public AccidentalBatchUI(TuttiUI<?,?> parentUI) { + JAXXUtil.initContext(this, parentUI); AccidentalBatchUIHandler handler = new AccidentalBatchUIHandler(parentUI, this); setContextValue(handler); handler.beforeInitUI(); } -public void selectFishingOperation(FishingOperation fishingOperation) { handler.selectFishingOperation(fishingOperation); } - protected void $afterCompleteSetup() { handler.afterInitUI(); } ]]></script> <AccidentalBatchUIHandler id='handler' - initializer='getContextValue(AccidentalBatchUIHandler.class)'/> + initializer='getContextValue(AccidentalBatchUIHandler.class)'/> <AccidentalBatchUIModel id='model' - initializer='getContextValue(AccidentalBatchUIModel.class)'/> + initializer='getContextValue(AccidentalBatchUIModel.class)'/> <LongTextEditorUI id='longTextEditor'/> <AttachmentEditorUI id='attachmentEditor'/> - <JPanel constraints='BorderLayout.NORTH' layout='{new BorderLayout()}'> - <JLabel id='fishingOperationReminderLabel' - constraints='BorderLayout.NORTH'/> - <JSeparator constraints='BorderLayout.CENTER'/> - </JPanel> + <JScrollPane id='tableScrollPane' constraints='BorderLayout.CENTER'> <JXTable id='table' onFocusLost='handler.saveSelectedRowIfRequired(event)'/> </JScrollPane> Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/accidental/AccidentalBatchUIHandler.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/accidental/AccidentalBatchUIHandler.java 2012-12-20 11:29:15 UTC (rev 93) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/accidental/AccidentalBatchUIHandler.java 2012-12-20 13:30:24 UTC (rev 94) @@ -33,11 +33,10 @@ import fr.ifremer.tutti.service.DecoratorService; import fr.ifremer.tutti.ui.swing.TuttiUI; import fr.ifremer.tutti.ui.swing.content.operation.AbstractTuttiBatchTableUIHandler; -import fr.ifremer.tutti.ui.swing.content.operation.FishingOperationsUI; +import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUIModel; import fr.ifremer.tutti.ui.swing.util.TuttiBeanMonitor; import fr.ifremer.tutti.ui.swing.util.editor.AttachmentCellComponent; import fr.ifremer.tutti.ui.swing.util.editor.LongTextCellComponent; -import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.jdesktop.swingx.JXTable; @@ -47,7 +46,6 @@ import javax.swing.table.TableColumnModel; import java.util.List; -import static org.nuiton.i18n.I18n._; import static org.nuiton.i18n.I18n.n_; /** @@ -67,9 +65,9 @@ */ private final AccidentalBatchUI ui; - public AccidentalBatchUIHandler(FishingOperationsUI parentUi, + public AccidentalBatchUIHandler(TuttiUI<?, ?> parentUi, AccidentalBatchUI ui) { - super(parentUi, ArrayUtils.EMPTY_STRING_ARRAY, + super(parentUi, AccidentalBatchRowModel.PROPERTY_SPECIES, AccidentalBatchRowModel.PROPERTY_WEIGHT, AccidentalBatchRowModel.PROPERTY_COMMENT); @@ -277,21 +275,6 @@ table.editingCanceled(null); } - if (fishingOperationMonitor.wasModified()) { - - // previous fishingOperation was modified, let's save it - AccidentalBatchUIModel beanToSave = fishingOperationMonitor.getBean(); - - FishingOperation fishingOperation = beanToSave.toBean(); - - if (log.isInfoEnabled()) { - log.info("FishingOperation " + fishingOperation.getId() + - " was modified, will save it."); - } - - persistenceService.saveFishingOperation(fishingOperation); - } - // make sure selection is empty (will remove bean from monitor) table.clearSelection(); @@ -301,24 +284,13 @@ List<AccidentalBatchRowModel> rows; - String fishingoperationText; - if (empty) { rows = null; - bean = new FishingOperation(); - model.setFishingOperation(null); - fishingoperationText = ""; } else { - Decorator<FishingOperation> decorator = - getDecorator(FishingOperation.class, null); - - fishingoperationText = - _("tutti.label.traitReminder", decorator.toString(bean)); - if (log.isInfoEnabled()) { - log.info("Get species batch for fishingOperation: " + - bean.getId() + " - " + fishingoperationText); + log.info("Get accidental batch for fishingOperation: " + + bean.getId()); } rows = Lists.newArrayList(); @@ -331,15 +303,9 @@ rows.add(entry); } } - model.setFishingOperation(bean); - } - model.fromBean(bean); + } model.setRows(rows); - - fishingOperationMonitor.clearModified(); - - ui.getFishingOperationReminderLabel().setText(fishingoperationText); } //------------------------------------------------------------------------// @@ -353,10 +319,11 @@ log.info("beforeInit: " + ui); } - AccidentalBatchUIModel model = new AccidentalBatchUIModel(); - ui.setContextValue(model); + EditCatchesUIModel catchesUIModel = + ui.getContextValue(EditCatchesUIModel.class); - fishingOperationMonitor.setBean(model); + AccidentalBatchUIModel model = new AccidentalBatchUIModel(catchesUIModel); + ui.setContextValue(model); } @Override Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/accidental/AccidentalBatchUIModel.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/accidental/AccidentalBatchUIModel.java 2012-12-20 11:29:15 UTC (rev 93) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/accidental/AccidentalBatchUIModel.java 2012-12-20 13:30:24 UTC (rev 94) @@ -24,50 +24,19 @@ * #L% */ -import fr.ifremer.tutti.persistence.entities.data.FishingOperation; -import fr.ifremer.tutti.ui.swing.util.table.AbstractTuttiTableUIModel; -import org.nuiton.util.beans.Binder; -import org.nuiton.util.beans.BinderModelBuilder; +import fr.ifremer.tutti.ui.swing.content.operation.AbstractTuttiBatchUIModel; +import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUIModel; /** * @author tchemit <chemit@codelutin.com> * @since 0.2 */ -public class AccidentalBatchUIModel extends AbstractTuttiTableUIModel<FishingOperation, AccidentalBatchRowModel, AccidentalBatchUIModel> { +public class AccidentalBatchUIModel extends AbstractTuttiBatchUIModel<AccidentalBatchRowModel, AccidentalBatchUIModel> { private static final long serialVersionUID = 1L; - /** - * Editing fishing operation. - * - * @since 0.2 - */ - protected FishingOperation fishingOperation; - - - protected static final Binder<FishingOperation, AccidentalBatchUIModel> fromBeanBinder = BinderModelBuilder.newEmptyBuilder(FishingOperation.class, AccidentalBatchUIModel.class) - .addProperty(FishingOperation.PROPERTY_ID, PROPERTY_ID) - .toBinder(); - - protected static final Binder<AccidentalBatchUIModel, FishingOperation> toBeanBinder = BinderModelBuilder.newEmptyBuilder(AccidentalBatchUIModel.class, FishingOperation.class) - .toBinder(); - - - public AccidentalBatchUIModel() { - super(FishingOperation.class, fromBeanBinder, toBeanBinder); + public AccidentalBatchUIModel(EditCatchesUIModel catchesUIModel) { + super(catchesUIModel); } - public FishingOperation getFishingOperation() { - return fishingOperation; - } - - public void setFishingOperation(FishingOperation fishingOperation) { - this.fishingOperation = fishingOperation; - } - - - @Override - protected FishingOperation newEntity() { - return fishingOperation; - } } \ No newline at end of file Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/benthos/BenthosBatchUI.css =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/benthos/BenthosBatchUI.css 2012-12-20 11:29:15 UTC (rev 93) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/benthos/BenthosBatchUI.css 2012-12-20 13:30:24 UTC (rev 94) @@ -29,26 +29,26 @@ showReset: true; } -#totalWeightLabel { - text: "tutti.label.benthos.totalWeight"; - labelFor: {totalWeightField}; +#benthosTotalWeightLabel { + text: "tutti.label.catches.benthosTotalWeight"; + labelFor: {benthosTotalWeightField}; } -#totalWeightField { - property: "totalWeight"; - model: {model.getTotalWeight()}; +#benthosTotalWeightField { + property: "benthosTotalWeight"; + model: {model.getBenthosTotalWeight()}; useFloat: false; numberPattern: {INT_6_DIGITS_PATTERN}; } -#sampleTotalWeightLabel { - text: "tutti.label.benthos.sampleTotalWeight"; - labelFor: {sampleTotalWeightField}; +#benthosSampleTotalWeightLabel { + text: "tutti.label.catches.benthosSampleTotalWeight"; + labelFor: {benthosSampleTotalWeightField}; } -#sampleTotalWeightField { - property: "sampleTotalWeight"; - model: {model.getSampleTotalWeight()}; +#benthosSampleTotalWeightField { + property: "benthosSampleTotalWeight"; + model: {model.getBenthosSampleTotalWeight()}; useFloat: false; numberPattern: {INT_6_DIGITS_PATTERN}; } Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/benthos/BenthosBatchUI.jaxx =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/benthos/BenthosBatchUI.jaxx 2012-12-20 11:29:15 UTC (rev 93) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/benthos/BenthosBatchUI.jaxx 2012-12-20 13:30:24 UTC (rev 94) @@ -25,10 +25,9 @@ implements='fr.ifremer.tutti.ui.swing.TuttiUI<BenthosBatchUIModel, BenthosBatchUIHandler>'> <import> - fr.ifremer.tutti.persistence.entities.data.FishingOperation - + fr.ifremer.tutti.ui.swing.TuttiUI fr.ifremer.tutti.ui.swing.TuttiUIContext - fr.ifremer.tutti.ui.swing.content.operation.FishingOperationsUI + fr.ifremer.tutti.ui.swing.util.editor.LongTextEditorUI fr.ifremer.tutti.ui.swing.util.editor.AttachmentEditorUI @@ -48,14 +47,13 @@ <script><![CDATA[ -public BenthosBatchUI(FishingOperationsUI parentUI) { +public BenthosBatchUI(TuttiUI<?,?> parentUI) { + JAXXUtil.initContext(this, parentUI); BenthosBatchUIHandler handler = new BenthosBatchUIHandler(parentUI, this); setContextValue(handler); handler.beforeInitUI(); } -public void selectFishingOperation(FishingOperation fishingOperation) { handler.selectFishingOperation(fishingOperation); } - protected void $afterCompleteSetup() { handler.afterInitUI(); } ]]></script> @@ -69,43 +67,39 @@ <BeanValidator id='validator' bean='model' errorTableModel='errorTableModel' uiClass='jaxx.runtime.validator.swing.ui.ImageValidationUI'> - <field name='totalWeight' component='totalWeightField'/> - <field name='sampleTotalWeight' component='sampleTotalWeightField'/> + <field name='benthosTotalWeight' component='benthosTotalWeightField'/> + <field name='benthosSampleTotalWeight' + component='benthosSampleTotalWeightField'/> </BeanValidator> <LongTextEditorUI id='longTextEditor'/> <AttachmentEditorUI id='attachmentEditor'/> - <JPanel constraints='BorderLayout.NORTH' layout='{new BorderLayout()}'> - <JLabel id='fishingOperationReminderLabel' - constraints='BorderLayout.NORTH'/> - <JSeparator constraints='BorderLayout.CENTER'/> + <Table id='form' fill='both' constraints='BorderLayout.NORTH'> - <Table id='form' fill='both' constraints='BorderLayout.SOUTH'> + <!-- Poids total --> + <row> + <cell anchor='west'> + <JLabel id='benthosTotalWeightLabel'/> + </cell> + <cell weightx='1.0'> + <NumberEditor id='benthosTotalWeightField' constructorParams='this'/> + </cell> + </row> - <!-- Poids total --> - <row> - <cell anchor='west'> - <JLabel id='totalWeightLabel'/> - </cell> - <cell weightx='1.0'> - <NumberEditor id='totalWeightField' constructorParams='this'/> - </cell> - </row> + <!-- Poids total échantillonné --> + <row> + <cell> + <JLabel id='benthosSampleTotalWeightLabel'/> + </cell> + <cell> + <NumberEditor id='benthosSampleTotalWeightField' + constructorParams='this'/> + </cell> + </row> + </Table> - <!-- Poids total échantillonné --> - <row> - <cell> - <JLabel id='sampleTotalWeightLabel'/> - </cell> - <cell> - <NumberEditor id='sampleTotalWeightField' constructorParams='this'/> - </cell> - </row> - </Table> - </JPanel> - <JScrollPane id='tableScrollPane' constraints='BorderLayout.CENTER'> <JXTable id='table' onFocusLost='handler.saveSelectedRowIfRequired(event);'/> Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/benthos/BenthosBatchUIHandler.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/benthos/BenthosBatchUIHandler.java 2012-12-20 11:29:15 UTC (rev 93) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/benthos/BenthosBatchUIHandler.java 2012-12-20 13:30:24 UTC (rev 94) @@ -33,7 +33,7 @@ import fr.ifremer.tutti.service.DecoratorService; import fr.ifremer.tutti.ui.swing.TuttiUI; import fr.ifremer.tutti.ui.swing.content.operation.AbstractTuttiBatchTableUIHandler; -import fr.ifremer.tutti.ui.swing.content.operation.FishingOperationsUI; +import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUIModel; import fr.ifremer.tutti.ui.swing.util.TuttiBeanMonitor; import fr.ifremer.tutti.ui.swing.util.editor.AttachmentCellComponent; import fr.ifremer.tutti.ui.swing.util.editor.LongTextCellComponent; @@ -46,7 +46,6 @@ import javax.swing.table.TableColumnModel; import java.util.List; -import static org.nuiton.i18n.I18n._; import static org.nuiton.i18n.I18n.n_; /** @@ -66,11 +65,9 @@ */ private final BenthosBatchUI ui; - public BenthosBatchUIHandler(FishingOperationsUI parentUi, + public BenthosBatchUIHandler(TuttiUI<?, ?> parentUi, BenthosBatchUI ui) { super(parentUi, - new String[]{BenthosBatchUIModel.PROPERTY_TOTAL_WEIGHT, - BenthosBatchUIModel.PROPERTY_SAMPLE_TOTAL_WEIGHT}, BenthosBatchRowModel.PROPERTY_SPECIES_TO_CONFIRM, BenthosBatchRowModel.PROPERTY_SPECIES, BenthosBatchRowModel.PROPERTY_WEIGHT, @@ -307,21 +304,6 @@ table.editingCanceled(null); } - if (fishingOperationMonitor.wasModified()) { - - // previous fishingOperation was modified, let's save it - BenthosBatchUIModel beanToSave = fishingOperationMonitor.getBean(); - - FishingOperation fishingOperation = beanToSave.toBean(); - - if (log.isInfoEnabled()) { - log.info("FishingOperation " + fishingOperation.getId() + - " was modified, will save it."); - } - - persistenceService.saveFishingOperation(fishingOperation); - } - // make sure selection is empty (will remove bean from monitor) table.clearSelection(); @@ -331,24 +313,13 @@ List<BenthosBatchRowModel> rows; - String fishingoperationText; - if (empty) { rows = null; - bean = new FishingOperation(); - model.setFishingOperation(null); - fishingoperationText = ""; } else { - Decorator<FishingOperation> decorator = - getDecorator(FishingOperation.class, null); - - fishingoperationText = - _("tutti.label.traitReminder", decorator.toString(bean)); - if (log.isInfoEnabled()) { log.info("Get species batch for fishingOperation: " + - bean.getId() + " - " + fishingoperationText); + bean.getId()); } rows = Lists.newArrayList(); @@ -361,15 +332,9 @@ rows.add(entry); } } - model.setFishingOperation(bean); } - model.fromBean(bean); model.setRows(rows); - - fishingOperationMonitor.clearModified(); - - ui.getFishingOperationReminderLabel().setText(fishingoperationText); } @@ -384,10 +349,13 @@ log.info("beforeInit: " + ui); } - BenthosBatchUIModel model = new BenthosBatchUIModel(); + EditCatchesUIModel catchesUIModel = + ui.getContextValue(EditCatchesUIModel.class); + + BenthosBatchUIModel model = new BenthosBatchUIModel(catchesUIModel); ui.setContextValue(model); - fishingOperationMonitor.setBean(model); +// fishingOperationMonitor.setBean(model); } @Override Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/benthos/BenthosBatchUIModel.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/benthos/BenthosBatchUIModel.java 2012-12-20 11:29:15 UTC (rev 93) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/benthos/BenthosBatchUIModel.java 2012-12-20 13:30:24 UTC (rev 94) @@ -24,90 +24,36 @@ * #L% */ -import fr.ifremer.tutti.persistence.entities.data.FishingOperation; -import fr.ifremer.tutti.ui.swing.util.table.AbstractTuttiTableUIModel; -import org.nuiton.util.beans.Binder; -import org.nuiton.util.beans.BinderModelBuilder; +import fr.ifremer.tutti.ui.swing.content.operation.AbstractTuttiBatchUIModel; +import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUIModel; /** * @author tchemit <chemit@codelutin.com> * @since 0.1 */ -public class BenthosBatchUIModel extends AbstractTuttiTableUIModel<FishingOperation, BenthosBatchRowModel, BenthosBatchUIModel> { +public class BenthosBatchUIModel extends AbstractTuttiBatchUIModel<BenthosBatchRowModel, BenthosBatchUIModel> { private static final long serialVersionUID = 1L; - public static final String PROPERTY_TOTAL_WEIGHT = "totalWeight"; - - public static final String PROPERTY_SAMPLE_TOTAL_WEIGHT = "sampleTotalWeight"; - - /** - * Editing fishing operation. - * - * @since 0.2 - */ - protected FishingOperation fishingOperation; - - /** - * Total Weight filled in screen. - * - * @since 0.2 - */ - protected Float totalWeight; - - /** - * Total Sample Weight filled in screen. - * - * @since 0.2 - */ - protected Float sampleTotalWeight; - - protected static final Binder<FishingOperation, BenthosBatchUIModel> fromBeanBinder = BinderModelBuilder.newEmptyBuilder(FishingOperation.class, BenthosBatchUIModel.class) - .addProperty(FishingOperation.PROPERTY_BENTHOS_TOTAL_WEIGHT, PROPERTY_TOTAL_WEIGHT) - .addProperty(FishingOperation.PROPERTY_BENTHOS_SAMPLE_TOTAL_WEIGHT, PROPERTY_SAMPLE_TOTAL_WEIGHT) - .addProperty(FishingOperation.PROPERTY_ID, PROPERTY_ID) - .toBinder(); - - protected static final Binder<BenthosBatchUIModel, FishingOperation> toBeanBinder = BinderModelBuilder.newEmptyBuilder(BenthosBatchUIModel.class, FishingOperation.class) - .addProperty(PROPERTY_TOTAL_WEIGHT, FishingOperation.PROPERTY_BENTHOS_TOTAL_WEIGHT) - .addProperty(PROPERTY_SAMPLE_TOTAL_WEIGHT, FishingOperation.PROPERTY_BENTHOS_SAMPLE_TOTAL_WEIGHT) - .toBinder(); - - - public BenthosBatchUIModel() { - super(FishingOperation.class, fromBeanBinder, toBeanBinder); + public BenthosBatchUIModel(EditCatchesUIModel catchesUIModel) { + super(catchesUIModel, + EditCatchesUIModel.PROPERTY_BENTHOS_TOTAL_WEIGHT, + EditCatchesUIModel.PROPERTY_BENTHOS_SAMPLE_TOTAL_WEIGHT); } - public FishingOperation getFishingOperation() { - return fishingOperation; + public Float getBenthosTotalWeight() { + return catchesUIModel.getBenthosTotalWeight(); } - public void setFishingOperation(FishingOperation fishingOperation) { - this.fishingOperation = fishingOperation; + public void setBenthosTotalWeight(Float benthosTotalWeight) { + catchesUIModel.setBenthosTotalWeight(benthosTotalWeight); } - public Float getTotalWeight() { - return totalWeight; + public Float getBenthosSampleTotalWeight() { + return catchesUIModel.getBenthosSampleTotalWeight(); } - public void setTotalWeight(Float totalWeight) { - Object oldValue = getTotalWeight(); - this.totalWeight = totalWeight; - firePropertyChange(PROPERTY_TOTAL_WEIGHT, oldValue, totalWeight); + public void setBenthosSampleTotalWeight(Float benthosSampleTotalWeight) { + catchesUIModel.setBenthosSampleTotalWeight(benthosSampleTotalWeight); } - - public Float getSampleTotalWeight() { - return sampleTotalWeight; - } - - public void setSampleTotalWeight(Float sampleTotalWeight) { - Object oldValue = getSampleTotalWeight(); - this.sampleTotalWeight = sampleTotalWeight; - firePropertyChange(PROPERTY_SAMPLE_TOTAL_WEIGHT, oldValue, sampleTotalWeight); - } - - @Override - protected FishingOperation newEntity() { - return fishingOperation; - } } \ No newline at end of file Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.css =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.css 2012-12-20 11:29:15 UTC (rev 93) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.css 2012-12-20 13:30:24 UTC (rev 94) @@ -1,3 +1,26 @@ +/* + * #%L + * Tutti :: UI + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2012 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% + */ NumberEditor { autoPopup: {handler.getConfig().isAutoPopupNumberEditor()}; @@ -6,8 +29,28 @@ showReset: true; } +#speciesTable { + border: {BorderFactory.createTitledBorder(_("tutti.legend.speciesCatches"))}; +} + +#benthosTable { + border: {BorderFactory.createTitledBorder(_("tutti.legend.benthosCatches"))}; +} + +#planktonTable { + border: {BorderFactory.createTitledBorder(_("tutti.legend.planktonCatches"))}; +} + +#macroWasteTable { + border: {BorderFactory.createTitledBorder(_("tutti.legend.macroWasteCatches"))}; +} + +#accidentalTable { + border: {BorderFactory.createTitledBorder(_("tutti.legend.accidentalCatches"))}; +} + #speciesTotalWeightLabel { - text: "tutti.label.species.speciesTotalWeight"; + text: "tutti.label.catches.speciesTotalWeight"; labelFor: {speciesTotalWeightField}; } @@ -19,7 +62,7 @@ } #speciesTotalVracWeightLabel { - text: "tutti.label.species.speciesTotalVracWeight"; + text: "tutti.label.catches.speciesTotalVracWeight"; labelFor: {speciesTotalVracWeightField}; } @@ -31,7 +74,7 @@ } #speciesSampleVracWeightLabel { - text: "tutti.label.species.speciesSampleVracWeight"; + text: "tutti.label.catches.speciesSampleVracWeight"; labelFor: {speciesSampleVracWeightField}; } @@ -43,7 +86,7 @@ } #speciesTotalHorsVracWeightLabel { - text: "tutti.label.species.speciesTotalHorsVracWeight"; + text: "tutti.label.catches.speciesTotalHorsVracWeight"; labelFor: {speciesTotalHorsVracWeightField}; } @@ -53,7 +96,7 @@ } #benthosTotalWeightLabel { - text: "tutti.label.benthos.benthosTotalWeight"; + text: "tutti.label.catches.benthosTotalWeight"; labelFor: {benthosTotalWeightField}; } @@ -65,7 +108,7 @@ } #benthosSampleTotalWeightLabel { - text: "tutti.label.benthos.benthosSampleTotalWeight"; + text: "tutti.label.catches.benthosSampleTotalWeight"; labelFor: {benthosSampleTotalWeightField}; } @@ -77,7 +120,7 @@ } #planktonTotalWeightLabel { - text: "tutti.label.plankton.planktontotalWeight"; + text: "tutti.label.catches.planktonTotalWeight"; labelFor: {planktonTotalWeightField}; } @@ -89,7 +132,7 @@ } #planktonSampleTotalWeightLabel { - text: "tutti.label.plankton.planktonSampleTotalWeight"; + text: "tutti.label.catches.planktonSampleTotalWeight"; labelFor: {planktonSampleTotalWeightField}; } @@ -101,7 +144,7 @@ } #macroWasteTotalWeightLabel { - text: "tutti.label.macroWaste.macroWasteTotalWeight"; + text: "tutti.label.catches.macroWasteTotalWeight"; labelFor: {macroWasteTotalWeightField}; } @@ -111,3 +154,12 @@ useFloat: false; numberPattern: {INT_6_DIGITS_PATTERN}; } + +#importPupitriButton { + actionIcon: "pupitri-import"; + text: "tutti.action.pupitri-import"; +} + +#observationIndividuelTab { + enabled: {false}; +} Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.css ___________________________________________________________________ Modified: svn:keywords - Author Date Id Revision + Author Date Id Revision HeadURL Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.jaxx =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.jaxx 2012-12-20 11:29:15 UTC (rev 93) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.jaxx 2012-12-20 13:30:24 UTC (rev 94) @@ -1,3 +1,26 @@ +<!-- + #%L + Tutti :: UI + $Id$ + $HeadURL$ + %% + Copyright (C) 2012 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% + --> <JPanel id='homePanel' layout='{new BorderLayout()}' implements='fr.ifremer.tutti.ui.swing.TuttiUI<EditCatchesUIModel, EditCatchesUIHandler>'> @@ -2,11 +25,16 @@ <import> - fr.ifremer.tutti.persistence.entities.data.FishingOperation + fr.ifremer.tutti.ui.swing.TuttiUIContext - fr.ifremer.tutti.ui.swing.TuttiUIContext fr.ifremer.tutti.ui.swing.content.operation.FishingOperationsUI - fr.ifremer.tutti.ui.swing.content.operation.species.SpeciesFrequencyUI + fr.ifremer.tutti.ui.swing.content.operation.accidental.AccidentalBatchUI + fr.ifremer.tutti.ui.swing.content.operation.benthos.BenthosBatchUI + fr.ifremer.tutti.ui.swing.content.operation.macrowaste.MacroWasteBatchUI + fr.ifremer.tutti.ui.swing.content.operation.plankton.PlanktonBatchUI + fr.ifremer.tutti.ui.swing.content.operation.species.SpeciesBatchUI + fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUI fr.ifremer.tutti.ui.swing.util.editor.LongTextEditorUI fr.ifremer.tutti.ui.swing.util.editor.AttachmentEditorUI org.jdesktop.swingx.JXTable + org.jdesktop.swingx.JXTitledPanel @@ -28,71 +56,212 @@ <script><![CDATA[ public EditCatchesUI(FishingOperationsUI parentUI) { + JAXXUtil.initContext(this, parentUI); EditCatchesUIHandler handler = new EditCatchesUIHandler(parentUI, this); setContextValue(handler); handler.beforeInitUI(); } -public void selectFishingOperation(FishingOperation fishingOperation) { handler.selectFishingOperation(fishingOperation); } - protected void $afterCompleteSetup() { handler.afterInitUI(); } ]]></script> <EditCatchesUIHandler id='handler' - initializer='getContextValue(EditCatchesUIHandler.class)'/> + initializer='getContextValue(EditCatchesUIHandler.class)'/> <EditCatchesUIModel id='model' - initializer='getContextValue(EditCatchesUIModel.class)'/> + initializer='getContextValue(EditCatchesUIModel.class)'/> <SwingValidatorMessageTableModel id='errorTableModel'/> <BeanValidator id='validator' bean='model' errorTableModel='errorTableModel' uiClass='jaxx.runtime.validator.swing.ui.ImageValidationUI'> - <field name='speciesTotalWeight' component='speciesTotalWeightField'/> - <field name='speciesTotalVracWeight' component='speciesTotalVracWeightField'/> - <field name='speciesSampleVracWeight' component='speciesSampleVracWeightField'/> - <field name='speciesTotalHorsVracWeight' component='speciesTotalHorsVracWeightField'/> + <field name='speciesTotalWeight' + component='speciesTotalWeightField'/> + <field name='speciesTotalVracWeight' + component='speciesTotalVracWeightField'/> + <field name='speciesSampleVracWeight' + component='speciesSampleVracWeightField'/> + <field name='speciesTotalHorsVracWeight' + component='speciesTotalHorsVracWeightField'/> + <field name='benthosTotalWeight' + component='benthosTotalWeightField'/> + <field name='benthosSampleTotalWeight' + component='benthosSampleTotalWeightField'/> + <field name='planktonTotalWeight' + component='planktonTotalWeightField'/> + <field name='planktonSampleTotalWeight' + component='planktonSampleTotalWeightField'/> + <field name='macroWasteTotalWeight' + component='macroWasteTotalWeightField'/> </BeanValidator> - <JPanel constraints='BorderLayout.NORTH' layout='{new BorderLayout()}'> - <JLabel id='fishingOperationReminderLabel' - constraints='BorderLayout.NORTH'/> - <JSeparator constraints='BorderLayout.CENTER'/> + <JTabbedPane id='tabPane' constraints='BorderLayout.CENTER'> + <tab id='catchesCaracteristicsTab' + title='tutti.label.tab.catchesCaracteristics'> + <JXTitledPanel id='catchesTabsFishingOperationReminderLabel'> + <Table id="catchesForm" fill='both' weightx='1'> + <row> + <cell> + <Table id='speciesTable' fill='both'> - <Table id='form' fill='both' constraints='BorderLayout.SOUTH'> + <!-- Poids total / Poids total vrac --> + <row> + <cell anchor='west'> + <JLabel id='speciesTotalWeightLabel'/> + </cell> + <cell weightx='1.0'> + <NumberEditor id='speciesTotalWeightField' + constructorParams='this'/> + </cell> + <cell anchor='west'> + <JLabel id='speciesTotalVracWeightLabel'/> + </cell> + <cell weightx='1.0'> + <NumberEditor id='speciesTotalVracWeightField' + constructorParams='this'/> + </cell> + </row> - <!-- Poids total / Poids total vrac --> - <row> - <cell anchor='west'> - <JLabel id='speciesTotalWeightLabel'/> - </cell> - <cell weightx='1.0'> - <NumberEditor id='speciesTotalWeightField' constructorParams='this'/> - </cell> - <cell anchor='west'> - <JLabel id='speciesTotalVracWeightLabel'/> - </cell> - <cell weightx='1.0'> - <NumberEditor id='speciesTotalVracWeightField' constructorParams='this'/> - </cell> - </row> + <!-- Poids échantillonné vrac / Poids total hors vrac --> + <row> + <cell> + <JLabel id='speciesSampleVracWeightLabel'/> + </cell> + <cell> + <NumberEditor id='speciesSampleVracWeightField' + constructorParams='this'/> + </cell> + <cell> + <JLabel id='speciesTotalHorsVracWeightLabel'/> + </cell> + <cell> + <JTextField id='speciesTotalHorsVracWeightField'/> + </cell> + </row> + </Table> + </cell> + </row> + <row> + <cell> + <Table id='benthosTable' fill='both'> - <!-- Poids échantillonné vrac / Poids total hors vrac --> - <row> - <cell> - <JLabel id='speciesSampleVracWeightLabel'/> - </cell> - <cell> - <NumberEditor id='speciesSampleVracWeightField' constructorParams='this'/> - </cell> - <cell> - <JLabel id='speciesTotalHorsVracWeightLabel'/> - </cell> - <cell> - <JTextField id='speciesTotalHorsVracWeightField'/> - </cell> - </row> - </Table> - </JPanel> + <!-- Poids total --> + <row> + <cell anchor='west'> + <JLabel id='benthosTotalWeightLabel'/> + </cell> + <cell weightx='1.0'> + <NumberEditor id='benthosTotalWeightField' + constructorParams='this'/> + </cell> + </row> + <!-- Poids total échantillonné --> + <row> + <cell> + <JLabel id='benthosSampleTotalWeightLabel'/> + </cell> + <cell> + <NumberEditor id='benthosSampleTotalWeightField' + constructorParams='this'/> + </cell> + </row> + </Table> + </cell> + </row> + <row> + <cell> + <Table id='planktonTable' fill='both'> + + <!-- Poids total --> + <row> + <cell anchor='west'> + <JLabel id='planktonTotalWeightLabel'/> + </cell> + <cell weightx='1.0'> + <NumberEditor id='planktonTotalWeightField' + constructorParams='this'/> + </cell> + </row> + + <!-- Poids total échantillonné --> + <row> + <cell> + <JLabel id='planktonSampleTotalWeightLabel'/> + </cell> + <cell> + <NumberEditor id='planktonSampleTotalWeightField' + constructorParams='this'/> + </cell> + </row> + </Table> + </cell> + </row> + <row> + <cell> + <Table id='macroWasteTable' fill='both'> + + <!-- Poids total --> + <row> + <cell anchor='west'> + <JLabel id='macroWasteTotalWeightLabel'/> + </cell> + <cell weightx='1.0'> + <NumberEditor id='macroWasteTotalWeightField' + constructorParams='this'/> + </cell> + </row> + </Table> + </cell> + </row> + <row> + <cell> + + </cell> + </row> + <!-- Actions d'import --> + <row> + <cell columns='6'> + <JPanel layout='{new GridLayout(1,0)}'> + <JButton id='importPupitriButton' + onActionPerformed='handler.importPupitri()'/> + </JPanel> + </cell> + </row> + </Table> + </JXTitledPanel> + </tab> + <tab id='speciesTab' title='tutti.label.tab.species'> + <JXTitledPanel id='speciesTabFishingOperationReminderLabel'> + <SpeciesBatchUI id='speciesTabContent' constructorParams='this'/> + </JXTitledPanel> + </tab> + <tab id='benthosTab' title='tutti.label.tab.benthos'> + <JXTitledPanel id='benthosTabFishingOperationReminderLabel'> + <BenthosBatchUI id='benthosTabContent' constructorParams='this'/> + </JXTitledPanel> + </tab> + <tab id='planktonTab' title='tutti.label.tab.plancton'> + <JXTitledPanel id='planktonTabFishingOperationReminderLabel'> + <PlanktonBatchUI id='planktonTabContent' constructorParams='this'/> + </JXTitledPanel> + </tab> + <tab id='macroWasteTab' title='tutti.label.tab.macroDechet'> + <JXTitledPanel id='macroWasteTabFishingOperationReminderLabel'> + <MacroWasteBatchUI id='macroWasteTabContent' constructorParams='this'/> + </JXTitledPanel> + </tab> + <tab id='accidentalTab' title='tutti.label.tab.accidentel'> + <JXTitledPanel id='accidentalTabFishingOperationReminderLabel'> + <AccidentalBatchUI id='accidentalTabContent' constructorParams='this'/> + </JXTitledPanel> + </tab> + <tab id='observationIndividuelTab' + title='tutti.label.tab.observationIndividuel'> + <JXTitledPanel id='observationTabFishingOperationReminderLabel'> + <JLabel text='tutti.to.be.done' horizontalAlignment='{JLabel.CENTER}'/> + </JXTitledPanel> + </tab> + </JTabbedPane> + </JPanel> \ No newline at end of file Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.jaxx ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIHandler.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIHandler.java 2012-12-20 11:29:15 UTC (rev 93) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIHandler.java 2012-12-20 13:30:24 UTC (rev 94) @@ -1,17 +1,37 @@ package fr.ifremer.tutti.ui.swing.content.operation.catches; +/* + * #%L + * Tutti :: UI + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2012 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.persistence.entities.data.FishingOperation; import fr.ifremer.tutti.service.PersistenceService; import fr.ifremer.tutti.ui.swing.AbstractTuttiUIHandler; import fr.ifremer.tutti.ui.swing.content.operation.FishingOperationsUI; import fr.ifremer.tutti.ui.swing.util.TuttiBeanMonitor; -import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.nuiton.util.decorator.Decorator; -import static org.nuiton.i18n.I18n._; - /** * @author tchemit <chemit@codelutin.com> * @since 0.3 @@ -22,23 +42,30 @@ private static final Log log = LogFactory.getLog(EditCatchesUIHandler.class); + /** + * UI. + * + * @since 0.3 + */ private final EditCatchesUI ui; - private final FishingOperationsUI parentUi; - + /** + * Persistence service. + * + * @since 0.3 + */ private final PersistenceService persistenceService; /** - * To monitor changes on the fishing operation. + * To monitor changes on the incoming fishing operation. * - * @since 0.2 + * @since 0.3 */ private final TuttiBeanMonitor<EditCatchesUIModel> fishingOperationMonitor; public EditCatchesUIHandler(FishingOperationsUI parentUi, EditCatchesUI ui) { super(parentUi.getHandler().getContext()); this.ui = ui; - this.parentUi = parentUi; this.persistenceService = context.getService(PersistenceService.class); this.fishingOperationMonitor = new TuttiBeanMonitor<EditCatchesUIModel>( EditCatchesUIModel.PROPERTY_SPECIES_TOTAL_WEIGHT, @@ -49,19 +76,16 @@ EditCatchesUIModel.PROPERTY_BENTHOS_SAMPLE_TOTAL_WEIGHT, EditCatchesUIModel.PROPERTY_PLANKTON_TOTAL_WEIGHT, EditCatchesUIModel.PROPERTY_PLANKTON_SAMPLE_TOTAL_WEIGHT, - EditCatchesUIModel.PROPERTY_MACRO_WASTE_TOTAL_WEIGHT - ); + EditCatchesUIModel.PROPERTY_MACRO_WASTE_TOTAL_WEIGHT); } @Override public void beforeInitUI() { - EditCatchesUIModel model = new EditCatchesUIModel(); + EditCatchesUIModel model = ui.getContextValue(EditCatchesUIModel.class); listModelIsModify(model); - ui.setContextValue(model); - fishingOperationMonitor.setBean(model); } @@ -80,7 +104,8 @@ return ui.getModel(); } - public void selectFishingOperation(FishingOperation bean) { + public void selectFishingOperation(FishingOperation bean, + String fishingOperationText) { if (fishingOperationMonitor.wasModified()) { @@ -101,26 +126,16 @@ EditCatchesUIModel model = getModel(); - String fishingoperationText; - if (empty) { bean = new FishingOperation(); model.setFishingOperation(null); - fishingoperationText = ""; } else { - Decorator<FishingOperation> decorator = - getDecorator(FishingOperation.class, null); - - fishingoperationText = - _("tutti.label.traitReminder", decorator.toString(bean)); - if (log.isInfoEnabled()) { log.info("Get species batch for fishingOperation: " + - bean.getId() + " - " + fishingoperationText); + bean.getId() + " - " + fishingOperationText); } - model.setFishingOperation(bean); } @@ -128,46 +143,27 @@ fishingOperationMonitor.clearModified(); - ui.getFishingOperationReminderLabel().setText(fishingoperationText); - } + ui.getCatchesTabsFishingOperationReminderLabel().setTitle(fishingOperationText); + ui.getSpeciesTabFishingOperationReminderLabel().setTitle(fishingOperationText); + ui.getBenthosTabFishingOperationReminderLabel().setTitle(fishingOperationText); + ui.getPlanktonTabFishingOperationReminderLabel().setTitle(fishingOperationText); + ui.getMacroWasteTabFishingOperationReminderLabel().setTitle(fishingOperationText); + ui.getAccidentalTabFishingOperationReminderLabel().setTitle(fishingOperationText); - public void cancel() { + ui.getSpeciesTabContent().getHandler().selectFishingOperation(bean + ); + ui.getBenthosTabContent().getHandler().selectFishingOperation(bean + ); + ui.getPlanktonTabContent().getHandler().selectFishingOperation(bean + ); + ui.getMacroWasteTabContent().getHandler().selectFishingOperation(bean + ); + ui.getAccidentalTabContent().getHandler().selectFishingOperation(bean + ); - String id = getModel().getId(); - - if (log.isInfoEnabled()) { - log.info("Cancel edition for fishingOperation: " + id); - } - boolean newBean = StringUtils.isBlank(id); - - if (newBean) { - - // cancel to create a new fishingOperation - parentUi.getHandler().selectFishingOperation(null); - - } else { - - // reselect in ui the fishingOperation - FishingOperation selectedFishingOperation = parentUi.getModel().getSelectedFishingOperation(); - parentUi.getHandler().selectFishingOperation(selectedFishingOperation); - } + ui.getTabPane().repaint(); } - public void save() { - - // get fishingOperation to save - FishingOperation toSave = getModel().toBean(); - - if (log.isInfoEnabled()) { - log.info("Save edition for fishingOperation: " + toSave.getId()); - } - - // persist current fishingOperation - parentUi.getHandler().saveFishingOperation(toSave); - - getModel().setModify(false); - } - public void importPupitri() { //TODO } Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIHandler.java ___________________________________________________________________ Modified: svn:keywords - Author Date Id Revision + Author Date Id Revision HeadURL Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIModel.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIModel.java 2012-12-20 11:29:15 UTC (rev 93) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIModel.java 2012-12-20 13:30:24 UTC (rev 94) @@ -1,9 +1,33 @@ package fr.ifremer.tutti.ui.swing.content.operation.catches; +/* + * #%L + * Tutti :: UI + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2012 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.persistence.entities.data.FishingOperation; import fr.ifremer.tutti.ui.swing.AbstractTuttiBeanUIModel; import org.nuiton.util.beans.Binder; -import org.nuiton.util.beans.BinderFactory; +import org.nuiton.util.beans.BinderModelBuilder; /** * @author tchemit <chemit@codelutin.com> @@ -31,13 +55,34 @@ public static final String PROPERTY_MACRO_WASTE_TOTAL_WEIGHT = "macroWasteTotalWeight"; - protected static Binder<EditCatchesUIModel, FishingOperation> toBeanBinder = - BinderFactory.newBinder(EditCatchesUIModel.class, - FishingOperation.class); + public static final String PROPERTY_FISHING_OPERATION = "fishingOperation"; - protected static Binder<FishingOperation, EditCatchesUIModel> fromBeanBinder = - BinderFactory.newBinder(FishingOperation.class, EditCatchesUIModel.class); + protected static final Binder<FishingOperation, EditCatchesUIModel> fromBeanBinder = BinderModelBuilder.newEmptyBuilder(FishingOperation.class, EditCatchesUIModel.class) + .addSimpleProperties( + PROPERTY_SPECIES_TOTAL_WEIGHT, + PROPERTY_SPECIES_TOTAL_VRAC_WEIGHT, + PROPERTY_SPECIES_TOTAL_HORS_VRAC_WEIGHT, + PROPERTY_SPECIES_SAMPLE_VRAC_WEIGHT, + PROPERTY_BENTHOS_TOTAL_WEIGHT, + PROPERTY_BENTHOS_SAMPLE_TOTAL_WEIGHT, + PROPERTY_PLANKTON_TOTAL_WEIGHT, + PROPERTY_PLANKTON_SAMPLE_TOTAL_WEIGHT, + PROPERTY_MACRO_WASTE_TOTAL_WEIGHT + ).toBinder(); + protected static final Binder<EditCatchesUIModel, FishingOperation> toBeanBinder = BinderModelBuilder.newEmptyBuilder(EditCatchesUIModel.class, FishingOperation.class) + .addSimpleProperties( + PROPERTY_SPECIES_TOTAL_WEIGHT, + PROPERTY_SPECIES_TOTAL_VRAC_WEIGHT, + PROPERTY_SPECIES_TOTAL_HORS_VRAC_WEIGHT, + PROPERTY_SPECIES_SAMPLE_VRAC_WEIGHT, + PROPERTY_BENTHOS_TOTAL_WEIGHT, + PROPERTY_BENTHOS_SAMPLE_TOTAL_WEIGHT, + PROPERTY_PLANKTON_TOTAL_WEIGHT, + PROPERTY_PLANKTON_SAMPLE_TOTAL_WEIGHT, + PROPERTY_MACRO_WASTE_TOTAL_WEIGHT + ).toBinder(); + protected Float speciesTotalWeight; protected Float speciesTotalVracWeight; @@ -67,7 +112,9 @@ } public void setFishingOperation(FishingOperation fishingOperation) { + Object oldValue = getFishingOperation(); this.fishingOperation = fishingOperation; + firePropertyChange(PROPERTY_FISHING_OPERATION, oldValue, fishingOperation); } public Float getSpeciesTotalWeight() { Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIModel.java ___________________________________________________________________ Modified: svn:keywords - Author Date Id Revision + Author Date Id Revision HeadURL Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/macrowaste/MacroWasteBatchUI.css =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/macrowaste/MacroWasteBatchUI.css 2012-12-20 11:29:15 UTC (rev 93) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/macrowaste/MacroWasteBatchUI.css 2012-12-20 13:30:24 UTC (rev 94) @@ -29,14 +29,14 @@ showReset: true; } -#totalWeightLabel { - text: "tutti.label.macroWaste.totalWeight"; - labelFor: {totalWeightField}; +#macroWasteTotalWeightLabel { + text: "tutti.label.catches.macroWasteTotalWeight"; + labelFor: {macroWasteTotalWeightField}; } -#totalWeightField { - property: "totalWeight"; - model: {model.getTotalWeight()}; +#macroWasteTotalWeightField { + property: "macroWasteTotalWeight"; + model: {model.getMacroWasteTotalWeight()}; useFloat: false; numberPattern: {INT_6_DIGITS_PATTERN}; } Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/macrowaste/MacroWasteBatchUI.jaxx =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/macrowaste/MacroWasteBatchUI.jaxx 2012-12-20 11:29:15 UTC (rev 93) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/macrowaste/MacroWasteBatchUI.jaxx 2012-12-20 13:30:24 UTC (rev 94) @@ -25,10 +25,9 @@ implements='fr.ifremer.tutti.ui.swing.TuttiUI<MacroWasteBatchUIModel, MacroWasteBatchUIHandler>'> <import> - fr.ifremer.tutti.persistence.entities.data.FishingOperation - + fr.ifremer.tutti.ui.swing.TuttiUI fr.ifremer.tutti.ui.swing.TuttiUIContext - fr.ifremer.tutti.ui.swing.content.operation.FishingOperationsUI + fr.ifremer.tutti.ui.swing.util.editor.LongTextEditorUI fr.ifremer.tutti.ui.swing.util.editor.AttachmentEditorUI @@ -48,14 +47,13 @@ <script><![CDATA[ -public MacroWasteBatchUI(FishingOperationsUI parentUI) { +public MacroWasteBatchUI(TuttiUI<?,?> parentUI) { + JAXXUtil.initContext(this, parentUI); MacroWasteBatchUIHandler handler = new MacroWasteBatchUIHandler(parentUI, this); setContextValue(handler); handler.beforeInitUI(); } -public void selectFishingOperation(FishingOperation fishingOperation) { handler.selectFishingOperation(fishingOperation); } - protected void $afterCompleteSetup() { handler.afterInitUI(); } ]]></script> @@ -69,30 +67,25 @@ <BeanValidator id='validator' bean='model' errorTableModel='errorTableModel' uiClass='jaxx.runtime.validator.swing.ui.ImageValidationUI'> - <field name='totalWeight' component='totalWeightField'/> + <field name='macroWasteTotalWeight' component='macroWasteTotalWeightField'/> </BeanValidator> <LongTextEditorUI id='longTextEditor'/> <AttachmentEditorUI id='attachmentEditor'/> - <JPanel constraints='BorderLayout.NORTH' layout='{new BorderLayout()}'> - <JLabel id='fishingOperationReminderLabel' - constraints='BorderLayout.NORTH'/> - <JSeparator constraints='BorderLayout.CENTER'/> - <Table id='form' fill='both' constraints='BorderLayout.SOUTH'> + <Table id='form' fill='both' constraints='BorderLayout.NORTH'> - <!-- Poids total --> - <row> - <cell anchor='west'> - <JLabel id='totalWeightLabel'/> - </cell> - <cell weightx='1.0'> - <NumberEditor id='totalWeightField' constructorParams='this'/> - </cell> - </row> - </Table> - </JPanel> + <!-- Poids total --> + <row> + <cell anchor='west'> + <JLabel id='macroWasteTotalWeightLabel'/> + </cell> + <cell weightx='1.0'> + <NumberEditor id='macroWasteTotalWeightField' constructorParams='this'/> + </cell> + </row> + </Table> <JScrollPane id='tableScrollPane' constraints='BorderLayout.CENTER'> <JXTable id='table' Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/macrowaste/MacroWasteBatchUIHandler.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/macrowaste/MacroWasteBatchUIHandler.java 2012-12-20 11:29:15 UTC (rev 93) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/macrowaste/MacroWasteBatchUIHandler.java 2012-12-20 13:30:24 UTC (rev 94) @@ -32,7 +32,7 @@ import fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue; import fr.ifremer.tutti.ui.swing.TuttiUI; import fr.ifremer.tutti.ui.swing.content.operation.AbstractTuttiBatchTableUIHandler; -import fr.ifremer.tutti.ui.swing.content.operation.FishingOperationsUI; +import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUIModel; import fr.ifremer.tutti.ui.swing.util.TuttiBeanMonitor; import fr.ifremer.tutti.ui.swing.util.editor.AttachmentCellComponent; import fr.ifremer.tutti.ui.swing.util.editor.LongTextCellComponent; @@ -45,7 +45,6 @@ import javax.swing.table.TableColumnModel; import java.util.List; -import static org.nuiton.i18n.I18n._; import static org.nuiton.i18n.I18n.n_; /** @@ -65,9 +64,8 @@ */ private final MacroWasteBatchUI ui; - public MacroWasteBatchUIHandler(FishingOperationsUI parentUi, MacroWasteBatchUI ui) { + public MacroWasteBatchUIHandler(TuttiUI<?, ?> parentUi, MacroWasteBatchUI ui) { super(parentUi, - new String[]{MacroWasteBatchUIModel.PROPERTY_TOTAL_WEIGHT}, MacroWasteBatchRowModel.PROPERTY_MACRO_WASTE_CATEGORY, MacroWasteBatchRowModel.PROPERTY_WEIGHT, MacroWasteBatchRowModel.PROPERTY_COMMENT); @@ -262,21 +260,6 @@ table.editingCanceled(null); } - if (fishingOperationMonitor.wasModified()) { - - // previous fishingOperation was modified, let's save it - MacroWasteBatchUIModel beanToSave = fishingOperationMonitor.getBean(); - - FishingOperation fishingOperation = beanToSave.toBean(); - - if (log.isInfoEnabled()) { - log.info("FishingOperation " + fishingOperation.getId() + - " was modified, will save it."); - } - - persistenceService.saveFishingOperation(fishingOperation); - } - // make sure selection is empty (will remove bean from monitor) table.clearSelection(); @@ -286,24 +269,13 @@ List<MacroWasteBatchRowModel> rows; - String fishingoperationText; - if (empty) { rows = null; - bean = new FishingOperation(); - model.setFishingOperation(null); - fishingoperationText = ""; } else { - Decorator<FishingOperation> decorator = - getDecorator(FishingOperation.class, null); - - fishingoperationText = - _("tutti.label.traitReminder", decorator.toString(bean)); - if (log.isInfoEnabled()) { log.info("Get species batch for fishingOperation: " + - bean.getId() + " - " + fishingoperationText); + bean.getId()); } rows = Lists.newArrayList(); @@ -316,15 +288,9 @@ rows.add(entry); } } - model.setFishingOperation(bean); } - model.fromBean(bean); model.setRows(rows); - - fishingOperationMonitor.clearModified(); - - ui.getFishingOperationReminderLabel().setText(fishingoperationText); } //------------------------------------------------------------------------// @@ -338,10 +304,11 @@ log.info("beforeInit: " + ui); } - MacroWasteBatchUIModel model = new MacroWasteBatchUIModel(); - ui.setContextValue(model); + EditCatchesUIModel catchesUIModel = + ui.getContextValue(EditCatchesUIModel.class); - fishingOperationMonitor.setBean(model); + MacroWasteBatchUIModel model = new MacroWasteBatchUIModel(catchesUIModel); + ui.setContextValue(model); } @Override Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/macrowaste/MacroWasteBatchUIModel.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/macrowaste/MacroWasteBatchUIModel.java 2012-12-20 11:29:15 UTC (rev 93) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/macrowaste/MacroWasteBatchUIModel.java 2012-12-20 13:30:24 UTC (rev 94) @@ -24,71 +24,27 @@ * #L% */ -import fr.ifremer.tutti.persistence.entities.data.FishingOperation; -import fr.ifremer.tutti.ui.swing.util.table.AbstractTuttiTableUIModel; -import org.nuiton.util.beans.Binder; -import org.nuiton.util.beans.BinderModelBuilder; +import fr.ifremer.tutti.ui.swing.content.operation.AbstractTuttiBatchUIModel; +import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUIModel; /** * @author tchemit <chemit@codelutin.com> * @since 0.2 */ -public class MacroWasteBatchUIModel extends AbstractTuttiTableUIModel<FishingOperation, MacroWasteBatchRowModel, MacroWasteBatchUIModel> { +public class MacroWasteBatchUIModel extends AbstractTuttiBatchUIModel<MacroWasteBatchRowModel, MacroWasteBatchUIModel> { private static final long serialVersionUID = 1L; - public static final String PROPERTY_TOTAL_WEIGHT = "totalWeight"; - - /** - * Editing fishing operation. - * - * @since 0.2 - */ - protected FishingOperation fishingOperation; - - /** - * Total Weight filled in screen. - * - * @since 0.2 - */ - protected Float totalWeight; - - - protected static final Binder<FishingOperation, MacroWasteBatchUIModel> fromBeanBinder = BinderModelBuilder.newEmptyBuilder(FishingOperation.class, MacroWasteBatchUIModel.class) - .addProperty(FishingOperation.PROPERTY_MACRO_WASTE_TOTAL_WEIGHT, PROPERTY_TOTAL_WEIGHT) - .addProperty(FishingOperation.PROPERTY_ID, PROPERTY_ID) - .toBinder(); - - protected static final Binder<MacroWasteBatchUIModel, FishingOperation> toBeanBinder = BinderModelBuilder.newEmptyBuilder(MacroWasteBatchUIModel.class, FishingOperation.class) - .addProperty(PROPERTY_TOTAL_WEIGHT, FishingOperation.PROPERTY_MACRO_WASTE_TOTAL_WEIGHT) - .toBinder(); - - - public MacroWasteBatchUIModel() { - super(FishingOperation.class, fromBeanBinder, toBeanBinder); + public MacroWasteBatchUIModel(EditCatchesUIModel catchesUIModel) { + super(catchesUIModel, + EditCatchesUIModel.PROPERTY_MACRO_WASTE_TOTAL_WEIGHT); } - public FishingOperation getFishingOperation() { - return fishingOperation; + public Float getMacroWasteTotalWeight() { + return catchesUIModel.getMacroWasteTotalWeight(); } - public void setFishingOperation(FishingOperation fishingOperation) { - this.fishingOperation = fishingOperation; + public void setMacroWasteTotalWeight(Float macroWasteTotalWeight) { + catchesUIModel.setMacroWasteTotalWeight(macroWasteTotalWeight); } - - - public Float getTotalWeight() { - return totalWeight; - } - - public void setTotalWeight(Float totalWeight) { - Object oldValue = getTotalWeight(); - this.totalWeight = totalWeight; - firePropertyChange(PROPERTY_TOTAL_WEIGHT, oldValue, totalWeight); - } - - @Override - protected FishingOperation newEntity() { - return fishingOperation; - } } \ No newline at end of file Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/plankton/PlanktonBatchUI.css =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/plankton/PlanktonBatchUI.css 2012-12-20 11:29:15 UTC (rev 93) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/plankton/PlanktonBatchUI.css 2012-12-20 13:30:24 UTC (rev 94) @@ -29,26 +29,26 @@ showReset: true; } -#totalWeightLabel { - text: "tutti.label.plankton.totalWeight"; - labelFor: {totalWeightField}; +#planktonTotalWeightLabel { + text: "tutti.label.catches.planktonTotalWeight"; + labelFor: {planktonTotalWeightField}; } -#totalWeightField { - property: "totalWeight"; - model: {model.getTotalWeight()}; +#planktonTotalWeightField { + property: "planktonTotalWeight"; + model: {model.getPlanktonTotalWeight()}; useFloat: false; numberPattern: {INT_6_DIGITS_PATTERN}; } -#sampleTotalWeightLabel { - text: "tutti.label.plankton.sampleTotalWeight"; - labelFor: {sampleTotalWeightField}; +#planktonSampleTotalWeightLabel { + text: "tutti.label.catches.planktonSampleTotalWeight"; + labelFor: {planktonSampleTotalWeightField}; } -#sampleTotalWeightField { - property: "sampleTotalWeight"; - model: {model.getSampleTotalWeight()}; +#planktonSampleTotalWeightField { + property: "planktonSampleTotalWeight"; + model: {model.getPlanktonSampleTotalWeight()}; useFloat: false; numberPattern: {INT_6_DIGITS_PATTERN}; } Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/plankton/PlanktonBatchUI.jaxx =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/plankton/PlanktonBatchUI.jaxx 2012-12-20 11:29:15 UTC (rev 93) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/plankton/PlanktonBatchUI.jaxx 2012-12-20 13:30:24 UTC (rev 94) @@ -25,10 +25,8 @@ implements='fr.ifremer.tutti.ui.swing.TuttiUI<PlanktonBatchUIModel, PlanktonBatchUIHandler>'> <import> - fr.ifremer.tutti.persistence.entities.data.FishingOperation - + fr.ifremer.tutti.ui.swing.TuttiUI fr.ifremer.tutti.ui.swing.TuttiUIContext - fr.ifremer.tutti.ui.swing.content.operation.FishingOperationsUI fr.ifremer.tutti.ui.swing.util.editor.LongTextEditorUI fr.ifremer.tutti.ui.swing.util.editor.AttachmentEditorUI @@ -48,14 +46,13 @@ <script><![CDATA[ -public PlanktonBatchUI(FishingOperationsUI parentUI) { +public PlanktonBatchUI(TuttiUI<?,?> parentUI) { + JAXXUtil.initContext(this, parentUI); PlanktonBatchUIHandler handler = new PlanktonBatchUIHandler(parentUI, this); setContextValue(handler); handler.beforeInitUI(); } -public void selectFishingOperation(FishingOperation fishingOperation) { handler.selectFishingOperation(fishingOperation); } - protected void $afterCompleteSetup() { handler.afterInitUI(); } ]]></script> @@ -69,41 +66,38 @@ <BeanValidator id='validator' bean='model' errorTableModel='errorTableModel' uiClass='jaxx.runtime.validator.swing.ui.ImageValidationUI'> - <field name='totalWeight' component='totalWeightField'/> - <field name='sampleTotalWeight' component='sampleTotalWeightField'/> + <field name='planktonTotalWeight' component='planktonTotalWeightField'/> + <field name='planktonSampleTotalWeight' + component='planktonSampleTotalWeightField'/> </BeanValidator> <LongTextEditorUI id='longTextEditor'/> <AttachmentEditorUI id='attachmentEditor'/> - <JPanel constraints='BorderLayout.NORTH' layout='{new BorderLayout()}'> - <JLabel id='fishingOperationReminderLabel' - constraints='BorderLayout.NORTH'/> - <JSeparator constraints='BorderLayout.CENTER'/> - <Table id='form' fill='both' constraints='BorderLayout.SOUTH'> + <Table id='form' fill='both' constraints='BorderLayout.NORTH'> - <!-- Poids total --> - <row> - <cell anchor='west'> - <JLabel id='totalWeightLabel'/> - </cell> - <cell weightx='1.0'> - <NumberEditor id='totalWeightField' constructorParams='this'/> - </cell> - </row> + <!-- Poids total --> + <row> + <cell anchor='west'> + <JLabel id='planktonTotalWeightLabel'/> + </cell> + <cell weightx='1.0'> + <NumberEditor id='planktonTotalWeightField' constructorParams='this'/> + </cell> + </row> - <!-- Poids total échantillonné --> - <row> - <cell> - <JLabel id='sampleTotalWeightLabel'/> - </cell> - <cell> - <NumberEditor id='sampleTotalWeightField' constructorParams='this'/> - </cell> - </row> - </Table> - </JPanel> + <!-- Poids total échantillonné --> + <row> + <cell> + <JLabel id='planktonSampleTotalWeightLabel'/> + </cell> + <cell> + <NumberEditor id='planktonSampleTotalWeightField' + constructorParams='this'/> + </cell> + </row> + </Table> <JScrollPane id='tableScrollPane' constraints='BorderLayout.CENTER'> <JXTable id='table' Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/plankton/PlanktonBatchUIHandler.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/plankton/PlanktonBatchUIHandler.java 2012-12-20 11:29:15 UTC (rev 93) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/plankton/PlanktonBatchUIHandler.java 2012-12-20 13:30:24 UTC (rev 94) @@ -33,7 +33,7 @@ import fr.ifremer.tutti.service.DecoratorService; import fr.ifremer.tutti.ui.swing.TuttiUI; import fr.ifremer.tutti.ui.swing.content.operation.AbstractTuttiBatchTableUIHandler; -import fr.ifremer.tutti.ui.swing.content.operation.FishingOperationsUI; +import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUIModel; import fr.ifremer.tutti.ui.swing.util.TuttiBeanMonitor; import fr.ifremer.tutti.ui.swing.util.editor.AttachmentCellComponent; import fr.ifremer.tutti.ui.swing.util.editor.LongTextCellComponent; @@ -46,7 +46,6 @@ import javax.swing.table.TableColumnModel; import java.util.List; -import static org.nuiton.i18n.I18n._; import static org.nuiton.i18n.I18n.n_; /** @@ -56,7 +55,8 @@ public class PlanktonBatchUIHandler extends AbstractTuttiBatchTableUIHandler<PlanktonBatchRowModel, PlanktonBatchUIModel> { /** Logger. */ - private static final Log log = LogFactory.getLog(PlanktonBatchUIHandler.class); + private static final Log log = + LogFactory.getLog(PlanktonBatchUIHandler.class); /** * UI. @@ -65,9 +65,8 @@ */ private final PlanktonBatchUI ui; - public PlanktonBatchUIHandler(FishingOperationsUI parentUi, PlanktonBatchUI ui) { - super(parentUi, new String[]{PlanktonBatchUIModel.PROPERTY_TOTAL_WEIGHT, - PlanktonBatchUIModel.PROPERTY_SAMPLE_TOTAL_WEIGHT}, + public PlanktonBatchUIHandler(TuttiUI<?, ?> parentUi, PlanktonBatchUI ui) { + super(parentUi, PlanktonBatchRowModel.PROPERTY_SPECIES_TO_CONFIRM, PlanktonBatchRowModel.PROPERTY_SPECIES, PlanktonBatchRowModel.PROPERTY_WEIGHT, @@ -304,21 +303,6 @@ table.editingCanceled(null); } - if (fishingOperationMonitor.wasModified()) { - - // previous fishingOperation was modified, let's save it - PlanktonBatchUIModel beanToSave = fishingOperationMonitor.getBean(); - - FishingOperation fishingOperation = beanToSave.toBean(); - - if (log.isInfoEnabled()) { - log.info("FishingOperation " + fishingOperation.getId() + - " was modified, will save it."); - } - - persistenceService.saveFishingOperation(fishingOperation); - } - // make sure selection is empty (will remove bean from monitor) table.clearSelection(); @@ -328,24 +312,14 @@ List<PlanktonBatchRowModel> rows; - String fishingoperationText; - if (empty) { rows = null; - bean = new FishingOperation(); - model.setFishingOperation(null); - fishingoperationText = ""; } else { - Decorator<FishingOperation> decorator = - getDecorator(FishingOperation.class, null); - fishingoperationText = - _("tutti.label.traitReminder", decorator.toString(bean)); - if (log.isInfoEnabled()) { log.info("Get species batch for fishingOperation: " + - bean.getId() + " - " + fishingoperationText); + bean.getId()); } rows = Lists.newArrayList(); @@ -358,15 +332,9 @@ rows.add(entry); } } - model.setFishingOperation(bean); } - model.fromBean(bean); model.setRows(rows); - - fishingOperationMonitor.clearModified(); - - ui.getFishingOperationReminderLabel().setText(fishingoperationText); } //------------------------------------------------------------------------// @@ -380,10 +348,11 @@ log.info("beforeInit: " + ui); } - PlanktonBatchUIModel model = new PlanktonBatchUIModel(); - ui.setContextValue(model); + EditCatchesUIModel catchesUIModel = + ui.getContextValue(EditCatchesUIModel.class); - fishingOperationMonitor.setBean(model); + PlanktonBatchUIModel model = new PlanktonBatchUIModel(catchesUIModel); + ui.setContextValue(model); } @Override Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/plankton/PlanktonBatchUIModel.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/plankton/PlanktonBatchUIModel.java 2012-12-20 11:29:15 UTC (rev 93) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/plankton/PlanktonBatchUIModel.java 2012-12-20 13:30:24 UTC (rev 94) @@ -24,90 +24,36 @@ * #L% */ -import fr.ifremer.tutti.persistence.entities.data.FishingOperation; -import fr.ifremer.tutti.ui.swing.util.table.AbstractTuttiTableUIModel; -import org.nuiton.util.beans.Binder; -import org.nuiton.util.beans.BinderModelBuilder; +import fr.ifremer.tutti.ui.swing.content.operation.AbstractTuttiBatchUIModel; +import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUIModel; /** * @author tchemit <chemit@codelutin.com> * @since 0.2 */ -public class PlanktonBatchUIModel extends AbstractTuttiTableUIModel<FishingOperation, PlanktonBatchRowModel, PlanktonBatchUIModel> { +public class PlanktonBatchUIModel extends AbstractTuttiBatchUIModel<PlanktonBatchRowModel, PlanktonBatchUIModel> { private static final long serialVersionUID = 1L; - public static final String PROPERTY_TOTAL_WEIGHT = "totalWeight"; - - public static final String PROPERTY_SAMPLE_TOTAL_WEIGHT = "sampleTotalWeight"; - - /** - * Editing fishing operation. - * - * @since 0.2 - */ - protected FishingOperation fishingOperation; - - /** - * Total Weight filled in screen. - * - * @since 0.2 - */ - protected Float totalWeight; - - /** - * Total Sample Weight filled in screen. - * - * @since 0.2 - */ - protected Float sampleTotalWeight; - - protected static final Binder<FishingOperation, PlanktonBatchUIModel> fromBeanBinder = BinderModelBuilder.newEmptyBuilder(FishingOperation.class, PlanktonBatchUIModel.class) - .addProperty(FishingOperation.PROPERTY_PLANKTON_TOTAL_WEIGHT, PROPERTY_TOTAL_WEIGHT) - .addProperty(FishingOperation.PROPERTY_PLANKTON_SAMPLE_TOTAL_WEIGHT, PROPERTY_SAMPLE_TOTAL_WEIGHT) - .addProperty(FishingOperation.PROPERTY_ID, PROPERTY_ID) - .toBinder(); - - protected static final Binder<PlanktonBatchUIModel, FishingOperation> toBeanBinder = BinderModelBuilder.newEmptyBuilder(PlanktonBatchUIModel.class, FishingOperation.class) - .addProperty(PROPERTY_TOTAL_WEIGHT, FishingOperation.PROPERTY_PLANKTON_TOTAL_WEIGHT) - .addProperty(PROPERTY_SAMPLE_TOTAL_WEIGHT, FishingOperation.PROPERTY_PLANKTON_SAMPLE_TOTAL_WEIGHT) - .toBinder(); - - - public PlanktonBatchUIModel() { - super(FishingOperation.class, fromBeanBinder, toBeanBinder); + public PlanktonBatchUIModel(EditCatchesUIModel catchesUIModel) { + super(catchesUIModel, + EditCatchesUIModel.PROPERTY_PLANKTON_TOTAL_WEIGHT, + EditCatchesUIModel.PROPERTY_PLANKTON_SAMPLE_TOTAL_WEIGHT); } - public FishingOperation getFishingOperation() { - return fishingOperation; + public Float getPlanktonTotalWeight() { + return catchesUIModel.getPlanktonTotalWeight(); } - public void setFishingOperation(FishingOperation fishingOperation) { - this.fishingOperation = fishingOperation; + public void setPlanktonTotalWeight(Float planktonTotalWeight) { + catchesUIModel.setPlanktonTotalWeight(planktonTotalWeight); } - public Float getTotalWeight() { - return totalWeight; + public Float getPlanktonSampleTotalWeight() { + return catchesUIModel.getPlanktonSampleTotalWeight(); } - public void setTotalWeight(Float totalWeight) { - Object oldValue = getTotalWeight(); - this.totalWeight = totalWeight; - firePropertyChange(PROPERTY_TOTAL_WEIGHT, oldValue, totalWeight); + public void setPlanktonSampleTotalWeight(Float planktonSampleTotalWeight) { + catchesUIModel.setPlanktonSampleTotalWeight(planktonSampleTotalWeight); } - - public Float getSampleTotalWeight() { - return sampleTotalWeight; - } - - public void setSampleTotalWeight(Float sampleTotalWeight) { - Object oldValue = getSampleTotalWeight(); - this.sampleTotalWeight = sampleTotalWeight; - firePropertyChange(PROPERTY_SAMPLE_TOTAL_WEIGHT, oldValue, sampleTotalWeight); - } - - @Override - protected FishingOperation newEntity() { - return fishingOperation; - } } \ No newline at end of file Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/species/SpeciesBatchUI.css =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/species/SpeciesBatchUI.css 2012-12-20 11:29:15 UTC (rev 93) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/species/SpeciesBatchUI.css 2012-12-20 13:30:24 UTC (rev 94) @@ -29,49 +29,49 @@ showReset: true; } -#totalWeightLabel { - text: "tutti.label.species.totalWeight"; - labelFor: {totalWeightField}; +#speciesTotalWeightLabel { + text: "tutti.label.catches.speciesTotalWeight"; + labelFor: {speciesTotalWeightField}; } -#totalWeightField { - property: "totalWeight"; - model: {model.getTotalWeight()}; +#speciesTotalWeightField { + property: "speciesTotalWeight"; + model: {model.getSpeciesTotalWeight()}; useFloat: false; numberPattern: {INT_6_DIGITS_PATTERN}; } -#totalVracWeightLabel { - text: "tutti.label.species.totalVracWeight"; - labelFor: {totalVracWeightField}; +#speciesTotalVracWeightLabel { + text: "tutti.label.catches.speciesTotalVracWeight"; + labelFor: {speciesTotalVracWeightField}; } -#totalVracWeightField { - property: "totalVracWeight"; - model: {model.getTotalVracWeight()}; +#speciesTotalVracWeightField { + property: "speciesTotalVracWeight"; + model: {model.getSpeciesTotalVracWeight()}; useFloat: false; numberPattern: {INT_6_DIGITS_PATTERN}; } -#sampleVracWeightLabel { - text: "tutti.label.species.sampleVracWeight"; - labelFor: {sampleVracWeightField}; +#speciesSampleVracWeightLabel { + text: "tutti.label.catches.speciesSampleVracWeight"; + labelFor: {speciesSampleVracWeightField}; } -#sampleVracWeightField { - property: "sampleVracWeight"; - model: {model.getSampleVracWeight()}; +#speciesSampleVracWeightField { + property: "speciesSampleVracWeight"; + model: {model.getSpeciesSampleVracWeight()}; useFloat: false; numberPattern: {INT_6_DIGITS_PATTERN}; } -#totalHorsVracWeightLabel { - text: "tutti.label.species.totalHorsVracWeight"; - labelFor: {totalHorsVracWeightField}; +#speciesTotalHorsVracWeightLabel { + text: "tutti.label.catches.speciesTotalHorsVracWeight"; + labelFor: {speciesTotalHorsVracWeightField}; } -#totalHorsVracWeightField { - text: {getStringValue(model.getTotalHorsVracWeight())}; +#speciesTotalHorsVracWeightField { + text: {getStringValue(model.getSpeciesTotalHorsVracWeight())}; editable: false; } Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/species/SpeciesBatchUI.jaxx =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/species/SpeciesBatchUI.jaxx 2012-12-20 11:29:15 UTC (rev 93) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/species/SpeciesBatchUI.jaxx 2012-12-20 13:30:24 UTC (rev 94) @@ -25,11 +25,9 @@ implements='fr.ifremer.tutti.ui.swing.TuttiUI<SpeciesBatchUIModel, SpeciesBatchUIHandler>'> <import> - fr.ifremer.tutti.persistence.entities.data.FishingOperation - + fr.ifremer.tutti.ui.swing.TuttiUI fr.ifremer.tutti.ui.swing.TuttiUIContext - fr.ifremer.tutti.ui.swing.content.operation.FishingOperationsUI - fr.ifremer.tutti.ui.swing.content.operation.species.SpeciesFrequencyUI + fr.ifremer.tutti.ui.swing.util.editor.LongTextEditorUI fr.ifremer.tutti.ui.swing.util.editor.AttachmentEditorUI @@ -50,14 +48,13 @@ <script><![CDATA[ -public SpeciesBatchUI(FishingOperationsUI parentUI) { +public SpeciesBatchUI(TuttiUI<?,?> parentUI) { + JAXXUtil.initContext(this, parentUI); SpeciesBatchUIHandler handler = new SpeciesBatchUIHandler(parentUI, this); setContextValue(handler); handler.beforeInitUI(); } -public void selectFishingOperation(FishingOperation fishingOperation) { handler.selectFishingOperation(fishingOperation); } - protected void $afterCompleteSetup() { handler.afterInitUI(); } ]]></script> @@ -71,10 +68,13 @@ <BeanValidator id='validator' bean='model' errorTableModel='errorTableModel' uiClass='jaxx.runtime.validator.swing.ui.ImageValidationUI'> - <field name='totalWeight' component='totalWeightField'/> - <field name='totalVracWeight' component='totalVracWeightField'/> - <field name='sampleVracWeight' component='sampleVracWeightField'/> - <field name='totalHorsVracWeight' component='totalHorsVracWeightField'/> + <field name='speciesTotalWeight' component='speciesTotalWeightField'/> + <field name='speciesTotalVracWeight' + component='speciesTotalVracWeightField'/> + <field name='speciesSampleVracWeight' + component='speciesSampleVracWeightField'/> + <field name='speciesTotalHorsVracWeight' + component='speciesTotalHorsVracWeightField'/> </BeanValidator> <SpeciesFrequencyUI id='frequencyEditor' @@ -83,47 +83,43 @@ <LongTextEditorUI id='longTextEditor'/> <AttachmentEditorUI id='attachmentEditor'/> - <JPanel constraints='BorderLayout.NORTH' layout='{new BorderLayout()}'> - <JLabel id='fishingOperationReminderLabel' - constraints='BorderLayout.NORTH'/> - <JSeparator constraints='BorderLayout.CENTER'/> - <Table id='form' fill='both' constraints='BorderLayout.SOUTH'> + <Table id='form' fill='both' constraints='BorderLayout.NORTH'> - <!-- Poids total / Poids total vrac --> - <row> - <cell anchor='west'> - <JLabel id='totalWeightLabel'/> - </cell> - <cell weightx='1.0'> - <NumberEditor id='totalWeightField' constructorParams='this'/> - </cell> - <cell anchor='west'> - <JLabel id='totalVracWeightLabel'/> - </cell> - <cell weightx='1.0'> - <NumberEditor id='totalVracWeightField' constructorParams='this'/> - </cell> - </row> + <!-- Poids total / Poids total vrac --> + <row> + <cell anchor='west'> + <JLabel id='speciesTotalWeightLabel'/> + </cell> + <cell weightx='1.0'> + <NumberEditor id='speciesTotalWeightField' constructorParams='this'/> + </cell> + <cell anchor='west'> + <JLabel id='speciesTotalVracWeightLabel'/> + </cell> + <cell weightx='1.0'> + <NumberEditor id='speciesTotalVracWeightField' + constructorParams='this'/> + </cell> + </row> - <!-- Poids échantillonné vrac / Poids total hors vrac --> - <row> - <cell> - <JLabel id='sampleVracWeightLabel'/> - </cell> - <cell> - <NumberEditor id='sampleVracWeightField' constructorParams='this'/> - </cell> - <cell> - <JLabel id='totalHorsVracWeightLabel'/> - </cell> - <cell> - <JTextField id='totalHorsVracWeightField'/> - </cell> - </row> - </Table> - </JPanel> + <!-- Poids échantillonné vrac / Poids total hors vrac --> + <row> + <cell> + <JLabel id='speciesSampleVracWeightLabel'/> + </cell> + <cell> + <NumberEditor id='speciesSampleVracWeightField' + constructorParams='this'/> + </cell> + <cell> + <JLabel id='speciesTotalHorsVracWeightLabel'/> + </cell> + <cell> + <JTextField id='speciesTotalHorsVracWeightField'/> + </cell> + </row> + </Table> - <JScrollPane id='tableScrollPane' constraints='BorderLayout.CENTER'> <JXTable id='table' onFocusLost='handler.saveSelectedRowIfRequired(event)'/> </JScrollPane> Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/species/SpeciesBatchUIHandler.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/species/SpeciesBatchUIHandler.java 2012-12-20 11:29:15 UTC (rev 93) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/species/SpeciesBatchUIHandler.java 2012-12-20 13:30:24 UTC (rev 94) @@ -38,7 +38,7 @@ import fr.ifremer.tutti.service.DecoratorService; import fr.ifremer.tutti.ui.swing.TuttiUI; import fr.ifremer.tutti.ui.swing.content.operation.AbstractTuttiBatchTableUIHandler; -import fr.ifremer.tutti.ui.swing.content.operation.FishingOperationsUI; +import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUIModel; import fr.ifremer.tutti.ui.swing.util.TuttiBeanMonitor; import fr.ifremer.tutti.ui.swing.util.editor.AttachmentCellComponent; import fr.ifremer.tutti.ui.swing.util.editor.LongTextCellComponent; @@ -52,7 +52,6 @@ import java.util.List; import java.util.Set; -import static org.nuiton.i18n.I18n._; import static org.nuiton.i18n.I18n.n_; /** @@ -84,15 +83,9 @@ */ private final SpeciesBatchUI ui; - public SpeciesBatchUIHandler(FishingOperationsUI parentUi, + public SpeciesBatchUIHandler(TuttiUI<?, ?> parentUi, SpeciesBatchUI ui) { super(parentUi, - new String[]{ - SpeciesBatchUIModel.PROPERTY_SAMPLE_VRAC_WEIGHT, - SpeciesBatchUIModel.PROPERTY_TOTAL_HORS_VRAC_WEIGHT, - SpeciesBatchUIModel.PROPERTY_TOTAL_VRAC_WEIGHT, - SpeciesBatchUIModel.PROPERTY_TOTAL_WEIGHT - }, SpeciesBatchRowModel.PROPERTY_SPECIES_TO_CONFIRM, SpeciesBatchRowModel.PROPERTY_SPECIES, SpeciesBatchRowModel.PROPERTY_SORTED_UNSORTED_CATEGORY, @@ -504,21 +497,6 @@ table.editingCanceled(null); } - if (fishingOperationMonitor.wasModified()) { - - // previous fishingOperation was modified, let's save it - SpeciesBatchUIModel beanToSave = fishingOperationMonitor.getBean(); - - FishingOperation fishingOperation = beanToSave.toBean(); - - if (log.isInfoEnabled()) { - log.info("FishingOperation " + fishingOperation.getId() + - " was modified, will save it."); - } - - persistenceService.saveFishingOperation(fishingOperation); - } - // make sure selection is empty (will remove bean from monitor) table.clearSelection(); @@ -528,24 +506,13 @@ List<SpeciesBatchRowModel> rows; - String fishingoperationText; - if (empty) { rows = null; - bean = new FishingOperation(); - model.setFishingOperation(null); - fishingoperationText = ""; } else { - Decorator<FishingOperation> decorator = - getDecorator(FishingOperation.class, null); - - fishingoperationText = - _("tutti.label.traitReminder", decorator.toString(bean)); - if (log.isInfoEnabled()) { log.info("Get species batch for fishingOperation: " + - bean.getId() + " - " + fishingoperationText); + bean.getId()); } rows = Lists.newArrayList(); @@ -560,15 +527,9 @@ rows.add(entry); } } - model.setFishingOperation(bean); } - model.fromBean(bean); model.setRows(rows); - - fishingOperationMonitor.clearModified(); - - ui.getFishingOperationReminderLabel().setText(fishingoperationText); } //------------------------------------------------------------------------// @@ -582,10 +543,11 @@ log.info("beforeInit: " + ui); } - SpeciesBatchUIModel model = new SpeciesBatchUIModel(); - ui.setContextValue(model); + EditCatchesUIModel catchesUIModel = + ui.getContextValue(EditCatchesUIModel.class); - fishingOperationMonitor.setBean(model); + SpeciesBatchUIModel model = new SpeciesBatchUIModel(catchesUIModel); + ui.setContextValue(model); } @Override @@ -658,7 +620,7 @@ // Use directly the batch total weight (means no super-sampling) - superSamplingTotalWeight = getModel().getTotalWeight(); + superSamplingTotalWeight = getModel().getSpeciesTotalWeight(); } else { superSamplingTotalWeight = superSamplingRow.getWeight(); } @@ -714,7 +676,7 @@ log.info("New total vrac / hors vrac: " + totalVrac + " / " + totalHorsVrac); } - getModel().setTotalHorsVracWeight(totalHorsVrac); + getModel().setSpeciesTotalHorsVracWeight(totalHorsVrac); //TODO Should we also set the total vrac weight ? // getModel().setTotalVracWeight(totalVrac); } Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/species/SpeciesBatchUIModel.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/species/SpeciesBatchUIModel.java 2012-12-20 11:29:15 UTC (rev 93) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/species/SpeciesBatchUIModel.java 2012-12-20 13:30:24 UTC (rev 94) @@ -25,9 +25,8 @@ */ import fr.ifremer.tutti.persistence.entities.data.FishingOperation; -import fr.ifremer.tutti.ui.swing.util.table.AbstractTuttiTableUIModel; -import org.nuiton.util.beans.Binder; -import org.nuiton.util.beans.BinderModelBuilder; +import fr.ifremer.tutti.ui.swing.content.operation.AbstractTuttiBatchUIModel; +import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUIModel; import java.util.List; @@ -35,54 +34,11 @@ * @author tchemit <chemit@codelutin.com> * @since 0.1 */ -public class SpeciesBatchUIModel extends AbstractTuttiTableUIModel<FishingOperation, SpeciesBatchRowModel, SpeciesBatchUIModel> { +public class SpeciesBatchUIModel extends AbstractTuttiBatchUIModel<SpeciesBatchRowModel, SpeciesBatchUIModel> { private static final long serialVersionUID = 1L; - public static final String PROPERTY_TOTAL_WEIGHT = "totalWeight"; - - public static final String PROPERTY_TOTAL_VRAC_WEIGHT = "totalVracWeight"; - - public static final String PROPERTY_SAMPLE_VRAC_WEIGHT = "sampleVracWeight"; - - public static final String PROPERTY_TOTAL_HORS_VRAC_WEIGHT = "totalHorsVracWeight"; - /** - * Editing fishing operation. - * - * @since 0.2 - */ - protected FishingOperation fishingOperation; - - /** - * Total Weight filled in screen. - * - * @since 0.2 - */ - protected Float totalWeight; - - /** - * Total vrac Weight filled in screen. - * - * @since 0.2 - */ - protected Float totalVracWeight; - - /** - * Total sample vrac Weight filled in screen. - * - * @since 0.2 - */ - protected Float sampleVracWeight; - - /** - * Total hors vrac Weight computed by hros vrac rows. - * - * @since 0.2 - */ - protected Float totalHorsVracWeight; - - /** * Sampling order (sets by protocol). * * @since 0.2 @@ -96,78 +52,51 @@ */ protected final SpeciesBatchTreeModel samplingTreeModel; - protected static final Binder<FishingOperation, SpeciesBatchUIModel> fromBeanBinder = BinderModelBuilder.newEmptyBuilder(FishingOperation.class, SpeciesBatchUIModel.class) - .addProperty(FishingOperation.PROPERTY_SPECIES_TOTAL_WEIGHT, PROPERTY_TOTAL_WEIGHT) - .addProperty(FishingOperation.PROPERTY_SPECIES_TOTAL_HORS_VRAC_WEIGHT, PROPERTY_TOTAL_HORS_VRAC_WEIGHT) - .addProperty(FishingOperation.PROPERTY_SPECIES_TOTAL_VRAC_WEIGHT, PROPERTY_TOTAL_VRAC_WEIGHT) - .addProperty(FishingOperation.PROPERTY_SPECIES_SAMPLE_VRAC_WEIGHT, PROPERTY_SAMPLE_VRAC_WEIGHT) - .addProperty(FishingOperation.PROPERTY_ID, PROPERTY_ID) - .toBinder(); - - protected static final Binder<SpeciesBatchUIModel, FishingOperation> toBeanBinder = BinderModelBuilder.newEmptyBuilder(SpeciesBatchUIModel.class, FishingOperation.class) - .addProperty(PROPERTY_TOTAL_WEIGHT, FishingOperation.PROPERTY_SPECIES_TOTAL_WEIGHT) - .addProperty(PROPERTY_TOTAL_HORS_VRAC_WEIGHT, FishingOperation.PROPERTY_SPECIES_TOTAL_HORS_VRAC_WEIGHT) - .addProperty(PROPERTY_TOTAL_VRAC_WEIGHT, FishingOperation.PROPERTY_SPECIES_TOTAL_VRAC_WEIGHT) - .addProperty(PROPERTY_SAMPLE_VRAC_WEIGHT, FishingOperation.PROPERTY_SPECIES_SAMPLE_VRAC_WEIGHT) - .toBinder(); - - public SpeciesBatchUIModel() { - super(FishingOperation.class, fromBeanBinder, toBeanBinder); + public SpeciesBatchUIModel(EditCatchesUIModel catchesUIModel) { + super(catchesUIModel, + EditCatchesUIModel.PROPERTY_SPECIES_TOTAL_WEIGHT, + EditCatchesUIModel.PROPERTY_SPECIES_TOTAL_VRAC_WEIGHT, + EditCatchesUIModel.PROPERTY_SPECIES_TOTAL_HORS_VRAC_WEIGHT, + EditCatchesUIModel.PROPERTY_SPECIES_SAMPLE_VRAC_WEIGHT); this.samplingTreeModel = new SpeciesBatchTreeModel(); } - public FishingOperation getFishingOperation() { - return fishingOperation; + public Float getSpeciesTotalWeight() { + return catchesUIModel.getSpeciesTotalWeight(); } - public void setFishingOperation(FishingOperation fishingOperation) { - this.fishingOperation = fishingOperation; + public void setSpeciesTotalWeight(Float speciesTotalWeight) { + catchesUIModel.setSpeciesTotalWeight(speciesTotalWeight); } - public SpeciesBatchTreeModel getSamplingTreeModel() { - return samplingTreeModel; + public Float getSpeciesTotalVracWeight() { + return catchesUIModel.getSpeciesTotalVracWeight(); } - public Float getTotalWeight() { - return totalWeight; + public void setSpeciesTotalVracWeight(Float speciesTotalVracWeight) { + catchesUIModel.setSpeciesTotalVracWeight(speciesTotalVracWeight); } - public void setTotalWeight(Float totalWeight) { - Object oldValue = getTotalWeight(); - this.totalWeight = totalWeight; - firePropertyChange(PROPERTY_TOTAL_WEIGHT, oldValue, totalWeight); + public Float getSpeciesSampleVracWeight() { + return catchesUIModel.getSpeciesSampleVracWeight(); } - public Float getTotalVracWeight() { - return totalVracWeight; + public void setSpeciesSampleVracWeight(Float speciesSampleVracWeight) { + catchesUIModel.setSpeciesSampleVracWeight(speciesSampleVracWeight); } - public void setTotalVracWeight(Float totalVracWeight) { - Object oldValue = getTotalVracWeight(); - this.totalVracWeight = totalVracWeight; - firePropertyChange(PROPERTY_TOTAL_VRAC_WEIGHT, oldValue, totalVracWeight); + public Float getSpeciesTotalHorsVracWeight() { + return catchesUIModel.getSpeciesTotalHorsVracWeight(); } - public Float getSampleVracWeight() { - return sampleVracWeight; + public void setSpeciesTotalHorsVracWeight(Float speciesTotalHorsVracWeight) { + catchesUIModel.setSpeciesTotalHorsVracWeight(speciesTotalHorsVracWeight); } - public void setSampleVracWeight(Float sampleVracWeight) { - Object oldValue = getSampleVracWeight(); - this.sampleVracWeight = sampleVracWeight; - firePropertyChange(PROPERTY_SAMPLE_VRAC_WEIGHT, oldValue, sampleVracWeight); + public SpeciesBatchTreeModel getSamplingTreeModel() { + return samplingTreeModel; } - public Float getTotalHorsVracWeight() { - return totalHorsVracWeight; - } - - public void setTotalHorsVracWeight(Float totalHorsVracWeight) { - Object oldValue = getTotalHorsVracWeight(); - this.totalHorsVracWeight = totalHorsVracWeight; - firePropertyChange(PROPERTY_TOTAL_HORS_VRAC_WEIGHT, oldValue, totalHorsVracWeight); - } - public List<String> getSamplingOrder() { return samplingOrder; } @@ -177,8 +106,4 @@ samplingTreeModel.setSamplingOrder(samplingOrder.toArray(new String[samplingOrder.size()])); } - @Override - protected FishingOperation newEntity() { - return fishingOperation; - } } Modified: trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties =================================================================== --- trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2012-12-20 11:29:15 UTC (rev 93) +++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2012-12-20 13:30:24 UTC (rev 94) @@ -45,8 +45,15 @@ tutti.label.attachmentEditor.file=Fichier tutti.label.attachmentEditor.fileComment=Commentaire tutti.label.attachmentEditor.fileName=Nom -tutti.label.benthos.sampleTotalWeight=Poids total échantillonné -tutti.label.benthos.totalWeight=Poids total +tutti.label.catches.benthosSampleTotalWeight=Poids total échantillonné +tutti.label.catches.benthosTotalWeight=Poids total +tutti.label.catches.macroWasteTotalWeight=Poids total +tutti.label.catches.planktonSampleTotalWeight=Poids total échantillonné +tutti.label.catches.planktonTotalWeight=Poids total +tutti.label.catches.speciesSampleVracWeight=Poids total vrac échantillon +tutti.label.catches.speciesTotalHorsVracWeight=Poids total hors vrac +tutti.label.catches.speciesTotalVracWeight=Poids total vrac +tutti.label.catches.speciesTotalWeight=Poids total tutti.label.comment=Commentaire tutti.label.cruise=Campagne tutti.label.cruise.beginDate=Date de début @@ -111,25 +118,16 @@ tutti.label.list.headOfSortRoom=Reponsable(s) de salle de tri tutti.label.list.saisisseur=Saisisseur(s) tutti.label.list.vessel=Navire(s) -tutti.label.macroWaste.totalWeight=Poids total tutti.label.no.fishingOperation.selected=< Aucun trait sélectionné > -tutti.label.plankton.sampleTotalWeight=Poids total échantillonné -tutti.label.plankton.totalWeight=Poids total tutti.label.program=Série de campagne tutti.label.program.name=Nom tutti.label.program.zone=Zone tutti.label.protocol=Protocol de saisie -tutti.label.species.sampleVracWeight=Poids total vrac échant. -tutti.label.species.speciesSampleVracWeight=Poids total vrac échantillon -tutti.label.species.speciesTotalHorsVracWeight=Poids total hors vrac -tutti.label.species.speciesTotalVracWeight=Poids total vrac -tutti.label.species.speciesTotalWeight=Poids total -tutti.label.species.totalHorsVracWeight=Poids total hors vrac -tutti.label.species.totalVracWeight=Poids total vrac -tutti.label.species.totalWeight=Poids total +tutti.label.species.speciesTotalHorsVracWeight= tutti.label.tab.accidentel=Captures accidentelles tutti.label.tab.benthos=Benthos tutti.label.tab.catches=Captures +tutti.label.tab.catchesCaracteristics=Caractéristiques générales tutti.label.tab.fishingOperation=Trait tutti.label.tab.fishingOperation.environment=Environnement tutti.label.tab.fishingOperation.gearShooting=Mise en oeuvre de l'engin @@ -140,7 +138,12 @@ tutti.label.tab.plancton=Plancton tutti.label.tab.species=Espèces tutti.label.traitReminder=Trait \: %s +tutti.legend.accidentalCatches=Captures accidentelles +tutti.legend.benthosCatches=Captures benthos tutti.legend.frequencyConfiguration=Configuration +tutti.legend.macroWasteCatches=Captures macro déchets +tutti.legend.planktonCatches=Captures plancton +tutti.legend.speciesCatches=Captures espèces tutti.menu.actions=Actions tutti.menu.actions.tip=Actions tutti.menu.file=Fichier