Author: tchemit Date: 2012-11-28 19:17:32 +0100 (Wed, 28 Nov 2012) New Revision: 25 Url: http://forge.codelutin.com/repositories/revision/tutti/25 Log: add trait catches bean and their screens Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/CaptureAccidentelTabUI.css trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/CaptureAccidentelTabUI.jaxx trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/CaptureAccidentelTabUIHandler.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/CaptureAccidentelTabUIModel.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/CaptureAccidentelTableModel.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/MacroDechetTabUI.css trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/MacroDechetTabUI.jaxx trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/MacroDechetTabUIHandler.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/MacroDechetTabUIModel.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/MacroDechetTableModel.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/PlanctonTabUI.css trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/PlanctonTabUI.jaxx trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/PlanctonTabUIHandler.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/PlanctonTabUIModel.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/PlanctonTableModel.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/SpeciesTabUI.css trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/SpeciesTabUI.jaxx trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/SpeciesTabUIHandler.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/SpeciesTabUIModel.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/SpeciesTableModel.java Removed: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/FishesTabUI.css trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/FishesTabUI.jaxx trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/FishesTabUIHandler.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/FishesTabUIModel.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/FishesTableModel.java Modified: trunk/tutti-persistence-dev/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceDevFixtures.java trunk/tutti-persistence-dev/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceDevImpl.java trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistence.java trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitBenthosCatchBean.java trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitCaptureAccidentelCatchBean.java trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitCatchBeanAware.java trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitMacroDechetCatchBean.java trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitPlanctonCatchBean.java trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TuttiBeans.java trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/VracHorsVracEnum.java trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/WeightCategoryBean.java trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/DecoratorService.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/AbstractTuttiUIHandler.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiUIUtil.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/campaign/EditCampaignUI.jaxx trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/campaign/EditCampaignUIHandler.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/campaign/EditCampaignUIModel.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/campaign/EditSurveyUI.jaxx trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/campaign/EditSurveyUIModel.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/BenthosTabUI.jaxx trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/BenthosTabUIHandler.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/BenthosTabUIModel.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/BenthosTableModel.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/CatchesUI.css trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/CatchesUI.jaxx trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/CatchesUIHandler.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/TraitTabUI.jaxx trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/TraitTabUIHandler.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/TraitTabUIModel.java trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistence.java =================================================================== --- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistence.java 2012-11-28 09:28:45 UTC (rev 24) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistence.java 2012-11-28 18:17:32 UTC (rev 25) @@ -101,7 +101,6 @@ List<TraitCaptureAccidentelCatchBean> getAllTraitCaptureAccidentelCatch(String traitId); - SurveyBean getSurvey(String surveyId); CampaignBean getCampaign(String campaignId); Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitBenthosCatchBean.java =================================================================== --- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitBenthosCatchBean.java 2012-11-28 09:28:45 UTC (rev 24) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitBenthosCatchBean.java 2012-11-28 18:17:32 UTC (rev 25) @@ -1,5 +1,29 @@ package fr.ifremer.tutti.persistence.entities; +/* + * #%L + * Tutti :: Persistence API + * $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.referential.SpeciesBean; /** Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitBenthosCatchBean.java ___________________________________________________________________ Modified: svn:keywords - Author Date Id Revision + Author Date Id Revision HeadURL Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitCaptureAccidentelCatchBean.java =================================================================== --- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitCaptureAccidentelCatchBean.java 2012-11-28 09:28:45 UTC (rev 24) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitCaptureAccidentelCatchBean.java 2012-11-28 18:17:32 UTC (rev 25) @@ -1,5 +1,29 @@ package fr.ifremer.tutti.persistence.entities; +/* + * #%L + * Tutti :: Persistence API + * $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.referential.SpeciesBean; /** Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitCaptureAccidentelCatchBean.java ___________________________________________________________________ Modified: svn:keywords - Author Date Id Revision + Author Date Id Revision HeadURL Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitCatchBeanAware.java =================================================================== --- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitCatchBeanAware.java 2012-11-28 09:28:45 UTC (rev 24) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitCatchBeanAware.java 2012-11-28 18:17:32 UTC (rev 25) @@ -1,7 +1,31 @@ package fr.ifremer.tutti.persistence.entities; +/* + * #%L + * Tutti :: Persistence API + * $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% + */ + /** - * TODO + * For any bean which relies to a {@link TraitBean}. * * @author tchemit <chemit@codelutin.com> * @since 0.2 Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitCatchBeanAware.java ___________________________________________________________________ Modified: svn:keywords - Author Date Id Revision + Author Date Id Revision HeadURL Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitMacroDechetCatchBean.java =================================================================== --- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitMacroDechetCatchBean.java 2012-11-28 09:28:45 UTC (rev 24) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitMacroDechetCatchBean.java 2012-11-28 18:17:32 UTC (rev 25) @@ -1,5 +1,29 @@ package fr.ifremer.tutti.persistence.entities; +/* + * #%L + * Tutti :: Persistence API + * $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.referential.SpeciesBean; /** Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitMacroDechetCatchBean.java ___________________________________________________________________ Modified: svn:keywords - Author Date Id Revision + Author Date Id Revision HeadURL Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitPlanctonCatchBean.java =================================================================== --- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitPlanctonCatchBean.java 2012-11-28 09:28:45 UTC (rev 24) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitPlanctonCatchBean.java 2012-11-28 18:17:32 UTC (rev 25) @@ -1,5 +1,29 @@ package fr.ifremer.tutti.persistence.entities; +/* + * #%L + * Tutti :: Persistence API + * $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.referential.SpeciesBean; /** Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitPlanctonCatchBean.java ___________________________________________________________________ Modified: svn:keywords - Author Date Id Revision + Author Date Id Revision HeadURL Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TuttiBeans.java =================================================================== --- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TuttiBeans.java 2012-11-28 09:28:45 UTC (rev 24) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TuttiBeans.java 2012-11-28 18:17:32 UTC (rev 25) @@ -41,6 +41,10 @@ return new IdPredicate<B>(id); } + public static <B extends AbstractTuttiBean & TraitCatchBeanAware> Predicate<B> newTraitIdPredicate(String id) { + return new TraitIdPredicate<B>(id); + } + public static <B extends AbstractTuttiBean> B findById(Collection<B> beans, String id) { B result = Iterables.tryFind(beans, newIdPredicate(id)).orNull(); @@ -64,4 +68,18 @@ return id.equals(input.getId()); } } + + protected static class TraitIdPredicate<B extends AbstractTuttiBean & TraitCatchBeanAware> implements Predicate<B> { + + private final String id; + + public TraitIdPredicate(String id) { + this.id = id; + } + + @Override + public boolean apply(B input) { + return id.equals(input.getTrait().getId()); + } + } } Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/VracHorsVracEnum.java =================================================================== --- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/VracHorsVracEnum.java 2012-11-28 09:28:45 UTC (rev 24) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/VracHorsVracEnum.java 2012-11-28 18:17:32 UTC (rev 25) @@ -1,5 +1,29 @@ package fr.ifremer.tutti.persistence.entities; +/* + * #%L + * Tutti :: Persistence API + * $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% + */ + /** * @author tchemit <chemit@codelutin.com> * @since 0.2 Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/VracHorsVracEnum.java ___________________________________________________________________ Modified: svn:keywords - Author Date Id Revision + Author Date Id Revision HeadURL Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/WeightCategoryBean.java =================================================================== --- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/WeightCategoryBean.java 2012-11-28 09:28:45 UTC (rev 24) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/WeightCategoryBean.java 2012-11-28 18:17:32 UTC (rev 25) @@ -1,5 +1,29 @@ package fr.ifremer.tutti.persistence.entities.referential; +/* + * #%L + * Tutti :: Persistence API + * $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.AbstractTuttiBean; /** Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/WeightCategoryBean.java ___________________________________________________________________ Modified: svn:keywords - Author Date Id Revision + Author Date Id Revision HeadURL Modified: trunk/tutti-persistence-dev/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceDevFixtures.java =================================================================== --- trunk/tutti-persistence-dev/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceDevFixtures.java 2012-11-28 09:28:45 UTC (rev 24) +++ trunk/tutti-persistence-dev/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceDevFixtures.java 2012-11-28 18:17:32 UTC (rev 25) @@ -223,11 +223,6 @@ se = new SexBean(); se.setId(UUID.randomUUID().toString()); - se.setName("Male"); - cache.put(SexBean.class, se); - - se = new SexBean(); - se.setId(UUID.randomUUID().toString()); se.setName("Femelle"); cache.put(SexBean.class, se); Modified: trunk/tutti-persistence-dev/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceDevImpl.java =================================================================== --- trunk/tutti-persistence-dev/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceDevImpl.java 2012-11-28 09:28:45 UTC (rev 24) +++ trunk/tutti-persistence-dev/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceDevImpl.java 2012-11-28 18:17:32 UTC (rev 25) @@ -446,13 +446,8 @@ return Lists.newArrayList(result); } - protected <B extends AbstractTuttiBean & TraitCatchBeanAware> List<B> getAllTraitFilterCatches(Class<B> beanType,final String traitId) { - List<B> result = Lists.newArrayList(Iterables.filter(getData(beanType), new Predicate<B>() { - @Override - public boolean apply(B input) { - return traitId.equals(input.getTrait().getId()); - } - })); + protected <B extends AbstractTuttiBean & TraitCatchBeanAware> List<B> getAllTraitFilterCatches(Class<B> beanType, String traitId) { + List<B> result = Lists.newArrayList(Iterables.filter(getData(beanType), TuttiBeans.newTraitIdPredicate(traitId))); return result; } Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/DecoratorService.java =================================================================== --- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/DecoratorService.java 2012-11-28 09:28:45 UTC (rev 24) +++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/DecoratorService.java 2012-11-28 18:17:32 UTC (rev 25) @@ -36,6 +36,7 @@ import fr.ifremer.tutti.persistence.entities.referential.SpeciesBean; import fr.ifremer.tutti.persistence.entities.referential.UserBean; import fr.ifremer.tutti.persistence.entities.referential.VesselBean; +import fr.ifremer.tutti.persistence.entities.referential.WeightCategoryBean; import fr.ifremer.tutti.persistence.entities.referential.ZoneBean; import org.nuiton.util.decorator.Decorator; import org.nuiton.util.decorator.DecoratorProvider; @@ -50,6 +51,12 @@ */ public class DecoratorService extends AbstractTuttiService { + public static final String SPECIES_BY_CODE = "byCode"; + + public static final String SPECIES_BY_GENUS = "byGenus"; + + public static final String BY_NAME= "byName"; + /** Delegate decorator provider. */ protected DecoratorProvider decoratorProvider; @@ -79,7 +86,7 @@ registerMultiJXPathDecorator(SurveyBean.class, "${name}$s", "#", " - "); registerMultiJXPathDecorator(CampaignBean.class, "${name}$s", "#", " - "); - registerMultiJXPathDecorator(TraitBean.class, "${stationNumber}$s#${traitNumber}$s#${date}$td/%2$tm/%2$tY", "#", " - "); + registerMultiJXPathDecorator(TraitBean.class, "${stationNumber}$s#${traitNumber}$s#${date}$td/%3$tm/%3$tY", "#", " - "); registerMultiJXPathDecorator(ZoneBean.class, "${name}$s", "#", " - "); registerMultiJXPathDecorator(VesselBean.class, "${name}$s", "#", " - "); registerMultiJXPathDecorator(CountryBean.class, "${name}$s", "#", " - "); @@ -90,9 +97,10 @@ registerMultiJXPathDecorator(StrataBean.class, "${name}$s", "#", " - "); registerMultiJXPathDecorator(SexBean.class, "${name}$s", "#", " - "); registerMultiJXPathDecorator(SpeciesBean.class, "${codeMemo}#${genusSpecies}$s", "#", " - "); - registerMultiJXPathDecorator(SpeciesBean.class, "byCode", "${codeMemo}#${genusSpecies}$s", "#", " - "); - registerMultiJXPathDecorator(SpeciesBean.class, "byGenius", "${genusSpecies}$s#${codeMemo}$s", "#", " - "); - + registerJXPathDecorator(SpeciesBean.class, SPECIES_BY_CODE, "${codeMemo}$s"); + registerJXPathDecorator(SpeciesBean.class, SPECIES_BY_GENUS, "${genusSpecies}$s"); + registerJXPathDecorator(WeightCategoryBean.class, BY_NAME, "${name}$s"); + registerJXPathDecorator(SexBean.class, BY_NAME, "${name}$s"); } }; } Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/AbstractTuttiUIHandler.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/AbstractTuttiUIHandler.java 2012-11-28 09:28:45 UTC (rev 24) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/AbstractTuttiUIHandler.java 2012-11-28 18:17:32 UTC (rev 25) @@ -30,7 +30,6 @@ import com.google.common.collect.Sets; import fr.ifremer.tutti.persistence.entities.AbstractTuttiBean; import fr.ifremer.tutti.service.DecoratorService; -import fr.ifremer.tutti.service.TuttiServiceTechnicalException; import fr.ifremer.tutti.ui.swing.config.TuttiConfig; import jaxx.runtime.swing.OneClicListSelectionModel; import jaxx.runtime.swing.editor.NumberEditor; @@ -39,7 +38,6 @@ import jaxx.runtime.swing.editor.bean.BeanListHeader; import jaxx.runtime.swing.renderer.DecoratorListCellRenderer; import jaxx.runtime.swing.renderer.DecoratorTableCellRenderer; -import org.apache.commons.beanutils.PropertyUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.jdesktop.swingx.JXDatePicker; @@ -102,12 +100,12 @@ public void setText(KeyEvent event, String property) { JTextComponent field = (JTextComponent) event.getSource(); String value = field.getText(); - setProperty(getModel(), property, value); + TuttiUIUtil.setProperty(getModel(), property, value); } public void setBoolean(ItemEvent event, String property) { boolean value = event.getStateChange() == ItemEvent.SELECTED; - setProperty(getModel(), property, value); + TuttiUIUtil.setProperty(getModel(), property, value); } public void selectListData(ListSelectionEvent event, String property) { @@ -123,21 +121,13 @@ Object o = list.getModel().getElementAt(index); selectedList.add(o); } - setProperty(getModel(), property, selectedList); + TuttiUIUtil.setProperty(getModel(), property, selectedList); } finally { selectionModel.setValueIsAdjusting(false); } } } - protected void setProperty(Object bean, String property, Object value) { - try { - PropertyUtils.setSimpleProperty(bean, property, value); - } catch (Exception e) { - throw new TuttiServiceTechnicalException("Could not set property", e); - } - } - protected void initUI(TuttiUI ui) { for (Map.Entry<String, Object> entry : ui.get$objectMap().entrySet()) { @@ -282,12 +272,17 @@ protected <O> ListCellRenderer newListCellRender(Class<O> type) { + return newListCellRender(type, null); + } + + protected <O> ListCellRenderer newListCellRender(Class<O> type, String name) { + DecoratorService decoratorService = context.getService(DecoratorService.class); Preconditions.checkNotNull(type); - Decorator<O> decorator = decoratorService.getDecoratorByType(type); + Decorator<O> decorator = decoratorService.getDecoratorByType(type, name); Preconditions.checkNotNull(decorator); DecoratorListCellRenderer result = new DecoratorListCellRenderer(decorator); @@ -296,12 +291,17 @@ protected <O> TableCellRenderer newTableCellRender(Class<O> type) { + return newTableCellRender(type, null); + } + + protected <O> TableCellRenderer newTableCellRender(Class<O> type, String name) { + DecoratorService decoratorService = context.getService(DecoratorService.class); Preconditions.checkNotNull(type); - Decorator<O> decorator = decoratorService.getDecoratorByType(type); + Decorator<O> decorator = decoratorService.getDecoratorByType(type, name); Preconditions.checkNotNull(decorator); DecoratorTableCellRenderer result = new DecoratorTableCellRenderer(decorator); Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiUIUtil.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiUIUtil.java 2012-11-28 09:28:45 UTC (rev 24) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiUIUtil.java 2012-11-28 18:17:32 UTC (rev 25) @@ -24,8 +24,11 @@ * #L% */ +import com.google.common.base.Preconditions; +import fr.ifremer.tutti.service.TuttiServiceTechnicalException; import jaxx.runtime.JAXXUtil; import jaxx.runtime.SwingUtil; +import org.apache.commons.beanutils.PropertyUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.nuiton.util.FileUtil; @@ -219,4 +222,24 @@ JOptionPane.YES_NO_OPTION); return i == JOptionPane.YES_OPTION; } + + public static void setProperty(Object bean, String property, Object value) { + Preconditions.checkNotNull(bean); + Preconditions.checkNotNull(property); + try { + PropertyUtils.setSimpleProperty(bean, property, value); + } catch (Exception e) { + throw new TuttiServiceTechnicalException("Could not set property '" + property + "' on object of type '" + bean.getClass().getName() + "'", e); + } + } + + public static Object getProperty(Object bean, String property) { + Preconditions.checkNotNull(bean); + Preconditions.checkNotNull(property); + try { + return PropertyUtils.getSimpleProperty(bean, property); + } catch (Exception e) { + throw new TuttiServiceTechnicalException("Could not get property '" + property + "' on object of type '" + bean.getClass().getName() + "'", e); + } + } } Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/campaign/EditCampaignUI.jaxx =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/campaign/EditCampaignUI.jaxx 2012-11-28 09:28:45 UTC (rev 24) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/campaign/EditCampaignUI.jaxx 2012-11-28 18:17:32 UTC (rev 25) @@ -25,11 +25,11 @@ implements='fr.ifremer.tutti.ui.swing.TuttiUI<EditCampaignUIModel, EditCampaignUIHandler>'> <import> - fr.ifremer.tutti.persistence.entities.CountryBean - fr.ifremer.tutti.persistence.entities.GearBean + fr.ifremer.tutti.persistence.entities.referential.CountryBean + fr.ifremer.tutti.persistence.entities.referential.GearBean fr.ifremer.tutti.persistence.entities.SurveyBean - fr.ifremer.tutti.persistence.entities.UserBean - fr.ifremer.tutti.persistence.entities.VesselBean + fr.ifremer.tutti.persistence.entities.referential.UserBean + fr.ifremer.tutti.persistence.entities.referential.VesselBean fr.ifremer.tutti.ui.swing.TuttiUIContext jaxx.runtime.swing.editor.bean.BeanComboBox Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/campaign/EditCampaignUIHandler.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/campaign/EditCampaignUIHandler.java 2012-11-28 09:28:45 UTC (rev 24) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/campaign/EditCampaignUIHandler.java 2012-11-28 18:17:32 UTC (rev 25) @@ -26,7 +26,7 @@ import fr.ifremer.tutti.persistence.entities.CampaignBean; import fr.ifremer.tutti.persistence.entities.SurveyBean; -import fr.ifremer.tutti.persistence.entities.UserBean; +import fr.ifremer.tutti.persistence.entities.referential.UserBean; import fr.ifremer.tutti.service.PersistenceService; import fr.ifremer.tutti.ui.swing.AbstractTuttiUIHandler; import fr.ifremer.tutti.ui.swing.TuttiScreen; Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/campaign/EditCampaignUIModel.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/campaign/EditCampaignUIModel.java 2012-11-28 09:28:45 UTC (rev 24) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/campaign/EditCampaignUIModel.java 2012-11-28 18:17:32 UTC (rev 25) @@ -25,11 +25,11 @@ */ import fr.ifremer.tutti.persistence.entities.CampaignBean; -import fr.ifremer.tutti.persistence.entities.CountryBean; -import fr.ifremer.tutti.persistence.entities.GearBean; +import fr.ifremer.tutti.persistence.entities.referential.CountryBean; +import fr.ifremer.tutti.persistence.entities.referential.GearBean; import fr.ifremer.tutti.persistence.entities.SurveyBean; -import fr.ifremer.tutti.persistence.entities.UserBean; -import fr.ifremer.tutti.persistence.entities.VesselBean; +import fr.ifremer.tutti.persistence.entities.referential.UserBean; +import fr.ifremer.tutti.persistence.entities.referential.VesselBean; import fr.ifremer.tutti.ui.swing.AbstractTuttiBeanUIModel; import org.nuiton.util.beans.BinderFactory; Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/campaign/EditSurveyUI.jaxx =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/campaign/EditSurveyUI.jaxx 2012-11-28 09:28:45 UTC (rev 24) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/campaign/EditSurveyUI.jaxx 2012-11-28 18:17:32 UTC (rev 25) @@ -25,7 +25,7 @@ implements='fr.ifremer.tutti.ui.swing.TuttiUI<EditSurveyUIModel, EditSurveyUIHandler>'> <import> - fr.ifremer.tutti.persistence.entities.ZoneBean + fr.ifremer.tutti.persistence.entities.referential.ZoneBean fr.ifremer.tutti.ui.swing.TuttiUIContext jaxx.runtime.swing.editor.bean.BeanComboBox Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/campaign/EditSurveyUIModel.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/campaign/EditSurveyUIModel.java 2012-11-28 09:28:45 UTC (rev 24) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/campaign/EditSurveyUIModel.java 2012-11-28 18:17:32 UTC (rev 25) @@ -25,7 +25,7 @@ */ import fr.ifremer.tutti.persistence.entities.SurveyBean; -import fr.ifremer.tutti.persistence.entities.ZoneBean; +import fr.ifremer.tutti.persistence.entities.referential.ZoneBean; import fr.ifremer.tutti.ui.swing.AbstractTuttiBeanUIModel; import org.nuiton.util.beans.BinderFactory; Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/BenthosTabUI.jaxx =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/BenthosTabUI.jaxx 2012-11-28 09:28:45 UTC (rev 24) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/BenthosTabUI.jaxx 2012-11-28 18:17:32 UTC (rev 25) @@ -25,11 +25,11 @@ implements='fr.ifremer.tutti.ui.swing.TuttiUI<BenthosTabUIModel, BenthosTabUIHandler>'> <import> - fr.ifremer.tutti.persistence.entities.BeaufortScaleBean - fr.ifremer.tutti.persistence.entities.SeaStateBean + fr.ifremer.tutti.persistence.entities.referential.BeaufortScaleBean + fr.ifremer.tutti.persistence.entities.referential.SeaStateBean fr.ifremer.tutti.persistence.entities.StrataBean fr.ifremer.tutti.persistence.entities.TraitBean - fr.ifremer.tutti.persistence.entities.UserBean + fr.ifremer.tutti.persistence.entities.referential.UserBean fr.ifremer.tutti.ui.swing.TuttiUIContext jaxx.runtime.swing.editor.NumberEditor @@ -66,7 +66,8 @@ <BeanValidator id='validator' bean='model' errorTableModel='errorTableModel' uiClass='jaxx.runtime.validator.swing.ui.ImageValidationUI'> - <!--field name='comment' component='commentField'/--> + <field name='totalWeight' component='totalWeightField'/> + <field name='sampleTotalWeight' component='sampleTotalWeightField'/> </BeanValidator> <Table id='form' fill='both' constraints='BorderLayout.NORTH'> Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/BenthosTabUIHandler.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/BenthosTabUIHandler.java 2012-11-28 09:28:45 UTC (rev 24) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/BenthosTabUIHandler.java 2012-11-28 18:17:32 UTC (rev 25) @@ -24,9 +24,10 @@ * #L% */ -import fr.ifremer.tutti.persistence.entities.CatchBean; -import fr.ifremer.tutti.persistence.entities.SpeciesBean; import fr.ifremer.tutti.persistence.entities.TraitBean; +import fr.ifremer.tutti.persistence.entities.TraitBenthosCatchBean; +import fr.ifremer.tutti.persistence.entities.TraitSpeciesCatchBean; +import fr.ifremer.tutti.persistence.entities.referential.SpeciesBean; import fr.ifremer.tutti.service.PersistenceService; import fr.ifremer.tutti.ui.swing.AbstractTuttiUIHandler; import jaxx.runtime.SwingUtil; @@ -124,7 +125,7 @@ model.addPropertyChangeListener(BenthosTabUIModel.PROPERTY_CATCHES, new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent evt) { - tableModel.setData((List<CatchBean>) evt.getNewValue()); + tableModel.setData((List<TraitSpeciesCatchBean>) evt.getNewValue()); } }); @@ -152,13 +153,13 @@ BenthosTabUIModel model = ui.getModel(); - List<CatchBean> catches; + List<TraitBenthosCatchBean> catches; if (empty) { catches = null; bean = new TraitBean(); } else { - catches = persistenceService.getAllCatches(bean.getId()); + catches = persistenceService.getAllTraitBenthosCatch(bean.getId()); } model.fromBean(bean); Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/BenthosTabUIModel.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/BenthosTabUIModel.java 2012-11-28 09:28:45 UTC (rev 24) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/BenthosTabUIModel.java 2012-11-28 18:17:32 UTC (rev 25) @@ -24,8 +24,8 @@ * #L% */ -import fr.ifremer.tutti.persistence.entities.CatchBean; import fr.ifremer.tutti.persistence.entities.TraitBean; +import fr.ifremer.tutti.persistence.entities.TraitBenthosCatchBean; import org.jdesktop.beans.AbstractSerializableBean; import org.nuiton.util.beans.BinderFactory; @@ -49,7 +49,7 @@ protected Float sampleTotalWeight; - protected List<CatchBean> catches; + protected List<TraitBenthosCatchBean> catches; public Float getTotalWeight() { return totalWeight; @@ -71,11 +71,11 @@ firePropertyChange(PROPERTY_SAMPLE_TOTAL_WEIGHT, oldValue, sampleTotalWeight); } - public List<CatchBean> getCatches() { + public List<TraitBenthosCatchBean> getCatches() { return catches; } - public void setCatches(List<CatchBean> catches) { + public void setCatches(List<TraitBenthosCatchBean> catches) { Object oldValue = getCatches(); this.catches = catches; firePropertyChange(PROPERTY_CATCHES, oldValue, catches); Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/BenthosTableModel.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/BenthosTableModel.java 2012-11-28 09:28:45 UTC (rev 24) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/BenthosTableModel.java 2012-11-28 18:17:32 UTC (rev 25) @@ -25,7 +25,7 @@ */ import com.google.common.collect.Lists; -import fr.ifremer.tutti.persistence.entities.CatchBean; +import fr.ifremer.tutti.persistence.entities.TraitSpeciesCatchBean; import javax.swing.table.AbstractTableModel; import javax.swing.table.TableColumnModel; @@ -39,7 +39,7 @@ private static final long serialVersionUID = 1L; - protected List<CatchBean> data; + protected List<TraitSpeciesCatchBean> data; protected final TableColumnModel columnModel; @@ -47,10 +47,10 @@ this.columnModel = columnModel; } - public void setData(List<CatchBean> data) { + public void setData(List<TraitSpeciesCatchBean> data) { if (data == null) { data = Lists.newArrayList(); - data.add(new CatchBean()); + data.add(new TraitSpeciesCatchBean()); } this.data = data; fireTableDataChanged(); Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/CaptureAccidentelTabUI.css =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/CaptureAccidentelTabUI.css (rev 0) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/CaptureAccidentelTabUI.css 2012-11-28 18:17:32 UTC (rev 25) @@ -0,0 +1,59 @@ +/* + * #%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()}; + showPopupButton:{handler.getConfig().isShowNumberEditorButton()}; + bean:{model}; + showReset:true; +} + +#totalWeightLabel { + text:"tutti.label.captureAccidentel.totalWeight"; + labelFor:{totalWeightField}; +} + +#totalWeightField { + property:"totalWeight"; + model:{model.getTotalWeight()}; + useFloat:false; + numberPattern:{INT_6_DIGITS_PATTERN}; +} + +#sampleTotalWeightLabel { + text:"tutti.label.captureAccidentel.sampleTotalWeight"; + labelFor:{totalWeightField}; +} + +#sampleTotalWeightField { + property:"sampleTotalWeight"; + model:{model.getSampleTotalWeight()}; + useFloat:false; + numberPattern:{INT_6_DIGITS_PATTERN}; +} + +#table { + model:{getContextValue(TableModel.class)}; + columnModel:{getContextValue(TableColumnModel.class)}; +} Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/CaptureAccidentelTabUI.css ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/CaptureAccidentelTabUI.jaxx =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/CaptureAccidentelTabUI.jaxx (rev 0) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/CaptureAccidentelTabUI.jaxx 2012-11-28 18:17:32 UTC (rev 25) @@ -0,0 +1,100 @@ +<!-- + #%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<CaptureAccidentelTabUIModel, CaptureAccidentelTabUIHandler>'> + + <import> + fr.ifremer.tutti.persistence.entities.referential.BeaufortScaleBean + fr.ifremer.tutti.persistence.entities.referential.SeaStateBean + fr.ifremer.tutti.persistence.entities.StrataBean + fr.ifremer.tutti.persistence.entities.TraitBean + fr.ifremer.tutti.persistence.entities.referential.UserBean + fr.ifremer.tutti.ui.swing.TuttiUIContext + + jaxx.runtime.swing.editor.NumberEditor + + jaxx.runtime.validator.swing.SwingValidatorUtil + jaxx.runtime.validator.swing.SwingValidatorMessageTableModel + + javax.swing.table.TableModel + javax.swing.table.TableColumnModel + + static org.nuiton.i18n.I18n._ + </import> + + <script><![CDATA[ + +public CaptureAccidentelTabUI(CatchesUI parentUI) { + CaptureAccidentelTabUIHandler handler = new CaptureAccidentelTabUIHandler(parentUI, this); + setContextValue(handler); + handler.beforeInitUI(); +} + +public void selectTrait(TraitBean trait) { handler.selectTrait(trait); } + +protected void $afterCompleteSetup() { handler.afterInitUI(); } + ]]></script> + + <CaptureAccidentelTabUIHandler id='handler' + initializer='getContextValue(CaptureAccidentelTabUIHandler.class)'/> + + <CaptureAccidentelTabUIModel id='model' + initializer='getContextValue(CaptureAccidentelTabUIModel.class)'/> + + <SwingValidatorMessageTableModel id='errorTableModel'/> + + <BeanValidator id='validator' bean='model' errorTableModel='errorTableModel' + uiClass='jaxx.runtime.validator.swing.ui.ImageValidationUI'> + <field name='totalWeight' component='totalWeightField'/> + <field name='sampleTotalWeight' component='sampleTotalWeightField'/> + </BeanValidator> + + <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 échantillonné --> + <row> + <cell> + <JLabel id='sampleTotalWeightLabel'/> + </cell> + <cell> + <NumberEditor id='sampleTotalWeightField' constructorParams='this'/> + </cell> + </row> + </Table> + + <JScrollPane id='tableScrollPane' constraints='BorderLayout.CENTER'> + <JTable id='table'/> + </JScrollPane> + +</JPanel> \ No newline at end of file Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/CaptureAccidentelTabUI.jaxx ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/CaptureAccidentelTabUIHandler.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/CaptureAccidentelTabUIHandler.java (rev 0) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/CaptureAccidentelTabUIHandler.java 2012-11-28 18:17:32 UTC (rev 25) @@ -0,0 +1,181 @@ +package fr.ifremer.tutti.ui.swing.content.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.TraitBean; +import fr.ifremer.tutti.persistence.entities.TraitCaptureAccidentelCatchBean; +import fr.ifremer.tutti.persistence.entities.TraitSpeciesCatchBean; +import fr.ifremer.tutti.persistence.entities.referential.SpeciesBean; +import fr.ifremer.tutti.service.PersistenceService; +import fr.ifremer.tutti.ui.swing.AbstractTuttiUIHandler; +import jaxx.runtime.SwingUtil; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import javax.swing.JComboBox; +import javax.swing.JTable; +import javax.swing.table.DefaultTableColumnModel; +import javax.swing.table.TableCellEditor; +import javax.swing.table.TableCellRenderer; +import javax.swing.table.TableColumn; +import javax.swing.table.TableColumnModel; +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; +import java.util.List; + +import static org.nuiton.i18n.I18n._; + +/** + * @author tchemit <chemit@codelutin.com> + * @since 0.2 + */ +public class CaptureAccidentelTabUIHandler extends AbstractTuttiUIHandler<CaptureAccidentelTabUIModel> { + + /** Logger. */ + private static final Log log = LogFactory.getLog(CaptureAccidentelTabUIHandler.class); + + private final CaptureAccidentelTabUI ui; + + private final CatchesUI parentUi; + + private final PersistenceService persistenceService; + + public CaptureAccidentelTabUIHandler(CatchesUI parentUi, CaptureAccidentelTabUI ui) { + super(parentUi.getHandler().getContext()); + this.ui = ui; + this.parentUi = parentUi; + this.persistenceService = context.getService(PersistenceService.class); + } + + @Override + public void beforeInitUI() { + + CaptureAccidentelTabUIModel model = new CaptureAccidentelTabUIModel(); + ui.setContextValue(model); + + JTable tb = new JTable(); + + TableCellEditor defaultEditor = tb.getDefaultEditor(String.class); + TableCellRenderer defaultRenderer = tb.getDefaultRenderer(Object.class); + + // prepare the table column model + TableColumnModel columnModel = new DefaultTableColumnModel(); + + TableColumn col; + + // species (by code) column + + col = new TableColumn(0); + + JComboBox speciesEditor = new JComboBox(); + List<SpeciesBean> allSpecies = persistenceService.getAllSpecies(); + SwingUtil.fillComboBox(speciesEditor, allSpecies, null); +// col.setCellEditor(); + col.setCellRenderer(newTableCellRender(SpeciesBean.class)); + col.setHeaderValue(_("tutti.table.captureAccidentel.header.speciesByCode")); +// col.setHeaderRenderer(SwingUtil.newStringTableCellRenderer(dRender,50, true)); + col.setIdentifier("speciesByCode"); + columnModel.addColumn(col); + + // Poids observé + col = new TableColumn(1); + col.setCellEditor(defaultEditor); + col.setCellRenderer(defaultRenderer); + col.setHeaderValue(_("tutti.table.captureAccidentel.header.weight")); +// col.setHeaderRenderer(SwingUtil.newStringTableCellRenderer(dRender,50, true)); + col.setIdentifier("weight"); + columnModel.addColumn(col); + + // Nombre observé + col = new TableColumn(2); + col.setCellEditor(defaultEditor); + col.setCellRenderer(defaultRenderer); + col.setHeaderValue(_("tutti.table.captureAccidentel.header.number")); +// col.setHeaderRenderer(SwingUtil.newStringTableCellRenderer(dRender,50, true)); + col.setIdentifier("computedNumber"); + columnModel.addColumn(col); + + ui.setContextValue(columnModel); + + final CaptureAccidentelTableModel tableModel = new CaptureAccidentelTableModel(columnModel); + ui.setContextValue(tableModel); + + model.addPropertyChangeListener(CaptureAccidentelTabUIModel.PROPERTY_CATCHES, new PropertyChangeListener() { + @Override + public void propertyChange(PropertyChangeEvent evt) { + tableModel.setData((List<TraitSpeciesCatchBean>) evt.getNewValue()); + } + }); + + } + + @Override + public void afterInitUI() { + CaptureAccidentelTabUIModel model = ui.getModel(); + + initUI(ui); + } + + @Override + public void onCloseUI() { + } + + @Override + protected CaptureAccidentelTabUIModel getModel() { + return ui.getModel(); + } + + public void selectTrait(TraitBean bean) { + + boolean empty = bean == null; + + CaptureAccidentelTabUIModel model = ui.getModel(); + + List<TraitCaptureAccidentelCatchBean> catches; + + if (empty) { + catches = null; + bean = new TraitBean(); + } else { + catches = persistenceService.getAllTraitCaptureAccidentelCatch(bean.getId()); + } + + model.fromBean(bean); + model.setCatches(catches); + } + + public void cancel() { + + if (log.isInfoEnabled()) { + log.info("Cancel edition"); + } + } + + public void save() { + if (log.isInfoEnabled()) { + log.info("Will save"); + } + } +} \ No newline at end of file Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/CaptureAccidentelTabUIHandler.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/CaptureAccidentelTabUIModel.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/CaptureAccidentelTabUIModel.java (rev 0) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/CaptureAccidentelTabUIModel.java 2012-11-28 18:17:32 UTC (rev 25) @@ -0,0 +1,95 @@ +package fr.ifremer.tutti.ui.swing.content.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.TraitBean; +import fr.ifremer.tutti.persistence.entities.TraitCaptureAccidentelCatchBean; +import org.jdesktop.beans.AbstractSerializableBean; +import org.nuiton.util.beans.BinderFactory; + +import java.util.List; + +/** + * @author tchemit <chemit@codelutin.com> + * @since 0.2 + */ +public class CaptureAccidentelTabUIModel extends AbstractSerializableBean { + + private static final long serialVersionUID = 1L; + + public static final String PROPERTY_TOTAL_WEIGHT = "totalWeight"; + + public static final String PROPERTY_SAMPLE_TOTAL_WEIGHT = "sampleTotalWeight"; + + public static final String PROPERTY_CATCHES = "catches"; + + protected Float totalWeight; + + protected Float sampleTotalWeight; + + protected List<TraitCaptureAccidentelCatchBean> catches; + + public Float getTotalWeight() { + return totalWeight; + } + + public void setTotalWeight(Float totalWeight) { + Object oldValue = getTotalWeight(); + this.totalWeight = totalWeight; + firePropertyChange(PROPERTY_TOTAL_WEIGHT, oldValue, totalWeight); + } + + public Float getSampleTotalWeight() { + return sampleTotalWeight; + } + + public void setSampleTotalWeight(Float sampleTotalWeight) { + Object oldValue = getSampleTotalWeight(); + this.sampleTotalWeight = sampleTotalWeight; + firePropertyChange(PROPERTY_SAMPLE_TOTAL_WEIGHT, oldValue, sampleTotalWeight); + } + + public List<TraitCaptureAccidentelCatchBean> getCatches() { + return catches; + } + + public void setCatches(List<TraitCaptureAccidentelCatchBean> catches) { + Object oldValue = getCatches(); + this.catches = catches; + firePropertyChange(PROPERTY_CATCHES, oldValue, catches); + } + + public void fromBean(TraitBean bean) { + BinderFactory.newBinder(TraitBean.class, + CaptureAccidentelTabUIModel.class).copy(bean, this); + } + + public TraitBean toBean() { + TraitBean result = new TraitBean(); + BinderFactory.newBinder(CaptureAccidentelTabUIModel.class, + TraitBean.class).copy(this, result); + return result; + } +} \ No newline at end of file Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/CaptureAccidentelTabUIModel.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/CaptureAccidentelTableModel.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/CaptureAccidentelTableModel.java (rev 0) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/CaptureAccidentelTableModel.java 2012-11-28 18:17:32 UTC (rev 25) @@ -0,0 +1,78 @@ +package fr.ifremer.tutti.ui.swing.content.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 com.google.common.collect.Lists; +import fr.ifremer.tutti.persistence.entities.TraitSpeciesCatchBean; + +import javax.swing.table.AbstractTableModel; +import javax.swing.table.TableColumnModel; +import java.util.List; + +/** + * @author tchemit <chemit@codelutin.com> + * @since 0.2 + */ +public class CaptureAccidentelTableModel extends AbstractTableModel { + + private static final long serialVersionUID = 1L; + + protected List<TraitSpeciesCatchBean> data; + + protected final TableColumnModel columnModel; + + public CaptureAccidentelTableModel(TableColumnModel columnModel) { + this.columnModel = columnModel; + } + + public void setData(List<TraitSpeciesCatchBean> data) { + if (data == null) { + data = Lists.newArrayList(); + data.add(new TraitSpeciesCatchBean()); + } + this.data = data; + fireTableDataChanged(); + } + + @Override + public int getRowCount() { + return data == null ? 0 : data.size(); + } + + @Override + public int getColumnCount() { + return columnModel.getColumnCount(); + } + + @Override + public Object getValueAt(int rowIndex, int columnIndex) { + return null; + } + + @Override + public boolean isCellEditable(int rowIndex, int columnIndex) { + return true; + } +} \ No newline at end of file Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/CaptureAccidentelTableModel.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/catches/CatchesUI.css =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/CatchesUI.css 2012-11-28 09:28:45 UTC (rev 24) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/CatchesUI.css 2012-11-28 18:17:32 UTC (rev 25) @@ -38,7 +38,7 @@ selectedItem:{model.getSelectedTrait()}; } -#fishesTab { +#speciesTab { enabled:{model.getSelectedTrait() != null}; } @@ -50,14 +50,15 @@ enabled:{model.getSelectedTrait() != null}; } -#macroDechetsTab { +#macroDechetTab { enabled:{model.getSelectedTrait() != null}; } -#captureAccidentellesTab { +#captureAccidentelTab { enabled:{model.getSelectedTrait() != null}; } -#observationIndividuellesTab { - enabled:{model.getSelectedTrait() != null}; +#observationIndividuelTab { + enabled:{false}; + /*enabled:{model.getSelectedTrait() != null};*/ } Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/CatchesUI.jaxx =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/CatchesUI.jaxx 2012-11-28 09:28:45 UTC (rev 24) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/CatchesUI.jaxx 2012-11-28 18:17:32 UTC (rev 25) @@ -70,22 +70,22 @@ <tab id='traitTab' title='tutti.label.tab.trait'> <TraitTabUI id='traitTabContent' constructorParams='this'/> </tab> - <tab id='fishesTab' title='tutti.label.tab.fishes'> - <FishesTabUI id='fishesTabContent' constructorParams='this'/> + <tab id='speciesTab' title='tutti.label.tab.species'> + <SpeciesTabUI id='speciesTabContent' constructorParams='this'/> </tab> <tab id='benthosTab' title='tutti.label.tab.benthos'> <BenthosTabUI id='benthosTabContent' constructorParams='this'/> </tab> <tab id='planctonTab' title='tutti.label.tab.plancton'> - <JLabel text='tutti.to.be.done' horizontalAlignment='{JLabel.CENTER}'/> + <PlanctonTabUI id='planctonTabContent' constructorParams='this'/> </tab> - <tab id='macroDechetsTab' title='tutti.label.tab.macroDechets'> - <JLabel text='tutti.to.be.done' horizontalAlignment='{JLabel.CENTER}'/> + <tab id='macroDechetTab' title='tutti.label.tab.macroDechet'> + <MacroDechetTabUI id='macroDechetTabContent' constructorParams='this'/> </tab> - <tab id='captureAccidentellesTab' title='tutti.label.tab.captureAccidentelles'> - <JLabel text='tutti.to.be.done' horizontalAlignment='{JLabel.CENTER}'/> + <tab id='captureAccidentelTab' title='tutti.label.tab.captureAccidentel'> + <CaptureAccidentelTabUI id='captureAccidentelTabContent' constructorParams='this'/> </tab> - <tab id='observationIndividuellesTab' title='tutti.label.tab.observationIndividuelles'> + <tab id='observationIndividuelTab' title='tutti.label.tab.observationIndividuel'> <JLabel text='tutti.to.be.done' horizontalAlignment='{JLabel.CENTER}'/> </tab> </JTabbedPane> Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/CatchesUIHandler.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/CatchesUIHandler.java 2012-11-28 09:28:45 UTC (rev 24) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/CatchesUIHandler.java 2012-11-28 18:17:32 UTC (rev 25) @@ -152,16 +152,15 @@ // propagate trait to his tabs ui.getTraitTabContent().selectTrait(selectedTrait); - ui.getFishesTabContent().selectTrait(selectedTrait); + ui.getSpeciesTabContent().selectTrait(selectedTrait); ui.getBenthosTabContent().selectTrait(selectedTrait); + ui.getPlanctonTabContent().selectTrait(selectedTrait); + ui.getMacroDechetTabContent().selectTrait(selectedTrait); + ui.getCaptureAccidentelTabContent().selectTrait(selectedTrait); // repaint tabs ui.getTabPane().repaint(); - -// ui.getPlanctonTabContent().selectTrait(selectedTrait); -// ui.getMacroDechetsTabContent().selectTrait(selectedTrait); -// ui.getCaptureAccidentellesTabContent().selectTrait(selectedTrait); -// ui.getObservationIndividuellesTabContent().selectTrait(selectedTrait); +// ui.getObservationIndividuelTabContent().selectTrait(selectedTrait); } public void saveTrait(TraitBean toSave) { Deleted: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/FishesTabUI.css =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/FishesTabUI.css 2012-11-28 09:28:45 UTC (rev 24) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/FishesTabUI.css 2012-11-28 18:17:32 UTC (rev 25) @@ -1,71 +0,0 @@ -/* - * #%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()}; - showPopupButton:{handler.getConfig().isShowNumberEditorButton()}; - bean:{model}; - showReset:true; -} - -#totalWeightTotalVracWeightLabel { - text:"tutti.label.totalWeightTotalVracWeight"; -} - -#sampleVracWeightTotalHorsVracWeightLabel { - text:"tutti.label.sampleVracWeightTotalHorsVracWeight"; -} - -#totalWeightField { - property:"totalWeight"; - model:{model.getTotalWeight()}; - useFloat:false; - numberPattern:{INT_6_DIGITS_PATTERN}; -} - -#totalVracWeightField { - property:"totalVracWeight"; - model:{model.getTotalVracWeight()}; - useFloat:false; - numberPattern:{INT_6_DIGITS_PATTERN}; -} - -#sampleVracWeightField { - property:"sampleVracWeight"; - model:{model.getSampleVracWeight()}; - useFloat:false; - numberPattern:{INT_6_DIGITS_PATTERN}; -} - -#totalHorsVracWeightField { - property:"totalHorsVracWeight"; - model:{model.getTotalHorsVracWeight()}; - useFloat:false; - numberPattern:{INT_6_DIGITS_PATTERN}; -} - -#table { - model:{getContextValue(TableModel.class)}; - columnModel:{getContextValue(TableColumnModel.class)}; -} Deleted: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/FishesTabUI.jaxx =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/FishesTabUI.jaxx 2012-11-28 09:28:45 UTC (rev 24) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/FishesTabUI.jaxx 2012-11-28 18:17:32 UTC (rev 25) @@ -1,105 +0,0 @@ -<!-- - #%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<FishesTabUIModel, FishesTabUIHandler>'> - - <import> - fr.ifremer.tutti.persistence.entities.BeaufortScaleBean - fr.ifremer.tutti.persistence.entities.SeaStateBean - fr.ifremer.tutti.persistence.entities.StrataBean - fr.ifremer.tutti.persistence.entities.TraitBean - fr.ifremer.tutti.persistence.entities.UserBean - fr.ifremer.tutti.ui.swing.TuttiUIContext - - jaxx.runtime.swing.editor.NumberEditor - - jaxx.runtime.validator.swing.SwingValidatorUtil - jaxx.runtime.validator.swing.SwingValidatorMessageTableModel - - javax.swing.table.TableModel - javax.swing.table.TableColumnModel - - static org.nuiton.i18n.I18n._ - </import> - - <script><![CDATA[ - -public FishesTabUI(CatchesUI parentUI) { - FishesTabUIHandler handler = new FishesTabUIHandler(parentUI, this); - setContextValue(handler); - handler.beforeInitUI(); -} - -public void selectTrait(TraitBean trait) { handler.selectTrait(trait); } - -protected void $afterCompleteSetup() { handler.afterInitUI(); } - ]]></script> - - <FishesTabUIHandler id='handler' - initializer='getContextValue(FishesTabUIHandler.class)'/> - - <FishesTabUIModel id='model' - initializer='getContextValue(FishesTabUIModel.class)'/> - - <SwingValidatorMessageTableModel id='errorTableModel'/> - - <BeanValidator id='validator' bean='model' errorTableModel='errorTableModel' - uiClass='jaxx.runtime.validator.swing.ui.ImageValidationUI'> - <!--field name='comment' component='commentField'/--> - </BeanValidator> - - <Table id='form' fill='both' constraints='BorderLayout.NORTH'> - - <!-- Poids total / Poids total vrac --> - <row> - <cell anchor='west'> - <JLabel id='totalWeightTotalVracWeightLabel'/> - </cell> - <cell weightx='1.0'> - <JPanel layout='{new GridLayout(1,0)}'> - <NumberEditor id='totalWeightField' constructorParams='this'/> - <NumberEditor id='totalVracWeightField' constructorParams='this'/> - </JPanel> - </cell> - </row> - - <!-- Poids échantillonné vrac / Poids total hors vrac --> - <row> - <cell> - <JLabel id='sampleVracWeightTotalHorsVracWeightLabel'/> - </cell> - <cell> - <JPanel layout='{new GridLayout(1,0)}'> - <NumberEditor id='sampleVracWeightField' constructorParams='this'/> - <NumberEditor id='totalHorsVracWeightField' constructorParams='this'/> - </JPanel> - </cell> - </row> - </Table> - - <JScrollPane id='tableScrollPane' constraints='BorderLayout.CENTER'> - <JTable id='table'/> - </JScrollPane> - -</JPanel> Deleted: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/FishesTabUIHandler.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/FishesTabUIHandler.java 2012-11-28 09:28:45 UTC (rev 24) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/FishesTabUIHandler.java 2012-11-28 18:17:32 UTC (rev 25) @@ -1,265 +0,0 @@ -package fr.ifremer.tutti.ui.swing.content.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.CatchBean; -import fr.ifremer.tutti.persistence.entities.SpeciesBean; -import fr.ifremer.tutti.persistence.entities.TraitBean; -import fr.ifremer.tutti.service.PersistenceService; -import fr.ifremer.tutti.ui.swing.AbstractTuttiUIHandler; -import jaxx.runtime.SwingUtil; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -import javax.swing.JComboBox; -import javax.swing.JTable; -import javax.swing.table.DefaultTableCellRenderer; -import javax.swing.table.DefaultTableColumnModel; -import javax.swing.table.TableCellEditor; -import javax.swing.table.TableCellRenderer; -import javax.swing.table.TableColumn; -import javax.swing.table.TableColumnModel; -import javax.swing.table.TableModel; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyChangeListener; -import java.util.List; - -import static org.nuiton.i18n.I18n._; - -/** - * @author tchemit <chemit@codelutin.com> - * @since 0.1 - */ -public class FishesTabUIHandler extends AbstractTuttiUIHandler<FishesTabUIModel> { - - /** Logger. */ - private static final Log log = LogFactory.getLog(FishesTabUIHandler.class); - - private final FishesTabUI ui; - - private final CatchesUI parentUi; - - private final PersistenceService persistenceService; - - public FishesTabUIHandler(CatchesUI parentUi, FishesTabUI ui) { - super(parentUi.getHandler().getContext()); - this.ui = ui; - this.parentUi = parentUi; - this.persistenceService = context.getService(PersistenceService.class); - } - - @Override - public void beforeInitUI() { - - FishesTabUIModel model = new FishesTabUIModel(); - ui.setContextValue(model); - - JTable tb = new JTable(); - - TableCellEditor defaultEditor = tb.getDefaultEditor(String.class); - TableCellRenderer defaultRenderer = tb.getDefaultRenderer(Object.class); - - DefaultTableCellRenderer dRender = new DefaultTableCellRenderer(); - // prepare the table column model - TableColumnModel columnModel = new DefaultTableColumnModel(); - - TableColumn col; - - // species (by code) column - - col = new TableColumn(0); - - JComboBox speciesEditor = new JComboBox(); - List<SpeciesBean> allSpecies = persistenceService.getAllSpecies(); - SwingUtil.fillComboBox(speciesEditor, allSpecies, null); -// col.setCellEditor(); - col.setCellRenderer(newTableCellRender(SpeciesBean.class)); - col.setHeaderValue(_("tutti.table.fishes.header.speciesByCode")); -// col.setHeaderRenderer(SwingUtil.newStringTableCellRenderer(dRender,50, true)); - col.setIdentifier("speciesByCode"); - columnModel.addColumn(col); - - // Vrac / Hors vrac - col = new TableColumn(1); - col.setCellEditor(defaultEditor); - col.setCellRenderer(defaultRenderer); - col.setHeaderValue(_("tutti.table.fishes.header.vracHorsVrac")); -// col.setHeaderRenderer(SwingUtil.newStringTableCellRenderer(dRender,50, true)); - col.setIdentifier("vracHorsVrac"); - columnModel.addColumn(col); - - // Catégorie de poids - col = new TableColumn(2); - col.setCellEditor(defaultEditor); - col.setCellRenderer(defaultRenderer); - col.setHeaderValue(_("tutti.table.fishes.header.weightCategory")); -// col.setHeaderRenderer(SwingUtil.newStringTableCellRenderer(dRender,50, true)); - col.setIdentifier("weightCategory"); - columnModel.addColumn(col); - - // Sex - col = new TableColumn(3); - col.setCellEditor(defaultEditor); - col.setCellRenderer(defaultRenderer); - col.setHeaderValue(_("tutti.table.fishes.header.sex")); -// col.setHeaderRenderer(SwingUtil.newStringTableCellRenderer(dRender,50, true)); - col.setIdentifier("sex"); - columnModel.addColumn(col); - - // Maturity - col = new TableColumn(4); - col.setCellEditor(defaultEditor); - col.setCellRenderer(defaultRenderer); - col.setHeaderValue(_("tutti.table.fishes.header.maturity")); -// col.setHeaderRenderer(SwingUtil.newStringTableCellRenderer(dRender,50, true)); - col.setIdentifier("maturity"); - columnModel.addColumn(col); - - // Age - col = new TableColumn(5); - col.setCellEditor(defaultEditor); - col.setCellRenderer(defaultRenderer); - col.setHeaderValue(_("tutti.table.fishes.header.age")); -// col.setHeaderRenderer(SwingUtil.newStringTableCellRenderer(dRender,50, true)); - col.setIdentifier("age"); - columnModel.addColumn(col); - - // Type de mensuration - col = new TableColumn(6); - col.setCellEditor(defaultEditor); - col.setCellRenderer(defaultRenderer); - col.setHeaderValue(_("tutti.table.fishes.header.mensurationType")); -// col.setHeaderRenderer(SwingUtil.newStringTableCellRenderer(dRender,50, true)); - col.setIdentifier("mensurationType"); - columnModel.addColumn(col); - - // Poids observé - col = new TableColumn(7); - col.setCellEditor(defaultEditor); - col.setCellRenderer(defaultRenderer); - col.setHeaderValue(_("tutti.table.fishes.header.weight")); -// col.setHeaderRenderer(SwingUtil.newStringTableCellRenderer(dRender,50, true)); - col.setIdentifier("weight"); - columnModel.addColumn(col); - - // Poids calculé - col = new TableColumn(8); - col.setCellEditor(defaultEditor); - col.setCellRenderer(defaultRenderer); - col.setHeaderValue(_("tutti.table.fishes.header.computedWeight")); -// col.setHeaderRenderer(SwingUtil.newStringTableCellRenderer(dRender,50, true)); - col.setIdentifier("computedWeight"); - columnModel.addColumn(col); - - // Nombre calculé - col = new TableColumn(9); - col.setCellEditor(defaultEditor); - col.setCellRenderer(defaultRenderer); - col.setHeaderValue(_("tutti.table.fishes.header.computedNumber")); -// col.setHeaderRenderer(SwingUtil.newStringTableCellRenderer(dRender,50, true)); - col.setIdentifier("computedNumber"); - columnModel.addColumn(col); - - // Poids d'échantillon - col = new TableColumn(10); - col.setCellEditor(defaultEditor); - col.setCellRenderer(defaultRenderer); - col.setHeaderValue(_("tutti.table.fishes.header.sampleWeight")); -// col.setHeaderRenderer(SwingUtil.newStringTableCellRenderer(dRender,50, true)); - col.setIdentifier("sampleWeight"); - columnModel.addColumn(col); - - // Fraction d'élévation - col = new TableColumn(11); - col.setCellEditor(defaultEditor); - col.setCellRenderer(defaultRenderer); - col.setHeaderValue(_("tutti.table.fishes.header.elevationRate")); -// col.setHeaderRenderer(SwingUtil.newStringTableCellRenderer(dRender,50, true)); - col.setIdentifier("elevationRate"); - columnModel.addColumn(col); - - ui.setContextValue(columnModel); - - final FishesTableModel tableModel = new FishesTableModel(columnModel); - ui.setContextValue(tableModel); - - model.addPropertyChangeListener(FishesTabUIModel.PROPERTY_CATCHES, new PropertyChangeListener() { - @Override - public void propertyChange(PropertyChangeEvent evt) { - tableModel.setData((List<CatchBean>) evt.getNewValue()); - } - }); - - } - - @Override - public void afterInitUI() { - FishesTabUIModel model = ui.getModel(); - - initUI(ui); - } - - @Override - public void onCloseUI() { - } - - @Override - protected FishesTabUIModel getModel() { - return ui.getModel(); - } - - public void selectTrait(TraitBean bean) { - - boolean empty = bean == null; - - FishesTabUIModel model = ui.getModel(); - - List<CatchBean> catches; - - if (empty) { - catches = null; - bean = new TraitBean(); - } else { - catches = persistenceService.getAllCatches(bean.getId()); - } - - model.fromBean(bean); - model.setCatches(catches); - - } - - public void cancel() { - - if (log.isInfoEnabled()) { - log.info("Cancel edition"); - } - } - - public void save() { - if (log.isInfoEnabled()) { - log.info("Will save"); - } - } -} Deleted: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/FishesTabUIModel.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/FishesTabUIModel.java 2012-11-28 09:28:45 UTC (rev 24) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/FishesTabUIModel.java 2012-11-28 18:17:32 UTC (rev 25) @@ -1,123 +0,0 @@ -package fr.ifremer.tutti.ui.swing.content.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.CatchBean; -import fr.ifremer.tutti.persistence.entities.TraitBean; -import org.jdesktop.beans.AbstractSerializableBean; -import org.nuiton.util.beans.BinderFactory; - -import java.util.List; - -/** - * @author tchemit <chemit@codelutin.com> - * @since 0.1 - */ -public class FishesTabUIModel extends AbstractSerializableBean { - - 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"; - - public static final String PROPERTY_CATCHES = "catches"; - - protected Float totalWeight; - - protected Float totalVracWeight; - - protected Float sampleVracWeight; - - protected Float totalHorsVracWeight; - - protected List<CatchBean> catches; - - public Float getTotalWeight() { - return totalWeight; - } - - public void setTotalWeight(Float totalWeight) { - Object oldValue = getTotalWeight(); - this.totalWeight = totalWeight; - firePropertyChange(PROPERTY_TOTAL_WEIGHT, oldValue, totalWeight); - } - - public Float getTotalVracWeight() { - return totalVracWeight; - } - - public void setTotalVracWeight(Float totalVracWeight) { - Object oldValue = getTotalVracWeight(); - this.totalVracWeight = totalVracWeight; - firePropertyChange(PROPERTY_TOTAL_VRAC_WEIGHT, oldValue, totalVracWeight); - } - - public Float getSampleVracWeight() { - return sampleVracWeight; - } - - public void setSampleVracWeight(Float sampleVracWeight) { - Object oldValue = getSampleVracWeight(); - this.sampleVracWeight = sampleVracWeight; - firePropertyChange(PROPERTY_SAMPLE_VRAC_WEIGHT, oldValue, sampleVracWeight); - } - - 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<CatchBean> getCatches() { - return catches; - } - - public void setCatches(List<CatchBean> catches) { - Object oldValue = getCatches(); - this.catches = catches; - firePropertyChange(PROPERTY_CATCHES, oldValue, catches); - } - - public void fromBean(TraitBean bean) { - BinderFactory.newBinder(TraitBean.class, - FishesTabUIModel.class).copy(bean, this); - } - - public TraitBean toBean() { - TraitBean result = new TraitBean(); - BinderFactory.newBinder(FishesTabUIModel.class, - TraitBean.class).copy(this, result); - return result; - } -} Deleted: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/FishesTableModel.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/FishesTableModel.java 2012-11-28 09:28:45 UTC (rev 24) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/FishesTableModel.java 2012-11-28 18:17:32 UTC (rev 25) @@ -1,78 +0,0 @@ -package fr.ifremer.tutti.ui.swing.content.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 com.google.common.collect.Lists; -import fr.ifremer.tutti.persistence.entities.CatchBean; - -import javax.swing.table.AbstractTableModel; -import javax.swing.table.TableColumnModel; -import java.util.List; - -/** - * @author tchemit <chemit@codelutin.com> - * @since 0.1 - */ -public class FishesTableModel extends AbstractTableModel { - - private static final long serialVersionUID = 1L; - - protected List<CatchBean> data; - - protected final TableColumnModel columnModel; - - public FishesTableModel(TableColumnModel columnModel) { - this.columnModel = columnModel; - } - - public void setData(List<CatchBean> data) { - if (data == null) { - data = Lists.newArrayList(); - data.add(new CatchBean()); - } - this.data = data; - fireTableDataChanged(); - } - - @Override - public int getRowCount() { - return data == null ? 0 : data.size(); - } - - @Override - public int getColumnCount() { - return columnModel.getColumnCount(); - } - - @Override - public Object getValueAt(int rowIndex, int columnIndex) { - return null; - } - - @Override - public boolean isCellEditable(int rowIndex, int columnIndex) { - return true; - } -} Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/MacroDechetTabUI.css =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/MacroDechetTabUI.css (rev 0) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/MacroDechetTabUI.css 2012-11-28 18:17:32 UTC (rev 25) @@ -0,0 +1,59 @@ +/* + * #%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()}; + showPopupButton:{handler.getConfig().isShowNumberEditorButton()}; + bean:{model}; + showReset:true; +} + +#totalWeightLabel { + text:"tutti.label.macroDechet.totalWeight"; + labelFor:{totalWeightField}; +} + +#totalWeightField { + property:"totalWeight"; + model:{model.getTotalWeight()}; + useFloat:false; + numberPattern:{INT_6_DIGITS_PATTERN}; +} + +#sampleTotalWeightLabel { + text:"tutti.label.macroDechet.sampleTotalWeight"; + labelFor:{totalWeightField}; +} + +#sampleTotalWeightField { + property:"sampleTotalWeight"; + model:{model.getSampleTotalWeight()}; + useFloat:false; + numberPattern:{INT_6_DIGITS_PATTERN}; +} + +#table { + model:{getContextValue(TableModel.class)}; + columnModel:{getContextValue(TableColumnModel.class)}; +} Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/MacroDechetTabUI.css ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/MacroDechetTabUI.jaxx =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/MacroDechetTabUI.jaxx (rev 0) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/MacroDechetTabUI.jaxx 2012-11-28 18:17:32 UTC (rev 25) @@ -0,0 +1,100 @@ +<!-- + #%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<MacroDechetTabUIModel, MacroDechetTabUIHandler>'> + + <import> + fr.ifremer.tutti.persistence.entities.referential.BeaufortScaleBean + fr.ifremer.tutti.persistence.entities.referential.SeaStateBean + fr.ifremer.tutti.persistence.entities.StrataBean + fr.ifremer.tutti.persistence.entities.TraitBean + fr.ifremer.tutti.persistence.entities.referential.UserBean + fr.ifremer.tutti.ui.swing.TuttiUIContext + + jaxx.runtime.swing.editor.NumberEditor + + jaxx.runtime.validator.swing.SwingValidatorUtil + jaxx.runtime.validator.swing.SwingValidatorMessageTableModel + + javax.swing.table.TableModel + javax.swing.table.TableColumnModel + + static org.nuiton.i18n.I18n._ + </import> + + <script><![CDATA[ + +public MacroDechetTabUI(CatchesUI parentUI) { + MacroDechetTabUIHandler handler = new MacroDechetTabUIHandler(parentUI, this); + setContextValue(handler); + handler.beforeInitUI(); +} + +public void selectTrait(TraitBean trait) { handler.selectTrait(trait); } + +protected void $afterCompleteSetup() { handler.afterInitUI(); } + ]]></script> + + <MacroDechetTabUIHandler id='handler' + initializer='getContextValue(MacroDechetTabUIHandler.class)'/> + + <MacroDechetTabUIModel id='model' + initializer='getContextValue(MacroDechetTabUIModel.class)'/> + + <SwingValidatorMessageTableModel id='errorTableModel'/> + + <BeanValidator id='validator' bean='model' errorTableModel='errorTableModel' + uiClass='jaxx.runtime.validator.swing.ui.ImageValidationUI'> + <field name='totalWeight' component='totalWeightField'/> + <field name='sampleTotalWeight' component='sampleTotalWeightField'/> + </BeanValidator> + + <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 échantillonné --> + <row> + <cell> + <JLabel id='sampleTotalWeightLabel'/> + </cell> + <cell> + <NumberEditor id='sampleTotalWeightField' constructorParams='this'/> + </cell> + </row> + </Table> + + <JScrollPane id='tableScrollPane' constraints='BorderLayout.CENTER'> + <JTable id='table'/> + </JScrollPane> + +</JPanel> \ No newline at end of file Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/MacroDechetTabUI.jaxx ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/MacroDechetTabUIHandler.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/MacroDechetTabUIHandler.java (rev 0) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/MacroDechetTabUIHandler.java 2012-11-28 18:17:32 UTC (rev 25) @@ -0,0 +1,181 @@ +package fr.ifremer.tutti.ui.swing.content.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.TraitBean; +import fr.ifremer.tutti.persistence.entities.TraitMacroDechetCatchBean; +import fr.ifremer.tutti.persistence.entities.TraitSpeciesCatchBean; +import fr.ifremer.tutti.persistence.entities.referential.SpeciesBean; +import fr.ifremer.tutti.service.PersistenceService; +import fr.ifremer.tutti.ui.swing.AbstractTuttiUIHandler; +import jaxx.runtime.SwingUtil; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import javax.swing.JComboBox; +import javax.swing.JTable; +import javax.swing.table.DefaultTableColumnModel; +import javax.swing.table.TableCellEditor; +import javax.swing.table.TableCellRenderer; +import javax.swing.table.TableColumn; +import javax.swing.table.TableColumnModel; +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; +import java.util.List; + +import static org.nuiton.i18n.I18n._; + +/** + * @author tchemit <chemit@codelutin.com> + * @since 0.2 + */ +public class MacroDechetTabUIHandler extends AbstractTuttiUIHandler<MacroDechetTabUIModel> { + + /** Logger. */ + private static final Log log = LogFactory.getLog(MacroDechetTabUIHandler.class); + + private final MacroDechetTabUI ui; + + private final CatchesUI parentUi; + + private final PersistenceService persistenceService; + + public MacroDechetTabUIHandler(CatchesUI parentUi, MacroDechetTabUI ui) { + super(parentUi.getHandler().getContext()); + this.ui = ui; + this.parentUi = parentUi; + this.persistenceService = context.getService(PersistenceService.class); + } + + @Override + public void beforeInitUI() { + + MacroDechetTabUIModel model = new MacroDechetTabUIModel(); + ui.setContextValue(model); + + JTable tb = new JTable(); + + TableCellEditor defaultEditor = tb.getDefaultEditor(String.class); + TableCellRenderer defaultRenderer = tb.getDefaultRenderer(Object.class); + + // prepare the table column model + TableColumnModel columnModel = new DefaultTableColumnModel(); + + TableColumn col; + + // species (by code) column + + col = new TableColumn(0); + + JComboBox speciesEditor = new JComboBox(); + List<SpeciesBean> allSpecies = persistenceService.getAllSpecies(); + SwingUtil.fillComboBox(speciesEditor, allSpecies, null); +// col.setCellEditor(); + col.setCellRenderer(newTableCellRender(SpeciesBean.class)); + col.setHeaderValue(_("tutti.table.macroDechet.header.speciesByCode")); +// col.setHeaderRenderer(SwingUtil.newStringTableCellRenderer(dRender,50, true)); + col.setIdentifier("speciesByCode"); + columnModel.addColumn(col); + + // Poids observé + col = new TableColumn(1); + col.setCellEditor(defaultEditor); + col.setCellRenderer(defaultRenderer); + col.setHeaderValue(_("tutti.table.macroDechet.header.weight")); +// col.setHeaderRenderer(SwingUtil.newStringTableCellRenderer(dRender,50, true)); + col.setIdentifier("weight"); + columnModel.addColumn(col); + + // Nombre observé + col = new TableColumn(2); + col.setCellEditor(defaultEditor); + col.setCellRenderer(defaultRenderer); + col.setHeaderValue(_("tutti.table.macroDechet.header.number")); +// col.setHeaderRenderer(SwingUtil.newStringTableCellRenderer(dRender,50, true)); + col.setIdentifier("computedNumber"); + columnModel.addColumn(col); + + ui.setContextValue(columnModel); + + final MacroDechetTableModel tableModel = new MacroDechetTableModel(columnModel); + ui.setContextValue(tableModel); + + model.addPropertyChangeListener(MacroDechetTabUIModel.PROPERTY_CATCHES, new PropertyChangeListener() { + @Override + public void propertyChange(PropertyChangeEvent evt) { + tableModel.setData((List<TraitSpeciesCatchBean>) evt.getNewValue()); + } + }); + + } + + @Override + public void afterInitUI() { + MacroDechetTabUIModel model = ui.getModel(); + + initUI(ui); + } + + @Override + public void onCloseUI() { + } + + @Override + protected MacroDechetTabUIModel getModel() { + return ui.getModel(); + } + + public void selectTrait(TraitBean bean) { + + boolean empty = bean == null; + + MacroDechetTabUIModel model = ui.getModel(); + + List<TraitMacroDechetCatchBean> catches; + + if (empty) { + catches = null; + bean = new TraitBean(); + } else { + catches = persistenceService.getAllTraitMacroDechetCatch(bean.getId()); + } + + model.fromBean(bean); + model.setCatches(catches); + } + + public void cancel() { + + if (log.isInfoEnabled()) { + log.info("Cancel edition"); + } + } + + public void save() { + if (log.isInfoEnabled()) { + log.info("Will save"); + } + } +} \ No newline at end of file Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/MacroDechetTabUIHandler.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/MacroDechetTabUIModel.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/MacroDechetTabUIModel.java (rev 0) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/MacroDechetTabUIModel.java 2012-11-28 18:17:32 UTC (rev 25) @@ -0,0 +1,95 @@ +package fr.ifremer.tutti.ui.swing.content.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.TraitBean; +import fr.ifremer.tutti.persistence.entities.TraitMacroDechetCatchBean; +import org.jdesktop.beans.AbstractSerializableBean; +import org.nuiton.util.beans.BinderFactory; + +import java.util.List; + +/** + * @author tchemit <chemit@codelutin.com> + * @since 0.2 + */ +public class MacroDechetTabUIModel extends AbstractSerializableBean { + + private static final long serialVersionUID = 1L; + + public static final String PROPERTY_TOTAL_WEIGHT = "totalWeight"; + + public static final String PROPERTY_SAMPLE_TOTAL_WEIGHT = "sampleTotalWeight"; + + public static final String PROPERTY_CATCHES = "catches"; + + protected Float totalWeight; + + protected Float sampleTotalWeight; + + protected List<TraitMacroDechetCatchBean> catches; + + public Float getTotalWeight() { + return totalWeight; + } + + public void setTotalWeight(Float totalWeight) { + Object oldValue = getTotalWeight(); + this.totalWeight = totalWeight; + firePropertyChange(PROPERTY_TOTAL_WEIGHT, oldValue, totalWeight); + } + + public Float getSampleTotalWeight() { + return sampleTotalWeight; + } + + public void setSampleTotalWeight(Float sampleTotalWeight) { + Object oldValue = getSampleTotalWeight(); + this.sampleTotalWeight = sampleTotalWeight; + firePropertyChange(PROPERTY_SAMPLE_TOTAL_WEIGHT, oldValue, sampleTotalWeight); + } + + public List<TraitMacroDechetCatchBean> getCatches() { + return catches; + } + + public void setCatches(List<TraitMacroDechetCatchBean> catches) { + Object oldValue = getCatches(); + this.catches = catches; + firePropertyChange(PROPERTY_CATCHES, oldValue, catches); + } + + public void fromBean(TraitBean bean) { + BinderFactory.newBinder(TraitBean.class, + MacroDechetTabUIModel.class).copy(bean, this); + } + + public TraitBean toBean() { + TraitBean result = new TraitBean(); + BinderFactory.newBinder(MacroDechetTabUIModel.class, + TraitBean.class).copy(this, result); + return result; + } +} \ No newline at end of file Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/MacroDechetTabUIModel.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/MacroDechetTableModel.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/MacroDechetTableModel.java (rev 0) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/MacroDechetTableModel.java 2012-11-28 18:17:32 UTC (rev 25) @@ -0,0 +1,78 @@ +package fr.ifremer.tutti.ui.swing.content.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 com.google.common.collect.Lists; +import fr.ifremer.tutti.persistence.entities.TraitSpeciesCatchBean; + +import javax.swing.table.AbstractTableModel; +import javax.swing.table.TableColumnModel; +import java.util.List; + +/** + * @author tchemit <chemit@codelutin.com> + * @since 0.2 + */ +public class MacroDechetTableModel extends AbstractTableModel { + + private static final long serialVersionUID = 1L; + + protected List<TraitSpeciesCatchBean> data; + + protected final TableColumnModel columnModel; + + public MacroDechetTableModel(TableColumnModel columnModel) { + this.columnModel = columnModel; + } + + public void setData(List<TraitSpeciesCatchBean> data) { + if (data == null) { + data = Lists.newArrayList(); + data.add(new TraitSpeciesCatchBean()); + } + this.data = data; + fireTableDataChanged(); + } + + @Override + public int getRowCount() { + return data == null ? 0 : data.size(); + } + + @Override + public int getColumnCount() { + return columnModel.getColumnCount(); + } + + @Override + public Object getValueAt(int rowIndex, int columnIndex) { + return null; + } + + @Override + public boolean isCellEditable(int rowIndex, int columnIndex) { + return true; + } +} \ No newline at end of file Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/MacroDechetTableModel.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/PlanctonTabUI.css =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/PlanctonTabUI.css (rev 0) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/PlanctonTabUI.css 2012-11-28 18:17:32 UTC (rev 25) @@ -0,0 +1,59 @@ +/* + * #%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()}; + showPopupButton:{handler.getConfig().isShowNumberEditorButton()}; + bean:{model}; + showReset:true; +} + +#totalWeightLabel { + text:"tutti.label.plancton.totalWeight"; + labelFor:{totalWeightField}; +} + +#totalWeightField { + property:"totalWeight"; + model:{model.getTotalWeight()}; + useFloat:false; + numberPattern:{INT_6_DIGITS_PATTERN}; +} + +#sampleTotalWeightLabel { + text:"tutti.label.plancton.sampleTotalWeight"; + labelFor:{totalWeightField}; +} + +#sampleTotalWeightField { + property:"sampleTotalWeight"; + model:{model.getSampleTotalWeight()}; + useFloat:false; + numberPattern:{INT_6_DIGITS_PATTERN}; +} + +#table { + model:{getContextValue(TableModel.class)}; + columnModel:{getContextValue(TableColumnModel.class)}; +} Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/PlanctonTabUI.css ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/PlanctonTabUI.jaxx =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/PlanctonTabUI.jaxx (rev 0) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/PlanctonTabUI.jaxx 2012-11-28 18:17:32 UTC (rev 25) @@ -0,0 +1,100 @@ +<!-- + #%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<PlanctonTabUIModel, PlanctonTabUIHandler>'> + + <import> + fr.ifremer.tutti.persistence.entities.referential.BeaufortScaleBean + fr.ifremer.tutti.persistence.entities.referential.SeaStateBean + fr.ifremer.tutti.persistence.entities.StrataBean + fr.ifremer.tutti.persistence.entities.TraitBean + fr.ifremer.tutti.persistence.entities.referential.UserBean + fr.ifremer.tutti.ui.swing.TuttiUIContext + + jaxx.runtime.swing.editor.NumberEditor + + jaxx.runtime.validator.swing.SwingValidatorUtil + jaxx.runtime.validator.swing.SwingValidatorMessageTableModel + + javax.swing.table.TableModel + javax.swing.table.TableColumnModel + + static org.nuiton.i18n.I18n._ + </import> + + <script><![CDATA[ + +public PlanctonTabUI(CatchesUI parentUI) { + PlanctonTabUIHandler handler = new PlanctonTabUIHandler(parentUI, this); + setContextValue(handler); + handler.beforeInitUI(); +} + +public void selectTrait(TraitBean trait) { handler.selectTrait(trait); } + +protected void $afterCompleteSetup() { handler.afterInitUI(); } + ]]></script> + + <PlanctonTabUIHandler id='handler' + initializer='getContextValue(PlanctonTabUIHandler.class)'/> + + <PlanctonTabUIModel id='model' + initializer='getContextValue(PlanctonTabUIModel.class)'/> + + <SwingValidatorMessageTableModel id='errorTableModel'/> + + <BeanValidator id='validator' bean='model' errorTableModel='errorTableModel' + uiClass='jaxx.runtime.validator.swing.ui.ImageValidationUI'> + <field name='totalWeight' component='totalWeightField'/> + <field name='sampleTotalWeight' component='sampleTotalWeightField'/> + </BeanValidator> + + <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 échantillonné --> + <row> + <cell> + <JLabel id='sampleTotalWeightLabel'/> + </cell> + <cell> + <NumberEditor id='sampleTotalWeightField' constructorParams='this'/> + </cell> + </row> + </Table> + + <JScrollPane id='tableScrollPane' constraints='BorderLayout.CENTER'> + <JTable id='table'/> + </JScrollPane> + +</JPanel> \ No newline at end of file Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/PlanctonTabUI.jaxx ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/PlanctonTabUIHandler.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/PlanctonTabUIHandler.java (rev 0) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/PlanctonTabUIHandler.java 2012-11-28 18:17:32 UTC (rev 25) @@ -0,0 +1,181 @@ +package fr.ifremer.tutti.ui.swing.content.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.TraitBean; +import fr.ifremer.tutti.persistence.entities.TraitPlanctonCatchBean; +import fr.ifremer.tutti.persistence.entities.TraitSpeciesCatchBean; +import fr.ifremer.tutti.persistence.entities.referential.SpeciesBean; +import fr.ifremer.tutti.service.PersistenceService; +import fr.ifremer.tutti.ui.swing.AbstractTuttiUIHandler; +import jaxx.runtime.SwingUtil; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import javax.swing.JComboBox; +import javax.swing.JTable; +import javax.swing.table.DefaultTableColumnModel; +import javax.swing.table.TableCellEditor; +import javax.swing.table.TableCellRenderer; +import javax.swing.table.TableColumn; +import javax.swing.table.TableColumnModel; +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; +import java.util.List; + +import static org.nuiton.i18n.I18n._; + +/** + * @author tchemit <chemit@codelutin.com> + * @since 0.2 + */ +public class PlanctonTabUIHandler extends AbstractTuttiUIHandler<PlanctonTabUIModel> { + + /** Logger. */ + private static final Log log = LogFactory.getLog(PlanctonTabUIHandler.class); + + private final PlanctonTabUI ui; + + private final CatchesUI parentUi; + + private final PersistenceService persistenceService; + + public PlanctonTabUIHandler(CatchesUI parentUi, PlanctonTabUI ui) { + super(parentUi.getHandler().getContext()); + this.ui = ui; + this.parentUi = parentUi; + this.persistenceService = context.getService(PersistenceService.class); + } + + @Override + public void beforeInitUI() { + + PlanctonTabUIModel model = new PlanctonTabUIModel(); + ui.setContextValue(model); + + JTable tb = new JTable(); + + TableCellEditor defaultEditor = tb.getDefaultEditor(String.class); + TableCellRenderer defaultRenderer = tb.getDefaultRenderer(Object.class); + + // prepare the table column model + TableColumnModel columnModel = new DefaultTableColumnModel(); + + TableColumn col; + + // species (by code) column + + col = new TableColumn(0); + + JComboBox speciesEditor = new JComboBox(); + List<SpeciesBean> allSpecies = persistenceService.getAllSpecies(); + SwingUtil.fillComboBox(speciesEditor, allSpecies, null); +// col.setCellEditor(); + col.setCellRenderer(newTableCellRender(SpeciesBean.class)); + col.setHeaderValue(_("tutti.table.plancton.header.speciesByCode")); +// col.setHeaderRenderer(SwingUtil.newStringTableCellRenderer(dRender,50, true)); + col.setIdentifier("speciesByCode"); + columnModel.addColumn(col); + + // Poids observé + col = new TableColumn(1); + col.setCellEditor(defaultEditor); + col.setCellRenderer(defaultRenderer); + col.setHeaderValue(_("tutti.table.plancton.header.weight")); +// col.setHeaderRenderer(SwingUtil.newStringTableCellRenderer(dRender,50, true)); + col.setIdentifier("weight"); + columnModel.addColumn(col); + + // Nombre observé + col = new TableColumn(2); + col.setCellEditor(defaultEditor); + col.setCellRenderer(defaultRenderer); + col.setHeaderValue(_("tutti.table.plancton.header.number")); +// col.setHeaderRenderer(SwingUtil.newStringTableCellRenderer(dRender,50, true)); + col.setIdentifier("computedNumber"); + columnModel.addColumn(col); + + ui.setContextValue(columnModel); + + final PlanctonTableModel tableModel = new PlanctonTableModel(columnModel); + ui.setContextValue(tableModel); + + model.addPropertyChangeListener(PlanctonTabUIModel.PROPERTY_CATCHES, new PropertyChangeListener() { + @Override + public void propertyChange(PropertyChangeEvent evt) { + tableModel.setData((List<TraitSpeciesCatchBean>) evt.getNewValue()); + } + }); + + } + + @Override + public void afterInitUI() { + PlanctonTabUIModel model = ui.getModel(); + + initUI(ui); + } + + @Override + public void onCloseUI() { + } + + @Override + protected PlanctonTabUIModel getModel() { + return ui.getModel(); + } + + public void selectTrait(TraitBean bean) { + + boolean empty = bean == null; + + PlanctonTabUIModel model = ui.getModel(); + + List<TraitPlanctonCatchBean> catches; + + if (empty) { + catches = null; + bean = new TraitBean(); + } else { + catches = persistenceService.getAllTraitPlanctonCatch(bean.getId()); + } + + model.fromBean(bean); + model.setCatches(catches); + } + + public void cancel() { + + if (log.isInfoEnabled()) { + log.info("Cancel edition"); + } + } + + public void save() { + if (log.isInfoEnabled()) { + log.info("Will save"); + } + } +} \ No newline at end of file Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/PlanctonTabUIHandler.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/PlanctonTabUIModel.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/PlanctonTabUIModel.java (rev 0) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/PlanctonTabUIModel.java 2012-11-28 18:17:32 UTC (rev 25) @@ -0,0 +1,95 @@ +package fr.ifremer.tutti.ui.swing.content.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.TraitBean; +import fr.ifremer.tutti.persistence.entities.TraitPlanctonCatchBean; +import org.jdesktop.beans.AbstractSerializableBean; +import org.nuiton.util.beans.BinderFactory; + +import java.util.List; + +/** + * @author tchemit <chemit@codelutin.com> + * @since 0.2 + */ +public class PlanctonTabUIModel extends AbstractSerializableBean { + + private static final long serialVersionUID = 1L; + + public static final String PROPERTY_TOTAL_WEIGHT = "totalWeight"; + + public static final String PROPERTY_SAMPLE_TOTAL_WEIGHT = "sampleTotalWeight"; + + public static final String PROPERTY_CATCHES = "catches"; + + protected Float totalWeight; + + protected Float sampleTotalWeight; + + protected List<TraitPlanctonCatchBean> catches; + + public Float getTotalWeight() { + return totalWeight; + } + + public void setTotalWeight(Float totalWeight) { + Object oldValue = getTotalWeight(); + this.totalWeight = totalWeight; + firePropertyChange(PROPERTY_TOTAL_WEIGHT, oldValue, totalWeight); + } + + public Float getSampleTotalWeight() { + return sampleTotalWeight; + } + + public void setSampleTotalWeight(Float sampleTotalWeight) { + Object oldValue = getSampleTotalWeight(); + this.sampleTotalWeight = sampleTotalWeight; + firePropertyChange(PROPERTY_SAMPLE_TOTAL_WEIGHT, oldValue, sampleTotalWeight); + } + + public List<TraitPlanctonCatchBean> getCatches() { + return catches; + } + + public void setCatches(List<TraitPlanctonCatchBean> catches) { + Object oldValue = getCatches(); + this.catches = catches; + firePropertyChange(PROPERTY_CATCHES, oldValue, catches); + } + + public void fromBean(TraitBean bean) { + BinderFactory.newBinder(TraitBean.class, + PlanctonTabUIModel.class).copy(bean, this); + } + + public TraitBean toBean() { + TraitBean result = new TraitBean(); + BinderFactory.newBinder(PlanctonTabUIModel.class, + TraitBean.class).copy(this, result); + return result; + } +} \ No newline at end of file Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/PlanctonTabUIModel.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/PlanctonTableModel.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/PlanctonTableModel.java (rev 0) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/PlanctonTableModel.java 2012-11-28 18:17:32 UTC (rev 25) @@ -0,0 +1,78 @@ +package fr.ifremer.tutti.ui.swing.content.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 com.google.common.collect.Lists; +import fr.ifremer.tutti.persistence.entities.TraitSpeciesCatchBean; + +import javax.swing.table.AbstractTableModel; +import javax.swing.table.TableColumnModel; +import java.util.List; + +/** + * @author tchemit <chemit@codelutin.com> + * @since 0.2 + */ +public class PlanctonTableModel extends AbstractTableModel { + + private static final long serialVersionUID = 1L; + + protected List<TraitSpeciesCatchBean> data; + + protected final TableColumnModel columnModel; + + public PlanctonTableModel(TableColumnModel columnModel) { + this.columnModel = columnModel; + } + + public void setData(List<TraitSpeciesCatchBean> data) { + if (data == null) { + data = Lists.newArrayList(); + data.add(new TraitSpeciesCatchBean()); + } + this.data = data; + fireTableDataChanged(); + } + + @Override + public int getRowCount() { + return data == null ? 0 : data.size(); + } + + @Override + public int getColumnCount() { + return columnModel.getColumnCount(); + } + + @Override + public Object getValueAt(int rowIndex, int columnIndex) { + return null; + } + + @Override + public boolean isCellEditable(int rowIndex, int columnIndex) { + return true; + } +} \ No newline at end of file Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/PlanctonTableModel.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/SpeciesTabUI.css (from rev 23, trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/FishesTabUI.css) =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/SpeciesTabUI.css (rev 0) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/SpeciesTabUI.css 2012-11-28 18:17:32 UTC (rev 25) @@ -0,0 +1,83 @@ +/* + * #%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()}; + showPopupButton:{handler.getConfig().isShowNumberEditorButton()}; + bean:{model}; + showReset:true; +} + +#totalWeightLabel { + text:"tutti.label.fishes.totalWeight"; + labelFor:{totalWeightField}; +} + +#totalWeightField { + property:"totalWeight"; + model:{model.getTotalWeight()}; + useFloat:false; + numberPattern:{INT_6_DIGITS_PATTERN}; +} + +#totalVracWeightLabel { + text:"tutti.label.fishes.totalVracWeight"; + labelFor:{totalVracWeightField}; +} + +#totalVracWeightField { + property:"totalVracWeight"; + model:{model.getTotalVracWeight()}; + useFloat:false; + numberPattern:{INT_6_DIGITS_PATTERN}; +} + +#sampleVracWeightLabel { + text:"tutti.label.fishes.sampleVracWeight"; + labelFor:{sampleVracWeightField}; +} + +#sampleVracWeightField { + property:"sampleVracWeight"; + model:{model.getSampleVracWeight()}; + useFloat:false; + numberPattern:{INT_6_DIGITS_PATTERN}; +} + +#totalHorsVracWeightLabel { + text:"tutti.label.fishes.totalHorsVracWeight"; + labelFor:{totalHorsVracWeightField}; +} + +#totalHorsVracWeightField { + property:"totalHorsVracWeight"; + model:{model.getTotalHorsVracWeight()}; + useFloat:false; + numberPattern:{INT_6_DIGITS_PATTERN}; +} + +#table { + model:{getContextValue(TableModel.class)}; + columnModel:{getContextValue(TableColumnModel.class)}; +} Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/SpeciesTabUI.css ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/SpeciesTabUI.jaxx (from rev 23, trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/FishesTabUI.jaxx) =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/SpeciesTabUI.jaxx (rev 0) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/SpeciesTabUI.jaxx 2012-11-28 18:17:32 UTC (rev 25) @@ -0,0 +1,114 @@ +<!-- + #%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<SpeciesTabUIModel, SpeciesTabUIHandler>'> + + <import> + fr.ifremer.tutti.persistence.entities.referential.BeaufortScaleBean + fr.ifremer.tutti.persistence.entities.referential.SeaStateBean + fr.ifremer.tutti.persistence.entities.StrataBean + fr.ifremer.tutti.persistence.entities.TraitBean + fr.ifremer.tutti.persistence.entities.referential.UserBean + fr.ifremer.tutti.ui.swing.TuttiUIContext + + jaxx.runtime.swing.editor.NumberEditor + + jaxx.runtime.validator.swing.SwingValidatorUtil + jaxx.runtime.validator.swing.SwingValidatorMessageTableModel + + javax.swing.table.TableModel + javax.swing.table.TableColumnModel + + static org.nuiton.i18n.I18n._ + </import> + + <script><![CDATA[ + +public SpeciesTabUI(CatchesUI parentUI) { + SpeciesTabUIHandler handler = new SpeciesTabUIHandler(parentUI, this); + setContextValue(handler); + handler.beforeInitUI(); +} + +public void selectTrait(TraitBean trait) { handler.selectTrait(trait); } + +protected void $afterCompleteSetup() { handler.afterInitUI(); } + ]]></script> + + <SpeciesTabUIHandler id='handler' + initializer='getContextValue(SpeciesTabUIHandler.class)'/> + + <SpeciesTabUIModel id='model' + initializer='getContextValue(SpeciesTabUIModel.class)'/> + + <SwingValidatorMessageTableModel id='errorTableModel'/> + + <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'/> + </BeanValidator> + + <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 é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> + <NumberEditor id='totalHorsVracWeightField' constructorParams='this'/> + </cell> + </row> + </Table> + + <JScrollPane id='tableScrollPane' constraints='BorderLayout.CENTER'> + <JTable id='table'/> + </JScrollPane> + +</JPanel> Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/SpeciesTabUI.jaxx ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/SpeciesTabUIHandler.java (from rev 23, trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/FishesTabUIHandler.java) =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/SpeciesTabUIHandler.java (rev 0) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/SpeciesTabUIHandler.java 2012-11-28 18:17:32 UTC (rev 25) @@ -0,0 +1,290 @@ +package fr.ifremer.tutti.ui.swing.content.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.TraitBean; +import fr.ifremer.tutti.persistence.entities.TraitSpeciesCatchBean; +import fr.ifremer.tutti.persistence.entities.VracHorsVracEnum; +import fr.ifremer.tutti.persistence.entities.referential.SexBean; +import fr.ifremer.tutti.persistence.entities.referential.SpeciesBean; +import fr.ifremer.tutti.persistence.entities.referential.WeightCategoryBean; +import fr.ifremer.tutti.service.DecoratorService; +import fr.ifremer.tutti.service.PersistenceService; +import fr.ifremer.tutti.ui.swing.AbstractTuttiUIHandler; +import jaxx.runtime.SwingUtil; +import jaxx.runtime.swing.editor.EnumEditor; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.jdesktop.swingx.autocomplete.ComboBoxCellEditor; + +import javax.swing.JComboBox; +import javax.swing.JTable; +import javax.swing.table.DefaultTableColumnModel; +import javax.swing.table.TableCellEditor; +import javax.swing.table.TableCellRenderer; +import javax.swing.table.TableColumn; +import javax.swing.table.TableColumnModel; +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; +import java.util.List; + +import static org.nuiton.i18n.I18n._; + +/** + * @author tchemit <chemit@codelutin.com> + * @since 0.1 + */ +public class SpeciesTabUIHandler extends AbstractTuttiUIHandler<SpeciesTabUIModel> { + + /** Logger. */ + private static final Log log = LogFactory.getLog(SpeciesTabUIHandler.class); + + private final SpeciesTabUI ui; + + private final CatchesUI parentUi; + + private final PersistenceService persistenceService; + + public SpeciesTabUIHandler(CatchesUI parentUi, SpeciesTabUI ui) { + super(parentUi.getHandler().getContext()); + this.ui = ui; + this.parentUi = parentUi; + this.persistenceService = context.getService(PersistenceService.class); + } + + @Override + public void beforeInitUI() { + + SpeciesTabUIModel model = new SpeciesTabUIModel(); + ui.setContextValue(model); + + JTable tb = new JTable(); + + TableCellEditor defaultEditor = tb.getDefaultEditor(String.class); + TableCellRenderer defaultRenderer = tb.getDefaultRenderer(Object.class); + + // prepare the table column model + TableColumnModel columnModel = new DefaultTableColumnModel(); + + TableColumn col; + + // Espèce à confirmer + col = new TableColumn(0); + col.setCellEditor(SwingUtil.newBooleanTableCellEditor(defaultRenderer)); + col.setCellRenderer(SwingUtil.newBooleanTableCellRenderer(defaultRenderer)); + col.setHeaderValue(_("tutti.table.species.header.toConfirm")); + col.setIdentifier(SpeciesTableModel.ColumnIdentifier.speciesToConfirm); + columnModel.addColumn(col); + + // species (by code) column + col = new TableColumn(1); + + List<SpeciesBean> allSpecies = persistenceService.getAllSpecies(); + JComboBox speciesEditor = new JComboBox(); + speciesEditor.setRenderer(newListCellRender(SpeciesBean.class, DecoratorService.SPECIES_BY_CODE)); + SwingUtil.fillComboBox(speciesEditor, allSpecies, null); + col.setCellEditor(new ComboBoxCellEditor(speciesEditor)); + col.setCellRenderer(newTableCellRender(SpeciesBean.class, DecoratorService.SPECIES_BY_CODE)); + col.setHeaderValue(_("tutti.table.species.header.speciesByCode")); + col.setIdentifier(SpeciesTableModel.ColumnIdentifier.speciesByCode); + columnModel.addColumn(col); + + // species (by genusCode) column + col = new TableColumn(2); + + JComboBox speciesEditor2 = new JComboBox(); + speciesEditor2.setRenderer(newListCellRender(SpeciesBean.class, DecoratorService.SPECIES_BY_GENUS)); + SwingUtil.fillComboBox(speciesEditor2, allSpecies, null); + col.setCellEditor(new ComboBoxCellEditor(speciesEditor2)); + col.setCellRenderer(newTableCellRender(SpeciesBean.class, DecoratorService.SPECIES_BY_GENUS)); + col.setHeaderValue(_("tutti.table.species.header.speciesByGenusCode")); + col.setIdentifier(SpeciesTableModel.ColumnIdentifier.speciesByGenusCode); + columnModel.addColumn(col); + + // Vrac / Hors vrac + col = new TableColumn(3); + + EnumEditor<VracHorsVracEnum> vracEditor = EnumEditor.newEditor(VracHorsVracEnum.values()); + + col.setCellEditor(new ComboBoxCellEditor(vracEditor)); +// col.setCellRenderer(SwingUtil.newEnumTableCellRenderer(defaultRenderer, VracHorsVracEnum.class)); + col.setCellRenderer(defaultRenderer); + col.setHeaderValue(_("tutti.table.species.header.vracHorsVrac")); +// col.setHeaderRenderer(SwingUtil.newStringTableCellRenderer(dRender,50, true)); + col.setIdentifier(SpeciesTableModel.ColumnIdentifier.vracHorsVrac); + columnModel.addColumn(col); + + // Catégorie de poids + col = new TableColumn(4); + + JComboBox weightCategoryCombo = new JComboBox(); + weightCategoryCombo.setRenderer(newListCellRender(WeightCategoryBean.class, DecoratorService.BY_NAME)); + SwingUtil.fillComboBox(weightCategoryCombo, persistenceService.getAllWeightCategories(), null); + col.setCellEditor(new ComboBoxCellEditor(weightCategoryCombo)); + col.setCellRenderer(newTableCellRender(WeightCategoryBean.class, DecoratorService.BY_NAME)); + col.setHeaderValue(_("tutti.table.species.header.weightCategory")); +// col.setHeaderRenderer(SwingUtil.newStringTableCellRenderer(dRender,50, true)); + col.setIdentifier(SpeciesTableModel.ColumnIdentifier.weightCategory); + columnModel.addColumn(col); + + // Sex + col = new TableColumn(5); + + JComboBox sexCombo = new JComboBox(); + sexCombo.setRenderer(newListCellRender(SexBean.class, DecoratorService.BY_NAME)); + SwingUtil.fillComboBox(sexCombo, persistenceService.getAllSex(), null); + col.setCellEditor(new ComboBoxCellEditor(sexCombo)); + col.setCellRenderer(newTableCellRender(SexBean.class, DecoratorService.BY_NAME)); + + col.setHeaderValue(_("tutti.table.species.header.sex")); +// col.setHeaderRenderer(SwingUtil.newStringTableCellRenderer(dRender,50, true)); + col.setIdentifier(SpeciesTableModel.ColumnIdentifier.sex); + columnModel.addColumn(col); + + // Maturity + col = new TableColumn(6); + col.setCellEditor(defaultEditor); + col.setCellRenderer(defaultRenderer); + col.setHeaderValue(_("tutti.table.species.header.maturity")); +// col.setHeaderRenderer(SwingUtil.newStringTableCellRenderer(dRender,50, true)); + col.setIdentifier(SpeciesTableModel.ColumnIdentifier.maturity); + columnModel.addColumn(col); + + // Age + col = new TableColumn(7); + col.setCellEditor(defaultEditor); + col.setCellRenderer(defaultRenderer); + col.setHeaderValue(_("tutti.table.species.header.age")); +// col.setHeaderRenderer(SwingUtil.newStringTableCellRenderer(dRender,50, true)); + col.setIdentifier(SpeciesTableModel.ColumnIdentifier.age); + columnModel.addColumn(col); + + // Poids observé + col = new TableColumn(8); + col.setCellEditor(defaultEditor); + col.setCellRenderer(defaultRenderer); + col.setHeaderValue(_("tutti.table.species.header.weight")); +// col.setHeaderRenderer(SwingUtil.newStringTableCellRenderer(dRender,50, true)); + col.setIdentifier(SpeciesTableModel.ColumnIdentifier.weight); + columnModel.addColumn(col); + + // Poids calculé + col = new TableColumn(9); + col.setCellEditor(defaultEditor); + col.setCellRenderer(defaultRenderer); + col.setHeaderValue(_("tutti.table.species.header.computedWeight")); +// col.setHeaderRenderer(SwingUtil.newStringTableCellRenderer(dRender,50, true)); + col.setIdentifier(SpeciesTableModel.ColumnIdentifier.computedWeight); + columnModel.addColumn(col); + + // Nombre calculé + col = new TableColumn(10); + col.setCellEditor(defaultEditor); + col.setCellRenderer(defaultRenderer); + col.setHeaderValue(_("tutti.table.species.header.computedNumber")); +// col.setHeaderRenderer(SwingUtil.newStringTableCellRenderer(dRender,50, true)); + col.setIdentifier(SpeciesTableModel.ColumnIdentifier.computedNumber); + columnModel.addColumn(col); + + // Poids d'échantillon + col = new TableColumn(11); + col.setCellEditor(defaultEditor); + col.setCellRenderer(defaultRenderer); + col.setHeaderValue(_("tutti.table.species.header.sampleWeight")); +// col.setHeaderRenderer(SwingUtil.newStringTableCellRenderer(dRender,50, true)); + col.setIdentifier(SpeciesTableModel.ColumnIdentifier.sampleWeight); + columnModel.addColumn(col); + + // Fraction d'élévation + col = new TableColumn(12); + col.setCellEditor(defaultEditor); + col.setCellRenderer(defaultRenderer); + col.setHeaderValue(_("tutti.table.species.header.elevationRate")); +// col.setHeaderRenderer(SwingUtil.newStringTableCellRenderer(dRender,50, true)); + col.setIdentifier(SpeciesTableModel.ColumnIdentifier.elevationRatio); + columnModel.addColumn(col); + + ui.setContextValue(columnModel); + + final SpeciesTableModel tableModel = new SpeciesTableModel(columnModel); + ui.setContextValue(tableModel); + + model.addPropertyChangeListener(SpeciesTabUIModel.PROPERTY_CATCHES, new PropertyChangeListener() { + @Override + public void propertyChange(PropertyChangeEvent evt) { + tableModel.setData((List<TraitSpeciesCatchBean>) evt.getNewValue()); + } + }); + } + + @Override + public void afterInitUI() { + SpeciesTabUIModel model = ui.getModel(); + + initUI(ui); + } + + @Override + public void onCloseUI() { + } + + @Override + protected SpeciesTabUIModel getModel() { + return ui.getModel(); + } + + public void selectTrait(TraitBean bean) { + + boolean empty = bean == null; + + SpeciesTabUIModel model = ui.getModel(); + + List<TraitSpeciesCatchBean> catches; + + if (empty) { + catches = null; + bean = new TraitBean(); + } else { + catches = persistenceService.getAllTraitSpeciesCatch(bean.getId()); + } + + model.fromBean(bean); + model.setCatches(catches); + + } + + public void cancel() { + + if (log.isInfoEnabled()) { + log.info("Cancel edition"); + } + } + + public void save() { + if (log.isInfoEnabled()) { + log.info("Will save"); + } + } +} Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/SpeciesTabUIHandler.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/SpeciesTabUIModel.java (from rev 23, trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/FishesTabUIModel.java) =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/SpeciesTabUIModel.java (rev 0) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/SpeciesTabUIModel.java 2012-11-28 18:17:32 UTC (rev 25) @@ -0,0 +1,123 @@ +package fr.ifremer.tutti.ui.swing.content.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.TraitBean; +import fr.ifremer.tutti.persistence.entities.TraitSpeciesCatchBean; +import org.jdesktop.beans.AbstractSerializableBean; +import org.nuiton.util.beans.BinderFactory; + +import java.util.List; + +/** + * @author tchemit <chemit@codelutin.com> + * @since 0.1 + */ +public class SpeciesTabUIModel extends AbstractSerializableBean { + + 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"; + + public static final String PROPERTY_CATCHES = "catches"; + + protected Float totalWeight; + + protected Float totalVracWeight; + + protected Float sampleVracWeight; + + protected Float totalHorsVracWeight; + + protected List<TraitSpeciesCatchBean> catches; + + public Float getTotalWeight() { + return totalWeight; + } + + public void setTotalWeight(Float totalWeight) { + Object oldValue = getTotalWeight(); + this.totalWeight = totalWeight; + firePropertyChange(PROPERTY_TOTAL_WEIGHT, oldValue, totalWeight); + } + + public Float getTotalVracWeight() { + return totalVracWeight; + } + + public void setTotalVracWeight(Float totalVracWeight) { + Object oldValue = getTotalVracWeight(); + this.totalVracWeight = totalVracWeight; + firePropertyChange(PROPERTY_TOTAL_VRAC_WEIGHT, oldValue, totalVracWeight); + } + + public Float getSampleVracWeight() { + return sampleVracWeight; + } + + public void setSampleVracWeight(Float sampleVracWeight) { + Object oldValue = getSampleVracWeight(); + this.sampleVracWeight = sampleVracWeight; + firePropertyChange(PROPERTY_SAMPLE_VRAC_WEIGHT, oldValue, sampleVracWeight); + } + + 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<TraitSpeciesCatchBean> getCatches() { + return catches; + } + + public void setCatches(List<TraitSpeciesCatchBean> catches) { + Object oldValue = getCatches(); + this.catches = catches; + firePropertyChange(PROPERTY_CATCHES, oldValue, catches); + } + + public void fromBean(TraitBean bean) { + BinderFactory.newBinder(TraitBean.class, + SpeciesTabUIModel.class).copy(bean, this); + } + + public TraitBean toBean() { + TraitBean result = new TraitBean(); + BinderFactory.newBinder(SpeciesTabUIModel.class, + TraitBean.class).copy(this, result); + return result; + } +} Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/SpeciesTabUIModel.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/SpeciesTableModel.java (from rev 23, trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/FishesTableModel.java) =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/SpeciesTableModel.java (rev 0) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/SpeciesTableModel.java 2012-11-28 18:17:32 UTC (rev 25) @@ -0,0 +1,180 @@ +package fr.ifremer.tutti.ui.swing.content.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 com.google.common.collect.Lists; +import fr.ifremer.tutti.persistence.entities.TraitSpeciesCatchBean; +import fr.ifremer.tutti.ui.swing.TuttiUIUtil; +import jaxx.runtime.SwingUtil; + +import javax.swing.table.AbstractTableModel; +import javax.swing.table.TableColumn; +import javax.swing.table.TableColumnModel; +import java.util.List; + +/** + * @author tchemit <chemit@codelutin.com> + * @since 0.1 + */ +public class SpeciesTableModel extends AbstractTableModel { + + public static enum ColumnIdentifier { + speciesToConfirm, + speciesByCode("species"), + speciesByGenusCode("species"), + vracHorsVrac, + weightCategory, + sex, + maturity, + age, + weight, + computedWeight(null), + computedNumber(null), + sampleWeight, + elevationRatio; + + final String propertyName; + + ColumnIdentifier() { + this(""); + } + + ColumnIdentifier(String propertyName) { + this.propertyName = "".equals(propertyName) ? name() : propertyName; + } + + public void setValue(TraitSpeciesCatchBean entry, Object value) { + if (propertyName != null) + TuttiUIUtil.setProperty(entry, propertyName, value); + } + + public Object getValue(TraitSpeciesCatchBean entry) { + Object result = null; + if (propertyName != null) { + result = TuttiUIUtil.getProperty(entry, propertyName); + } + return result; + } + } + + private static final long serialVersionUID = 1L; + + protected List<TraitSpeciesCatchBean> data; + + protected final List<ColumnIdentifier> columnIdentifiers; + + protected final TableColumn[] columns; + + protected final TraitSpeciesCatchBean newRow = new TraitSpeciesCatchBean(); + + public SpeciesTableModel(TableColumnModel columnModel) { + + int nbcols = columnModel.getColumnCount(); + columns = new TableColumn[nbcols]; + columnIdentifiers = Lists.newArrayList(); + for (int i = 0; i < nbcols; i++) { + TableColumn column = columnModel.getColumn(i); + columns[i] = column; + columnIdentifiers.add((ColumnIdentifier) column.getIdentifier()); + } + } + + public void setData(List<TraitSpeciesCatchBean> data) { + if (data == null) { + data = Lists.newArrayList(); + data.add(new TraitSpeciesCatchBean()); + } + this.data = data; + fireTableDataChanged(); + } + + @Override + public int getRowCount() { + return (data == null ? 0 : data.size()) + 1; + } + + @Override + public int getColumnCount() { + return columns.length; + } + + @Override + public Object getValueAt(int rowIndex, int columnIndex) { + TraitSpeciesCatchBean entry = getEntry(rowIndex); + ColumnIdentifier propertyName = getPropertyName(columnIndex); + Object result = propertyName.getValue(entry); + return result; + } + + @Override + public void setValueAt(Object aValue, int rowIndex, int columnIndex) { + TraitSpeciesCatchBean entry = getEntry(rowIndex); + ColumnIdentifier propertyName = getPropertyName(columnIndex); + propertyName.setValue(entry, aValue); + + if (propertyName == ColumnIdentifier.speciesByCode) { + + // update also speciesByGenusCode column + int otherColumnIndex = getColumnIndex(ColumnIdentifier.speciesByGenusCode); + fireTableCellUpdated(rowIndex, otherColumnIndex); + } else if (propertyName == ColumnIdentifier.speciesByGenusCode) { + + // update also speciesByCode column + int otherColumnIndex = getColumnIndex(ColumnIdentifier.speciesByCode); + fireTableCellUpdated(rowIndex, otherColumnIndex); + } + } + + @Override + public boolean isCellEditable(int rowIndex, int columnIndex) { + return true; + } + + protected TraitSpeciesCatchBean getEntry(int rowIndex) { + SwingUtil.ensureRowIndex(this, rowIndex); + TraitSpeciesCatchBean result; + if (data == null || rowIndex >= data.size()) { + result = newRow; + } else { + result = data.get(rowIndex); + } + return result; + } + + protected TableColumn getColumn(int columnIndex) { + SwingUtil.ensureColumnIndex(this, columnIndex); + return columns[columnIndex]; + } + + protected ColumnIdentifier getPropertyName(int columnIndex) { + TableColumn column = getColumn(columnIndex); + return (ColumnIdentifier) column.getIdentifier(); + } + + protected int getColumnIndex(ColumnIdentifier property) { + int result = columnIdentifiers.indexOf(property); + return result; + } +} Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/SpeciesTableModel.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/catches/TraitTabUI.jaxx =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/TraitTabUI.jaxx 2012-11-28 09:28:45 UTC (rev 24) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/TraitTabUI.jaxx 2012-11-28 18:17:32 UTC (rev 25) @@ -25,11 +25,11 @@ implements='fr.ifremer.tutti.ui.swing.TuttiUI<TraitTabUIModel, TraitTabUIHandler>'> <import> - fr.ifremer.tutti.persistence.entities.BeaufortScaleBean - fr.ifremer.tutti.persistence.entities.SeaStateBean + fr.ifremer.tutti.persistence.entities.referential.BeaufortScaleBean + fr.ifremer.tutti.persistence.entities.referential.SeaStateBean fr.ifremer.tutti.persistence.entities.StrataBean fr.ifremer.tutti.persistence.entities.TraitBean - fr.ifremer.tutti.persistence.entities.UserBean + fr.ifremer.tutti.persistence.entities.referential.UserBean fr.ifremer.tutti.ui.swing.TuttiUIContext jaxx.runtime.swing.editor.bean.BeanComboBox Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/TraitTabUIHandler.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/TraitTabUIHandler.java 2012-11-28 09:28:45 UTC (rev 24) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/TraitTabUIHandler.java 2012-11-28 18:17:32 UTC (rev 25) @@ -25,7 +25,7 @@ */ import fr.ifremer.tutti.persistence.entities.TraitBean; -import fr.ifremer.tutti.persistence.entities.UserBean; +import fr.ifremer.tutti.persistence.entities.referential.UserBean; import fr.ifremer.tutti.service.PersistenceService; import fr.ifremer.tutti.ui.swing.AbstractTuttiUIHandler; import org.apache.commons.collections.CollectionUtils; Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/TraitTabUIModel.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/TraitTabUIModel.java 2012-11-28 09:28:45 UTC (rev 24) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/TraitTabUIModel.java 2012-11-28 18:17:32 UTC (rev 25) @@ -24,12 +24,12 @@ * #L% */ -import fr.ifremer.tutti.persistence.entities.BeaufortScaleBean; import fr.ifremer.tutti.persistence.entities.CampaignBean; -import fr.ifremer.tutti.persistence.entities.SeaStateBean; import fr.ifremer.tutti.persistence.entities.StrataBean; import fr.ifremer.tutti.persistence.entities.TraitBean; -import fr.ifremer.tutti.persistence.entities.UserBean; +import fr.ifremer.tutti.persistence.entities.referential.BeaufortScaleBean; +import fr.ifremer.tutti.persistence.entities.referential.SeaStateBean; +import fr.ifremer.tutti.persistence.entities.referential.UserBean; import fr.ifremer.tutti.ui.swing.AbstractTuttiBeanUIModel; import org.nuiton.util.beans.BinderFactory; 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-11-28 09:28:45 UTC (rev 24) +++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2012-11-28 18:17:32 UTC (rev 25) @@ -1,7 +1,7 @@ tutti.about.bottomText=Copyright %s - %s - version %s tutti.about.message=<h3>Tutti</h3><p><strong>Outil de saisie de données d'opérations et de captures au cours des campagnes halieutiques.</strong></p><br/><p>Ce logiciel permettra la saisie en mer des données d'opération de pêche (positions, environnement, engin, etc) et des captures associées (composition de la capture en espèces scientifiques avec poids, nombres, tailles etc) pour l'ensemble des campagnes halieutiques réalisées par l'Ifremer.</p><p>Ce projet a été initiée en 2012 par l'<a href\="http\://www.ifremer.fr">Ifremer</a> et réalisé par la société <a href\="http\://codelutin.com">Codelutin</a>.</p><hr/><br/><p>Pour plus d'informations, vous pouvez visiter le <a href\="http\://maven-site.forge.codelutin.com/tutti">site du projet</a>.</p><p>Projet hébergé sur la forge <a href\="http\://forge.codelutin.com/projects/tutti">Forge.codelutin.com</a>.</p> -tutti.action.about=A propos -tutti.action.about.tip=A Propos +tutti.action.about=À propos +tutti.action.about.tip=À Propos tutti.action.cancel=Annuler tutti.action.casino-import=Import Casino tutti.action.catches=Captures @@ -26,8 +26,6 @@ tutti.action.site.tip=Accéder au site du projet Tutti tutti.application.config=Configuration de l'application Tutti tutti.application.name=Tutti -tutti.config.application.site.url=Url du site internet de l'application -tutti.config.application.version=Version de l'application tutti.config.campaignId=Identifiant de la dernière campagne utilisée tutti.config.category.applications=Application tutti.config.category.applications.description=Application @@ -35,48 +33,52 @@ tutti.config.category.other.description=Autres options tutti.config.category.shortcuts=Raccourcis tutti.config.category.shortcuts.description=Liste des raccourcis clavier -tutti.config.data.directory=Répertoire de données de l'application. Vous pouvez utiliser l'expression ${tutti.data.directory} pour le référence dans d'autres propriétés de configuration (ex\: ${tutti.data.directory}/tmp). -tutti.config.license.organizationName=Nom de l'organisation dans la licence tutti.config.surveyId=Identifiant de la dernière série de campagne utilisée -tutti.config.tmp.directory=Répertoire temporaire utilisée par l'application (est nettoyé à chaque démarrage de l'application) tutti.config.ui.autoPopupNumberEditor=Toujours afficher le pavé numérique lors de l'édition d'un nombre tutti.config.ui.config=Chemin du fichier de configuration des interfaces graphiques tutti.config.ui.showNumberEditorButton=Afficher le pavé numérique de saisie -tutti.label.benthos.sampleTotalWeight=Poids échantilloné observé -tutti.label.benthos.totalWeight=Poids total observé +tutti.label.benthos.sampleTotalWeight=Poids échantilloné +tutti.label.benthos.totalWeight=Poids total tutti.label.campaign=Campagne tutti.label.campaign.country=Pays tutti.label.campaign.name=Nom tutti.label.campaign.survey=Série tutti.label.campaign.surveyPart=Série partielle +tutti.label.captureAccidentel.sampleTotalWeight=Poids total échantillonné +tutti.label.captureAccidentel.totalWeight=Poids total tutti.label.comment=Commentaire +tutti.label.fishes.sampleVracWeight=Poids total vrac échant. +tutti.label.fishes.totalHorsVracWeight=Poids total hors vrac +tutti.label.fishes.totalVracWeight=Poids total vrac +tutti.label.fishes.totalWeight=Poids total tutti.label.list.gear=Engin(s) tutti.label.list.headOfMission=Chef(s) de mission tutti.label.list.headOfSortRoom=Reponsable(s) de salle de tri tutti.label.list.saisisseur=Nom des saisisseurs tutti.label.list.vessel=Navire(s) +tutti.label.macroDechet.sampleTotalWeight=Poids total échantillonné +tutti.label.macroDechet.totalWeight=Poids total tutti.label.no.trait.selected=< Aucun trait sélectionné > -tutti.label.sampleVracWeightTotalHorsVracWeight=Poids total vrac échant. / total hors vrac +tutti.label.plancton.sampleTotalWeight=Poids total échantillonné +tutti.label.plancton.totalWeight=Poids total tutti.label.survey=Série de campagne tutti.label.survey.name=Nom tutti.label.survey.zone=Zone tutti.label.tab.benthos=Benthos -tutti.label.tab.captureAccidentelles=Captures accidentelles -tutti.label.tab.fishes=Poissons -tutti.label.tab.macroDechets=Macro déchets -tutti.label.tab.observationIndividuelles=Observations individuelles +tutti.label.tab.captureAccidentel=Captures accidentelles +tutti.label.tab.macroDechet=Macro déchets +tutti.label.tab.observationIndividuel=Observations individuelles tutti.label.tab.plancton=Plancton +tutti.label.tab.species=Espèces tutti.label.tab.trait=Trait tutti.label.tab.trait.gearShooting=Données de traine -tutti.label.tab.trait.general=Caractéristiques +tutti.label.tab.trait.general=Caractéristiques générales tutti.label.tab.trait.hydrology=Paramètres hydrologiques -tutti.label.totalWeightTotalVracWeight=Poids total / total vrac tutti.label.trait.averageBottomSalinity=Salinité de fond moyenne tutti.label.trait.averageBottomTemperature=Température de fond moyenne tutti.label.trait.beaufortScale=Force du vent tutti.label.trait.date=Date tutti.label.trait.distanceChaluteeDuree=Distance chalutée / Durée -tutti.label.trait.duree=Durée tutti.label.trait.gearShootingEndBottomSalinity=Salinité de fond fin de traine tutti.label.trait.gearShootingEndBottomTemperature=Température de fond fin de traine tutti.label.trait.gearShootingEndDepth=Profondeur fin de traine @@ -95,15 +97,12 @@ tutti.label.trait.gearShootingStartTime=Début de traine tutti.label.trait.geometrieMesuree=Géométrie mesurée tutti.label.trait.localite=Localité -tutti.label.trait.longueurFunes=Longueur des funes tutti.label.trait.longueurFunesBras=Longueur des funes / bras tutti.label.trait.ouvertureHorizontaleVerticale=Ouverture horizontale / verticale -tutti.label.trait.ouvertureVerticale=Ouverture verticale tutti.label.trait.seaState=Etat de la mer tutti.label.trait.stationNumberTraitNumber=Numéro de la station / Trait tutti.label.trait.strata=Strate d'association tutti.label.trait.systemeFermetureCul=Système de fermeture de cul -tutti.label.trait.traitNumber=Numéro du trait tutti.label.trait.traitRectiligne=Trait rectiligne tutti.label.trait.traitValid=Trait valide tutti.label.trait.windDirection=Direction du vent @@ -121,34 +120,32 @@ tutti.menu.synchronisationImport.tip=Effectuer des imports tutti.menu.synchronisations=Synchronisation tutti.menu.synchronisations.tip=Import/Export -tutti.service.config=Configuration des services de Tutti -tutti.table.benthos.header.number=Nb ob. +tutti.table.benthos.header.number=Nombre observé tutti.table.benthos.header.speciesByCode=Espèce -tutti.table.benthos.header.weight=Poids ob. -tutti.table.fishes.header.age=Age -tutti.table.fishes.header.computedNumber=Nombre calculé -tutti.table.fishes.header.computedNumber.tip=Nombre calculé -tutti.table.fishes.header.computedWeight=Poids calculé -tutti.table.fishes.header.computedWeight.tip=Poids calculé -tutti.table.fishes.header.elevationRate=Fraction d'él -tutti.table.fishes.header.elevationRate.tip=Fraction d'él -tutti.table.fishes.header.maturity=Maturité -tutti.table.fishes.header.maturity.tip=Maturié -tutti.table.fishes.header.mensurationType=Type de mensuration -tutti.table.fishes.header.mensurationType.tip=Type de mensuration -tutti.table.fishes.header.sampleWeight=Poids échan -tutti.table.fishes.header.sampleWeight.tip=Poids échan -tutti.table.fishes.header.sex=Sexe -tutti.table.fishes.header.sex.tip=Sexe -tutti.table.fishes.header.speciesByCode=Espèce -tutti.table.fishes.header.speciesByCode.tip=Espèce -tutti.table.fishes.header.vracHorsVrac=Vrac / Hors Vrac -tutti.table.fishes.header.vracHorsVrac.tip=Vrac / Hors Vrac -tutti.table.fishes.header.weight=Poids -tutti.table.fishes.header.weight.tip=Poids -tutti.table.fishes.header.weightCategory=Catégorie Poids -tutti.table.fishes.header.weightCategory.tip=Catégorie Poids -tutti.title.about=A propos de Tutti +tutti.table.benthos.header.weight=Poids observé +tutti.table.captureAccidentel.header.number=Nombre observé +tutti.table.captureAccidentel.header.speciesByCode=Espèce +tutti.table.captureAccidentel.header.weight=Poids observé +tutti.table.macroDechet.header.number=Nombre observé +tutti.table.macroDechet.header.speciesByCode=Espèce +tutti.table.macroDechet.header.weight=Poids observé +tutti.table.plancton.header.number=Nombre observé +tutti.table.plancton.header.speciesByCode=Espèce +tutti.table.plancton.header.weight=Poids observé +tutti.table.species.header.age=Age +tutti.table.species.header.computedNumber=Nombre calculé +tutti.table.species.header.computedWeight=Poids calculé +tutti.table.species.header.elevationRate=Fraction d'él +tutti.table.species.header.maturity=Maturité +tutti.table.species.header.sampleWeight=Poids échan +tutti.table.species.header.sex=Sexe +tutti.table.species.header.speciesByCode=Espèce +tutti.table.species.header.speciesByGenusCode=Espèce +tutti.table.species.header.toConfirm=A Confirmer +tutti.table.species.header.vracHorsVrac=Vrac / Hors Vrac +tutti.table.species.header.weight=Poids +tutti.table.species.header.weightCategory=Catégorie Poids +tutti.title.about=À propos de Tutti tutti.title.create.campaign=Créer une nouvelle campagne tutti.title.create.survey=Créer une nouvelle série de campagne tutti.title.edit.campaign=Editer une campagne existante