Tutti-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
November 2012
- 1 participants
- 14 discussions
28 Nov '12
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(a)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(a)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(a)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(a)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(a)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(a)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(a)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(a)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(a)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(a)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(a)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(a)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(a)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(a)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(a)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(a)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(a)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
1
0
28 Nov '12
Author: tchemit
Date: 2012-11-28 10:28:45 +0100 (Wed, 28 Nov 2012)
New Revision: 24
Url: http://forge.codelutin.com/repositories/revision/tutti/24
Log:
- introduce a new pakcage for referential entities
- add trait catches like beans (name will be changed)
- add different species decoration
Added:
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/TraitSpeciesCatchBean.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/
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/BeaufortScaleBean.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/CountryBean.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/GearBean.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/SeaStateBean.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/SexBean.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/SpeciesBean.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/UserBean.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/VesselBean.java
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/ZoneBean.java
Removed:
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/BeaufortScaleBean.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/CatchBean.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/CountryBean.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/GearBean.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/SeaStateBean.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/SexBean.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/SpeciesBean.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/UserBean.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/VesselBean.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/ZoneBean.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-dev/src/test/java/fr/ifremer/tutti/persistence/TuttiPersistenceDevImplTest.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistence.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/CampaignBean.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/SurveyBean.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitBean.java
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/DecoratorService.java
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java
trunk/tutti-service/src/main/resources/i18n/tutti-service_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-26 10:32:29 UTC (rev 23)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistence.java 2012-11-28 09:28:45 UTC (rev 24)
@@ -24,20 +24,25 @@
* #L%
*/
-import fr.ifremer.tutti.persistence.entities.BeaufortScaleBean;
import fr.ifremer.tutti.persistence.entities.CampaignBean;
-import fr.ifremer.tutti.persistence.entities.CatchBean;
-import fr.ifremer.tutti.persistence.entities.CountryBean;
-import fr.ifremer.tutti.persistence.entities.GearBean;
-import fr.ifremer.tutti.persistence.entities.SeaStateBean;
-import fr.ifremer.tutti.persistence.entities.SexBean;
-import fr.ifremer.tutti.persistence.entities.SpeciesBean;
import fr.ifremer.tutti.persistence.entities.StrataBean;
import fr.ifremer.tutti.persistence.entities.SurveyBean;
import fr.ifremer.tutti.persistence.entities.TraitBean;
-import fr.ifremer.tutti.persistence.entities.UserBean;
-import fr.ifremer.tutti.persistence.entities.VesselBean;
-import fr.ifremer.tutti.persistence.entities.ZoneBean;
+import fr.ifremer.tutti.persistence.entities.TraitBenthosCatchBean;
+import fr.ifremer.tutti.persistence.entities.TraitCaptureAccidentelCatchBean;
+import fr.ifremer.tutti.persistence.entities.TraitMacroDechetCatchBean;
+import fr.ifremer.tutti.persistence.entities.TraitPlanctonCatchBean;
+import fr.ifremer.tutti.persistence.entities.TraitSpeciesCatchBean;
+import fr.ifremer.tutti.persistence.entities.referential.BeaufortScaleBean;
+import fr.ifremer.tutti.persistence.entities.referential.CountryBean;
+import fr.ifremer.tutti.persistence.entities.referential.GearBean;
+import fr.ifremer.tutti.persistence.entities.referential.SeaStateBean;
+import fr.ifremer.tutti.persistence.entities.referential.SexBean;
+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.ApplicationConfig;
import java.io.Closeable;
@@ -58,6 +63,8 @@
void close() throws IOException;
+ List<WeightCategoryBean> getAllWeightCategories();
+
List<SexBean> getAllSex();
List<SpeciesBean> getAllSpecies();
@@ -84,6 +91,17 @@
List<TraitBean> getAllTraits(String campaignId);
+ List<TraitSpeciesCatchBean> getAllTraitSpeciesCatch(String traitId);
+
+ List<TraitBenthosCatchBean> getAllTraitBenthosCatch(String traitId);
+
+ List<TraitPlanctonCatchBean> getAllTraitPlanctonCatch(String traitId);
+
+ List<TraitMacroDechetCatchBean> getAllTraitMacroDechetCatch(String traitId);
+
+ List<TraitCaptureAccidentelCatchBean> getAllTraitCaptureAccidentelCatch(String traitId);
+
+
SurveyBean getSurvey(String surveyId);
CampaignBean getCampaign(String campaignId);
@@ -102,5 +120,4 @@
TraitBean saveTrait(TraitBean bean);
- List<CatchBean> getAllCatches(String traitId);
}
Deleted: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/BeaufortScaleBean.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/BeaufortScaleBean.java 2012-11-26 10:32:29 UTC (rev 23)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/BeaufortScaleBean.java 2012-11-28 09:28:45 UTC (rev 24)
@@ -1,47 +0,0 @@
-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%
- */
-
-/**
- * Represents a beaufort scale.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.1
- */
-public class BeaufortScaleBean extends AbstractTuttiBean {
-
- private static final long serialVersionUID = 1L;
-
- protected String name;
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
-}
\ No newline at end of file
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/CampaignBean.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/CampaignBean.java 2012-11-26 10:32:29 UTC (rev 23)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/CampaignBean.java 2012-11-28 09:28:45 UTC (rev 24)
@@ -24,6 +24,11 @@
* #L%
*/
+import fr.ifremer.tutti.persistence.entities.referential.CountryBean;
+import fr.ifremer.tutti.persistence.entities.referential.GearBean;
+import fr.ifremer.tutti.persistence.entities.referential.UserBean;
+import fr.ifremer.tutti.persistence.entities.referential.VesselBean;
+
import java.util.List;
/**
Deleted: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/CatchBean.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/CatchBean.java 2012-11-26 10:32:29 UTC (rev 23)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/CatchBean.java 2012-11-28 09:28:45 UTC (rev 24)
@@ -1,46 +0,0 @@
-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%
- */
-
-/**
- * Represents a catch.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.1
- */
-public class CatchBean extends AbstractTuttiBean {
-
- private static final long serialVersionUID = 1L;
-
- protected TraitBean trait;
-
- public TraitBean getTrait() {
- return trait;
- }
-
- public void setTrait(TraitBean trait) {
- this.trait = trait;
- }
-}
Deleted: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/CountryBean.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/CountryBean.java 2012-11-26 10:32:29 UTC (rev 23)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/CountryBean.java 2012-11-28 09:28:45 UTC (rev 24)
@@ -1,47 +0,0 @@
-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%
- */
-
-/**
- * Represents a country.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.1
- */
-public class CountryBean extends AbstractTuttiBean {
-
- private static final long serialVersionUID = 1L;
-
- protected String name;
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
-}
\ No newline at end of file
Deleted: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/GearBean.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/GearBean.java 2012-11-26 10:32:29 UTC (rev 23)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/GearBean.java 2012-11-28 09:28:45 UTC (rev 24)
@@ -1,47 +0,0 @@
-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%
- */
-
-/**
- * Represents a gear.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.1
- */
-public class GearBean extends AbstractTuttiBean {
-
- private static final long serialVersionUID = 1L;
-
- protected String name;
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
-}
\ No newline at end of file
Deleted: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/SeaStateBean.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/SeaStateBean.java 2012-11-26 10:32:29 UTC (rev 23)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/SeaStateBean.java 2012-11-28 09:28:45 UTC (rev 24)
@@ -1,47 +0,0 @@
-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%
- */
-
-/**
- * Represents the sea state.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.1
- */
-public class SeaStateBean extends AbstractTuttiBean {
-
- private static final long serialVersionUID = 1L;
-
- protected String name;
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
-}
\ No newline at end of file
Deleted: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/SexBean.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/SexBean.java 2012-11-26 10:32:29 UTC (rev 23)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/SexBean.java 2012-11-28 09:28:45 UTC (rev 24)
@@ -1,46 +0,0 @@
-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%
- */
-
-/**
- * Represents a sex.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.1
- */
-public class SexBean extends AbstractTuttiBean {
-
- private static final long serialVersionUID = 1L;
-
- protected String name;
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-}
Deleted: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/SpeciesBean.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/SpeciesBean.java 2012-11-26 10:32:29 UTC (rev 23)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/SpeciesBean.java 2012-11-28 09:28:45 UTC (rev 24)
@@ -1,56 +0,0 @@
-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%
- */
-
-/**
- * Represents a fishes species.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.1
- */
-public class SpeciesBean extends AbstractTuttiBean {
-
- private static final long serialVersionUID = 1L;
-
- protected String codeMemo;
-
- protected String genusSpecies;
-
- public String getCodeMemo() {
- return codeMemo;
- }
-
- public void setCodeMemo(String codeMemo) {
- this.codeMemo = codeMemo;
- }
-
- public String getGenusSpecies() {
- return genusSpecies;
- }
-
- public void setGenusSpecies(String genusSpecies) {
- this.genusSpecies = genusSpecies;
- }
-}
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/SurveyBean.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/SurveyBean.java 2012-11-26 10:32:29 UTC (rev 23)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/SurveyBean.java 2012-11-28 09:28:45 UTC (rev 24)
@@ -24,6 +24,8 @@
* #L%
*/
+import fr.ifremer.tutti.persistence.entities.referential.ZoneBean;
+
/**
* To represent a survey.
*
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitBean.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitBean.java 2012-11-26 10:32:29 UTC (rev 23)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitBean.java 2012-11-28 09:28:45 UTC (rev 24)
@@ -24,6 +24,10 @@
* #L%
*/
+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 java.util.Date;
import java.util.List;
Added: 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 (rev 0)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitBenthosCatchBean.java 2012-11-28 09:28:45 UTC (rev 24)
@@ -0,0 +1,119 @@
+package fr.ifremer.tutti.persistence.entities;
+
+import fr.ifremer.tutti.persistence.entities.referential.SpeciesBean;
+
+/**
+ * Represents a benthos catch while a trait.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.2
+ */
+public class TraitBenthosCatchBean extends AbstractTuttiBean implements TraitCatchBeanAware {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * When catch was observed.
+ *
+ * @since 0.2
+ */
+ protected TraitBean trait;
+
+ /**
+ * Species observed.
+ *
+ * @since 0.2
+ */
+ protected SpeciesBean species;
+
+ /**
+ * Is the species need to be confirmed?.
+ *
+ * @since 0.2
+ */
+ protected boolean speciesToConfirm;
+
+ /**
+ * Is catch is vrac or horsVrac?.
+ *
+ * @since 0.2
+ */
+ protected VracHorsVracEnum vracHorsVrac;
+
+ /**
+ * Observed weight.
+ *
+ * @since 0.2
+ */
+ protected Float weight;
+
+ /**
+ * Sample weight.
+ *
+ * @since 0.2
+ */
+ protected Float sampleWeight;
+
+ /**
+ * Elevation ratio.
+ *
+ * @since 0.2
+ */
+ protected Float elevationRatio;
+
+ public TraitBean getTrait() {
+ return trait;
+ }
+
+ public void setTrait(TraitBean trait) {
+ this.trait = trait;
+ }
+
+ public SpeciesBean getSpecies() {
+ return species;
+ }
+
+ public void setSpecies(SpeciesBean species) {
+ this.species = species;
+ }
+
+ public boolean isSpeciesToConfirm() {
+ return speciesToConfirm;
+ }
+
+ public void setSpeciesToConfirm(boolean speciesToConfirm) {
+ this.speciesToConfirm = speciesToConfirm;
+ }
+
+ public VracHorsVracEnum getVracHorsVrac() {
+ return vracHorsVrac;
+ }
+
+ public void setVracHorsVrac(VracHorsVracEnum vracHorsVrac) {
+ this.vracHorsVrac = vracHorsVrac;
+ }
+
+ public Float getWeight() {
+ return weight;
+ }
+
+ public void setWeight(Float weight) {
+ this.weight = weight;
+ }
+
+ public Float getSampleWeight() {
+ return sampleWeight;
+ }
+
+ public void setSampleWeight(Float sampleWeight) {
+ this.sampleWeight = sampleWeight;
+ }
+
+ public Float getElevationRatio() {
+ return elevationRatio;
+ }
+
+ public void setElevationRatio(Float elevationRatio) {
+ this.elevationRatio = elevationRatio;
+ }
+}
\ No newline at end of file
Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitBenthosCatchBean.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: 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 (rev 0)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitCaptureAccidentelCatchBean.java 2012-11-28 09:28:45 UTC (rev 24)
@@ -0,0 +1,60 @@
+package fr.ifremer.tutti.persistence.entities;
+
+import fr.ifremer.tutti.persistence.entities.referential.SpeciesBean;
+
+/**
+ * Represents a capture accidentel catch while a trait.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.2
+ */
+public class TraitCaptureAccidentelCatchBean extends AbstractTuttiBean implements TraitCatchBeanAware{
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * When catch was observed.
+ *
+ * @since 0.2
+ */
+ protected TraitBean trait;
+
+ /**
+ * Species observed.
+ *
+ * @since 0.2
+ */
+ protected SpeciesBean species;
+
+ /**
+ * Observed weight.
+ *
+ * @since 0.2
+ */
+ protected Float weight;
+
+ public TraitBean getTrait() {
+ return trait;
+ }
+
+ public void setTrait(TraitBean trait) {
+ this.trait = trait;
+ }
+
+ public SpeciesBean getSpecies() {
+ return species;
+ }
+
+ public void setSpecies(SpeciesBean species) {
+ this.species = species;
+ }
+
+ public Float getWeight() {
+ return weight;
+ }
+
+ public void setWeight(Float weight) {
+ this.weight = weight;
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitCaptureAccidentelCatchBean.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: 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 (rev 0)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitCatchBeanAware.java 2012-11-28 09:28:45 UTC (rev 24)
@@ -0,0 +1,14 @@
+package fr.ifremer.tutti.persistence.entities;
+
+/**
+ * TODO
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.2
+ */
+public interface TraitCatchBeanAware {
+
+ TraitBean getTrait();
+
+ void setTrait(TraitBean trait);
+}
Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitCatchBeanAware.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: 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 (rev 0)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitMacroDechetCatchBean.java 2012-11-28 09:28:45 UTC (rev 24)
@@ -0,0 +1,60 @@
+package fr.ifremer.tutti.persistence.entities;
+
+import fr.ifremer.tutti.persistence.entities.referential.SpeciesBean;
+
+/**
+ * Represents a macro dechet catch while a trait.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.2
+ */
+public class TraitMacroDechetCatchBean extends AbstractTuttiBean implements TraitCatchBeanAware{
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * When catch was observed.
+ *
+ * @since 0.2
+ */
+ protected TraitBean trait;
+
+ /**
+ * Species observed.
+ *
+ * @since 0.2
+ */
+ protected SpeciesBean species;
+
+ /**
+ * Observed weight.
+ *
+ * @since 0.2
+ */
+ protected Float weight;
+
+ public TraitBean getTrait() {
+ return trait;
+ }
+
+ public void setTrait(TraitBean trait) {
+ this.trait = trait;
+ }
+
+ public SpeciesBean getSpecies() {
+ return species;
+ }
+
+ public void setSpecies(SpeciesBean species) {
+ this.species = species;
+ }
+
+ public Float getWeight() {
+ return weight;
+ }
+
+ public void setWeight(Float weight) {
+ this.weight = weight;
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitMacroDechetCatchBean.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: 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 (rev 0)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitPlanctonCatchBean.java 2012-11-28 09:28:45 UTC (rev 24)
@@ -0,0 +1,60 @@
+package fr.ifremer.tutti.persistence.entities;
+
+import fr.ifremer.tutti.persistence.entities.referential.SpeciesBean;
+
+/**
+ * Represents a plancton catch while a trait.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.2
+ */
+public class TraitPlanctonCatchBean extends AbstractTuttiBean implements TraitCatchBeanAware{
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * When catch was observed.
+ *
+ * @since 0.2
+ */
+ protected TraitBean trait;
+
+ /**
+ * Species observed.
+ *
+ * @since 0.2
+ */
+ protected SpeciesBean species;
+
+ /**
+ * Observed weight.
+ *
+ * @since 0.2
+ */
+ protected Float weight;
+
+ public TraitBean getTrait() {
+ return trait;
+ }
+
+ public void setTrait(TraitBean trait) {
+ this.trait = trait;
+ }
+
+ public SpeciesBean getSpecies() {
+ return species;
+ }
+
+ public void setSpecies(SpeciesBean species) {
+ this.species = species;
+ }
+
+ public Float getWeight() {
+ return weight;
+ }
+
+ public void setWeight(Float weight) {
+ this.weight = weight;
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitPlanctonCatchBean.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Copied: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitSpeciesCatchBean.java (from rev 23, trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/CatchBean.java)
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitSpeciesCatchBean.java (rev 0)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitSpeciesCatchBean.java 2012-11-28 09:28:45 UTC (rev 24)
@@ -0,0 +1,213 @@
+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.SexBean;
+import fr.ifremer.tutti.persistence.entities.referential.SpeciesBean;
+import fr.ifremer.tutti.persistence.entities.referential.WeightCategoryBean;
+
+/**
+ * Represents a catch of species while a trait.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.1
+ */
+public class TraitSpeciesCatchBean extends AbstractTuttiBean implements TraitCatchBeanAware{
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * When catch was observed.
+ *
+ * @since 0.2
+ */
+ protected TraitBean trait;
+
+ /**
+ * Species observed.
+ *
+ * @since 0.2
+ */
+ protected SpeciesBean species;
+
+ /**
+ * Is the species need to be confirmed?.
+ *
+ * @since 0.2
+ */
+ protected boolean speciesToConfirm;
+
+ /**
+ * Is catch is vrac or horsVrac?.
+ *
+ * @since 0.2
+ */
+ protected VracHorsVracEnum vracHorsVrac;
+
+ /**
+ * Weight category (can be null).
+ *
+ * @since 0.2
+ */
+ protected WeightCategoryBean weightCategory;
+
+ /**
+ * Sex (can be null).
+ *
+ * @since 0.2
+ */
+ protected SexBean sex;
+
+ /**
+ * Maturity (can be null).
+ *
+ * @since 0.2
+ */
+ protected Float maturity;
+
+ /**
+ * Age (can be null).
+ *
+ * @since 0.2
+ */
+ protected Float age;
+
+ /**
+ * Observed weight.
+ *
+ * @since 0.2
+ */
+ protected Float weight;
+
+ /**
+ * Sample weight.
+ *
+ * @since 0.2
+ */
+ protected Float sampleWeight;
+
+ /**
+ * Elevation ratio.
+ *
+ * @since 0.2
+ */
+ protected Float elevationRatio;
+
+ public TraitBean getTrait() {
+ return trait;
+ }
+
+ public void setTrait(TraitBean trait) {
+ this.trait = trait;
+ }
+
+ public SpeciesBean getSpecies() {
+ return species;
+ }
+
+ public void setSpecies(SpeciesBean species) {
+ this.species = species;
+ }
+
+ public Boolean getSpeciesToConfirm() {
+ return speciesToConfirm;
+ }
+
+ public void setSpeciesToConfirm(Boolean speciesToConfirm) {
+ this.speciesToConfirm = speciesToConfirm;
+ }
+
+ public boolean isSpeciesToConfirm() {
+ return speciesToConfirm;
+ }
+
+ public void setSpeciesToConfirm(boolean speciesToConfirm) {
+ this.speciesToConfirm = speciesToConfirm;
+ }
+
+ public VracHorsVracEnum getVracHorsVrac() {
+ return vracHorsVrac;
+ }
+
+ public void setVracHorsVrac(VracHorsVracEnum vracHorsVrac) {
+ this.vracHorsVrac = vracHorsVrac;
+ }
+
+ public WeightCategoryBean getWeightCategory() {
+ return weightCategory;
+ }
+
+ public void setWeightCategory(WeightCategoryBean weightCategory) {
+ this.weightCategory = weightCategory;
+ }
+
+ public SexBean getSex() {
+ return sex;
+ }
+
+ public void setSex(SexBean sex) {
+ this.sex = sex;
+ }
+
+ public Float getMaturity() {
+ return maturity;
+ }
+
+ public void setMaturity(Float maturity) {
+ this.maturity = maturity;
+ }
+
+ public Float getAge() {
+ return age;
+ }
+
+ public void setAge(Float age) {
+ this.age = age;
+ }
+
+ public Float getWeight() {
+ return weight;
+ }
+
+ public void setWeight(Float weight) {
+ this.weight = weight;
+ }
+
+ public Float getSampleWeight() {
+ return sampleWeight;
+ }
+
+ public void setSampleWeight(Float sampleWeight) {
+ this.sampleWeight = sampleWeight;
+ }
+
+ public Float getElevationRatio() {
+ return elevationRatio;
+ }
+
+ public void setElevationRatio(Float elevationRatio) {
+ this.elevationRatio = elevationRatio;
+ }
+}
Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitSpeciesCatchBean.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/UserBean.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/UserBean.java 2012-11-26 10:32:29 UTC (rev 23)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/UserBean.java 2012-11-28 09:28:45 UTC (rev 24)
@@ -1,47 +0,0 @@
-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%
- */
-
-/**
- * Represents a user.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.1
- */
-public class UserBean extends AbstractTuttiBean {
-
- private static final long serialVersionUID = 1L;
-
- protected String name;
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
-}
\ No newline at end of file
Deleted: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/VesselBean.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/VesselBean.java 2012-11-26 10:32:29 UTC (rev 23)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/VesselBean.java 2012-11-28 09:28:45 UTC (rev 24)
@@ -1,47 +0,0 @@
-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%
- */
-
-/**
- * Represents a vessel.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.1
- */
-public class VesselBean extends AbstractTuttiBean {
-
- private static final long serialVersionUID = 1L;
-
- protected String name;
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
-}
\ No newline at end of file
Added: 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 (rev 0)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/VracHorsVracEnum.java 2012-11-28 09:28:45 UTC (rev 24)
@@ -0,0 +1,10 @@
+package fr.ifremer.tutti.persistence.entities;
+
+/**
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.2
+ */
+public enum VracHorsVracEnum {
+ VRAC,
+ HORS_VRAC
+}
Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/VracHorsVracEnum.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Deleted: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/ZoneBean.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/ZoneBean.java 2012-11-26 10:32:29 UTC (rev 23)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/ZoneBean.java 2012-11-28 09:28:45 UTC (rev 24)
@@ -1,47 +0,0 @@
-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%
- */
-
-/**
- * Represents a survey zone.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.1
- */
-public class ZoneBean extends AbstractTuttiBean {
-
- private static final long serialVersionUID = 1L;
-
- protected String name;
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
-}
\ No newline at end of file
Copied: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/BeaufortScaleBean.java (from rev 23, trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/BeaufortScaleBean.java)
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/BeaufortScaleBean.java (rev 0)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/BeaufortScaleBean.java 2012-11-28 09:28:45 UTC (rev 24)
@@ -0,0 +1,49 @@
+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;
+
+/**
+ * Represents a beaufort scale.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.1
+ */
+public class BeaufortScaleBean extends AbstractTuttiBean {
+
+ private static final long serialVersionUID = 1L;
+
+ protected String name;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/BeaufortScaleBean.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Copied: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/CountryBean.java (from rev 23, trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/CountryBean.java)
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/CountryBean.java (rev 0)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/CountryBean.java 2012-11-28 09:28:45 UTC (rev 24)
@@ -0,0 +1,49 @@
+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;
+
+/**
+ * Represents a country.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.1
+ */
+public class CountryBean extends AbstractTuttiBean {
+
+ private static final long serialVersionUID = 1L;
+
+ protected String name;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/CountryBean.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Copied: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/GearBean.java (from rev 23, trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/GearBean.java)
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/GearBean.java (rev 0)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/GearBean.java 2012-11-28 09:28:45 UTC (rev 24)
@@ -0,0 +1,49 @@
+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;
+
+/**
+ * Represents a gear.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.1
+ */
+public class GearBean extends AbstractTuttiBean {
+
+ private static final long serialVersionUID = 1L;
+
+ protected String name;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/GearBean.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Copied: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/SeaStateBean.java (from rev 23, trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/SeaStateBean.java)
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/SeaStateBean.java (rev 0)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/SeaStateBean.java 2012-11-28 09:28:45 UTC (rev 24)
@@ -0,0 +1,49 @@
+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;
+
+/**
+ * Represents the sea state.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.1
+ */
+public class SeaStateBean extends AbstractTuttiBean {
+
+ private static final long serialVersionUID = 1L;
+
+ protected String name;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/SeaStateBean.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Copied: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/SexBean.java (from rev 23, trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/SexBean.java)
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/SexBean.java (rev 0)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/SexBean.java 2012-11-28 09:28:45 UTC (rev 24)
@@ -0,0 +1,48 @@
+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;
+
+/**
+ * Represents a sex.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.1
+ */
+public class SexBean extends AbstractTuttiBean {
+
+ private static final long serialVersionUID = 1L;
+
+ protected String name;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+}
Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/SexBean.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Copied: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/SpeciesBean.java (from rev 23, trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/SpeciesBean.java)
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/SpeciesBean.java (rev 0)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/SpeciesBean.java 2012-11-28 09:28:45 UTC (rev 24)
@@ -0,0 +1,58 @@
+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;
+
+/**
+ * Represents a fishes species.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.1
+ */
+public class SpeciesBean extends AbstractTuttiBean {
+
+ private static final long serialVersionUID = 1L;
+
+ protected String codeMemo;
+
+ protected String genusSpecies;
+
+ public String getCodeMemo() {
+ return codeMemo;
+ }
+
+ public void setCodeMemo(String codeMemo) {
+ this.codeMemo = codeMemo;
+ }
+
+ public String getGenusSpecies() {
+ return genusSpecies;
+ }
+
+ public void setGenusSpecies(String genusSpecies) {
+ this.genusSpecies = genusSpecies;
+ }
+}
Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/SpeciesBean.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Copied: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/UserBean.java (from rev 23, trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/UserBean.java)
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/UserBean.java (rev 0)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/UserBean.java 2012-11-28 09:28:45 UTC (rev 24)
@@ -0,0 +1,49 @@
+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;
+
+/**
+ * Represents a user.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.1
+ */
+public class UserBean extends AbstractTuttiBean {
+
+ private static final long serialVersionUID = 1L;
+
+ protected String name;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/UserBean.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Copied: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/VesselBean.java (from rev 23, trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/VesselBean.java)
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/VesselBean.java (rev 0)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/VesselBean.java 2012-11-28 09:28:45 UTC (rev 24)
@@ -0,0 +1,49 @@
+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;
+
+/**
+ * Represents a vessel.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.1
+ */
+public class VesselBean extends AbstractTuttiBean {
+
+ private static final long serialVersionUID = 1L;
+
+ protected String name;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/VesselBean.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: 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 (rev 0)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/WeightCategoryBean.java 2012-11-28 09:28:45 UTC (rev 24)
@@ -0,0 +1,25 @@
+package fr.ifremer.tutti.persistence.entities.referential;
+
+import fr.ifremer.tutti.persistence.entities.AbstractTuttiBean;
+
+/**
+ * Represents a weight category.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.2
+ */
+public class WeightCategoryBean extends AbstractTuttiBean {
+
+ private static final long serialVersionUID = 1L;
+
+ protected String name;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+}
Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/WeightCategoryBean.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Copied: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/ZoneBean.java (from rev 23, trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/ZoneBean.java)
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/ZoneBean.java (rev 0)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/ZoneBean.java 2012-11-28 09:28:45 UTC (rev 24)
@@ -0,0 +1,49 @@
+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;
+
+/**
+ * Represents a survey zone.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.1
+ */
+public class ZoneBean extends AbstractTuttiBean {
+
+ private static final long serialVersionUID = 1L;
+
+ protected String name;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/referential/ZoneBean.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
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-26 10:32:29 UTC (rev 23)
+++ trunk/tutti-persistence-dev/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceDevFixtures.java 2012-11-28 09:28:45 UTC (rev 24)
@@ -24,21 +24,19 @@
* #L%
*/
-import com.google.common.collect.Lists;
-import fr.ifremer.tutti.persistence.entities.BeaufortScaleBean;
-import fr.ifremer.tutti.persistence.entities.CampaignBean;
-import fr.ifremer.tutti.persistence.entities.CatchBean;
-import fr.ifremer.tutti.persistence.entities.CountryBean;
-import fr.ifremer.tutti.persistence.entities.GearBean;
-import fr.ifremer.tutti.persistence.entities.SeaStateBean;
-import fr.ifremer.tutti.persistence.entities.SexBean;
-import fr.ifremer.tutti.persistence.entities.SpeciesBean;
+import com.google.common.collect.ArrayListMultimap;
+import fr.ifremer.tutti.persistence.entities.AbstractTuttiBean;
import fr.ifremer.tutti.persistence.entities.StrataBean;
-import fr.ifremer.tutti.persistence.entities.SurveyBean;
-import fr.ifremer.tutti.persistence.entities.TraitBean;
-import fr.ifremer.tutti.persistence.entities.UserBean;
-import fr.ifremer.tutti.persistence.entities.VesselBean;
-import fr.ifremer.tutti.persistence.entities.ZoneBean;
+import fr.ifremer.tutti.persistence.entities.referential.BeaufortScaleBean;
+import fr.ifremer.tutti.persistence.entities.referential.CountryBean;
+import fr.ifremer.tutti.persistence.entities.referential.GearBean;
+import fr.ifremer.tutti.persistence.entities.referential.SeaStateBean;
+import fr.ifremer.tutti.persistence.entities.referential.SexBean;
+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 java.util.List;
import java.util.UUID;
@@ -51,169 +49,145 @@
*/
public class TuttiPersistenceDevFixtures {
- protected final List<CampaignBean> campaign = Lists.newArrayList();
+ protected final ArrayListMultimap<Class<? extends AbstractTuttiBean>, AbstractTuttiBean> cache;
- protected final List<SurveyBean> survey = Lists.newArrayList();
-
- protected final List<ZoneBean> zone = Lists.newArrayList();
-
- protected final List<TraitBean> trait = Lists.newArrayList();
-
- protected final List<CountryBean> country = Lists.newArrayList();
-
- protected final List<VesselBean> vessel = Lists.newArrayList();
-
- protected final List<GearBean> gear = Lists.newArrayList();
-
- protected final List<UserBean> user = Lists.newArrayList();
-
- protected final List<StrataBean> strata = Lists.newArrayList();
-
- protected final List<SeaStateBean> seaState = Lists.newArrayList();
-
- protected final List<BeaufortScaleBean> beaufortScale = Lists.newArrayList();
-
- protected final List<SpeciesBean> species = Lists.newArrayList();
-
- protected final List<CatchBean> catches = Lists.newArrayList();
-
- protected final List<SexBean> sex = Lists.newArrayList();
-
public TuttiPersistenceDevFixtures() {
- // inject default datas
+ // inject default datas (only referential)
+ cache = ArrayListMultimap.create();
+
ZoneBean b;
b = new ZoneBean();
b.setId(UUID.randomUUID().toString());
b.setName("zone1");
- zone.add(b);
+ cache.put(ZoneBean.class, b);
b = new ZoneBean();
b.setId(UUID.randomUUID().toString());
b.setName("zone2");
- zone.add(b);
+ cache.put(ZoneBean.class, b);
CountryBean c;
c = new CountryBean();
c.setId(UUID.randomUUID().toString());
c.setName("France");
- country.add(c);
+ cache.put(CountryBean.class, c);
c = new CountryBean();
c.setId(UUID.randomUUID().toString());
c.setName("Espagne");
- country.add(c);
+ cache.put(CountryBean.class, c);
VesselBean v;
v = new VesselBean();
v.setId(UUID.randomUUID().toString());
v.setName("THALASSA");
- vessel.add(v);
+ cache.put(VesselBean.class, v);
v = new VesselBean();
v.setId(UUID.randomUUID().toString());
v.setName("THALASSA-II");
- vessel.add(v);
+ cache.put(VesselBean.class, v);
GearBean g;
g = new GearBean();
g.setId(UUID.randomUUID().toString());
g.setName("Gear-1");
- gear.add(g);
+ cache.put(GearBean.class, g);
g = new GearBean();
g.setId(UUID.randomUUID().toString());
g.setName("Gear-2");
- gear.add(g);
+ cache.put(GearBean.class, g);
UserBean u;
u = new UserBean();
u.setId(UUID.randomUUID().toString());
u.setName("Vincent Badts");
- user.add(u);
+ cache.put(UserBean.class, u);
u = new UserBean();
u.setId(UUID.randomUUID().toString());
u.setName("Jean claude Mahet");
- user.add(u);
+ cache.put(UserBean.class, u);
u = new UserBean();
u.setId(UUID.randomUUID().toString());
u.setName("Luisa Metral");
- user.add(u);
+ cache.put(UserBean.class, u);
u = new UserBean();
u.setId(UUID.randomUUID().toString());
u.setName("Jean Hervé Bourdeix");
- user.add(u);
+ cache.put(UserBean.class, u);
u = new UserBean();
u.setId(UUID.randomUUID().toString());
u.setName("Ysabelle Cheret");
- user.add(u);
+ cache.put(UserBean.class, u);
u = new UserBean();
u.setId(UUID.randomUUID().toString());
u.setName("Blandine Brisset");
- user.add(u);
+ cache.put(UserBean.class, u);
BeaufortScaleBean bs;
bs = new BeaufortScaleBean();
bs.setId(UUID.randomUUID().toString());
bs.setName("Calme");
- beaufortScale.add(bs);
+ cache.put(BeaufortScaleBean.class, bs);
bs = new BeaufortScaleBean();
bs.setId(UUID.randomUUID().toString());
bs.setName("Très légère brise");
- beaufortScale.add(bs);
+ cache.put(BeaufortScaleBean.class, bs);
bs = new BeaufortScaleBean();
bs.setId(UUID.randomUUID().toString());
bs.setName("Petite brise");
- beaufortScale.add(bs);
+ cache.put(BeaufortScaleBean.class, bs);
bs = new BeaufortScaleBean();
bs.setId(UUID.randomUUID().toString());
bs.setName("Jolie brise");
- beaufortScale.add(bs);
+ cache.put(BeaufortScaleBean.class, bs);
bs = new BeaufortScaleBean();
bs.setId(UUID.randomUUID().toString());
bs.setName("Vent frais");
- beaufortScale.add(bs);
+ cache.put(BeaufortScaleBean.class, bs);
bs = new BeaufortScaleBean();
bs.setId(UUID.randomUUID().toString());
bs.setName("Grand frais");
- beaufortScale.add(bs);
+ cache.put(BeaufortScaleBean.class, bs);
bs = new BeaufortScaleBean();
bs.setId(UUID.randomUUID().toString());
bs.setName("Coup de vent");
- beaufortScale.add(bs);
+ cache.put(BeaufortScaleBean.class, bs);
bs = new BeaufortScaleBean();
bs.setId(UUID.randomUUID().toString());
bs.setName("Fort coup de vent");
- beaufortScale.add(bs);
+ cache.put(BeaufortScaleBean.class, bs);
SeaStateBean st;
st = new SeaStateBean();
st.setId(UUID.randomUUID().toString());
st.setName("Mer calme");
- seaState.add(st);
+ cache.put(SeaStateBean.class, st);
st = new SeaStateBean();
st.setId(UUID.randomUUID().toString());
st.setName("Mer agitée");
- seaState.add(st);
+ cache.put(SeaStateBean.class, st);
SpeciesBean sp;
@@ -221,101 +195,108 @@
sp.setId(UUID.randomUUID().toString());
sp.setCodeMemo("BAR");
sp.setGenusSpecies("Bar");
- species.add(sp);
+ cache.put(SpeciesBean.class, sp);
sp = new SpeciesBean();
sp.setId(UUID.randomUUID().toString());
sp.setCodeMemo("CHIN");
sp.setGenusSpecies("Chinchard");
- species.add(sp);
+ cache.put(SpeciesBean.class, sp);
sp = new SpeciesBean();
sp.setId(UUID.randomUUID().toString());
sp.setCodeMemo("FLE");
sp.setGenusSpecies("Flet");
- species.add(sp);
+ cache.put(SpeciesBean.class, sp);
sp = new SpeciesBean();
sp.setId(UUID.randomUUID().toString());
sp.setCodeMemo("LIM");
sp.setGenusSpecies("Limande");
- species.add(sp);
+ cache.put(SpeciesBean.class, sp);
SexBean se;
se = new SexBean();
se.setId(UUID.randomUUID().toString());
se.setName("Male");
- sex.add(se);
+ cache.put(SexBean.class, se);
se = new SexBean();
se.setId(UUID.randomUUID().toString());
se.setName("Male");
- sex.add(se);
+ cache.put(SexBean.class, se);
se = new SexBean();
se.setId(UUID.randomUUID().toString());
se.setName("Femelle");
- sex.add(se);
+ cache.put(SexBean.class, se);
se = new SexBean();
se.setId(UUID.randomUUID().toString());
se.setName("Indéterminé");
- sex.add(se);
- }
+ cache.put(SexBean.class, se);
- public List<CampaignBean> campaign() {
- return campaign;
- }
+ WeightCategoryBean wc;
- public List<SurveyBean> survey() {
- return survey;
+ wc = new WeightCategoryBean();
+ wc.setId(UUID.randomUUID().toString());
+ wc.setName("Petit");
+ cache.put(WeightCategoryBean.class, wc);
+
+ wc = new WeightCategoryBean();
+ wc.setId(UUID.randomUUID().toString());
+ wc.setName("Gros");
+ cache.put(WeightCategoryBean.class, wc);
+
}
public List<ZoneBean> zone() {
- return zone;
+ return getData(ZoneBean.class);
}
- public List<TraitBean> trait() {
- return trait;
- }
-
public List<CountryBean> country() {
- return country;
+ return getData(CountryBean.class);
}
+
public List<VesselBean> vessel() {
- return vessel;
+ return getData(VesselBean.class);
}
public List<GearBean> gear() {
- return gear;
+ return getData(GearBean.class);
}
public List<UserBean> user() {
- return user;
+ return getData(UserBean.class);
}
public List<StrataBean> strata() {
- return strata;
+ return getData(StrataBean.class);
}
public List<SeaStateBean> seaState() {
- return seaState;
+ return getData(SeaStateBean.class);
}
public List<BeaufortScaleBean> beaufortScale() {
- return beaufortScale;
+ return getData(BeaufortScaleBean.class);
}
public List<SpeciesBean> species() {
- return species;
+ return getData(SpeciesBean.class);
}
- public List<CatchBean> catches() {
- return catches;
+ public List<SexBean> sex() {
+ return getData(SexBean.class);
}
- public List<SexBean> sex() {
- return sex;
+ public List<WeightCategoryBean> weightCategory() {
+ return getData(WeightCategoryBean.class);
}
+
+ protected <B extends AbstractTuttiBean> List<B> getData(Class<B> entityType) {
+ List<B> result = (List<B>) cache.get(entityType);
+ return result;
+ }
}
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-26 10:32:29 UTC (rev 23)
+++ trunk/tutti-persistence-dev/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceDevImpl.java 2012-11-28 09:28:45 UTC (rev 24)
@@ -26,25 +26,32 @@
import com.google.common.base.Predicate;
+import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
import fr.ifremer.tutti.persistence.config.TuttiPersistenceDevConfig;
import fr.ifremer.tutti.persistence.entities.AbstractTuttiBean;
-import fr.ifremer.tutti.persistence.entities.BeaufortScaleBean;
import fr.ifremer.tutti.persistence.entities.CampaignBean;
-import fr.ifremer.tutti.persistence.entities.CatchBean;
-import fr.ifremer.tutti.persistence.entities.CountryBean;
-import fr.ifremer.tutti.persistence.entities.GearBean;
-import fr.ifremer.tutti.persistence.entities.SeaStateBean;
-import fr.ifremer.tutti.persistence.entities.SexBean;
-import fr.ifremer.tutti.persistence.entities.SpeciesBean;
import fr.ifremer.tutti.persistence.entities.StrataBean;
import fr.ifremer.tutti.persistence.entities.SurveyBean;
import fr.ifremer.tutti.persistence.entities.TraitBean;
+import fr.ifremer.tutti.persistence.entities.TraitBenthosCatchBean;
+import fr.ifremer.tutti.persistence.entities.TraitCaptureAccidentelCatchBean;
+import fr.ifremer.tutti.persistence.entities.TraitCatchBeanAware;
+import fr.ifremer.tutti.persistence.entities.TraitMacroDechetCatchBean;
+import fr.ifremer.tutti.persistence.entities.TraitPlanctonCatchBean;
+import fr.ifremer.tutti.persistence.entities.TraitSpeciesCatchBean;
import fr.ifremer.tutti.persistence.entities.TuttiBeans;
-import fr.ifremer.tutti.persistence.entities.UserBean;
-import fr.ifremer.tutti.persistence.entities.VesselBean;
-import fr.ifremer.tutti.persistence.entities.ZoneBean;
+import fr.ifremer.tutti.persistence.entities.referential.BeaufortScaleBean;
+import fr.ifremer.tutti.persistence.entities.referential.CountryBean;
+import fr.ifremer.tutti.persistence.entities.referential.GearBean;
+import fr.ifremer.tutti.persistence.entities.referential.SeaStateBean;
+import fr.ifremer.tutti.persistence.entities.referential.SexBean;
+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.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.logging.Log;
@@ -73,33 +80,29 @@
private static final Log log =
LogFactory.getLog(TuttiPersistenceDevImpl.class);
- protected final List<CampaignBean> campaign = Lists.newArrayList();
+ protected final ArrayListMultimap<Class<? extends AbstractTuttiBean>, AbstractTuttiBean> cache = ArrayListMultimap.create();
- protected final List<SurveyBean> survey = Lists.newArrayList();
+ public static final List<Class<? extends AbstractTuttiBean>> TYPES = Lists.newArrayList(
+ BeaufortScaleBean.class,
+ CampaignBean.class,
+ CountryBean.class,
+ GearBean.class,
+ SeaStateBean.class,
+ SexBean.class,
+ SpeciesBean.class,
+ SurveyBean.class,
+ TraitBean.class,
+ TraitBenthosCatchBean.class,
+ TraitSpeciesCatchBean.class,
+ TraitPlanctonCatchBean.class,
+ TraitMacroDechetCatchBean.class,
+ TraitCaptureAccidentelCatchBean.class,
+ UserBean.class,
+ VesselBean.class,
+ WeightCategoryBean.class,
+ ZoneBean.class
+ );
- protected final List<ZoneBean> zone = Lists.newArrayList();
-
- protected final List<TraitBean> trait = Lists.newArrayList();
-
- protected final List<CountryBean> country = Lists.newArrayList();
-
- protected final List<VesselBean> vessel = Lists.newArrayList();
-
- protected final List<GearBean> gear = Lists.newArrayList();
-
- protected final List<UserBean> user = Lists.newArrayList();
-
- protected final List<StrataBean> strata = Lists.newArrayList();
-
- protected final List<SeaStateBean> seaState = Lists.newArrayList();
-
- protected final List<BeaufortScaleBean> beaufortScale = Lists.newArrayList();
-
- protected final List<SpeciesBean> species = Lists.newArrayList();
-
- protected final List<CatchBean> catches = Lists.newArrayList();
- protected final List<SexBean> sex= Lists.newArrayList();
-
@Override
public String getImplementationName() {
return "Persistence Dev implementation";
@@ -117,129 +120,100 @@
throw new RuntimeException("Could not create directory", e);
}
- user.clear();
- country.clear();
- vessel.clear();
- gear.clear();
- zone.clear();
- survey.clear();
- campaign.clear();
- trait.clear();
- strata.clear();
- seaState.clear();
- beaufortScale.clear();
- species.clear();
- catches.clear();
- sex.clear();
+ cache.clear();
TuttiPersistenceDevFixtures fixtures =
new TuttiPersistenceDevFixtures();
- user.addAll(loadEntities(UserBean.class, fixtures.user()));
- country.addAll(loadEntities(CountryBean.class, fixtures.country()));
- vessel.addAll(loadEntities(VesselBean.class, fixtures.vessel()));
- gear.addAll(loadEntities(GearBean.class, fixtures.gear()));
- zone.addAll(loadEntities(ZoneBean.class, fixtures.zone()));
- survey.addAll(loadEntities(SurveyBean.class, fixtures.survey()));
- campaign.addAll(loadEntities(CampaignBean.class, fixtures.campaign()));
- trait.addAll(loadEntities(TraitBean.class, fixtures.trait()));
- strata.addAll(loadEntities(StrataBean.class, fixtures.strata()));
- seaState.addAll(loadEntities(SeaStateBean.class, fixtures.seaState()));
- beaufortScale.addAll(loadEntities(BeaufortScaleBean.class, fixtures.beaufortScale()));
- species.addAll(loadEntities(SpeciesBean.class, fixtures.species()));
- catches.addAll(loadEntities(CatchBean.class, fixtures.catches()));
- sex.addAll(loadEntities(SexBean.class, fixtures.sex()));
+ for (Class<? extends AbstractTuttiBean> entityType : TYPES) {
+ loadEntities(entityType, fixtures);
+ }
}
@Override
public void close() throws IOException {
- persistToFile(UserBean.class, user);
- persistToFile(CountryBean.class, country);
- persistToFile(VesselBean.class, vessel);
- persistToFile(GearBean.class, gear);
- persistToFile(ZoneBean.class, zone);
- persistToFile(SurveyBean.class, survey);
- persistToFile(CampaignBean.class, campaign);
- persistToFile(TraitBean.class, trait);
- persistToFile(StrataBean.class, strata);
- persistToFile(SeaStateBean.class, seaState);
- persistToFile(BeaufortScaleBean.class, beaufortScale);
- persistToFile(SpeciesBean.class, species);
- persistToFile(CatchBean.class, catches);
- persistToFile(SexBean.class, sex);
+ for (Class<? extends AbstractTuttiBean> entityType : cache.keySet()) {
+ persistToFile(entityType);
+ }
}
@Override
+ public List<WeightCategoryBean> getAllWeightCategories() {
+ List<WeightCategoryBean> result = getDataInNewList(WeightCategoryBean.class);
+ return result;
+ }
+
+ @Override
public List<SexBean> getAllSex() {
- List<SexBean> result = Lists.newArrayList(sex);
+ List<SexBean> result = getDataInNewList(SexBean.class);
return result;
}
@Override
public List<SpeciesBean> getAllSpecies() {
- List<SpeciesBean> result = Lists.newArrayList(species);
+ List<SpeciesBean> result = getDataInNewList(SpeciesBean.class);
return result;
}
@Override
public List<SurveyBean> getAllSurveys() {
- List<SurveyBean> result = Lists.newArrayList(survey);
+ List<SurveyBean> result = getDataInNewList(SurveyBean.class);
return result;
}
@Override
public List<ZoneBean> getAllZones() {
- List<ZoneBean> result = Lists.newArrayList(zone);
+ List<ZoneBean> result = getDataInNewList(ZoneBean.class);
return result;
}
@Override
public List<CountryBean> getAllCountries() {
- List<CountryBean> result = Lists.newArrayList(country);
+ List<CountryBean> result = getDataInNewList(CountryBean.class);
return result;
}
@Override
public List<VesselBean> getAllVessels() {
- List<VesselBean> result = Lists.newArrayList(vessel);
+ List<VesselBean> result = getDataInNewList(VesselBean.class);
return result;
}
@Override
public List<GearBean> getAllGears() {
- List<GearBean> result = Lists.newArrayList(gear);
+ List<GearBean> result = getDataInNewList(GearBean.class);
return result;
}
@Override
public List<UserBean> getAllUsers() {
- List<UserBean> result = Lists.newArrayList(user);
+ List<UserBean> result = getDataInNewList(UserBean.class);
return result;
}
@Override
public List<SeaStateBean> getAllSeaStates() {
- List<SeaStateBean> result = Lists.newArrayList(seaState);
+ List<SeaStateBean> result = getDataInNewList(SeaStateBean.class);
return result;
}
@Override
public List<StrataBean> getAllStratas() {
- List<StrataBean> result = Lists.newArrayList(strata);
+ List<StrataBean> result = getDataInNewList(StrataBean.class);
return result;
}
@Override
public List<BeaufortScaleBean> getAllBeaufortScales() {
- List<BeaufortScaleBean> result = Lists.newArrayList(beaufortScale);
+ List<BeaufortScaleBean> result = getDataInNewList(BeaufortScaleBean.class);
return result;
}
@Override
public List<CampaignBean> getAllCampaigns(final String surveyId) {
- List<CampaignBean> result = Lists.newArrayList(Iterables.filter(campaign, new Predicate<CampaignBean>() {
+ List<CampaignBean> result = Lists.newArrayList(Iterables.filter(getData(CampaignBean.class), new Predicate<CampaignBean>() {
@Override
public boolean apply(CampaignBean input) {
return surveyId.equals(input.getSurvey().getId());
@@ -250,7 +224,7 @@
@Override
public List<TraitBean> getAllTraits(final String campaignId) {
- List<TraitBean> result = Lists.newArrayList(Iterables.filter(trait, new Predicate<TraitBean>() {
+ List<TraitBean> result = Lists.newArrayList(Iterables.filter(getData(TraitBean.class), new Predicate<TraitBean>() {
@Override
public boolean apply(TraitBean input) {
return campaignId.equals(input.getCampaign().getId());
@@ -260,93 +234,107 @@
}
@Override
- public List<CatchBean> getAllCatches(final String traitId) {
- List<CatchBean> result = Lists.newArrayList(Iterables.filter(catches, new Predicate<CatchBean>() {
- @Override
- public boolean apply(CatchBean input) {
- return traitId.equals(input.getTrait().getId());
- }
- }));
- return result;
+ public List<TraitSpeciesCatchBean> getAllTraitSpeciesCatch(final String traitId) {
+ return getAllTraitFilterCatches(TraitSpeciesCatchBean.class, traitId);
}
@Override
+ public List<TraitBenthosCatchBean> getAllTraitBenthosCatch(String traitId) {
+ return getAllTraitFilterCatches(TraitBenthosCatchBean.class, traitId);
+ }
+
+ @Override
+ public List<TraitPlanctonCatchBean> getAllTraitPlanctonCatch(String traitId) {
+ return getAllTraitFilterCatches(TraitPlanctonCatchBean.class, traitId);
+ }
+
+ @Override
+ public List<TraitMacroDechetCatchBean> getAllTraitMacroDechetCatch(String traitId) {
+ return getAllTraitFilterCatches(TraitMacroDechetCatchBean.class, traitId);
+ }
+
+ @Override
+ public List<TraitCaptureAccidentelCatchBean> getAllTraitCaptureAccidentelCatch(String traitId) {
+ return getAllTraitFilterCatches(TraitCaptureAccidentelCatchBean.class, traitId);
+ }
+
+ @Override
public SurveyBean getSurvey(String surveyId) {
- SurveyBean result = TuttiBeans.findById(survey, surveyId);
+ SurveyBean result = TuttiBeans.findById(getData(SurveyBean.class), surveyId);
return result;
}
@Override
public CampaignBean getCampaign(String campaignId) {
- CampaignBean result = TuttiBeans.findById(campaign, campaignId);
+ CampaignBean result = TuttiBeans.findById(getData(CampaignBean.class), campaignId);
return result;
}
@Override
public TraitBean getTrait(String traitId) {
- TraitBean result = TuttiBeans.findById(trait, traitId);
+ TraitBean result = TuttiBeans.findById(getData(TraitBean.class), traitId);
return result;
}
@Override
public SurveyBean createSurvey(SurveyBean bean) {
SurveyBean result = new SurveyBean();
- persist(SurveyBean.class, bean, result, survey);
+ persist(SurveyBean.class, bean, result);
return result;
}
@Override
public SurveyBean saveSurvey(SurveyBean bean) {
SurveyBean result = getSurvey(bean.getId());
- persist(SurveyBean.class, bean, result, survey);
+ persist(SurveyBean.class, bean, result);
return result;
}
@Override
public CampaignBean createCampaign(CampaignBean bean) {
CampaignBean result = new CampaignBean();
- persist(CampaignBean.class, bean, result, campaign);
+ persist(CampaignBean.class, bean, result);
return result;
}
@Override
public CampaignBean saveCampaign(CampaignBean bean) {
CampaignBean result = getCampaign(bean.getId());
- persist(CampaignBean.class, bean, result, campaign);
+ persist(CampaignBean.class, bean, result);
return result;
}
@Override
public TraitBean createTrait(TraitBean bean) {
TraitBean result = new TraitBean();
- persist(TraitBean.class, bean, result, trait);
+ persist(TraitBean.class, bean, result);
return result;
}
@Override
public TraitBean saveTrait(TraitBean bean) {
TraitBean result = getTrait(bean.getId());
- persist(TraitBean.class, bean, result, trait);
+ persist(TraitBean.class, bean, result);
return result;
}
protected <B extends AbstractTuttiBean> void persist(Class<B> beanType,
- B source,
- B target,
- List<B> entities) {
+ B source, B target) {
+
BinderFactory.newBinder(beanType).copyExcluding(
source, target, "id");
if (source.getId() == null) {
target.setId(UUID.randomUUID().toString());
}
- if (!entities.contains(target)) {
- entities.add(target);
+ if (!cache.containsValue(target)) {
+ cache.put(beanType, target);
}
- persistToFile(beanType, entities);
+ persistToFile(beanType);
}
- protected <B> List<B> loadEntities(Class<B> entityType,
- List<B> defaultList) throws IOException {
+ protected <B extends AbstractTuttiBean> List<B> loadEntities(Class<B> entityType,
+ TuttiPersistenceDevFixtures fix
+ ) throws IOException {
File storageFile = getStorageFile(entityType);
List<B> result;
@@ -362,6 +350,43 @@
result = (List<B>) oos.readObject();
oos.close();
+ } catch (ClassNotFoundException e) {
+ throw new RuntimeException("Could not find a class ", e);
+ } finally {
+ IOUtils.closeQuietly(oos);
+ }
+
+ cache.putAll(entityType, result);
+ } else {
+
+ result = fix.getData(entityType);
+
+ cache.putAll(entityType, result);
+
+ // persist it right now
+ persistToFile(entityType);
+ }
+
+ return result;
+ }
+
+ protected <B extends AbstractTuttiBean> List<B> loadEntities(Class<B> entityType,
+ List<B> defaultList) throws IOException {
+ File storageFile = getStorageFile(entityType);
+
+ List<B> result;
+
+ if (storageFile.exists()) {
+ if (log.isDebugEnabled()) {
+ log.debug("Load data from file: " + storageFile);
+ }
+
+ ObjectInputStream oos =
+ new ObjectInputStream(new FileInputStream(storageFile));
+ try {
+
+ result = (List<B>) oos.readObject();
+ oos.close();
return result;
} catch (ClassNotFoundException e) {
throw new RuntimeException("Could not find a class ", e);
@@ -373,8 +398,10 @@
result = defaultList;
// persist it right now
- persistToFile(entityType, result);
+ persistToFile(entityType);
}
+
+ cache.putAll(entityType, result);
return result;
}
@@ -385,8 +412,9 @@
return result;
}
- protected <B> void persistToFile(Class<B> entityType, List<B> entities) {
+ protected <B extends AbstractTuttiBean> void persistToFile(Class<B> entityType) {
+ List<B> entities = getDataInNewList(entityType);
File storageFile = getStorageFile(entityType);
if (log.isDebugEnabled()) {
@@ -408,4 +436,24 @@
}
}
+ protected <B extends AbstractTuttiBean> List<B> getData(Class<B> entityType) {
+ List<B> result = (List<B>) cache.get(entityType);
+ return result;
+ }
+
+ protected <B extends AbstractTuttiBean> List<B> getDataInNewList(Class<B> entityType) {
+ List<B> result = getData(entityType);
+ 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());
+ }
+ }));
+ return result;
+ }
+
}
Modified: trunk/tutti-persistence-dev/src/test/java/fr/ifremer/tutti/persistence/TuttiPersistenceDevImplTest.java
===================================================================
--- trunk/tutti-persistence-dev/src/test/java/fr/ifremer/tutti/persistence/TuttiPersistenceDevImplTest.java 2012-11-26 10:32:29 UTC (rev 23)
+++ trunk/tutti-persistence-dev/src/test/java/fr/ifremer/tutti/persistence/TuttiPersistenceDevImplTest.java 2012-11-28 09:28:45 UTC (rev 24)
@@ -84,7 +84,7 @@
Assert.assertTrue(storageDirectory.exists());
TuttiPersistenceDevFixtures fixtures = new TuttiPersistenceDevFixtures();
- Assert.assertEquals(fixtures.survey().size(), persistence.getAllSurveys().size());
+ Assert.assertEquals(fixtures.seaState().size(), persistence.getAllSeaStates().size());
}
@Test
@@ -97,11 +97,11 @@
persistence.open(config.getConfig());
TuttiPersistenceDevFixtures fixtures = new TuttiPersistenceDevFixtures();
- Assert.assertEquals(fixtures.survey().size(), persistence.getAllSurveys().size());
+ Assert.assertEquals(fixtures.seaState().size(), persistence.getAllSeaStates().size());
persistence.close();
Assert.assertTrue(storageDirectory.exists());
- Assert.assertEquals(fixtures.survey().size(), persistence.getAllSurveys().size());
+ Assert.assertEquals(fixtures.seaState().size(), persistence.getAllSeaStates().size());
}
@Test
@@ -114,6 +114,8 @@
persistence.open(config.getConfig());
Assert.assertTrue(storageDirectory.exists());
+ int size = persistence.getAllSurveys().size();
+
SurveyBean s = new SurveyBean();
s.setId("46de4ba5-3be6-4ab6-9f39-586b8e491fda");
s.setName("Serie 3");
@@ -126,8 +128,7 @@
persistence.open(config.getConfig());
- TuttiPersistenceDevFixtures fixtures = new TuttiPersistenceDevFixtures();
- Assert.assertEquals(fixtures.survey().size() + 1, persistence.getAllSurveys().size());
+ Assert.assertEquals(size + 1, persistence.getAllSurveys().size());
}
public static File getTestSpecificDirectory(Class<?> testClassName,
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-26 10:32:29 UTC (rev 23)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/DecoratorService.java 2012-11-28 09:28:45 UTC (rev 24)
@@ -24,19 +24,19 @@
* #L%
*/
-import fr.ifremer.tutti.persistence.entities.BeaufortScaleBean;
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.SeaStateBean;
-import fr.ifremer.tutti.persistence.entities.SexBean;
-import fr.ifremer.tutti.persistence.entities.SpeciesBean;
import fr.ifremer.tutti.persistence.entities.StrataBean;
import fr.ifremer.tutti.persistence.entities.SurveyBean;
import fr.ifremer.tutti.persistence.entities.TraitBean;
-import fr.ifremer.tutti.persistence.entities.UserBean;
-import fr.ifremer.tutti.persistence.entities.VesselBean;
-import fr.ifremer.tutti.persistence.entities.ZoneBean;
+import fr.ifremer.tutti.persistence.entities.referential.BeaufortScaleBean;
+import fr.ifremer.tutti.persistence.entities.referential.CountryBean;
+import fr.ifremer.tutti.persistence.entities.referential.GearBean;
+import fr.ifremer.tutti.persistence.entities.referential.SeaStateBean;
+import fr.ifremer.tutti.persistence.entities.referential.SexBean;
+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.ZoneBean;
import org.nuiton.util.decorator.Decorator;
import org.nuiton.util.decorator.DecoratorProvider;
@@ -79,7 +79,7 @@
registerMultiJXPathDecorator(SurveyBean.class, "${name}$s", "#", " - ");
registerMultiJXPathDecorator(CampaignBean.class, "${name}$s", "#", " - ");
- registerMultiJXPathDecorator(TraitBean.class, "${stationNumber}$s#${date}$td/%2$tm/%2$tY", "#", " - ");
+ registerMultiJXPathDecorator(TraitBean.class, "${stationNumber}$s#${traitNumber}$s#${date}$td/%2$tm/%2$tY", "#", " - ");
registerMultiJXPathDecorator(ZoneBean.class, "${name}$s", "#", " - ");
registerMultiJXPathDecorator(VesselBean.class, "${name}$s", "#", " - ");
registerMultiJXPathDecorator(CountryBean.class, "${name}$s", "#", " - ");
@@ -90,6 +90,8 @@
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", "#", " - ");
}
};
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java 2012-11-26 10:32:29 UTC (rev 23)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java 2012-11-28 09:28:45 UTC (rev 24)
@@ -26,20 +26,25 @@
import com.google.common.base.Preconditions;
import fr.ifremer.tutti.persistence.TuttiPersistence;
-import fr.ifremer.tutti.persistence.entities.BeaufortScaleBean;
import fr.ifremer.tutti.persistence.entities.CampaignBean;
-import fr.ifremer.tutti.persistence.entities.CatchBean;
-import fr.ifremer.tutti.persistence.entities.CountryBean;
-import fr.ifremer.tutti.persistence.entities.GearBean;
-import fr.ifremer.tutti.persistence.entities.SeaStateBean;
-import fr.ifremer.tutti.persistence.entities.SexBean;
-import fr.ifremer.tutti.persistence.entities.SpeciesBean;
import fr.ifremer.tutti.persistence.entities.StrataBean;
import fr.ifremer.tutti.persistence.entities.SurveyBean;
import fr.ifremer.tutti.persistence.entities.TraitBean;
-import fr.ifremer.tutti.persistence.entities.UserBean;
-import fr.ifremer.tutti.persistence.entities.VesselBean;
-import fr.ifremer.tutti.persistence.entities.ZoneBean;
+import fr.ifremer.tutti.persistence.entities.TraitBenthosCatchBean;
+import fr.ifremer.tutti.persistence.entities.TraitCaptureAccidentelCatchBean;
+import fr.ifremer.tutti.persistence.entities.TraitMacroDechetCatchBean;
+import fr.ifremer.tutti.persistence.entities.TraitPlanctonCatchBean;
+import fr.ifremer.tutti.persistence.entities.TraitSpeciesCatchBean;
+import fr.ifremer.tutti.persistence.entities.referential.BeaufortScaleBean;
+import fr.ifremer.tutti.persistence.entities.referential.CountryBean;
+import fr.ifremer.tutti.persistence.entities.referential.GearBean;
+import fr.ifremer.tutti.persistence.entities.referential.SeaStateBean;
+import fr.ifremer.tutti.persistence.entities.referential.SexBean;
+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.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuiton.util.ApplicationConfig;
@@ -113,6 +118,12 @@
}
@Override
+ public List<WeightCategoryBean> getAllWeightCategories() {
+ checkDriverExists();
+ return driver.getAllWeightCategories();
+ }
+
+ @Override
public List<SexBean> getAllSex() {
checkDriverExists();
return driver.getAllSex();
@@ -197,12 +208,36 @@
}
@Override
- public List<CatchBean> getAllCatches(String traitId) {
+ public List<TraitSpeciesCatchBean> getAllTraitSpeciesCatch(String traitId) {
checkDriverExists();
- return driver.getAllCatches(traitId);
+ return driver.getAllTraitSpeciesCatch(traitId);
}
@Override
+ public List<TraitBenthosCatchBean> getAllTraitBenthosCatch(String traitId) {
+ checkDriverExists();
+ return driver.getAllTraitBenthosCatch(traitId);
+ }
+
+ @Override
+ public List<TraitPlanctonCatchBean> getAllTraitPlanctonCatch(String traitId) {
+ checkDriverExists();
+ return driver.getAllTraitPlanctonCatch(traitId);
+ }
+
+ @Override
+ public List<TraitMacroDechetCatchBean> getAllTraitMacroDechetCatch(String traitId) {
+ checkDriverExists();
+ return driver.getAllTraitMacroDechetCatch(traitId);
+ }
+
+ @Override
+ public List<TraitCaptureAccidentelCatchBean> getAllTraitCaptureAccidentelCatch(String traitId) {
+ checkDriverExists();
+ return driver.getAllTraitCaptureAccidentelCatch(traitId);
+ }
+
+ @Override
public SurveyBean getSurvey(String surveyId) {
checkDriverExists();
return driver.getSurvey(surveyId);
Modified: trunk/tutti-service/src/main/resources/i18n/tutti-service_fr_FR.properties
===================================================================
--- trunk/tutti-service/src/main/resources/i18n/tutti-service_fr_FR.properties 2012-11-26 10:32:29 UTC (rev 23)
+++ trunk/tutti-service/src/main/resources/i18n/tutti-service_fr_FR.properties 2012-11-28 09:28:45 UTC (rev 24)
@@ -1,11 +1,8 @@
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.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.config=Chemin du fichier de configuration des interfaces graphiques
tutti.property.beaufortScaleBean=Vent beaufort
tutti.property.campaignBean=Campagne
tutti.property.codeMemo=Code Memo
1
0
r23 - in trunk: . tutti-persistence tutti-persistence-dev tutti-service tutti-ui-swing
by tchemit@users.forge.codelutin.com 26 Nov '12
by tchemit@users.forge.codelutin.com 26 Nov '12
26 Nov '12
Author: tchemit
Date: 2012-11-26 11:32:29 +0100 (Mon, 26 Nov 2012)
New Revision: 23
Url: http://forge.codelutin.com/repositories/revision/tutti/23
Log:
[maven-release-plugin] prepare for next development iteration
Modified:
trunk/pom.xml
trunk/tutti-persistence-dev/pom.xml
trunk/tutti-persistence/pom.xml
trunk/tutti-service/pom.xml
trunk/tutti-ui-swing/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2012-11-26 10:32:21 UTC (rev 22)
+++ trunk/pom.xml 2012-11-26 10:32:29 UTC (rev 23)
@@ -11,7 +11,7 @@
<groupId>fr.ifremer</groupId>
<artifactId>tutti</artifactId>
- <version>0.1</version>
+ <version>0.2-SNAPSHOT</version>
<modules>
<module>tutti-persistence</module>
@@ -57,12 +57,12 @@
</developers>
<scm>
- <url>http://svn.forge.codelutin.com/svn/tutti/tags/tutti-0.1</url>
+ <url>http://svn.forge.codelutin.com/svn/tutti/trunk</url>
<connection>
- scm:svn:http://svn.forge.codelutin.com/svn/tutti/tags/tutti-0.1
+ scm:svn:http://svn.forge.codelutin.com/svn/tutti/trunk
</connection>
<developerConnection>
- scm:svn:http://svn.forge.codelutin.com/svn/tutti/tags/tutti-0.1
+ scm:svn:http://svn.forge.codelutin.com/svn/tutti/trunk
</developerConnection>
</scm>
Modified: trunk/tutti-persistence/pom.xml
===================================================================
--- trunk/tutti-persistence/pom.xml 2012-11-26 10:32:21 UTC (rev 22)
+++ trunk/tutti-persistence/pom.xml 2012-11-26 10:32:29 UTC (rev 23)
@@ -6,7 +6,7 @@
<parent>
<groupId>fr.ifremer</groupId>
<artifactId>tutti</artifactId>
- <version>0.1</version>
+ <version>0.2-SNAPSHOT</version>
</parent>
<groupId>fr.ifremer.tutti</groupId>
Modified: trunk/tutti-persistence-dev/pom.xml
===================================================================
--- trunk/tutti-persistence-dev/pom.xml 2012-11-26 10:32:21 UTC (rev 22)
+++ trunk/tutti-persistence-dev/pom.xml 2012-11-26 10:32:29 UTC (rev 23)
@@ -6,7 +6,7 @@
<parent>
<groupId>fr.ifremer</groupId>
<artifactId>tutti</artifactId>
- <version>0.1</version>
+ <version>0.2-SNAPSHOT</version>
</parent>
<groupId>fr.ifremer.tutti</groupId>
Modified: trunk/tutti-service/pom.xml
===================================================================
--- trunk/tutti-service/pom.xml 2012-11-26 10:32:21 UTC (rev 22)
+++ trunk/tutti-service/pom.xml 2012-11-26 10:32:29 UTC (rev 23)
@@ -6,7 +6,7 @@
<parent>
<groupId>fr.ifremer</groupId>
<artifactId>tutti</artifactId>
- <version>0.1</version>
+ <version>0.2-SNAPSHOT</version>
</parent>
<groupId>fr.ifremer.tutti</groupId>
Modified: trunk/tutti-ui-swing/pom.xml
===================================================================
--- trunk/tutti-ui-swing/pom.xml 2012-11-26 10:32:21 UTC (rev 22)
+++ trunk/tutti-ui-swing/pom.xml 2012-11-26 10:32:29 UTC (rev 23)
@@ -6,7 +6,7 @@
<parent>
<groupId>fr.ifremer</groupId>
<artifactId>tutti</artifactId>
- <version>0.1</version>
+ <version>0.2-SNAPSHOT</version>
</parent>
<groupId>fr.ifremer.tutti</groupId>
1
0
Author: tchemit
Date: 2012-11-26 11:32:21 +0100 (Mon, 26 Nov 2012)
New Revision: 22
Url: http://forge.codelutin.com/repositories/revision/tutti/22
Log:
[maven-release-plugin] copy for tag tutti-0.1
Added:
tags/tutti-0.1/
1
0
r21 - in trunk: . tutti-persistence tutti-persistence-dev tutti-service tutti-ui-swing
by tchemit@users.forge.codelutin.com 26 Nov '12
by tchemit@users.forge.codelutin.com 26 Nov '12
26 Nov '12
Author: tchemit
Date: 2012-11-26 11:32:13 +0100 (Mon, 26 Nov 2012)
New Revision: 21
Url: http://forge.codelutin.com/repositories/revision/tutti/21
Log:
[maven-release-plugin] prepare release tutti-0.1
Modified:
trunk/pom.xml
trunk/tutti-persistence-dev/pom.xml
trunk/tutti-persistence/pom.xml
trunk/tutti-service/pom.xml
trunk/tutti-ui-swing/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2012-11-26 10:27:11 UTC (rev 20)
+++ trunk/pom.xml 2012-11-26 10:32:13 UTC (rev 21)
@@ -11,7 +11,7 @@
<groupId>fr.ifremer</groupId>
<artifactId>tutti</artifactId>
- <version>0.1-SNAPSHOT</version>
+ <version>0.1</version>
<modules>
<module>tutti-persistence</module>
@@ -57,12 +57,12 @@
</developers>
<scm>
- <url>http://svn.forge.codelutin.com/svn/tutti/trunk</url>
+ <url>http://svn.forge.codelutin.com/svn/tutti/tags/tutti-0.1</url>
<connection>
- scm:svn:http://svn.forge.codelutin.com/svn/tutti/trunk
+ scm:svn:http://svn.forge.codelutin.com/svn/tutti/tags/tutti-0.1
</connection>
<developerConnection>
- scm:svn:http://svn.forge.codelutin.com/svn/tutti/trunk
+ scm:svn:http://svn.forge.codelutin.com/svn/tutti/tags/tutti-0.1
</developerConnection>
</scm>
Modified: trunk/tutti-persistence/pom.xml
===================================================================
--- trunk/tutti-persistence/pom.xml 2012-11-26 10:27:11 UTC (rev 20)
+++ trunk/tutti-persistence/pom.xml 2012-11-26 10:32:13 UTC (rev 21)
@@ -1,14 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>fr.ifremer</groupId>
<artifactId>tutti</artifactId>
- <version>0.1-SNAPSHOT</version>
+ <version>0.1</version>
</parent>
<groupId>fr.ifremer.tutti</groupId>
Modified: trunk/tutti-persistence-dev/pom.xml
===================================================================
--- trunk/tutti-persistence-dev/pom.xml 2012-11-26 10:27:11 UTC (rev 20)
+++ trunk/tutti-persistence-dev/pom.xml 2012-11-26 10:32:13 UTC (rev 21)
@@ -1,14 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>fr.ifremer</groupId>
<artifactId>tutti</artifactId>
- <version>0.1-SNAPSHOT</version>
+ <version>0.1</version>
</parent>
<groupId>fr.ifremer.tutti</groupId>
Modified: trunk/tutti-service/pom.xml
===================================================================
--- trunk/tutti-service/pom.xml 2012-11-26 10:27:11 UTC (rev 20)
+++ trunk/tutti-service/pom.xml 2012-11-26 10:32:13 UTC (rev 21)
@@ -1,14 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>fr.ifremer</groupId>
<artifactId>tutti</artifactId>
- <version>0.1-SNAPSHOT</version>
+ <version>0.1</version>
</parent>
<groupId>fr.ifremer.tutti</groupId>
Modified: trunk/tutti-ui-swing/pom.xml
===================================================================
--- trunk/tutti-ui-swing/pom.xml 2012-11-26 10:27:11 UTC (rev 20)
+++ trunk/tutti-ui-swing/pom.xml 2012-11-26 10:32:13 UTC (rev 21)
@@ -1,14 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>fr.ifremer</groupId>
<artifactId>tutti</artifactId>
- <version>0.1-SNAPSHOT</version>
+ <version>0.1</version>
</parent>
<groupId>fr.ifremer.tutti</groupId>
1
0
r20 - in trunk/tutti-ui-swing/src/main: java/fr/ifremer/tutti/ui/swing/content/campaign java/fr/ifremer/tutti/ui/swing/content/catches resources/i18n resources/icons
by tchemit@users.forge.codelutin.com 26 Nov '12
by tchemit@users.forge.codelutin.com 26 Nov '12
26 Nov '12
Author: tchemit
Date: 2012-11-26 11:27:11 +0100 (Mon, 26 Nov 2012)
New Revision: 20
Url: http://forge.codelutin.com/repositories/revision/tutti/20
Log:
add benthos tab
continue catches tab
fix casino import icon
Added:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/BenthosTabUI.css
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/resources/icons/action-pupitri-import.png
Modified:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/campaign/EditCampaignUI.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/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/FishesTableModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/TraitTabUI.css
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/resources/i18n/tutti-ui-swing_fr_FR.properties
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/campaign/EditCampaignUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/campaign/EditCampaignUI.css 2012-11-26 10:26:20 UTC (rev 19)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/campaign/EditCampaignUI.css 2012-11-26 10:27:11 UTC (rev 20)
@@ -152,7 +152,7 @@
}
#importCasinoButton {
- actionIcon:"casion-import";
+ actionIcon:"casino-import";
text:"tutti.action.casino-import";
}
Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/BenthosTabUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/BenthosTabUI.css (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/BenthosTabUI.css 2012-11-26 10:27:11 UTC (rev 20)
@@ -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.benthos.totalWeight";
+ labelFor:{totalWeightField};
+}
+
+#totalWeightField {
+ property:"totalWeight";
+ model:{model.getTotalWeight()};
+ useFloat:false;
+ numberPattern:{INT_6_DIGITS_PATTERN};
+}
+
+#sampleTotalWeightLabel {
+ text:"tutti.label.benthos.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/BenthosTabUI.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/BenthosTabUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/BenthosTabUI.jaxx (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/BenthosTabUI.jaxx 2012-11-26 10:27:11 UTC (rev 20)
@@ -0,0 +1,99 @@
+<!--
+ #%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<BenthosTabUIModel, BenthosTabUIHandler>'>
+
+ <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 BenthosTabUI(CatchesUI parentUI) {
+ BenthosTabUIHandler handler = new BenthosTabUIHandler(parentUI, this);
+ setContextValue(handler);
+ handler.beforeInitUI();
+}
+
+public void selectTrait(TraitBean trait) { handler.selectTrait(trait); }
+
+protected void $afterCompleteSetup() { handler.afterInitUI(); }
+ ]]></script>
+
+ <BenthosTabUIHandler id='handler'
+ initializer='getContextValue(BenthosTabUIHandler.class)'/>
+
+ <BenthosTabUIModel id='model'
+ initializer='getContextValue(BenthosTabUIModel.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 -->
+ <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>
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/BenthosTabUI.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/BenthosTabUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/BenthosTabUIHandler.java (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/BenthosTabUIHandler.java 2012-11-26 10:27:11 UTC (rev 20)
@@ -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 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.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(a)codelutin.com>
+ * @since 0.1
+ */
+public class BenthosTabUIHandler extends AbstractTuttiUIHandler<BenthosTabUIModel> {
+
+ /** Logger. */
+ private static final Log log = LogFactory.getLog(BenthosTabUIHandler.class);
+
+ private final BenthosTabUI ui;
+
+ private final CatchesUI parentUi;
+
+ private final PersistenceService persistenceService;
+
+ public BenthosTabUIHandler(CatchesUI parentUi, BenthosTabUI ui) {
+ super(parentUi.getHandler().getContext());
+ this.ui = ui;
+ this.parentUi = parentUi;
+ this.persistenceService = context.getService(PersistenceService.class);
+ }
+
+ @Override
+ public void beforeInitUI() {
+
+ BenthosTabUIModel model = new BenthosTabUIModel();
+ 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.benthos.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.benthos.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.benthos.header.number"));
+// col.setHeaderRenderer(SwingUtil.newStringTableCellRenderer(dRender,50, true));
+ col.setIdentifier("computedNumber");
+ columnModel.addColumn(col);
+
+ ui.setContextValue(columnModel);
+
+ final BenthosTableModel tableModel = new BenthosTableModel(columnModel);
+ ui.setContextValue(tableModel);
+
+ model.addPropertyChangeListener(BenthosTabUIModel.PROPERTY_CATCHES, new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ tableModel.setData((List<CatchBean>) evt.getNewValue());
+ }
+ });
+
+ }
+
+ @Override
+ public void afterInitUI() {
+ BenthosTabUIModel model = ui.getModel();
+
+ initUI(ui);
+ }
+
+ @Override
+ public void onCloseUI() {
+ }
+
+ @Override
+ protected BenthosTabUIModel getModel() {
+ return ui.getModel();
+ }
+
+ public void selectTrait(TraitBean bean) {
+
+ boolean empty = bean == null;
+
+ BenthosTabUIModel 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");
+ }
+ }
+}
\ No newline at end of file
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/BenthosTabUIHandler.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/BenthosTabUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/BenthosTabUIModel.java (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/BenthosTabUIModel.java 2012-11-26 10:27:11 UTC (rev 20)
@@ -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.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(a)codelutin.com>
+ * @since 0.1
+ */
+public class BenthosTabUIModel 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<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 getSampleTotalWeight() {
+ return sampleTotalWeight;
+ }
+
+ public void setSampleTotalWeight(Float sampleTotalWeight) {
+ Object oldValue = getSampleTotalWeight();
+ this.sampleTotalWeight = sampleTotalWeight;
+ firePropertyChange(PROPERTY_SAMPLE_TOTAL_WEIGHT, oldValue, sampleTotalWeight);
+ }
+
+ 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,
+ BenthosTabUIModel.class).copy(bean, this);
+ }
+
+ public TraitBean toBean() {
+ TraitBean result = new TraitBean();
+ BinderFactory.newBinder(BenthosTabUIModel.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/BenthosTabUIModel.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/BenthosTableModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/BenthosTableModel.java (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/BenthosTableModel.java 2012-11-26 10:27:11 UTC (rev 20)
@@ -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.CatchBean;
+
+import javax.swing.table.AbstractTableModel;
+import javax.swing.table.TableColumnModel;
+import java.util.List;
+
+/**
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.1
+ */
+public class BenthosTableModel extends AbstractTableModel {
+
+ private static final long serialVersionUID = 1L;
+
+ protected List<CatchBean> data;
+
+ protected final TableColumnModel columnModel;
+
+ public BenthosTableModel(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;
+ }
+}
\ No newline at end of file
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/BenthosTableModel.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.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/CatchesUI.jaxx 2012-11-26 10:26:20 UTC (rev 19)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/CatchesUI.jaxx 2012-11-26 10:27:11 UTC (rev 20)
@@ -74,7 +74,7 @@
<FishesTabUI id='fishesTabContent' constructorParams='this'/>
</tab>
<tab id='benthosTab' title='tutti.label.tab.benthos'>
- <JLabel text='tutti.to.be.done' horizontalAlignment='{JLabel.CENTER}'/>
+ <BenthosTabUI id='benthosTabContent' constructorParams='this'/>
</tab>
<tab id='planctonTab' title='tutti.label.tab.plancton'>
<JLabel text='tutti.to.be.done' horizontalAlignment='{JLabel.CENTER}'/>
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-26 10:26:20 UTC (rev 19)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/CatchesUIHandler.java 2012-11-26 10:27:11 UTC (rev 20)
@@ -152,12 +152,12 @@
// propagate trait to his tabs
ui.getTraitTabContent().selectTrait(selectedTrait);
+ ui.getFishesTabContent().selectTrait(selectedTrait);
+ ui.getBenthosTabContent().selectTrait(selectedTrait);
// repaint tabs
ui.getTabPane().repaint();
-// ui.getFishesTabContent().selectTrait(selectedTrait);
-// ui.getBenthosTabContent().selectTrait(selectedTrait);
// ui.getPlanctonTabContent().selectTrait(selectedTrait);
// ui.getMacroDechetsTabContent().selectTrait(selectedTrait);
// ui.getCaptureAccidentellesTabContent().selectTrait(selectedTrait);
Modified: 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-26 10:26:20 UTC (rev 19)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/FishesTabUI.css 2012-11-26 10:27:11 UTC (rev 20)
@@ -65,6 +65,7 @@
numberPattern:{INT_6_DIGITS_PATTERN};
}
-#fishesTable {
- model:{new FishesTableModel()};
+#table {
+ model:{getContextValue(TableModel.class)};
+ columnModel:{getContextValue(TableColumnModel.class)};
}
Modified: 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-26 10:26:20 UTC (rev 19)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/FishesTabUI.jaxx 2012-11-26 10:27:11 UTC (rev 20)
@@ -37,6 +37,9 @@
jaxx.runtime.validator.swing.SwingValidatorUtil
jaxx.runtime.validator.swing.SwingValidatorMessageTableModel
+ javax.swing.table.TableModel
+ javax.swing.table.TableColumnModel
+
static org.nuiton.i18n.I18n._
</import>
@@ -96,7 +99,7 @@
</Table>
<JScrollPane id='tableScrollPane' constraints='BorderLayout.CENTER'>
- <JTable id='fishesTable'/>
+ <JTable id='table'/>
</JScrollPane>
</JPanel>
Modified: 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-26 10:26:20 UTC (rev 19)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/FishesTabUIHandler.java 2012-11-26 10:27:11 UTC (rev 20)
@@ -25,14 +25,29 @@
*/
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(a)codelutin.com>
* @since 0.1
@@ -57,9 +72,146 @@
@Override
public void beforeInitUI() {
+
FishesTabUIModel model = new FishesTabUIModel();
+ ui.setContextValue(model);
- 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
Modified: 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-26 10:26:20 UTC (rev 19)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/FishesTableModel.java 2012-11-26 10:27:11 UTC (rev 20)
@@ -24,11 +24,14 @@
* #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;
/**
- * TODO
- *
* @author tchemit <chemit(a)codelutin.com>
* @since 0.1
*/
@@ -36,18 +39,40 @@
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 0;
+ return data == null ? 0 : data.size();
}
@Override
public int getColumnCount() {
- return 0;
+ return columnModel.getColumnCount();
}
@Override
public Object getValueAt(int rowIndex, int columnIndex) {
return null;
}
+
+ @Override
+ public boolean isCellEditable(int rowIndex, int columnIndex) {
+ return true;
+ }
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/TraitTabUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/TraitTabUI.css 2012-11-26 10:26:20 UTC (rev 19)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/TraitTabUI.css 2012-11-26 10:27:11 UTC (rev 20)
@@ -477,6 +477,11 @@
enabled:{model.isModify()};
}
+#importPupitriButton {
+ actionIcon:"pupitri-import";
+ text:"tutti.action.pupitri-import";
+}
+
#messagePanel {
border:{BorderFactory.createTitledBorder("Messages")};
height:200;
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-26 10:26:20 UTC (rev 19)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/TraitTabUI.jaxx 2012-11-26 10:27:11 UTC (rev 20)
@@ -527,10 +527,16 @@
</JTabbedPane>
<!-- Actions -->
- <JPanel layout='{new GridLayout(1,2,0,0)}' constraints='BorderLayout.SOUTH'>
- <JButton id='cancelButton' onActionPerformed='handler.cancel()'/>
- <JButton id='saveButton' onActionPerformed='handler.save()'/>
+ <JPanel layout='{new BorderLayout()}' constraints='BorderLayout.SOUTH'>
+ <JPanel layout='{new GridLayout(1,0)}' constraints='BorderLayout.NORTH'>
+ <JButton id='importPupitriButton' onActionPerformed='handler.importPupitri()'/>
+ </JPanel>
+ <JPanel layout='{new GridLayout(1,0)}' constraints='BorderLayout.CENTER'>
+ <JButton id='cancelButton' onActionPerformed='handler.cancel()'/>
+ <JButton id='saveButton' onActionPerformed='handler.save()'/>
+ </JPanel>
</JPanel>
+
</JPanel>
<JLabel id='noTraitPane'/>
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-26 10:26:20 UTC (rev 19)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/TraitTabUIHandler.java 2012-11-26 10:27:11 UTC (rev 20)
@@ -24,7 +24,6 @@
* #L%
*/
-import com.google.common.collect.Lists;
import fr.ifremer.tutti.persistence.entities.TraitBean;
import fr.ifremer.tutti.persistence.entities.UserBean;
import fr.ifremer.tutti.service.PersistenceService;
@@ -33,11 +32,9 @@
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.nuiton.validator.bean.simple.SimpleBeanValidator;
import javax.swing.JLabel;
import javax.swing.JPanel;
-import javax.swing.ListSelectionModel;
import java.awt.BorderLayout;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
@@ -121,7 +118,7 @@
model.setEmpty(true);
- listenValidatorValid(ui.getValidator(),getModel() );
+ listenValidatorValid(ui.getValidator(), getModel());
}
@Override
@@ -207,6 +204,10 @@
ui.getTraitTabPane().setSelectedIndex(selectedIndex);
}
+ public void importPupitri() {
+ //TODO
+ }
+
public void setGearShootingStartLatitude(String text) {
ui.getModel().setGearShootingStartLatitude(Float.valueOf(text));
}
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-26 10:26:20 UTC (rev 19)
+++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2012-11-26 10:27:11 UTC (rev 20)
@@ -15,6 +15,7 @@
tutti.action.manageProtocol=Protocole
tutti.action.manageProtocol.tip=Gérer les protocoles
tutti.action.new=Nouveau
+tutti.action.pupitri-import=Import PUPITRI
tutti.action.reload.actions=Recharger les actions
tutti.action.reload.home=Reload home screen
tutti.action.reload.ui=Recharger l'interface graphique
@@ -41,6 +42,8 @@
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.campaign=Campagne
tutti.label.campaign.country=Pays
tutti.label.campaign.name=Nom
@@ -119,6 +122,32 @@
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.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.title.create.campaign=Créer une nouvelle campagne
tutti.title.create.survey=Créer une nouvelle série de campagne
Copied: trunk/tutti-ui-swing/src/main/resources/icons/action-pupitri-import.png (from rev 18, trunk/tutti-ui-swing/src/main/resources/icons/action-casino-import.png)
===================================================================
(Binary files differ)
1
0
r19 - trunk/tutti-persistence-dev/src/main/java/fr/ifremer/tutti/persistence
by tchemit@users.forge.codelutin.com 26 Nov '12
by tchemit@users.forge.codelutin.com 26 Nov '12
26 Nov '12
Author: tchemit
Date: 2012-11-26 11:26:20 +0100 (Mon, 26 Nov 2012)
New Revision: 19
Url: http://forge.codelutin.com/repositories/revision/tutti/19
Log:
remove theme data
Modified:
trunk/tutti-persistence-dev/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceDevFixtures.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/TuttiPersistenceDevFixtures.java 2012-11-25 18:23:49 UTC (rev 18)
+++ trunk/tutti-persistence-dev/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceDevFixtures.java 2012-11-26 10:26:20 UTC (rev 19)
@@ -133,63 +133,34 @@
u = new UserBean();
u.setId(UUID.randomUUID().toString());
- u.setName("Mathieu");
+ u.setName("Vincent Badts");
user.add(u);
u = new UserBean();
u.setId(UUID.randomUUID().toString());
- u.setName("Vincent");
+ u.setName("Jean claude Mahet");
user.add(u);
u = new UserBean();
u.setId(UUID.randomUUID().toString());
- u.setName("Benjamin");
+ u.setName("Luisa Metral");
user.add(u);
- SurveyBean s;
+ u = new UserBean();
+ u.setId(UUID.randomUUID().toString());
+ u.setName("Jean Hervé Bourdeix");
+ user.add(u);
- s = new SurveyBean();
- s.setId("5ff3c32a-174f-4737-9845-a49fea316b3e");
- s.setName("Serie 1");
- s.setComment("Comment");
- s.setZone(zone.get(0));
- survey.add(s);
+ u = new UserBean();
+ u.setId(UUID.randomUUID().toString());
+ u.setName("Ysabelle Cheret");
+ user.add(u);
- s = new SurveyBean();
- s.setId("36de4ba5-3be6-4ab6-9f39-586b8e491fda");
- s.setName("Serie 2");
- s.setComment("Comment");
- s.setZone(zone.get(1));
- survey.add(s);
+ u = new UserBean();
+ u.setId(UUID.randomUUID().toString());
+ u.setName("Blandine Brisset");
+ user.add(u);
- CampaignBean ca;
-
- ca = new CampaignBean();
- ca.setId("08c5d345-f602-4d2b-a861-4a88b5637134");
- ca.setName("Campagne 1");
- ca.setComment("Comment");
- ca.setSurvey(survey.get(0));
- ca.setCountry(country.get(0));
- ca.setSurveyPart("survey part 1");
- ca.setVessel(Lists.<VesselBean>newArrayList(vessel.get(0)));
- ca.setGear(Lists.<GearBean>newArrayList(gear.get(0)));
- ca.setHeadOfMission(Lists.<UserBean>newArrayList(user.get(0)));
- ca.setHeadOfSortRoom(Lists.<UserBean>newArrayList(user.get(1), user.get(2)));
- campaign.add(ca);
-
- ca = new CampaignBean();
- ca.setId("397a15ab-cafc-42f0-83eb-b2c56643d79a");
- ca.setName("Campagne 1 bis");
- ca.setComment("Comment");
- ca.setSurvey(survey.get(0));
- ca.setCountry(country.get(0));
- ca.setSurveyPart("survey part 2");
- ca.setVessel(Lists.<VesselBean>newArrayList(vessel.get(1)));
- ca.setGear(Lists.<GearBean>newArrayList(gear.get(1)));
- ca.setHeadOfMission(Lists.<UserBean>newArrayList(user.get(0), user.get(1)));
- ca.setHeadOfSortRoom(Lists.<UserBean>newArrayList(user.get(2)));
- campaign.add(ca);
-
BeaufortScaleBean bs;
bs = new BeaufortScaleBean();
1
0
25 Nov '12
Author: tchemit
Date: 2012-11-25 19:23:49 +0100 (Sun, 25 Nov 2012)
New Revision: 18
Url: http://forge.codelutin.com/repositories/revision/tutti/18
Log:
add new entities
begin of catch fishes screen
add casino import button
Added:
trunk/tutti-persistence-dev/src/main/java/fr/ifremer/tutti/persistence/config/TopiaPersistenceDevConfigProvider.java
trunk/tutti-persistence-dev/src/main/resources/META-INF/services/org.nuiton.util.ApplicationConfigProvider
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/CatchBean.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/SexBean.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/SpeciesBean.java
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
trunk/tutti-ui-swing/src/main/resources/icons/action-casino-import.png
trunk/tutti-ui-swing/src/main/resources/icons/action-local-export.png
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-service/src/main/java/fr/ifremer/tutti/service/DecoratorService.java
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java
trunk/tutti-service/src/main/resources/i18n/tutti-service_fr_FR.properties
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/campaign/EditCampaignUI.css
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/catches/CatchesUI.jaxx
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-24 13:39:59 UTC (rev 17)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistence.java 2012-11-25 18:23:49 UTC (rev 18)
@@ -26,9 +26,12 @@
import fr.ifremer.tutti.persistence.entities.BeaufortScaleBean;
import fr.ifremer.tutti.persistence.entities.CampaignBean;
+import fr.ifremer.tutti.persistence.entities.CatchBean;
import fr.ifremer.tutti.persistence.entities.CountryBean;
import fr.ifremer.tutti.persistence.entities.GearBean;
import fr.ifremer.tutti.persistence.entities.SeaStateBean;
+import fr.ifremer.tutti.persistence.entities.SexBean;
+import fr.ifremer.tutti.persistence.entities.SpeciesBean;
import fr.ifremer.tutti.persistence.entities.StrataBean;
import fr.ifremer.tutti.persistence.entities.SurveyBean;
import fr.ifremer.tutti.persistence.entities.TraitBean;
@@ -55,6 +58,10 @@
void close() throws IOException;
+ List<SexBean> getAllSex();
+
+ List<SpeciesBean> getAllSpecies();
+
List<SeaStateBean> getAllSeaStates();
List<StrataBean> getAllStratas();
@@ -94,4 +101,6 @@
TraitBean createTrait(TraitBean bean);
TraitBean saveTrait(TraitBean bean);
+
+ List<CatchBean> getAllCatches(String traitId);
}
Added: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/CatchBean.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/CatchBean.java (rev 0)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/CatchBean.java 2012-11-25 18:23:49 UTC (rev 18)
@@ -0,0 +1,46 @@
+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%
+ */
+
+/**
+ * Represents a catch.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.1
+ */
+public class CatchBean extends AbstractTuttiBean {
+
+ private static final long serialVersionUID = 1L;
+
+ protected TraitBean trait;
+
+ public TraitBean getTrait() {
+ return trait;
+ }
+
+ public void setTrait(TraitBean trait) {
+ this.trait = trait;
+ }
+}
Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/CatchBean.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/SexBean.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/SexBean.java (rev 0)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/SexBean.java 2012-11-25 18:23:49 UTC (rev 18)
@@ -0,0 +1,46 @@
+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%
+ */
+
+/**
+ * Represents a sex.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.1
+ */
+public class SexBean extends AbstractTuttiBean {
+
+ private static final long serialVersionUID = 1L;
+
+ protected String name;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+}
Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/SexBean.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/SpeciesBean.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/SpeciesBean.java (rev 0)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/SpeciesBean.java 2012-11-25 18:23:49 UTC (rev 18)
@@ -0,0 +1,56 @@
+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%
+ */
+
+/**
+ * Represents a fishes species.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.1
+ */
+public class SpeciesBean extends AbstractTuttiBean {
+
+ private static final long serialVersionUID = 1L;
+
+ protected String codeMemo;
+
+ protected String genusSpecies;
+
+ public String getCodeMemo() {
+ return codeMemo;
+ }
+
+ public void setCodeMemo(String codeMemo) {
+ this.codeMemo = codeMemo;
+ }
+
+ public String getGenusSpecies() {
+ return genusSpecies;
+ }
+
+ public void setGenusSpecies(String genusSpecies) {
+ this.genusSpecies = genusSpecies;
+ }
+}
Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/SpeciesBean.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
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-24 13:39:59 UTC (rev 17)
+++ trunk/tutti-persistence-dev/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceDevFixtures.java 2012-11-25 18:23:49 UTC (rev 18)
@@ -27,9 +27,12 @@
import com.google.common.collect.Lists;
import fr.ifremer.tutti.persistence.entities.BeaufortScaleBean;
import fr.ifremer.tutti.persistence.entities.CampaignBean;
+import fr.ifremer.tutti.persistence.entities.CatchBean;
import fr.ifremer.tutti.persistence.entities.CountryBean;
import fr.ifremer.tutti.persistence.entities.GearBean;
import fr.ifremer.tutti.persistence.entities.SeaStateBean;
+import fr.ifremer.tutti.persistence.entities.SexBean;
+import fr.ifremer.tutti.persistence.entities.SpeciesBean;
import fr.ifremer.tutti.persistence.entities.StrataBean;
import fr.ifremer.tutti.persistence.entities.SurveyBean;
import fr.ifremer.tutti.persistence.entities.TraitBean;
@@ -70,7 +73,14 @@
protected final List<BeaufortScaleBean> beaufortScale = Lists.newArrayList();
+ protected final List<SpeciesBean> species = Lists.newArrayList();
+
+ protected final List<CatchBean> catches = Lists.newArrayList();
+
+ protected final List<SexBean> sex = Lists.newArrayList();
+
public TuttiPersistenceDevFixtures() {
+
// inject default datas
ZoneBean b;
@@ -85,15 +95,14 @@
zone.add(b);
CountryBean c;
-
c = new CountryBean();
c.setId(UUID.randomUUID().toString());
- c.setName("france");
+ c.setName("France");
country.add(c);
c = new CountryBean();
c.setId(UUID.randomUUID().toString());
- c.setName("espagne");
+ c.setName("Espagne");
country.add(c);
VesselBean v;
@@ -234,6 +243,53 @@
st.setId(UUID.randomUUID().toString());
st.setName("Mer agitée");
seaState.add(st);
+
+ SpeciesBean sp;
+
+ sp = new SpeciesBean();
+ sp.setId(UUID.randomUUID().toString());
+ sp.setCodeMemo("BAR");
+ sp.setGenusSpecies("Bar");
+ species.add(sp);
+
+ sp = new SpeciesBean();
+ sp.setId(UUID.randomUUID().toString());
+ sp.setCodeMemo("CHIN");
+ sp.setGenusSpecies("Chinchard");
+ species.add(sp);
+
+ sp = new SpeciesBean();
+ sp.setId(UUID.randomUUID().toString());
+ sp.setCodeMemo("FLE");
+ sp.setGenusSpecies("Flet");
+ species.add(sp);
+
+ sp = new SpeciesBean();
+ sp.setId(UUID.randomUUID().toString());
+ sp.setCodeMemo("LIM");
+ sp.setGenusSpecies("Limande");
+ species.add(sp);
+
+ SexBean se;
+ se = new SexBean();
+ se.setId(UUID.randomUUID().toString());
+ se.setName("Male");
+ sex.add(se);
+
+ se = new SexBean();
+ se.setId(UUID.randomUUID().toString());
+ se.setName("Male");
+ sex.add(se);
+
+ se = new SexBean();
+ se.setId(UUID.randomUUID().toString());
+ se.setName("Femelle");
+ sex.add(se);
+
+ se = new SexBean();
+ se.setId(UUID.randomUUID().toString());
+ se.setName("Indéterminé");
+ sex.add(se);
}
public List<CampaignBean> campaign() {
@@ -279,4 +335,16 @@
public List<BeaufortScaleBean> beaufortScale() {
return beaufortScale;
}
+
+ public List<SpeciesBean> species() {
+ return species;
+ }
+
+ public List<CatchBean> catches() {
+ return catches;
+ }
+
+ public List<SexBean> sex() {
+ return sex;
+ }
}
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-24 13:39:59 UTC (rev 17)
+++ trunk/tutti-persistence-dev/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceDevImpl.java 2012-11-25 18:23:49 UTC (rev 18)
@@ -32,9 +32,12 @@
import fr.ifremer.tutti.persistence.entities.AbstractTuttiBean;
import fr.ifremer.tutti.persistence.entities.BeaufortScaleBean;
import fr.ifremer.tutti.persistence.entities.CampaignBean;
+import fr.ifremer.tutti.persistence.entities.CatchBean;
import fr.ifremer.tutti.persistence.entities.CountryBean;
import fr.ifremer.tutti.persistence.entities.GearBean;
import fr.ifremer.tutti.persistence.entities.SeaStateBean;
+import fr.ifremer.tutti.persistence.entities.SexBean;
+import fr.ifremer.tutti.persistence.entities.SpeciesBean;
import fr.ifremer.tutti.persistence.entities.StrataBean;
import fr.ifremer.tutti.persistence.entities.SurveyBean;
import fr.ifremer.tutti.persistence.entities.TraitBean;
@@ -92,6 +95,11 @@
protected final List<BeaufortScaleBean> beaufortScale = Lists.newArrayList();
+ protected final List<SpeciesBean> species = Lists.newArrayList();
+
+ protected final List<CatchBean> catches = Lists.newArrayList();
+ protected final List<SexBean> sex= Lists.newArrayList();
+
@Override
public String getImplementationName() {
return "Persistence Dev implementation";
@@ -120,6 +128,9 @@
strata.clear();
seaState.clear();
beaufortScale.clear();
+ species.clear();
+ catches.clear();
+ sex.clear();
TuttiPersistenceDevFixtures fixtures =
new TuttiPersistenceDevFixtures();
@@ -135,6 +146,9 @@
strata.addAll(loadEntities(StrataBean.class, fixtures.strata()));
seaState.addAll(loadEntities(SeaStateBean.class, fixtures.seaState()));
beaufortScale.addAll(loadEntities(BeaufortScaleBean.class, fixtures.beaufortScale()));
+ species.addAll(loadEntities(SpeciesBean.class, fixtures.species()));
+ catches.addAll(loadEntities(CatchBean.class, fixtures.catches()));
+ sex.addAll(loadEntities(SexBean.class, fixtures.sex()));
}
@Override
@@ -151,9 +165,24 @@
persistToFile(StrataBean.class, strata);
persistToFile(SeaStateBean.class, seaState);
persistToFile(BeaufortScaleBean.class, beaufortScale);
+ persistToFile(SpeciesBean.class, species);
+ persistToFile(CatchBean.class, catches);
+ persistToFile(SexBean.class, sex);
}
@Override
+ public List<SexBean> getAllSex() {
+ List<SexBean> result = Lists.newArrayList(sex);
+ return result;
+ }
+
+ @Override
+ public List<SpeciesBean> getAllSpecies() {
+ List<SpeciesBean> result = Lists.newArrayList(species);
+ return result;
+ }
+
+ @Override
public List<SurveyBean> getAllSurveys() {
List<SurveyBean> result = Lists.newArrayList(survey);
return result;
@@ -231,6 +260,17 @@
}
@Override
+ public List<CatchBean> getAllCatches(final String traitId) {
+ List<CatchBean> result = Lists.newArrayList(Iterables.filter(catches, new Predicate<CatchBean>() {
+ @Override
+ public boolean apply(CatchBean input) {
+ return traitId.equals(input.getTrait().getId());
+ }
+ }));
+ return result;
+ }
+
+ @Override
public SurveyBean getSurvey(String surveyId) {
SurveyBean result = TuttiBeans.findById(survey, surveyId);
return result;
Added: trunk/tutti-persistence-dev/src/main/java/fr/ifremer/tutti/persistence/config/TopiaPersistenceDevConfigProvider.java
===================================================================
--- trunk/tutti-persistence-dev/src/main/java/fr/ifremer/tutti/persistence/config/TopiaPersistenceDevConfigProvider.java (rev 0)
+++ trunk/tutti-persistence-dev/src/main/java/fr/ifremer/tutti/persistence/config/TopiaPersistenceDevConfigProvider.java 2012-11-25 18:23:49 UTC (rev 18)
@@ -0,0 +1,59 @@
+package fr.ifremer.tutti.persistence.config;
+
+/*
+ * #%L
+ * Tutti :: Persistence Dev (impl)
+ * $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 org.nuiton.util.ApplicationConfig;
+import org.nuiton.util.ApplicationConfigProvider;
+
+import java.util.Locale;
+
+/**
+ * Persistence config provider (for site generation).
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.1
+ */
+public class TopiaPersistenceDevConfigProvider implements ApplicationConfigProvider {
+
+ @Override
+ public String getName() {
+ return "tutti-persistence";
+ }
+
+ @Override
+ public String getDescription(Locale locale) {
+ return "Configuration de la persistence de Tutti";
+ }
+
+ @Override
+ public ApplicationConfig.OptionDef[] getOptions() {
+ return TuttiPersistenceDevConfigOption.values();
+ }
+
+ @Override
+ public ApplicationConfig.ActionDef[] getActions() {
+ return new ApplicationConfig.ActionDef[0];
+ }
+}
Property changes on: trunk/tutti-persistence-dev/src/main/java/fr/ifremer/tutti/persistence/config/TopiaPersistenceDevConfigProvider.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/tutti-persistence-dev/src/main/resources/META-INF/services/org.nuiton.util.ApplicationConfigProvider
===================================================================
--- trunk/tutti-persistence-dev/src/main/resources/META-INF/services/org.nuiton.util.ApplicationConfigProvider (rev 0)
+++ trunk/tutti-persistence-dev/src/main/resources/META-INF/services/org.nuiton.util.ApplicationConfigProvider 2012-11-25 18:23:49 UTC (rev 18)
@@ -0,0 +1 @@
+fr.ifremer.tutti.persistence.config.TopiaPersistenceDevConfigProvider
\ No newline at end of file
Property changes on: trunk/tutti-persistence-dev/src/main/resources/META-INF/services/org.nuiton.util.ApplicationConfigProvider
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
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-24 13:39:59 UTC (rev 17)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/DecoratorService.java 2012-11-25 18:23:49 UTC (rev 18)
@@ -29,6 +29,8 @@
import fr.ifremer.tutti.persistence.entities.CountryBean;
import fr.ifremer.tutti.persistence.entities.GearBean;
import fr.ifremer.tutti.persistence.entities.SeaStateBean;
+import fr.ifremer.tutti.persistence.entities.SexBean;
+import fr.ifremer.tutti.persistence.entities.SpeciesBean;
import fr.ifremer.tutti.persistence.entities.StrataBean;
import fr.ifremer.tutti.persistence.entities.SurveyBean;
import fr.ifremer.tutti.persistence.entities.TraitBean;
@@ -86,6 +88,8 @@
registerMultiJXPathDecorator(BeaufortScaleBean.class, "${name}$s", "#", " - ");
registerMultiJXPathDecorator(SeaStateBean.class, "${name}$s", "#", " - ");
registerMultiJXPathDecorator(StrataBean.class, "${name}$s", "#", " - ");
+ registerMultiJXPathDecorator(SexBean.class, "${name}$s", "#", " - ");
+ registerMultiJXPathDecorator(SpeciesBean.class, "${codeMemo}#${genusSpecies}$s", "#", " - ");
}
};
@@ -106,6 +110,8 @@
n_("tutti.property.beaufortScaleBean");
n_("tutti.property.seaStateBean");
n_("tutti.property.strataBean");
+ n_("tutti.property.codeMemo");
+ n_("tutti.property.genusSpecies");
}
}
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java 2012-11-24 13:39:59 UTC (rev 17)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java 2012-11-25 18:23:49 UTC (rev 18)
@@ -28,9 +28,12 @@
import fr.ifremer.tutti.persistence.TuttiPersistence;
import fr.ifremer.tutti.persistence.entities.BeaufortScaleBean;
import fr.ifremer.tutti.persistence.entities.CampaignBean;
+import fr.ifremer.tutti.persistence.entities.CatchBean;
import fr.ifremer.tutti.persistence.entities.CountryBean;
import fr.ifremer.tutti.persistence.entities.GearBean;
import fr.ifremer.tutti.persistence.entities.SeaStateBean;
+import fr.ifremer.tutti.persistence.entities.SexBean;
+import fr.ifremer.tutti.persistence.entities.SpeciesBean;
import fr.ifremer.tutti.persistence.entities.StrataBean;
import fr.ifremer.tutti.persistence.entities.SurveyBean;
import fr.ifremer.tutti.persistence.entities.TraitBean;
@@ -110,6 +113,18 @@
}
@Override
+ public List<SexBean> getAllSex() {
+ checkDriverExists();
+ return driver.getAllSex();
+ }
+
+ @Override
+ public List<SpeciesBean> getAllSpecies() {
+ checkDriverExists();
+ return driver.getAllSpecies();
+ }
+
+ @Override
public String getImplementationName() {
checkDriverExists();
return driver.getImplementationName();
@@ -182,6 +197,12 @@
}
@Override
+ public List<CatchBean> getAllCatches(String traitId) {
+ checkDriverExists();
+ return driver.getAllCatches(traitId);
+ }
+
+ @Override
public SurveyBean getSurvey(String surveyId) {
checkDriverExists();
return driver.getSurvey(surveyId);
Modified: trunk/tutti-service/src/main/resources/i18n/tutti-service_fr_FR.properties
===================================================================
--- trunk/tutti-service/src/main/resources/i18n/tutti-service_fr_FR.properties 2012-11-24 13:39:59 UTC (rev 17)
+++ trunk/tutti-service/src/main/resources/i18n/tutti-service_fr_FR.properties 2012-11-25 18:23:49 UTC (rev 18)
@@ -8,9 +8,11 @@
tutti.config.ui.config=Chemin du fichier de configuration des interfaces graphiques
tutti.property.beaufortScaleBean=Vent beaufort
tutti.property.campaignBean=Campagne
+tutti.property.codeMemo=Code Memo
tutti.property.countryBean=Pays
tutti.property.date=Date
tutti.property.gearBean=Engin
+tutti.property.genusSpecies=Nom scientifique
tutti.property.name=Nom
tutti.property.seaStateBean=État de la mer
tutti.property.stationNumber=Numéro de station
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/campaign/EditCampaignUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/campaign/EditCampaignUI.css 2012-11-24 13:39:59 UTC (rev 17)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/campaign/EditCampaignUI.css 2012-11-25 18:23:49 UTC (rev 18)
@@ -151,6 +151,11 @@
text:"tutti.action.cancel";
}
+#importCasinoButton {
+ actionIcon:"casion-import";
+ text:"tutti.action.casino-import";
+}
+
#messagePanel {
border:{BorderFactory.createTitledBorder("Messages")};
height:200;
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-24 13:39:59 UTC (rev 17)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/campaign/EditCampaignUI.jaxx 2012-11-25 18:23:49 UTC (rev 18)
@@ -184,9 +184,17 @@
</cell>
</row>
- <!-- Actions -->
+ <!-- Import Actions -->
<row>
<cell columns='2'>
+ <JButton id='importCasinoButton'
+ onActionPerformed='handler.importCasino()'/>
+ </cell>
+ </row>
+
+ <!-- Form Actions -->
+ <row>
+ <cell columns='2'>
<JPanel layout='{new GridLayout(1, 0)}'>
<JButton id='cancelButton' onActionPerformed='handler.cancel()'/>
<JButton id='saveButton' onActionPerformed='handler.save()'/>
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-24 13:39:59 UTC (rev 17)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/campaign/EditCampaignUIHandler.java 2012-11-25 18:23:49 UTC (rev 18)
@@ -150,4 +150,8 @@
context.setScreen(TuttiScreen.SELECT_CAMPAIGN);
}
+ public void importCasino() {
+
+ }
+
}
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-24 13:39:59 UTC (rev 17)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/CatchesUI.jaxx 2012-11-25 18:23:49 UTC (rev 18)
@@ -68,10 +68,10 @@
<JTabbedPane id='tabPane' constraints='BorderLayout.CENTER'>
<tab id='traitTab' title='tutti.label.tab.trait'>
- <TraitTabUI id='traitTabContent' constructorParams='this'/>
+ <TraitTabUI id='traitTabContent' constructorParams='this'/>
</tab>
<tab id='fishesTab' title='tutti.label.tab.fishes'>
- <JLabel text='tutti.to.be.done' horizontalAlignment='{JLabel.CENTER}'/>
+ <FishesTabUI id='fishesTabContent' constructorParams='this'/>
</tab>
<tab id='benthosTab' title='tutti.label.tab.benthos'>
<JLabel text='tutti.to.be.done' horizontalAlignment='{JLabel.CENTER}'/>
Added: 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 (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/FishesTabUI.css 2012-11-25 18:23:49 UTC (rev 18)
@@ -0,0 +1,70 @@
+/*
+ * #%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};
+}
+
+#fishesTable {
+ model:{new FishesTableModel()};
+}
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/FishesTabUI.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/FishesTabUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/FishesTabUI.jaxx (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/FishesTabUI.jaxx 2012-11-25 18:23:49 UTC (rev 18)
@@ -0,0 +1,102 @@
+<!--
+ #%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
+
+ 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='fishesTable'/>
+ </JScrollPane>
+
+</JPanel>
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/FishesTabUI.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/FishesTabUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/FishesTabUIHandler.java (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/FishesTabUIHandler.java 2012-11-25 18:23:49 UTC (rev 18)
@@ -0,0 +1,113 @@
+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 fr.ifremer.tutti.service.PersistenceService;
+import fr.ifremer.tutti.ui.swing.AbstractTuttiUIHandler;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import java.util.List;
+
+/**
+ * @author tchemit <chemit(a)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);
+ }
+
+ @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");
+ }
+ }
+}
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/FishesTabUIHandler.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/FishesTabUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/FishesTabUIModel.java (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/FishesTabUIModel.java 2012-11-25 18:23:49 UTC (rev 18)
@@ -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.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(a)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;
+ }
+}
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/FishesTabUIModel.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/FishesTableModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/FishesTableModel.java (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/FishesTableModel.java 2012-11-25 18:23:49 UTC (rev 18)
@@ -0,0 +1,53 @@
+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 javax.swing.table.AbstractTableModel;
+
+/**
+ * TODO
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.1
+ */
+public class FishesTableModel extends AbstractTableModel {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public int getRowCount() {
+ return 0;
+ }
+
+ @Override
+ public int getColumnCount() {
+ return 0;
+ }
+
+ @Override
+ public Object getValueAt(int rowIndex, int columnIndex) {
+ return null;
+ }
+}
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/FishesTableModel.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
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-24 13:39:59 UTC (rev 17)
+++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2012-11-25 18:23:49 UTC (rev 18)
@@ -3,6 +3,7 @@
tutti.action.about=A propos
tutti.action.about.tip=A Propos
tutti.action.cancel=Annuler
+tutti.action.casino-import=Import Casino
tutti.action.catches=Captures
tutti.action.configuration=Configuration
tutti.action.configuration.tip=Configurer Tutti
@@ -52,6 +53,7 @@
tutti.label.list.saisisseur=Nom des saisisseurs
tutti.label.list.vessel=Navire(s)
tutti.label.no.trait.selected=< Aucun trait sélectionné >
+tutti.label.sampleVracWeightTotalHorsVracWeight=Poids total vrac échant. / total hors vrac
tutti.label.survey=Série de campagne
tutti.label.survey.name=Nom
tutti.label.survey.zone=Zone
@@ -65,6 +67,7 @@
tutti.label.tab.trait.gearShooting=Données de traine
tutti.label.tab.trait.general=Caractéristiques
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
Added: trunk/tutti-ui-swing/src/main/resources/icons/action-casino-import.png
===================================================================
(Binary files differ)
Property changes on: trunk/tutti-ui-swing/src/main/resources/icons/action-casino-import.png
___________________________________________________________________
Added: svn:mime-type
+ image/png
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: trunk/tutti-ui-swing/src/main/resources/icons/action-local-export.png
===================================================================
(Binary files differ)
Property changes on: trunk/tutti-ui-swing/src/main/resources/icons/action-local-export.png
___________________________________________________________________
Added: svn:mime-type
+ image/png
Added: svn:keywords
+ Author Date Id Revision HeadURL
1
0
Author: tchemit
Date: 2012-11-24 14:39:59 +0100 (Sat, 24 Nov 2012)
New Revision: 17
Url: http://forge.codelutin.com/repositories/revision/tutti/17
Log:
fix organisation url
Modified:
trunk/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2012-11-24 13:21:36 UTC (rev 16)
+++ trunk/pom.xml 2012-11-24 13:39:59 UTC (rev 17)
@@ -31,7 +31,7 @@
<organization>
<name>Ifremer</name>
- <url>http://ifremer.fr/</url>
+ <url>http://www.ifremer.fr/</url>
</organization>
<licenses>
1
0
r16 - in trunk: tutti-persistence tutti-ui-swing tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing tutti-ui-swing/src/main/resources/i18n
by tchemit@users.forge.codelutin.com 24 Nov '12
by tchemit@users.forge.codelutin.com 24 Nov '12
24 Nov '12
Author: tchemit
Date: 2012-11-24 14:21:36 +0100 (Sat, 24 Nov 2012)
New Revision: 16
Url: http://forge.codelutin.com/repositories/revision/tutti/16
Log:
optimize dependencies + add missing svn properties + license header
Modified:
trunk/tutti-persistence/pom.xml
trunk/tutti-ui-swing/pom.xml
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/AbstractTuttiBeanUIModel.java
trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties
Modified: trunk/tutti-persistence/pom.xml
===================================================================
--- trunk/tutti-persistence/pom.xml 2012-11-24 13:10:24 UTC (rev 15)
+++ trunk/tutti-persistence/pom.xml 2012-11-24 13:21:36 UTC (rev 16)
@@ -28,11 +28,6 @@
<artifactId>guava</artifactId>
</dependency>
- <dependency>
- <groupId>org.swinglabs.swingx</groupId>
- <artifactId>swingx-common</artifactId>
- </dependency>
-
</dependencies>
Modified: trunk/tutti-ui-swing/pom.xml
===================================================================
--- trunk/tutti-ui-swing/pom.xml 2012-11-24 13:10:24 UTC (rev 15)
+++ trunk/tutti-ui-swing/pom.xml 2012-11-24 13:21:36 UTC (rev 16)
@@ -215,6 +215,11 @@
</dependency>
<dependency>
+ <groupId>commons-collections</groupId>
+ <artifactId>commons-collections</artifactId>
+ </dependency>
+
+ <dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</dependency>
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/AbstractTuttiBeanUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/AbstractTuttiBeanUIModel.java 2012-11-24 13:10:24 UTC (rev 15)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/AbstractTuttiBeanUIModel.java 2012-11-24 13:21:36 UTC (rev 16)
@@ -1,5 +1,29 @@
package fr.ifremer.tutti.ui.swing;
+/*
+ * #%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 org.jdesktop.beans.AbstractSerializableBean;
/**
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/AbstractTuttiBeanUIModel.java
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
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-24 13:10:24 UTC (rev 15)
+++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2012-11-24 13:21:36 UTC (rev 16)
@@ -1,8 +1,5 @@
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.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.cancel=Annuler
1
0