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
- 4130 discussions
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
24 Nov '12
Author: tchemit
Date: 2012-11-24 14:10:24 +0100 (Sat, 24 Nov 2012)
New Revision: 15
Url: http://forge.codelutin.com/repositories/revision/tutti/15
Log:
- remove codelutin from copyright
- finish trait editform
- improve ui forms
Added:
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/AbstractTuttiBean.java
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/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/java/fr/ifremer/tutti/ui/swing/content/catches/TraitTabUIModel.java
trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/catches/
trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/catches/TraitTabUIModel-error-validation.xml
Removed:
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/AbstractTuttiEntity.java
trunk/tutti-service/src/main/java/fr/ifremer/tutti/application/
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/TraitConfigTabUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/TraitConfigTabUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/TraitConfigTabUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/TraitConfigTabUIModel.java
Modified:
trunk/pom.xml
trunk/src/site/rst/index.rst
trunk/src/site/site_fr.xml
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/main/java/fr/ifremer/tutti/persistence/config/TuttiPersistenceDevConfig.java
trunk/tutti-persistence-dev/src/main/java/fr/ifremer/tutti/persistence/config/TuttiPersistenceDevConfigOption.java
trunk/tutti-persistence-dev/src/test/java/fr/ifremer/tutti/persistence/TuttiPersistenceDevImplTest.java
trunk/tutti-persistence-dev/src/test/resources/log4j.properties
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistence.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/BeaufortScaleBean.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/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/StrataBean.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-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TuttiBeans.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
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/AbstractTuttiService.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/java/fr/ifremer/tutti/service/TuttiService.java
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/TuttiServiceContext.java
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/TuttiServiceTechnicalException.java
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/config/TuttiServiceConfig.java
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/config/TuttiServiceConfigOption.java
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/config/TuttiServiceConfigProvider.java
trunk/tutti-service/src/main/resources/i18n/tutti-service_fr_FR.properties
trunk/tutti-ui-swing/pom.xml
trunk/tutti-ui-swing/src/main/assembly/bin.xml
trunk/tutti-ui-swing/src/main/filtered-resources/tutti.properties
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/MainUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/MainUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/MainUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/RunTutti.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiScreen.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiUI.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiUIContext.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/config/TuttiApplicationConfigProvider.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/config/TuttiConfig.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/config/TuttiConfigOption.java
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/campaign/EditCampaignUIModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/campaign/EditSurveyUI.css
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/EditSurveyUIHandler.java
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/SelectCampaignUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/campaign/SelectCampaignUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/campaign/SelectCampaignUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/campaign/SelectCampaignUIModel.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/CatchesUIModel.java
trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/campaign/EditCampaignUIModel-error-validation.xml
trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/campaign/EditSurveyUIModel-error-validation.xml
trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties
trunk/tutti-ui-swing/src/main/resources/log4j.properties
trunk/tutti-ui-swing/src/main/resources/validators.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2012-11-23 22:18:17 UTC (rev 14)
+++ trunk/pom.xml 2012-11-24 13:10:24 UTC (rev 15)
@@ -106,9 +106,7 @@
<relativizeDecorationLinks>false</relativizeDecorationLinks>
<!-- license header configuration -->
- <license.organizationName>
- Ifremer, Code Lutin
- </license.organizationName>
+ <license.organizationName>Ifremer</license.organizationName>
<license.licenseName>gpl_v3</license.licenseName>
</properties>
Modified: trunk/src/site/rst/index.rst
===================================================================
--- trunk/src/site/rst/index.rst 2012-11-23 22:18:17 UTC (rev 14)
+++ trunk/src/site/rst/index.rst 2012-11-24 13:10:24 UTC (rev 15)
@@ -4,7 +4,7 @@
.. * $Id$
.. * $HeadURL$
.. * %%
-.. * Copyright (C) 2012 Ifremer, Code Lutin
+.. * 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
@@ -21,6 +21,7 @@
.. * <http://www.gnu.org/licenses/gpl-3.0.html>.
.. * #L%
.. -
+
=====
Tutti
=====
Modified: trunk/src/site/site_fr.xml
===================================================================
--- trunk/src/site/site_fr.xml 2012-11-23 22:18:17 UTC (rev 14)
+++ trunk/src/site/site_fr.xml 2012-11-24 13:10:24 UTC (rev 15)
@@ -5,7 +5,7 @@
$Id$
$HeadURL$
%%
- Copyright (C) 2012 Ifremer, Code Lutin
+ 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
@@ -23,7 +23,6 @@
#L%
-->
-
<project name="${project.name}">
<skin>
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-23 22:18:17 UTC (rev 14)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistence.java 2012-11-24 13:10:24 UTC (rev 15)
@@ -6,7 +6,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2012 Ifremer, Code Lutin
+ * 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
Copied: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/AbstractTuttiBean.java (from rev 12, trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/AbstractTuttiEntity.java)
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/AbstractTuttiBean.java (rev 0)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/AbstractTuttiBean.java 2012-11-24 13:10:24 UTC (rev 15)
@@ -0,0 +1,48 @@
+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 java.io.Serializable;
+
+/**
+ * Abstract tutti bean.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.1
+ */
+public abstract class AbstractTuttiBean implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ protected String id;
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+}
\ No newline at end of file
Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/AbstractTuttiBean.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/AbstractTuttiEntity.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/AbstractTuttiEntity.java 2012-11-23 22:18:17 UTC (rev 14)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/AbstractTuttiEntity.java 2012-11-24 13:10:24 UTC (rev 15)
@@ -1,52 +0,0 @@
-package fr.ifremer.tutti.persistence.entities;
-
-/*
- * #%L
- * Tutti :: Persistence API
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2012 Ifremer, Code Lutin
- * %%
- * 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;
-
-/**
- * TODO
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.1
- */
-public class AbstractTuttiEntity extends AbstractSerializableBean {
-
- private static final long serialVersionUID = 1L;
-
- public static final String PROPERTY_ID = "id";
-
- protected String id;
-
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- Object oldValue = getId();
- this.id = id;
- firePropertyChange(PROPERTY_ID, oldValue, id);
- }
-}
\ No newline at end of file
Modified: 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-23 22:18:17 UTC (rev 14)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/BeaufortScaleBean.java 2012-11-24 13:10:24 UTC (rev 15)
@@ -6,7 +6,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2012 Ifremer, Code Lutin
+ * 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
@@ -25,12 +25,12 @@
*/
/**
- * Represents the beaufort scale.
+ * Represents a beaufort scale.
*
* @author tchemit <chemit(a)codelutin.com>
* @since 0.1
*/
-public class BeaufortScaleBean extends AbstractTuttiEntity {
+public class BeaufortScaleBean extends AbstractTuttiBean {
private static final long serialVersionUID = 1L;
@@ -41,9 +41,7 @@
}
public void setName(String name) {
- Object oldValue = getName();
this.name = name;
- firePropertyChange("name", oldValue, 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-23 22:18:17 UTC (rev 14)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/CampaignBean.java 2012-11-24 13:10:24 UTC (rev 15)
@@ -6,7 +6,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2012 Ifremer, Code Lutin
+ * 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
@@ -32,7 +32,7 @@
* @author tchemit <chemit(a)codelutin.com>
* @since 0.1
*/
-public class CampaignBean extends AbstractTuttiEntity {
+public class CampaignBean extends AbstractTuttiBean {
private static final long serialVersionUID = 1L;
Modified: 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-23 22:18:17 UTC (rev 14)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/CountryBean.java 2012-11-24 13:10:24 UTC (rev 15)
@@ -6,7 +6,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2012 Ifremer, Code Lutin
+ * 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
@@ -30,7 +30,7 @@
* @author tchemit <chemit(a)codelutin.com>
* @since 0.1
*/
-public class CountryBean extends AbstractTuttiEntity {
+public class CountryBean extends AbstractTuttiBean {
private static final long serialVersionUID = 1L;
@@ -41,9 +41,7 @@
}
public void setName(String name) {
- Object oldValue = getName();
this.name = name;
- firePropertyChange("name", oldValue, name);
}
}
\ No newline at end of file
Modified: 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-23 22:18:17 UTC (rev 14)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/GearBean.java 2012-11-24 13:10:24 UTC (rev 15)
@@ -6,7 +6,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2012 Ifremer, Code Lutin
+ * 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
@@ -30,7 +30,7 @@
* @author tchemit <chemit(a)codelutin.com>
* @since 0.1
*/
-public class GearBean extends AbstractTuttiEntity {
+public class GearBean extends AbstractTuttiBean {
private static final long serialVersionUID = 1L;
@@ -41,9 +41,7 @@
}
public void setName(String name) {
- Object oldValue = getName();
this.name = name;
- firePropertyChange("name", oldValue, name);
}
}
\ No newline at end of file
Modified: 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-23 22:18:17 UTC (rev 14)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/SeaStateBean.java 2012-11-24 13:10:24 UTC (rev 15)
@@ -6,7 +6,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2012 Ifremer, Code Lutin
+ * 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
@@ -30,7 +30,7 @@
* @author tchemit <chemit(a)codelutin.com>
* @since 0.1
*/
-public class SeaStateBean extends AbstractTuttiEntity {
+public class SeaStateBean extends AbstractTuttiBean {
private static final long serialVersionUID = 1L;
@@ -41,9 +41,7 @@
}
public void setName(String name) {
- Object oldValue = getName();
this.name = name;
- firePropertyChange("name", oldValue, name);
}
}
\ No newline at end of file
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/StrataBean.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/StrataBean.java 2012-11-23 22:18:17 UTC (rev 14)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/StrataBean.java 2012-11-24 13:10:24 UTC (rev 15)
@@ -6,7 +6,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2012 Ifremer, Code Lutin
+ * 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
@@ -30,7 +30,7 @@
* @author tchemit <chemit(a)codelutin.com>
* @since 0.1
*/
-public class StrataBean extends AbstractTuttiEntity {
+public class StrataBean extends AbstractTuttiBean {
private static final long serialVersionUID = 1L;
@@ -41,9 +41,7 @@
}
public void setName(String name) {
- Object oldValue = getName();
this.name = name;
- firePropertyChange("name", oldValue, name);
}
}
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-23 22:18:17 UTC (rev 14)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/SurveyBean.java 2012-11-24 13:10:24 UTC (rev 15)
@@ -6,7 +6,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2012 Ifremer, Code Lutin
+ * 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
@@ -30,7 +30,7 @@
* @author tchemit <chemit(a)codelutin.com>
* @since 0.1
*/
-public class SurveyBean extends AbstractTuttiEntity {
+public class SurveyBean extends AbstractTuttiBean {
private static final long serialVersionUID = 1L;
@@ -45,9 +45,7 @@
}
public void setName(String name) {
- Object oldValue = getName();
this.name = name;
- firePropertyChange("name", oldValue, name);
}
public String getComment() {
@@ -55,9 +53,7 @@
}
public void setComment(String comment) {
- Object oldValue = getComment();
this.comment = comment;
- firePropertyChange("comment", oldValue, comment);
}
public ZoneBean getZone() {
@@ -65,8 +61,6 @@
}
public void setZone(ZoneBean zone) {
- Object oldValue = getZone();
this.zone = zone;
- firePropertyChange("zone", oldValue, zone);
}
}
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-23 22:18:17 UTC (rev 14)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitBean.java 2012-11-24 13:10:24 UTC (rev 15)
@@ -6,7 +6,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2012 Ifremer, Code Lutin
+ * 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
@@ -33,7 +33,7 @@
* @author tchemit <chemit(a)codelutin.com>
* @since 0.1
*/
-public class TraitBean extends AbstractTuttiEntity {
+public class TraitBean extends AbstractTuttiBean {
private static final long serialVersionUID = 1L;
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-23 22:18:17 UTC (rev 14)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TuttiBeans.java 2012-11-24 13:10:24 UTC (rev 15)
@@ -6,7 +6,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2012 Ifremer, Code Lutin
+ * 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
@@ -37,11 +37,11 @@
*/
public class TuttiBeans {
- public static <B extends AbstractTuttiEntity> Predicate<B> newIdPredicate(String id) {
+ public static <B extends AbstractTuttiBean> Predicate<B> newIdPredicate(String id) {
return new IdPredicate<B>(id);
}
- public static <B extends AbstractTuttiEntity> B findById(Collection<B> beans,
+ public static <B extends AbstractTuttiBean> B findById(Collection<B> beans,
String id) {
B result = Iterables.tryFind(beans, newIdPredicate(id)).orNull();
return result;
@@ -51,7 +51,7 @@
// helper class does not instanciate
}
- protected static class IdPredicate<B extends AbstractTuttiEntity> implements Predicate<B> {
+ protected static class IdPredicate<B extends AbstractTuttiBean> implements Predicate<B> {
private final String id;
Modified: 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-23 22:18:17 UTC (rev 14)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/UserBean.java 2012-11-24 13:10:24 UTC (rev 15)
@@ -6,7 +6,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2012 Ifremer, Code Lutin
+ * 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
@@ -30,7 +30,7 @@
* @author tchemit <chemit(a)codelutin.com>
* @since 0.1
*/
-public class UserBean extends AbstractTuttiEntity {
+public class UserBean extends AbstractTuttiBean {
private static final long serialVersionUID = 1L;
@@ -41,9 +41,7 @@
}
public void setName(String name) {
- Object oldValue = getName();
this.name = name;
- firePropertyChange("name", oldValue, name);
}
}
\ No newline at end of file
Modified: 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-23 22:18:17 UTC (rev 14)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/VesselBean.java 2012-11-24 13:10:24 UTC (rev 15)
@@ -6,7 +6,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2012 Ifremer, Code Lutin
+ * 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
@@ -30,7 +30,7 @@
* @author tchemit <chemit(a)codelutin.com>
* @since 0.1
*/
-public class VesselBean extends AbstractTuttiEntity {
+public class VesselBean extends AbstractTuttiBean {
private static final long serialVersionUID = 1L;
@@ -41,9 +41,7 @@
}
public void setName(String name) {
- Object oldValue = getName();
this.name = name;
- firePropertyChange("name", oldValue, name);
}
}
\ No newline at end of file
Modified: 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-23 22:18:17 UTC (rev 14)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/ZoneBean.java 2012-11-24 13:10:24 UTC (rev 15)
@@ -6,7 +6,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2012 Ifremer, Code Lutin
+ * 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
@@ -30,7 +30,7 @@
* @author tchemit <chemit(a)codelutin.com>
* @since 0.1
*/
-public class ZoneBean extends AbstractTuttiEntity {
+public class ZoneBean extends AbstractTuttiBean {
private static final long serialVersionUID = 1L;
@@ -41,9 +41,7 @@
}
public void setName(String name) {
- Object oldValue = getName();
this.name = name;
- firePropertyChange("name", oldValue, name);
}
}
\ No newline at end of file
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-23 22:18:17 UTC (rev 14)
+++ trunk/tutti-persistence-dev/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceDevFixtures.java 2012-11-24 13:10:24 UTC (rev 15)
@@ -6,7 +6,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2012 Ifremer, Code Lutin
+ * 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
@@ -64,7 +64,6 @@
protected final List<UserBean> user = Lists.newArrayList();
-
protected final List<StrataBean> strata = Lists.newArrayList();
protected final List<SeaStateBean> seaState = Lists.newArrayList();
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-23 22:18:17 UTC (rev 14)
+++ trunk/tutti-persistence-dev/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceDevImpl.java 2012-11-24 13:10:24 UTC (rev 15)
@@ -6,7 +6,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2012 Ifremer, Code Lutin
+ * 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
@@ -29,7 +29,7 @@
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.AbstractTuttiEntity;
+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.CountryBean;
@@ -290,12 +290,12 @@
return result;
}
- protected <B extends AbstractTuttiEntity> void persist(Class<B> beanType,
- B source,
- B target,
- List<B> entities) {
+ protected <B extends AbstractTuttiBean> void persist(Class<B> beanType,
+ B source,
+ B target,
+ List<B> entities) {
BinderFactory.newBinder(beanType).copyExcluding(
- source, target, AbstractTuttiEntity.PROPERTY_ID);
+ source, target, "id");
if (source.getId() == null) {
target.setId(UUID.randomUUID().toString());
}
Modified: trunk/tutti-persistence-dev/src/main/java/fr/ifremer/tutti/persistence/config/TuttiPersistenceDevConfig.java
===================================================================
--- trunk/tutti-persistence-dev/src/main/java/fr/ifremer/tutti/persistence/config/TuttiPersistenceDevConfig.java 2012-11-23 22:18:17 UTC (rev 14)
+++ trunk/tutti-persistence-dev/src/main/java/fr/ifremer/tutti/persistence/config/TuttiPersistenceDevConfig.java 2012-11-24 13:10:24 UTC (rev 15)
@@ -6,7 +6,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2012 Ifremer, Code Lutin
+ * 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
Modified: trunk/tutti-persistence-dev/src/main/java/fr/ifremer/tutti/persistence/config/TuttiPersistenceDevConfigOption.java
===================================================================
--- trunk/tutti-persistence-dev/src/main/java/fr/ifremer/tutti/persistence/config/TuttiPersistenceDevConfigOption.java 2012-11-23 22:18:17 UTC (rev 14)
+++ trunk/tutti-persistence-dev/src/main/java/fr/ifremer/tutti/persistence/config/TuttiPersistenceDevConfigOption.java 2012-11-24 13:10:24 UTC (rev 15)
@@ -6,7 +6,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2012 Ifremer, Code Lutin
+ * 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
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-23 22:18:17 UTC (rev 14)
+++ trunk/tutti-persistence-dev/src/test/java/fr/ifremer/tutti/persistence/TuttiPersistenceDevImplTest.java 2012-11-24 13:10:24 UTC (rev 15)
@@ -6,7 +6,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2012 Ifremer, Code Lutin
+ * 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
Modified: trunk/tutti-persistence-dev/src/test/resources/log4j.properties
===================================================================
--- trunk/tutti-persistence-dev/src/test/resources/log4j.properties 2012-11-23 22:18:17 UTC (rev 14)
+++ trunk/tutti-persistence-dev/src/test/resources/log4j.properties 2012-11-24 13:10:24 UTC (rev 15)
@@ -4,7 +4,7 @@
# $Id$
# $HeadURL$
# %%
-# Copyright (C) 2012 Ifremer, Code Lutin
+# 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
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/AbstractTuttiService.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/AbstractTuttiService.java 2012-11-23 22:18:17 UTC (rev 14)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/AbstractTuttiService.java 2012-11-24 13:10:24 UTC (rev 15)
@@ -6,7 +6,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2012 Ifremer, Code Lutin
+ * 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
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-23 22:18:17 UTC (rev 14)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/DecoratorService.java 2012-11-24 13:10:24 UTC (rev 15)
@@ -6,7 +6,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2012 Ifremer, Code Lutin
+ * 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
@@ -38,6 +38,8 @@
import org.nuiton.util.decorator.Decorator;
import org.nuiton.util.decorator.DecoratorProvider;
+import static org.nuiton.i18n.I18n.n_;
+
/**
* Tutti decorator service.
*
@@ -73,20 +75,37 @@
@Override
protected void loadDecorators() {
- registerMultiJXPathDecorator(SurveyBean.class, "${id}$s#${name}$s", "#", " - ");
- registerMultiJXPathDecorator(CampaignBean.class, "${id}$s#${name}$s", "#", " - ");
- registerMultiJXPathDecorator(TraitBean.class, "${id}$s#${stationNumber}$s", "#", " - ");
- registerMultiJXPathDecorator(ZoneBean.class, "${id}$s#${name}$s", "#", " - ");
- registerMultiJXPathDecorator(VesselBean.class, "${id}$s#${name}$s", "#", " - ");
- registerMultiJXPathDecorator(CountryBean.class, "${id}$s#${name}$s", "#", " - ");
- registerMultiJXPathDecorator(GearBean.class, "${id}$s#${name}$s", "#", " - ");
- registerMultiJXPathDecorator(UserBean.class, "${id}$s#${name}$s", "#", " - ");
- registerMultiJXPathDecorator(BeaufortScaleBean.class, "${id}$s#${name}$s", "#", " - ");
- registerMultiJXPathDecorator(SeaStateBean.class, "${id}$s#${name}$s", "#", " - ");
- registerMultiJXPathDecorator(StrataBean.class, "${id}$s#${name}$s", "#", " - ");
+ registerMultiJXPathDecorator(SurveyBean.class, "${name}$s", "#", " - ");
+ registerMultiJXPathDecorator(CampaignBean.class, "${name}$s", "#", " - ");
+ registerMultiJXPathDecorator(TraitBean.class, "${stationNumber}$s#${date}$td/%2$tm/%2$tY", "#", " - ");
+ registerMultiJXPathDecorator(ZoneBean.class, "${name}$s", "#", " - ");
+ registerMultiJXPathDecorator(VesselBean.class, "${name}$s", "#", " - ");
+ registerMultiJXPathDecorator(CountryBean.class, "${name}$s", "#", " - ");
+ registerMultiJXPathDecorator(GearBean.class, "${name}$s", "#", " - ");
+ registerMultiJXPathDecorator(UserBean.class, "${name}$s", "#", " - ");
+ registerMultiJXPathDecorator(BeaufortScaleBean.class, "${name}$s", "#", " - ");
+ registerMultiJXPathDecorator(SeaStateBean.class, "${name}$s", "#", " - ");
+ registerMultiJXPathDecorator(StrataBean.class, "${name}$s", "#", " - ");
}
};
}
+ static {
+ n_("tutti.property.name");
+ n_("tutti.property.stationNumber");
+ n_("tutti.property.date");
+ n_("tutti.property.surveyBean");
+ n_("tutti.property.campaignBean");
+ n_("tutti.property.traitBean");
+ n_("tutti.property.zoneBean");
+ n_("tutti.property.vesselBean");
+ n_("tutti.property.countryBean");
+ n_("tutti.property.gearBean");
+ n_("tutti.property.userBean");
+ n_("tutti.property.beaufortScaleBean");
+ n_("tutti.property.seaStateBean");
+ n_("tutti.property.strataBean");
+ }
+
}
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-23 22:18:17 UTC (rev 14)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java 2012-11-24 13:10:24 UTC (rev 15)
@@ -6,7 +6,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2012 Ifremer, Code Lutin
+ * 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
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/TuttiService.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/TuttiService.java 2012-11-23 22:18:17 UTC (rev 14)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/TuttiService.java 2012-11-24 13:10:24 UTC (rev 15)
@@ -6,7 +6,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2012 Ifremer, Code Lutin
+ * 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
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/TuttiServiceContext.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/TuttiServiceContext.java 2012-11-23 22:18:17 UTC (rev 14)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/TuttiServiceContext.java 2012-11-24 13:10:24 UTC (rev 15)
@@ -6,7 +6,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2012 Ifremer, Code Lutin
+ * 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
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/TuttiServiceTechnicalException.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/TuttiServiceTechnicalException.java 2012-11-23 22:18:17 UTC (rev 14)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/TuttiServiceTechnicalException.java 2012-11-24 13:10:24 UTC (rev 15)
@@ -6,7 +6,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2012 Ifremer, Code Lutin
+ * 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
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/config/TuttiServiceConfig.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/config/TuttiServiceConfig.java 2012-11-23 22:18:17 UTC (rev 14)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/config/TuttiServiceConfig.java 2012-11-24 13:10:24 UTC (rev 15)
@@ -6,7 +6,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2012 Ifremer, Code Lutin
+ * 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
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/config/TuttiServiceConfigOption.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/config/TuttiServiceConfigOption.java 2012-11-23 22:18:17 UTC (rev 14)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/config/TuttiServiceConfigOption.java 2012-11-24 13:10:24 UTC (rev 15)
@@ -6,7 +6,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2012 Ifremer, Code Lutin
+ * 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
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/config/TuttiServiceConfigProvider.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/config/TuttiServiceConfigProvider.java 2012-11-23 22:18:17 UTC (rev 14)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/config/TuttiServiceConfigProvider.java 2012-11-24 13:10:24 UTC (rev 15)
@@ -6,7 +6,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2012 Ifremer, Code Lutin
+ * 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
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-23 22:18:17 UTC (rev 14)
+++ trunk/tutti-service/src/main/resources/i18n/tutti-service_fr_FR.properties 2012-11-24 13:10:24 UTC (rev 15)
@@ -6,4 +6,18 @@
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.countryBean=Pays
+tutti.property.date=Date
+tutti.property.gearBean=Engin
+tutti.property.name=Nom
+tutti.property.seaStateBean=État de la mer
+tutti.property.stationNumber=Numéro de station
+tutti.property.strataBean=Strate d'association
+tutti.property.surveyBean=Série de campagne
+tutti.property.traitBean=Trait
+tutti.property.userBean=Utilisateur
+tutti.property.vesselBean=Navire
+tutti.property.zoneBean=Zone
tutti.service.config=Configuration des services de Tutti
Modified: trunk/tutti-ui-swing/pom.xml
===================================================================
--- trunk/tutti-ui-swing/pom.xml 2012-11-23 22:18:17 UTC (rev 14)
+++ trunk/tutti-ui-swing/pom.xml 2012-11-24 13:10:24 UTC (rev 15)
@@ -220,6 +220,11 @@
</dependency>
<dependency>
+ <groupId>commons-beanutils</groupId>
+ <artifactId>commons-beanutils</artifactId>
+ </dependency>
+
+ <dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
Modified: trunk/tutti-ui-swing/src/main/assembly/bin.xml
===================================================================
--- trunk/tutti-ui-swing/src/main/assembly/bin.xml 2012-11-23 22:18:17 UTC (rev 14)
+++ trunk/tutti-ui-swing/src/main/assembly/bin.xml 2012-11-24 13:10:24 UTC (rev 15)
@@ -5,7 +5,7 @@
$Id$
$HeadURL$
%%
- Copyright (C) 2012 Ifremer, Code Lutin
+ 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
Modified: trunk/tutti-ui-swing/src/main/filtered-resources/tutti.properties
===================================================================
--- trunk/tutti-ui-swing/src/main/filtered-resources/tutti.properties 2012-11-23 22:18:17 UTC (rev 14)
+++ trunk/tutti-ui-swing/src/main/filtered-resources/tutti.properties 2012-11-24 13:10:24 UTC (rev 15)
@@ -4,7 +4,7 @@
# $Id$
# $HeadURL$
# %%
-# Copyright (C) 2012 Ifremer, Code Lutin
+# 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
Added: 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 (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/AbstractTuttiBeanUIModel.java 2012-11-24 13:10:24 UTC (rev 15)
@@ -0,0 +1,61 @@
+package fr.ifremer.tutti.ui.swing;
+
+import org.jdesktop.beans.AbstractSerializableBean;
+
+/**
+ * Abstract UI model to edit a bean.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.1
+ */
+public abstract class AbstractTuttiBeanUIModel extends AbstractSerializableBean {
+
+ private static final long serialVersionUID = 1L;
+
+
+ public static final String PROPERTY_ID = "id";
+
+ public static final String PROPERTY_MODIFY = "modify";
+
+ public static final String PROPERTY_VALID = "valid";
+
+ protected String id;
+
+ protected boolean modify;
+
+ protected boolean valid;
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ Object oldValue = getId();
+ this.id = id;
+ firePropertyChange(PROPERTY_ID, oldValue, id);
+ }
+
+ public boolean isModify() {
+ return modify;
+ }
+
+ public void setModify(boolean modify) {
+ Object oldValue = isModify();
+ this.modify = modify;
+ firePropertyChange(PROPERTY_MODIFY, oldValue, modify);
+ }
+
+ public boolean isValid() {
+ return valid;
+ }
+
+ public void setValid(boolean valid) {
+ Object oldValue = isValid();
+ this.valid = valid;
+ firePropertyChange(PROPERTY_VALID, oldValue, valid);
+ }
+
+ public boolean isCreate() {
+ return id == null;
+ }
+}
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/AbstractTuttiBeanUIModel.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
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-23 22:18:17 UTC (rev 14)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/AbstractTuttiUIHandler.java 2012-11-24 13:10:24 UTC (rev 15)
@@ -6,7 +6,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2012 Ifremer, Code Lutin
+ * 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
@@ -27,9 +27,11 @@
import com.google.common.base.Function;
import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
+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 fr.ifremer.tutti.service.DecoratorService;
-import fr.ifremer.tutti.persistence.entities.AbstractTuttiEntity;
import jaxx.runtime.swing.OneClicListSelectionModel;
import jaxx.runtime.swing.editor.NumberEditor;
import jaxx.runtime.swing.editor.TimeEditor;
@@ -37,20 +39,31 @@
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;
import org.nuiton.util.decorator.Decorator;
import org.nuiton.util.decorator.JXPathDecorator;
+import org.nuiton.validator.bean.simple.SimpleBeanValidator;
import javax.swing.JList;
import javax.swing.ListCellRenderer;
import javax.swing.ListModel;
+import javax.swing.ListSelectionModel;
+import javax.swing.event.ListSelectionEvent;
import javax.swing.table.TableCellRenderer;
+import javax.swing.text.JTextComponent;
+import java.awt.event.ItemEvent;
+import java.awt.event.KeyEvent;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
+import java.util.Map;
+import java.util.Set;
/**
* Contract of any UI handler.
@@ -58,7 +71,7 @@
* @author tchemit <chemit(a)codelutin.com>
* @since 0.1
*/
-public abstract class AbstractTuttiUIHandler {
+public abstract class AbstractTuttiUIHandler<M> {
/** Logger. */
private static final Log log =
@@ -70,6 +83,8 @@
public abstract void onCloseUI();
+ protected abstract M getModel();
+
protected final TuttiUIContext context;
protected AbstractTuttiUIHandler(TuttiUIContext context) {
@@ -84,25 +99,79 @@
return context.getConfig();
}
+ public void setText(KeyEvent event, String property) {
+ JTextComponent field = (JTextComponent) event.getSource();
+ String value = field.getText();
+ setProperty(getModel(), property, value);
+ }
+
+ public void setBoolean(ItemEvent event, String property) {
+ boolean value = event.getStateChange() == ItemEvent.SELECTED;
+ setProperty(getModel(), property, value);
+ }
+
+ public void selectListData(ListSelectionEvent event, String property) {
+ if (!event.getValueIsAdjusting()) {
+ JList list = (JList) event.getSource();
+ ListSelectionModel selectionModel = list.getSelectionModel();
+
+ selectionModel.setValueIsAdjusting(true);
+ try {
+ List selectedList = Lists.newLinkedList();
+
+ for (int index : list.getSelectedIndices()) {
+ Object o = list.getModel().getElementAt(index);
+ selectedList.add(o);
+ }
+ 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()) {
+ Object component = entry.getValue();
+ if (component instanceof NumberEditor) {
+ initNumberEditor((NumberEditor) component);
+ } else if (component instanceof JXDatePicker) {
+ initDatePicker((JXDatePicker) component);
+ } else if (component instanceof TimeEditor) {
+ initTimeEditor((TimeEditor) component);
+ }
+ }
+ }
+
/**
* Prépare un component de choix d'entités pour un type d'entité donné et
* pour un service de persistance donné.
*
- * @param <E> le type de l'entité
- * @param entityClass le type de l'entité
- * @param comboBox le component graphique à initialiser
+ * @param comboBox le component graphique à initialiser
*/
- protected <E extends AbstractTuttiEntity> void initBeanComboBox(
- Class<E> entityClass,
+ protected <E extends AbstractTuttiBean> void initBeanComboBox(
BeanComboBox<E> comboBox,
List<E> data,
E selectedData) {
- // init combobox
- Decorator<E> decorator = context.getService(DecoratorService.class).getDecoratorByType(entityClass);
+ Class<E> beanType = (Class<E>) comboBox.getHandler().getTargetClass();
+ DecoratorService decoratorService =
+ context.getService(DecoratorService.class);
+ Decorator<E> decorator = decoratorService.getDecoratorByType(beanType);
+
if (log.isInfoEnabled()) {
- log.info("entity list [" + entityClass.getName() + "] : " + data.size());
+ log.info("entity list [" + beanType.getName() + "] : " +
+ (data == null ? 0 : data.size()));
}
// add data list to combo box
@@ -111,7 +180,7 @@
comboBox.setSelectedItem(selectedData);
if (log.isDebugEnabled()) {
- log.debug("combo list [" + entityClass.getName() + "] : " +
+ log.debug("combo [" + beanType.getName() + "] : " +
comboBox.getData().size());
}
}
@@ -120,35 +189,34 @@
* Prépare un component de choix d'entités pour un type d'entité donné et
* pour un service de persistance donné.
*
- * @param <E> le type de l'entité
- * @param entityClass le type de l'entité
- * @param comboBox le component graphique à initialiser
+ * @param listHeader le component graphique à initialiser
*/
- protected <E extends AbstractTuttiEntity> void initBeanList(
- Class<E> entityClass,
- BeanListHeader<E> comboBox,
+ protected <E extends AbstractTuttiBean> void initBeanList(
+ BeanListHeader<E> listHeader,
List<E> data,
List<E> selectedData) {
- // init combobox
+ Class<E> beanType = listHeader.getBeanType();
+
DecoratorService decoratorService =
context.getService(DecoratorService.class);
- Decorator<E> decorator = decoratorService.getDecoratorByType(entityClass);
+ Decorator<E> decorator = decoratorService.getDecoratorByType(beanType);
if (log.isInfoEnabled()) {
- log.info("entity list [" + entityClass.getName() + "] : " + data.size());
+ log.info("entity list [" + beanType.getName() + "] : " +
+ (data == null ? 0 : data.size()));
}
// add data list to combo box
- comboBox.init((JXPathDecorator<E>) decorator, data);
+ listHeader.init((JXPathDecorator<E>) decorator, data);
- OneClicListSelectionModel.installModel(comboBox.getList());
+ OneClicListSelectionModel.installModel(listHeader.getList());
- updateIndices(comboBox.getList(), selectedData);
+ updateIndices(listHeader.getList(), selectedData);
if (log.isDebugEnabled()) {
- log.debug("combo list [" + entityClass.getName() + "] : " +
- comboBox.getData().size());
+ log.debug("Jlist [" + beanType.getName() + "] : " +
+ listHeader.getData().size());
}
}
@@ -175,8 +243,8 @@
picker.getEditor().setEditable(false);
}
- protected <B extends AbstractTuttiEntity> void updateIndices(JList<B> jlist,
- List<B> list) {
+ protected <B extends AbstractTuttiBean> void updateIndices(JList<B> jlist,
+ List<B> list) {
List<String> ids = list == null ?
Collections.<String>emptyList() :
@@ -239,4 +307,31 @@
DecoratorTableCellRenderer result = new DecoratorTableCellRenderer(decorator);
return result;
}
+
+ protected void listenValidatorValid(SimpleBeanValidator validator,
+ final AbstractTuttiBeanUIModel model) {
+ validator.addPropertyChangeListener(SimpleBeanValidator.VALID_PROPERTY, new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ model.setValid((Boolean) evt.getNewValue());
+ }
+ });
+ }
+
+
+ protected void listModelIsModify(AbstractTuttiBeanUIModel model) {
+ model.addPropertyChangeListener(new PropertyChangeListener() {
+
+ final Set<String> excludeProperties = Sets.newHashSet(
+ AbstractTuttiBeanUIModel.PROPERTY_MODIFY,
+ AbstractTuttiBeanUIModel.PROPERTY_VALID);
+
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ if (!excludeProperties.contains(evt.getPropertyName())) {
+ ((AbstractTuttiBeanUIModel) evt.getSource()).setModify(true);
+ }
+ }
+ });
+ }
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/MainUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/MainUI.css 2012-11-23 22:18:17 UTC (rev 14)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/MainUI.css 2012-11-24 13:10:24 UTC (rev 15)
@@ -4,7 +4,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2012 Ifremer, Code Lutin
+ * 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
@@ -56,7 +56,7 @@
text:"tutti.action.manageProtocol";
toolTipText:"tutti.action.manageProtocol.tip";
mnemonic:P;
- enabled:{uiContext.getScreen() != TuttiScreen.EDIT_PROTOCOL};
+ enabled:{model.getScreen() != TuttiScreen.EDIT_PROTOCOL};
/*actionIcon:"protocol";*/
}
@@ -64,7 +64,7 @@
text:"tutti.action.selectCampaign";
toolTipText:"tutti.action.selectCampaign.tip";
mnemonic:S;
- enabled:{uiContext.getScreen() != TuttiScreen.SELECT_CAMPAIGN};
+ enabled:{model.getScreen() != TuttiScreen.SELECT_CAMPAIGN};
/*actionIcon:"campaign";*/
}
@@ -72,7 +72,7 @@
text:"tutti.action.fillCatches";
toolTipText:"tutti.action.fillCatches.tip";
mnemonic:C;
- enabled:{uiContext.getScreen() != TuttiScreen.FILL_CATCHES && uiContext.isCampaignContextFilled()};
+ enabled:{model.getScreen() != TuttiScreen.FILL_CATCHES && model.isCampaignContextFilled()};
/*actionIcon:"catches";*/
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/MainUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/MainUI.jaxx 2012-11-23 22:18:17 UTC (rev 14)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/MainUI.jaxx 2012-11-24 13:10:24 UTC (rev 15)
@@ -4,7 +4,7 @@
$Id$
$HeadURL$
%%
- Copyright (C) 2012 Ifremer, Code Lutin
+ 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
@@ -22,7 +22,7 @@
#L%
-->
<JFrame id='mainFrame' onWindowClosing='getHandler().closeTutti()'
- implements='fr.ifremer.tutti.ui.swing.TuttiUI<MainUIHandler>'
+ implements='fr.ifremer.tutti.ui.swing.TuttiUI<TuttiUIContext, MainUIHandler>'
width='800' height='600'>
<import>
@@ -31,15 +31,15 @@
org.jdesktop.swingx.JXTitledPanel
</import>
+ <TuttiUIContext id='model'
+ initializer='getContextValue(TuttiUIContext.class)'/>
<MainUIHandler id='handler'
initializer='getContextValue(MainUIHandler.class)'/>
<script><![CDATA[
- protected TuttiUIContext uiContext;
-
public MainUI(TuttiUIContext context) {
- this.uiContext = context;
+ setContextValue(context);
MainUIHandler handler = new MainUIHandler(context, this);
setContextValue(handler);
handler.beforeInitUI();
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/MainUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/MainUIHandler.java 2012-11-23 22:18:17 UTC (rev 14)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/MainUIHandler.java 2012-11-24 13:10:24 UTC (rev 15)
@@ -6,7 +6,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2012 Ifremer, Code Lutin
+ * 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
@@ -24,13 +24,12 @@
* #L%
*/
-import fr.ifremer.tutti.service.TuttiServiceContext;
+import fr.ifremer.tutti.persistence.entities.CampaignBean;
+import fr.ifremer.tutti.persistence.entities.SurveyBean;
+import fr.ifremer.tutti.service.PersistenceService;
import fr.ifremer.tutti.service.config.TuttiServiceConfigOption;
import fr.ifremer.tutti.ui.swing.config.TuttiConfig;
import fr.ifremer.tutti.ui.swing.config.TuttiConfigOption;
-import fr.ifremer.tutti.service.PersistenceService;
-import fr.ifremer.tutti.persistence.entities.CampaignBean;
-import fr.ifremer.tutti.persistence.entities.SurveyBean;
import fr.ifremer.tutti.ui.swing.content.campaign.EditCampaignUI;
import fr.ifremer.tutti.ui.swing.content.campaign.EditSurveyUI;
import fr.ifremer.tutti.ui.swing.content.campaign.SelectCampaignUI;
@@ -58,7 +57,7 @@
* @author tchemit <chemit(a)codelutin.com>
* @since 0.1
*/
-public class MainUIHandler extends AbstractTuttiUIHandler {
+public class MainUIHandler extends AbstractTuttiUIHandler<TuttiUIContext> {
/** Logger. */
private static final Log log = LogFactory.getLog(MainUIHandler.class);
@@ -67,7 +66,6 @@
protected JComponent currentBody;
-
protected final PersistenceService persistenceService;
protected MainUIHandler(TuttiUIContext context, MainUI ui) {
@@ -76,17 +74,8 @@
this.persistenceService = context.getService(PersistenceService.class);
}
- public MainUI getUI() {
- return ui;
- }
-
- public TuttiServiceContext getAppContext() {
- return context.getAppContext();
- }
-
@Override
public void beforeInitUI() {
- // nothing to do
context.addPropertyChangeListener(new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
@@ -119,7 +108,19 @@
changeTitle();
- context.setScreen(TuttiScreen.SELECT_CAMPAIGN);
+ TuttiScreen screen;
+
+ if (context.isCampaignContextFilled()) {
+
+ // direct fill catches screen
+ screen = TuttiScreen.FILL_CATCHES;
+ } else {
+
+ // go to select campaign screen
+ screen = TuttiScreen.SELECT_CAMPAIGN;
+ }
+
+ context.setScreen(screen);
}
@Override
@@ -130,6 +131,11 @@
context.close();
}
+ @Override
+ protected TuttiUIContext getModel() {
+ return ui.getModel();
+ }
+
public void showConfig() {
TuttiConfig config = context.getConfig();
@@ -390,7 +396,7 @@
protected void closeCurrentBody() {
if (currentBody != null) {
- TuttiUI<?> body = (TuttiUI<?>) currentBody;
+ TuttiUI<?,?> body = (TuttiUI<?,?>) currentBody;
body.getHandler().onCloseUI();
context.getSwingSession().save();
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/RunTutti.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/RunTutti.java 2012-11-23 22:18:17 UTC (rev 14)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/RunTutti.java 2012-11-24 13:10:24 UTC (rev 15)
@@ -6,7 +6,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2012 Ifremer, Code Lutin
+ * 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
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiScreen.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiScreen.java 2012-11-23 22:18:17 UTC (rev 14)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiScreen.java 2012-11-24 13:10:24 UTC (rev 15)
@@ -6,7 +6,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2012 Ifremer, Code Lutin
+ * 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
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiUI.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiUI.java 2012-11-23 22:18:17 UTC (rev 14)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiUI.java 2012-11-24 13:10:24 UTC (rev 15)
@@ -6,7 +6,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2012 Ifremer, Code Lutin
+ * 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
@@ -32,8 +32,10 @@
* @author tchemit <chemit(a)codelutin.com>
* @since 0.1
*/
-public interface TuttiUI<H extends AbstractTuttiUIHandler> extends JAXXObject {
+public interface TuttiUI<M, H extends AbstractTuttiUIHandler<M>> extends JAXXObject {
+ M getModel();
+
H getHandler();
/**
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiUIContext.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiUIContext.java 2012-11-23 22:18:17 UTC (rev 14)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiUIContext.java 2012-11-24 13:10:24 UTC (rev 15)
@@ -6,7 +6,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2012 Ifremer, Code Lutin
+ * 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
@@ -42,7 +42,6 @@
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.io.Closeable;
-import java.io.IOException;
import java.util.Set;
/**
@@ -107,13 +106,6 @@
protected String campaignId;
/**
- * Id of last selected trait (can be null if none ever selected.
- *
- * @since 0.1
- */
- protected String traitId;
-
- /**
* Current screen displayed in ui.
*
* @since 0.1
@@ -122,10 +114,9 @@
public static TuttiUIContext newContext(TuttiConfig config) {
Preconditions.checkNotNull(config);
- Preconditions.checkState(applicationContext != null, "Application context was already opened!");
+ Preconditions.checkState(applicationContext == null,
+ "Application context was already opened!");
applicationContext = new TuttiUIContext(config);
-
-
return applicationContext;
}
@@ -135,18 +126,10 @@
this.swingSession = new SwingSession(getConfig().getUIConfigFile(), false);
}
- public TuttiServiceContext getAppContext() {
- return serviceContext;
- }
-
public <S extends TuttiService> S getService(Class<S> serviceType) {
return serviceContext.getService(serviceType);
}
- public <S extends TuttiService> void closeService(S service) throws IOException {
- serviceContext.closeService(service);
- }
-
public TuttiConfig getConfig() {
return config;
}
@@ -159,6 +142,19 @@
return surveyId;
}
+ public String getCampaignId() {
+ return campaignId;
+ }
+
+ public boolean isCampaignContextFilled() {
+ return StringUtils.isNotBlank(surveyId) &&
+ StringUtils.isNotBlank(campaignId);
+ }
+
+ public TuttiScreen getScreen() {
+ return screen;
+ }
+
public void setSurveyId(String surveyId) {
boolean oldValue = isCampaignContextFilled();
@@ -170,10 +166,6 @@
oldValue, isCampaignContextFilled());
}
- public String getCampaignId() {
- return campaignId;
- }
-
public void setCampaignId(String campaignId) {
boolean oldValue = isCampaignContextFilled();
@@ -185,26 +177,6 @@
oldValue, isCampaignContextFilled());
}
- public String getTraitId() {
- return traitId;
- }
-
- public void setTraitId(String traitId) {
- this.traitId = traitId;
-
- // always propagate the change
- firePropertyChange("traitId", null, traitId);
- }
-
- public boolean isCampaignContextFilled() {
- return StringUtils.isNotBlank(surveyId) &&
- StringUtils.isNotBlank(campaignId);
- }
-
- public TuttiScreen getScreen() {
- return screen;
- }
-
public void setScreen(TuttiScreen screen) {
Object oldValue = getScreen();
this.screen = screen;
@@ -301,23 +273,12 @@
});
}
- public void saveContextToConfig() {
- if (log.isInfoEnabled()) {
- log.info("Save config (surveyId: " + surveyId + ", campaignId: " +
- campaignId + ")");
- }
- config.setSurveyId(surveyId);
- config.setCampaignId(campaignId);
- config.save();
- }
-
@Override
public void close() {
// Clear data references
surveyId = null;
campaignId = null;
- traitId = null;
IOUtils.closeQuietly(serviceContext);
@@ -330,4 +291,14 @@
removePropertyChangeListener(listener);
}
}
+
+ protected void saveContextToConfig() {
+ if (log.isInfoEnabled()) {
+ log.info("Save config (surveyId: " + surveyId + ", campaignId: " +
+ campaignId + ")");
+ }
+ config.setSurveyId(surveyId);
+ config.setCampaignId(campaignId);
+ config.save();
+ }
}
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-23 22:18:17 UTC (rev 14)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiUIUtil.java 2012-11-24 13:10:24 UTC (rev 15)
@@ -6,7 +6,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2012 Ifremer, Code Lutin
+ * 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
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/config/TuttiApplicationConfigProvider.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/config/TuttiApplicationConfigProvider.java 2012-11-23 22:18:17 UTC (rev 14)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/config/TuttiApplicationConfigProvider.java 2012-11-24 13:10:24 UTC (rev 15)
@@ -6,7 +6,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2012 Ifremer, Code Lutin
+ * 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
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/config/TuttiConfig.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/config/TuttiConfig.java 2012-11-23 22:18:17 UTC (rev 14)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/config/TuttiConfig.java 2012-11-24 13:10:24 UTC (rev 15)
@@ -6,7 +6,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2012 Ifremer, Code Lutin
+ * 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
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/config/TuttiConfigOption.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/config/TuttiConfigOption.java 2012-11-23 22:18:17 UTC (rev 14)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/config/TuttiConfigOption.java 2012-11-24 13:10:24 UTC (rev 15)
@@ -6,7 +6,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2012 Ifremer, Code Lutin
+ * 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
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-23 22:18:17 UTC (rev 14)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/campaign/EditCampaignUI.css 2012-11-24 13:10:24 UTC (rev 15)
@@ -4,7 +4,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2012 Ifremer, Code Lutin
+ * 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
@@ -28,13 +28,13 @@
BeanComboBox {
showReset:true;
- i18nPrefix:"tutti.common.";
+ i18nPrefix:"tutti.property.";
bean:{model};
}
BeanListHeader {
showReset:true;
- i18nPrefix:"tutti.common.";
+ i18nPrefix:"tutti.property.";
}
JList {
@@ -49,101 +49,101 @@
continuousLayout:true;
}
-#campaignNameLabel {
+#nameLabel {
text:"tutti.label.campaign.name";
- labelFor:{campaignNameField};
+ labelFor:{nameField};
}
-#campaignNameField {
- text:{getModel().getName()};
+#nameField {
+ text:{model.getName()};
}
-#campaignSurveyPartLabel {
+#surveyPartLabel {
text:"tutti.label.campaign.surveyPart";
- labelFor:{campaignSurveyPartField};
+ labelFor:{surveyPartField};
}
-#campaignSurveyPartField {
- text:{getModel().getSurveyPart()};
+#surveyPartField {
+ text:{model.getSurveyPart()};
}
-#campaignCountryLabel {
+#countryLabel {
text:"tutti.label.campaign.country";
- labelFor:{campaignCountryComboBox};
+ labelFor:{countryComboBox};
}
-#campaignCountryComboBox {
+#countryComboBox {
property:"country";
selectedItem:{model.getCountry()};
}
-#campaignSurveyLabel {
+#surveyLabel {
text:"tutti.label.campaign.survey";
- labelFor:{campaignSurveyComboBox};
+ labelFor:{surveyComboBox};
}
-#campaignSurveyComboBox {
+#surveyComboBox {
property:"survey";
selectedItem:{model.getSurvey()};
}
-#campaignVesselPane {
+#vesselPane {
horizontalScrollBarPolicy:{JScrollPane.HORIZONTAL_SCROLLBAR_NEVER};
verticalScrollBarPolicy:{JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED};
}
-#campaignVesselHeader {
+#vesselHeader {
labelText:{_("tutti.label.list.vessel")};
- list:{campaignVesselList};
+ list:{vesselList};
beanType:{VesselBean.class};
}
-#campaignGearPane {
+#gearPane {
horizontalScrollBarPolicy:{JScrollPane.HORIZONTAL_SCROLLBAR_NEVER};
verticalScrollBarPolicy:{JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED};
}
-#campaignGearHeader {
+#gearHeader {
labelText:{_("tutti.label.list.gear")};
- list:{campaignGearList};
+ list:{gearList};
beanType:{GearBean.class};
}
-#campaignHeadOfMissionPane {
+#headOfMissionPane {
horizontalScrollBarPolicy:{JScrollPane.HORIZONTAL_SCROLLBAR_NEVER};
verticalScrollBarPolicy:{JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED};
}
-#campaignHeadOfMissionHeader {
+#headOfMissionHeader {
labelText:{_("tutti.label.list.headOfMission")};
- list:{campaignHeadOfMissionList};
+ list:{headOfMissionList};
beanType:{UserBean.class};
}
-#campaignHeadOfSortRoomPane {
+#headOfSortRoomPane {
horizontalScrollBarPolicy:{JScrollPane.HORIZONTAL_SCROLLBAR_NEVER};
verticalScrollBarPolicy:{JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED};
}
-#campaignHeadOfSortRoomHeader {
+#headOfSortRoomHeader {
labelText:{_("tutti.label.list.headOfSortRoom")};
- list:{campaignHeadOfSortRoomList};
+ list:{headOfSortRoomList};
beanType:{UserBean.class};
}
-#campaignCommentPane {
+#commentPane {
columnHeaderView:{new JLabel(_("tutti.label.comment"))};
minimumSize:{new Dimension(10,50)};
}
-#campaignCommentField {
- text:{getStringValue(model.getComment())};
+#commentField {
+ text:{model.getComment()};
}
#saveButton {
actionIcon:"save";
text:"tutti.action.save";
- enabled:{validator.isValid()};
+ enabled:{model.isModify() && model.isValid()};
}
#cancelButton {
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-23 22:18:17 UTC (rev 14)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/campaign/EditCampaignUI.jaxx 2012-11-24 13:10:24 UTC (rev 15)
@@ -4,7 +4,7 @@
$Id$
$HeadURL$
%%
- Copyright (C) 2012 Ifremer, Code Lutin
+ 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
@@ -22,7 +22,7 @@
#L%
-->
<JPanel id='homePanel' layout='{new BorderLayout()}'
- implements='fr.ifremer.tutti.ui.swing.TuttiUI<EditCampaignUIHandler>'>
+ implements='fr.ifremer.tutti.ui.swing.TuttiUI<EditCampaignUIModel, EditCampaignUIHandler>'>
<import>
fr.ifremer.tutti.persistence.entities.CountryBean
@@ -70,15 +70,15 @@
<BeanValidator id='validator' bean='model' errorTableModel='errorTableModel'
uiClass='jaxx.runtime.validator.swing.ui.ImageValidationUI'>
- <field name='name' component='campaignNameField'/>
- <field name='comment' component='campaignCommentField'/>
- <field name='surveyPart' component='campaignSurveyPartField'/>
- <field name='country' component='campaignCountryComboBox'/>
- <field name='survey' component='campaignSurveyComboBox'/>
- <field name='vessel' component='campaignVesselPane'/>
- <field name='gear' component='campaignGearPane'/>
- <field name='headOfMission' component='campaignHeadOfMissionPane'/>
- <field name='headOfSortRoom' component='campaignHeadOfSortRoomPane'/>
+ <field name='name' component='nameField'/>
+ <field name='comment' component='commentField'/>
+ <field name='surveyPart' component='surveyPartField'/>
+ <field name='country' component='countryComboBox'/>
+ <field name='survey' component='surveyComboBox'/>
+ <field name='vessel' component='vesselPane'/>
+ <field name='gear' component='gearPane'/>
+ <field name='headOfMission' component='headOfMissionPane'/>
+ <field name='headOfSortRoom' component='headOfSortRoomPane'/>
</BeanValidator>
<JSplitPane id='splitPane' constraints='BorderLayout.CENTER'>
@@ -87,92 +87,86 @@
<!-- campaign survey -->
<row>
<cell anchor='west'>
- <JLabel id='campaignSurveyLabel'/>
+ <JLabel id='surveyLabel'/>
</cell>
- <cell fill='horizontal' weightx='1.0' columns='4'>
- <BeanComboBox id='campaignSurveyComboBox' constructorParams='this'
+ <cell weightx='1.0'>
+ <BeanComboBox id='surveyComboBox' constructorParams='this'
genericType='SurveyBean'/>
</cell>
</row>
<!-- campaign country -->
<row>
- <cell anchor='west'>
- <JLabel id='campaignCountryLabel'/>
+ <cell>
+ <JLabel id='countryLabel'/>
</cell>
- <cell fill='horizontal' weightx='1.0' columns='4'>
- <BeanComboBox id='campaignCountryComboBox' constructorParams='this'
+ <cell>
+ <BeanComboBox id='countryComboBox' constructorParams='this'
genericType='CountryBean'/>
</cell>
</row>
<!-- campaign name -->
<row>
- <cell anchor='west'>
- <JLabel id='campaignNameLabel'/>
+ <cell>
+ <JLabel id='nameLabel'/>
</cell>
- <cell fill='horizontal' weightx='1.0' columns='4'>
- <JTextField id='campaignNameField'
- onKeyReleased='getModel().setName(campaignNameField.getText())'/>
+ <cell>
+ <JTextField id='nameField'
+ onKeyReleased='handler.setText(event, "name")'/>
</cell>
</row>
<!-- campaign survey part -->
<row>
- <cell anchor='west'>
- <JLabel id='campaignSurveyPartLabel'/>
+ <cell>
+ <JLabel id='surveyPartLabel'/>
</cell>
- <cell fill='horizontal' weightx='1.0' columns='2'>
- <JTextField id='campaignSurveyPartField'
- onKeyReleased='getModel().setSurveyPart(campaignSurveyPartField.getText())'/>
+ <cell>
+ <JTextField id='surveyPartField'
+ onKeyReleased='handler.setText(event, "surveyPart")'/>
</cell>
</row>
<!-- campaign vessel / gear -->
- <row fill="both" weighty='0.3'>
- <cell fill='both' weightx='1.0' columns='3'>
-
- <JPanel layout='{new GridLayout(1,0)}'>
-
- <JScrollPane id='campaignVesselPane'
- columnHeaderView="{campaignVesselHeader}"
- onFocusGained='campaignVesselList.requestFocus()'>
- <JList id='campaignVesselList'
- onValueChanged='if ( !event.getValueIsAdjusting()) { handler.selectVessels(((JList)event.getSource()).getSelectedValues()); }'/>
- <BeanListHeader id='campaignVesselHeader'
- genericType='VesselBean'/>
+ <row weighty='0.3'>
+ <cell columns='2'>
+ <JPanel layout='{new GridLayout(1, 0)}'>
+ <JScrollPane id='vesselPane' columnHeaderView="{vesselHeader}"
+ onFocusGained='vesselList.requestFocus()'>
+ <JList id='vesselList'
+ onValueChanged='handler.selectListData(event, "vessel")'/>
+ <BeanListHeader id='vesselHeader' genericType='VesselBean'/>
</JScrollPane>
- <JScrollPane id='campaignGearPane'
- columnHeaderView="{campaignGearHeader}"
- onFocusGained='campaignGearList.requestFocus()'>
- <JList id='campaignGearList'
- onValueChanged='if ( !event.getValueIsAdjusting()) { handler.selectGears(((JList)event.getSource()).getSelectedValues()); }'/>
- <BeanListHeader id='campaignGearHeader' genericType='GearBean'/>
+ <JScrollPane id='gearPane' columnHeaderView="{gearHeader}"
+ onFocusGained='gearList.requestFocus()'>
+ <JList id='gearList'
+ onValueChanged='handler.selectListData(event, "gear")'/>
+ <BeanListHeader id='gearHeader' genericType='GearBean'/>
</JScrollPane>
</JPanel>
</cell>
</row>
<!-- campaign headOfMission / headOfSortRoom -->
- <row fill="both" weighty='0.3'>
- <cell fill='both' weightx='1.0' columns='3'>
+ <row weighty='0.3'>
+ <cell columns='2'>
+ <JPanel layout='{new GridLayout(1, 0)}'>
- <JPanel layout='{new GridLayout(1,0)}'>
-
- <JScrollPane id='campaignHeadOfMissionPane'
- columnHeaderView="{campaignHeadOfMissionHeader}"
- onFocusGained='campaignHeadOfMissionList.requestFocus()'>
- <JList id='campaignHeadOfMissionList'
- onValueChanged='if ( !event.getValueIsAdjusting()) { handler.selectHeadOfMission(((JList)event.getSource()).getSelectedValues()); }'/>
- <BeanListHeader id='campaignHeadOfMissionHeader'
+ <JScrollPane id='headOfMissionPane'
+ columnHeaderView="{headOfMissionHeader}"
+ onFocusGained='headOfMissionList.requestFocus()'>
+ <JList id='headOfMissionList'
+ onValueChanged='handler.selectListData(event, "headOfMission")'/>
+ <BeanListHeader id='headOfMissionHeader'
genericType='UserBean'/>
</JScrollPane>
- <JScrollPane id='campaignHeadOfSortRoomPane'
- columnHeaderView="{campaignHeadOfSortRoomHeader}"
- onFocusGained='campaignHeadOfSortRoomList.requestFocus()'>
- <JList id='campaignHeadOfSortRoomList'
- onValueChanged='if ( !event.getValueIsAdjusting()) { handler.selectHeadOfSortRoom(((JList)event.getSource()).getSelectedValues()); }'/>
- <BeanListHeader id='campaignHeadOfSortRoomHeader'
+ <JScrollPane id='headOfSortRoomPane'
+ columnHeaderView="{headOfSortRoomHeader}"
+ onFocusGained='headOfSortRoomList.requestFocus()'>
+ <JList id='headOfSortRoomList'
+ onValueChanged='handler.selectListData(event, "headOfSortRoom")'/>
+ <BeanListHeader id='headOfSortRoomHeader'
genericType='UserBean'/>
</JScrollPane>
</JPanel>
@@ -180,20 +174,20 @@
</row>
<!-- campaign comment -->
- <row fill="both" weighty='0.3'>
- <cell columns='3'>
- <JScrollPane id='campaignCommentPane'
- onFocusGained='campaignCommentField.requestFocus()'>
- <JTextArea id='campaignCommentField'
- onKeyReleased='getModel().setComment(campaignCommentField.getText())'/>
+ <row weighty='0.3'>
+ <cell columns='2'>
+ <JScrollPane id='commentPane'
+ onFocusGained='commentField.requestFocus()'>
+ <JTextArea id='commentField'
+ onKeyReleased='handler.setText(event, "comment")'/>
</JScrollPane>
</cell>
</row>
<!-- Actions -->
<row>
- <cell columns='3' fill="both">
- <JPanel layout='{new GridLayout(1,2,0,0)}'>
+ <cell columns='2'>
+ <JPanel layout='{new GridLayout(1, 0)}'>
<JButton id='cancelButton' onActionPerformed='handler.cancel()'/>
<JButton id='saveButton' onActionPerformed='handler.save()'/>
</JPanel>
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-23 22:18:17 UTC (rev 14)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/campaign/EditCampaignUIHandler.java 2012-11-24 13:10:24 UTC (rev 15)
@@ -6,7 +6,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2012 Ifremer, Code Lutin
+ * 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
@@ -24,13 +24,9 @@
* #L%
*/
-import com.google.common.collect.Lists;
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.SurveyBean;
import fr.ifremer.tutti.persistence.entities.UserBean;
-import fr.ifremer.tutti.persistence.entities.VesselBean;
import fr.ifremer.tutti.service.PersistenceService;
import fr.ifremer.tutti.ui.swing.AbstractTuttiUIHandler;
import fr.ifremer.tutti.ui.swing.TuttiScreen;
@@ -38,7 +34,6 @@
import jaxx.runtime.validator.swing.SwingValidatorMessageTableRenderer;
import jaxx.runtime.validator.swing.SwingValidatorUtil;
-import javax.swing.ListSelectionModel;
import java.util.List;
/**
@@ -47,7 +42,7 @@
* @author tchemit <chemit(a)codelutin.com>
* @since 0.1
*/
-public class EditCampaignUIHandler extends AbstractTuttiUIHandler {
+public class EditCampaignUIHandler extends AbstractTuttiUIHandler<EditCampaignUIModel> {
private final EditCampaignUI ui;
@@ -67,8 +62,6 @@
String campaignId = context.getCampaignId();
if (campaignId == null) {
- model.setCreate(true);
-
SurveyBean survey =
persistenceService.getSurvey(context.getSurveyId());
model.setSurvey(survey);
@@ -79,57 +72,59 @@
model.fromBean(campaign);
}
+ listModelIsModify(model);
ui.setContextValue(model);
}
@Override
public void afterInitUI() {
-
- List<SurveyBean> surveys = persistenceService.getAllSurveys();
- List<CountryBean> countries = persistenceService.getAllCountries();
- List<VesselBean> vessels = persistenceService.getAllVessels();
- List<GearBean> gears = persistenceService.getAllGears();
List<UserBean> users = persistenceService.getAllUsers();
- initBeanComboBox(SurveyBean.class,
- ui.getCampaignSurveyComboBox(),
- surveys,
- ui.getModel().getSurvey());
+ EditCampaignUIModel model = ui.getModel();
- initBeanComboBox(CountryBean.class,
- ui.getCampaignCountryComboBox(),
- countries,
- ui.getModel().getCountry());
+ initBeanComboBox(ui.getSurveyComboBox(),
+ persistenceService.getAllSurveys(),
+ model.getSurvey());
- initBeanList(VesselBean.class,
- ui.getCampaignVesselHeader(),
- vessels,
- ui.getModel().getVessel());
+ initBeanComboBox(ui.getCountryComboBox(),
+ persistenceService.getAllCountries(),
+ model.getCountry());
- initBeanList(GearBean.class,
- ui.getCampaignGearHeader(),
- gears,
- ui.getModel().getGear());
+ initBeanList(ui.getVesselHeader(),
+ persistenceService.getAllVessels(),
+ model.getVessel());
- initBeanList(UserBean.class,
- ui.getCampaignHeadOfMissionHeader(),
+ initBeanList(ui.getGearHeader(),
+ persistenceService.getAllGears(),
+ model.getGear());
+
+ initBeanList(ui.getHeadOfMissionHeader(),
users,
- ui.getModel().getHeadOfMission());
+ model.getHeadOfMission());
- initBeanList(UserBean.class,
- ui.getCampaignHeadOfSortRoomHeader(),
+ initBeanList(ui.getHeadOfSortRoomHeader(),
users,
- ui.getModel().getHeadOfSortRoom());
+ model.getHeadOfSortRoom());
SwingValidatorUtil.installUI(ui.getErrorTable(),
new SwingValidatorMessageTableRenderer());
+
+ listenValidatorValid(ui.getValidator(), model);
+
+ // if new trait can already cancel his creation
+ model.setModify(model.isCreate());
}
@Override
public void onCloseUI() {
}
+ @Override
+ protected EditCampaignUIModel getModel() {
+ return ui.getModel();
+ }
+
public void cancel() {
context.setScreen(TuttiScreen.SELECT_CAMPAIGN);
@@ -155,64 +150,4 @@
context.setScreen(TuttiScreen.SELECT_CAMPAIGN);
}
- public void selectGears(Object... selected) {
-
- ListSelectionModel selectionModel =
- ui.getCampaignGearList().getSelectionModel();
- selectionModel.setValueIsAdjusting(true);
- try {
- List<GearBean> selectedList = Lists.newLinkedList();
- for (Object o : selected) {
- selectedList.add((GearBean) o);
- }
- ui.getModel().setGear(selectedList);
- } finally {
- selectionModel.setValueIsAdjusting(false);
- }
- }
-
- public void selectVessels(Object... selected) {
- ListSelectionModel selectionModel =
- ui.getCampaignVesselList().getSelectionModel();
- selectionModel.setValueIsAdjusting(true);
- try {
- List<VesselBean> selectedList = Lists.newLinkedList();
- for (Object o : selected) {
- selectedList.add((VesselBean) o);
- }
- ui.getModel().setVessel(selectedList);
- } finally {
- selectionModel.setValueIsAdjusting(false);
- }
- }
-
- public void selectHeadOfMission(Object... selected) {
- ListSelectionModel selectionModel =
- ui.getCampaignHeadOfMissionList().getSelectionModel();
- selectionModel.setValueIsAdjusting(true);
- try {
- List<UserBean> selectedList = Lists.newLinkedList();
- for (Object o : selected) {
- selectedList.add((UserBean) o);
- }
- ui.getModel().setHeadOfMission(selectedList);
- } finally {
- selectionModel.setValueIsAdjusting(false);
- }
- }
-
- public void selectHeadOfSortRoom(Object... selected) {
- ListSelectionModel selectionModel =
- ui.getCampaignHeadOfSortRoomList().getSelectionModel();
- selectionModel.setValueIsAdjusting(true);
- try {
- List<UserBean> selectedList = Lists.newLinkedList();
- for (Object o : selected) {
- selectedList.add((UserBean) o);
- }
- ui.getModel().setHeadOfSortRoom(selectedList);
- } finally {
- selectionModel.setValueIsAdjusting(false);
- }
- }
}
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-23 22:18:17 UTC (rev 14)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/campaign/EditCampaignUIModel.java 2012-11-24 13:10:24 UTC (rev 15)
@@ -6,7 +6,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2012 Ifremer, Code Lutin
+ * 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
@@ -24,13 +24,13 @@
* #L%
*/
-import fr.ifremer.tutti.persistence.entities.AbstractTuttiEntity;
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.SurveyBean;
import fr.ifremer.tutti.persistence.entities.UserBean;
import fr.ifremer.tutti.persistence.entities.VesselBean;
+import fr.ifremer.tutti.ui.swing.AbstractTuttiBeanUIModel;
import org.nuiton.util.beans.BinderFactory;
import java.util.List;
@@ -41,12 +41,10 @@
* @author tchemit <chemit(a)codelutin.com>
* @since 0.1O
*/
-public class EditCampaignUIModel extends AbstractTuttiEntity {
+public class EditCampaignUIModel extends AbstractTuttiBeanUIModel {
private static final long serialVersionUID = 1L;
- protected boolean create;
-
protected SurveyBean survey;
protected CountryBean country;
@@ -65,16 +63,18 @@
protected String comment;
- public boolean isCreate() {
- return create;
- }
+// protected boolean create;
+//
+// public boolean isCreate() {
+// return create;
+// }
+//
+// public void setCreate(boolean create) {
+// Object oldValue = isCreate();
+// this.create = create;
+// firePropertyChange("create", oldValue, create);
+// }
- public void setCreate(boolean create) {
- Object oldValue = isCreate();
- this.create = create;
- firePropertyChange("create", oldValue, create);
- }
-
public SurveyBean getSurvey() {
return survey;
}
@@ -112,7 +112,7 @@
public void setCountry(CountryBean country) {
Object oldValue = getCountry();
this.country = country;
- firePropertyChange("comment", oldValue, comment);
+ firePropertyChange("country", oldValue, country);
}
public String getSurveyPart() {
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/campaign/EditSurveyUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/campaign/EditSurveyUI.css 2012-11-23 22:18:17 UTC (rev 14)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/campaign/EditSurveyUI.css 2012-11-24 13:10:24 UTC (rev 15)
@@ -4,7 +4,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2012 Ifremer, Code Lutin
+ * 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
@@ -21,6 +21,13 @@
* <http://www.gnu.org/licenses/gpl-3.0.html>.
* #L%
*/
+
+BeanComboBox {
+ showReset:true;
+ i18nPrefix:"tutti.property.";
+ bean:{model};
+}
+
#splitPane {
orientation:{JSplitPane.VERTICAL_SPLIT};
resizeWeight:0.3;
@@ -32,40 +39,37 @@
border:{BorderFactory.createTitledBorder((String)null)};
}
-#surveyNameLabel {
+#nameLabel {
text:"tutti.label.survey.name";
- labelFor:{surveyNameField};
+ labelFor:{nameField};
}
-#surveyNameField {
- text:{getModel().getName()};
+#nameField {
+ text:{model.getName()};
}
-#surveyCommentPane {
+#commentPane {
columnHeaderView:{new JLabel(_("tutti.label.comment"))};
minimumSize:{new Dimension(10,50)};
}
-#surveyCommentField {
+#commentField {
text:{getStringValue(model.getComment())};
}
-#surveyZoneLabel {
+#zoneLabel {
text:"tutti.label.survey.zone";
- labelFor:{surveyZoneComboBox};
+ labelFor:{zoneComboBox};
}
-#surveyZoneComboBox {
+#zoneComboBox {
property:"zone";
- bean:{model};
- showReset:true;
- i18nPrefix:"tutti.common.";
selectedItem:{model.getZone()};
}
#saveButton {
text:"tutti.action.save";
- enabled:{validator.isValid()};
+ enabled:{model.isModify() && model.isValid()};
actionIcon:"save";
}
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-23 22:18:17 UTC (rev 14)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/campaign/EditSurveyUI.jaxx 2012-11-24 13:10:24 UTC (rev 15)
@@ -4,7 +4,7 @@
$Id$
$HeadURL$
%%
- Copyright (C) 2012 Ifremer, Code Lutin
+ 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
@@ -22,7 +22,7 @@
#L%
-->
<JPanel id='homePanel' layout='{new BorderLayout()}'
- implements='fr.ifremer.tutti.ui.swing.TuttiUI<EditSurveyUIHandler>'>
+ implements='fr.ifremer.tutti.ui.swing.TuttiUI<EditSurveyUIModel, EditSurveyUIHandler>'>
<import>
fr.ifremer.tutti.persistence.entities.ZoneBean
@@ -62,9 +62,9 @@
<BeanValidator id='validator' bean='model' errorTableModel='errorTableModel'
uiClass='jaxx.runtime.validator.swing.ui.ImageValidationUI'>
- <field name='name' component='surveyNameField'/>
- <field name='zone' component='surveyZoneComboBox'/>
- <field name='comment' component='surveyCommentField'/>
+ <field name='name' component='nameField'/>
+ <field name='zone' component='zoneComboBox'/>
+ <field name='comment' component='commentField'/>
</BeanValidator>
<JSplitPane id='splitPane' constraints='BorderLayout.CENTER'>
@@ -74,46 +74,40 @@
<!-- survey name -->
<row>
<cell anchor='west'>
- <JLabel id='surveyNameLabel'/>
+ <JLabel id='nameLabel'/>
</cell>
- <cell fill='horizontal' weightx='1.0' columns='4'>
- <JTextField id='surveyNameField'
- onKeyReleased='getModel().setName(surveyNameField.getText())'/>
+ <cell weightx='1.0'>
+ <JTextField id='nameField'
+ onKeyReleased='handler.setText(event, "name")'/>
</cell>
</row>
<!-- survey zone -->
<row>
- <cell anchor='west'>
- <JLabel id='surveyZoneLabel'/>
+ <cell>
+ <JLabel id='zoneLabel'/>
</cell>
- <cell fill='horizontal' weightx='1.0' columns='4'>
- <BeanComboBox id='surveyZoneComboBox' constructorParams='this'
+ <cell>
+ <BeanComboBox id='zoneComboBox' constructorParams='this'
genericType='ZoneBean'/>
</cell>
</row>
<!-- survey comment -->
- <row fill="both" weighty='0.8'>
- <cell columns='5'>
- <JScrollPane id='surveyCommentPane'
- onFocusGained='surveyCommentField.requestFocus()'>
- <JTextArea id='surveyCommentField'
- onKeyReleased='getModel().setComment(surveyCommentField.getText())'/>
+ <row weighty='0.8'>
+ <cell columns='2'>
+ <JScrollPane id='commentPane'
+ onFocusGained='commentField.requestFocus()'>
+ <JTextArea id='commentField'
+ onKeyReleased='handler.setText(event, "comment")'/>
</JScrollPane>
</cell>
</row>
- <!--row fill="both" weighty='0.2'>
- <cell columns='5'>
- <JPanel/>
- </cell>
- </row-->
-
<!-- actions -->
<row anchor='south'>
- <cell columns='5' fill="both">
- <JPanel layout='{new GridLayout(1,2,0,0)}'>
+ <cell columns='2'>
+ <JPanel layout='{new GridLayout(1, 0)}'>
<JButton id='cancelButton' onActionPerformed='handler.cancel()'/>
<JButton id='saveButton' onActionPerformed='handler.save()'/>
</JPanel>
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/campaign/EditSurveyUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/campaign/EditSurveyUIHandler.java 2012-11-23 22:18:17 UTC (rev 14)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/campaign/EditSurveyUIHandler.java 2012-11-24 13:10:24 UTC (rev 15)
@@ -6,7 +6,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2012 Ifremer, Code Lutin
+ * 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
@@ -25,7 +25,6 @@
*/
import fr.ifremer.tutti.persistence.entities.SurveyBean;
-import fr.ifremer.tutti.persistence.entities.ZoneBean;
import fr.ifremer.tutti.service.PersistenceService;
import fr.ifremer.tutti.ui.swing.AbstractTuttiUIHandler;
import fr.ifremer.tutti.ui.swing.TuttiScreen;
@@ -35,15 +34,13 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import java.util.List;
-
/**
* Handler of UI {@link EditSurveyUI}.
*
* @author tchemit <chemit(a)codelutin.com>
* @since 0.1
*/
-public class EditSurveyUIHandler extends AbstractTuttiUIHandler {
+public class EditSurveyUIHandler extends AbstractTuttiUIHandler<EditSurveyUIModel> {
/** Logger. */
private static final Log log = LogFactory.getLog(EditSurveyUIHandler.class);
@@ -69,7 +66,6 @@
if (log.isInfoEnabled()) {
log.info("Edit new survey");
}
- model.setCreate(true);
} else {
if (log.isInfoEnabled()) {
@@ -80,21 +76,27 @@
model.fromBean(survey);
}
+
+ listModelIsModify(model);
+
ui.setContextValue(model);
}
@Override
public void afterInitUI() {
- List<ZoneBean> zones = persistenceService.getAllZones();
+ EditSurveyUIModel model = ui.getModel();
+ initBeanComboBox(ui.getZoneComboBox(),
+ persistenceService.getAllZones(),
+ model.getZone());
- initBeanComboBox(ZoneBean.class,
- ui.getSurveyZoneComboBox(),
- zones,
- ui.getModel().getZone());
-
SwingValidatorUtil.installUI(ui.getErrorTable(),
new SwingValidatorMessageTableRenderer());
+
+ listenValidatorValid(ui.getValidator(), model);
+
+ // if new survey can already cancel his creation
+ model.setModify(model.isCreate());
}
@Override
@@ -102,6 +104,11 @@
ui.getValidator().setBean(null);
}
+ @Override
+ protected EditSurveyUIModel getModel() {
+ return ui.getModel();
+ }
+
public void cancel() {
context.setScreen(TuttiScreen.SELECT_CAMPAIGN);
}
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-23 22:18:17 UTC (rev 14)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/campaign/EditSurveyUIModel.java 2012-11-24 13:10:24 UTC (rev 15)
@@ -6,7 +6,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2012 Ifremer, Code Lutin
+ * 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
@@ -24,9 +24,9 @@
* #L%
*/
-import fr.ifremer.tutti.persistence.entities.AbstractTuttiEntity;
import fr.ifremer.tutti.persistence.entities.SurveyBean;
import fr.ifremer.tutti.persistence.entities.ZoneBean;
+import fr.ifremer.tutti.ui.swing.AbstractTuttiBeanUIModel;
import org.nuiton.util.beans.BinderFactory;
/**
@@ -35,7 +35,7 @@
* @author tchemit <chemit(a)codelutin.com>
* @since 0.1
*/
-public class EditSurveyUIModel extends AbstractTuttiEntity {
+public class EditSurveyUIModel extends AbstractTuttiBeanUIModel {
private static final long serialVersionUID = 1L;
@@ -45,18 +45,18 @@
protected ZoneBean zone;
- protected boolean create;
+// protected boolean create;
+//
+// public boolean isCreate() {
+// return create;
+// }
+//
+// public void setCreate(boolean create) {
+// Object oldValue = isCreate();
+// this.create = create;
+// firePropertyChange("create", oldValue, create);
+// }
- public boolean isCreate() {
- return create;
- }
-
- public void setCreate(boolean create) {
- Object oldValue = isCreate();
- this.create = create;
- firePropertyChange("create", oldValue, create);
- }
-
public String getName() {
return name;
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/campaign/SelectCampaignUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/campaign/SelectCampaignUI.css 2012-11-23 22:18:17 UTC (rev 14)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/campaign/SelectCampaignUI.css 2012-11-24 13:10:24 UTC (rev 15)
@@ -4,7 +4,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2012 Ifremer, Code Lutin
+ * 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
@@ -21,12 +21,20 @@
* <http://www.gnu.org/licenses/gpl-3.0.html>.
* #L%
*/
+
+BeanComboBox {
+ showReset:true;
+ i18nPrefix:"tutti.property.";
+ bean:{model};
+}
+
#surveyLabel {
text: "tutti.label.survey";
}
#surveyCombobox {
- model: {surveyListModel};
+ property:"survey";
+ selectedItem:{model.getSurvey()};
}
#editSurveyButton {
@@ -46,8 +54,9 @@
}
#campaignCombobox {
+ property:"campaign";
enabled: {model.isSurveyFound()};
- model: {campaignListModel};
+ selectedItem:{model.getCampaign()};
}
#editCampaignButton {
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/campaign/SelectCampaignUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/campaign/SelectCampaignUI.jaxx 2012-11-23 22:18:17 UTC (rev 14)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/campaign/SelectCampaignUI.jaxx 2012-11-24 13:10:24 UTC (rev 15)
@@ -4,7 +4,7 @@
$Id$
$HeadURL$
%%
- Copyright (C) 2012 Ifremer, Code Lutin
+ 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
@@ -22,7 +22,7 @@
#L%
-->
<JPanel id='homePanel' layout='{new BorderLayout()}'
- implements='fr.ifremer.tutti.ui.swing.TuttiUI<SelectCampaignUIHandler>'>
+ implements='fr.ifremer.tutti.ui.swing.TuttiUI<SelectCampaignUIModel, SelectCampaignUIHandler>'>
<import>
fr.ifremer.tutti.persistence.entities.SurveyBean
@@ -30,7 +30,7 @@
fr.ifremer.tutti.persistence.entities.TraitBean
fr.ifremer.tutti.ui.swing.TuttiUIContext
- jaxx.runtime.swing.model.GenericListModel
+ jaxx.runtime.swing.editor.bean.BeanComboBox
static org.nuiton.i18n.I18n._
</import>
@@ -47,62 +47,57 @@
}
protected void $afterCompleteSetup() {
- getHandler().afterInitUI();
+ handler.afterInitUI();
}
]]></script>
<SelectCampaignUIHandler id='handler'
- initializer='getContextValue(SelectCampaignUIHandler.class)'/>
+ initializer='getContextValue(SelectCampaignUIHandler.class)'/>
- <SelectCampaignUIModel id='model'/>
+ <SelectCampaignUIModel id='model'
+ initializer='getContextValue(SelectCampaignUIModel.class)'/>
- <GenericListModel id='surveyListModel' genericType='SurveyBean'/>
-
- <GenericListModel id='campaignListModel' genericType='CampaignBean'/>
-
- <GenericListModel id='traitListModel' genericType='TraitBean'/>
-
<Table fill='both' constraints='BorderLayout.CENTER'>
<row>
<cell anchor='west'>
<JLabel id='surveyLabel'/>
</cell>
- <cell fill='horizontal' weightx='1.0'>
- <JComboBox id='surveyCombobox'
- onActionPerformed='getHandler().selectSurvey()'/>
+ <cell weightx='1.0'>
+ <BeanComboBox id='surveyCombobox' constructorParams='this'
+ genericType='SurveyBean'/>
</cell>
<cell>
- <JPanel layout='{new GridLayout(1,2,0,0)}'>
+ <JPanel layout='{new GridLayout(1,0)}'>
<JButton id='editSurveyButton'
- onActionPerformed='getHandler().showSelectedSurvey()'/>
+ onActionPerformed='handler.showSelectedSurvey()'/>
<JButton id='newSurveyButton'
- onActionPerformed='getHandler().showNewSurvey()'/>
+ onActionPerformed='handler.showNewSurvey()'/>
</JPanel>
</cell>
</row>
<row>
- <cell anchor='west'>
+ <cell>
<JLabel id='campaignLabel'/>
</cell>
- <cell fill='horizontal' weightx='1.0'>
- <JComboBox id='campaignCombobox'
- onActionPerformed='getHandler().selectCampaign()'/>
+ <cell>
+ <BeanComboBox id='campaignCombobox' constructorParams='this'
+ genericType='CampaignBean'/>
</cell>
<cell>
- <JPanel layout='{new GridLayout(1,2,0,0)}'>
+ <JPanel layout='{new GridLayout(1,0)}'>
<JButton id='editCampaignButton'
- onActionPerformed='getHandler().showSelectedCampaign()'/>
+ onActionPerformed='handler.showSelectedCampaign()'/>
<JButton id='newCampaignButton'
- onActionPerformed='getHandler().showNewCampaign()'/>
+ onActionPerformed='handler.showNewCampaign()'/>
</JPanel>
</cell>
</row>
<row>
- <cell fill='both' columns='3'>
- <JPanel layout='{new GridLayout(1,0,0,0)}'>
+ <cell columns='3'>
+ <!--JPanel layout='{new GridLayout(1,0)}'-->
<JButton id='showCatchesButton'
- onActionPerformed='getHandler().showCatches()'/>
- </JPanel>
+ onActionPerformed='handler.showCatches()'/>
+ <!--/JPanel-->
</cell>
</row>
</Table>
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/campaign/SelectCampaignUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/campaign/SelectCampaignUIHandler.java 2012-11-23 22:18:17 UTC (rev 14)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/campaign/SelectCampaignUIHandler.java 2012-11-24 13:10:24 UTC (rev 15)
@@ -6,7 +6,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2012 Ifremer, Code Lutin
+ * 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
@@ -24,6 +24,7 @@
* #L%
*/
+import com.google.common.collect.Lists;
import fr.ifremer.tutti.persistence.entities.CampaignBean;
import fr.ifremer.tutti.persistence.entities.SurveyBean;
import fr.ifremer.tutti.persistence.entities.TuttiBeans;
@@ -31,6 +32,8 @@
import fr.ifremer.tutti.ui.swing.AbstractTuttiUIHandler;
import fr.ifremer.tutti.ui.swing.TuttiScreen;
import fr.ifremer.tutti.ui.swing.TuttiUIContext;
+import jaxx.runtime.swing.editor.bean.BeanComboBox;
+import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -44,17 +47,12 @@
* @author tchemit <chemit(a)codelutin.com>
* @since 0.1
*/
-public class SelectCampaignUIHandler extends AbstractTuttiUIHandler {
+public class SelectCampaignUIHandler extends AbstractTuttiUIHandler<SelectCampaignUIModel> {
/** Logger. */
private static final Log log =
LogFactory.getLog(SelectCampaignUIHandler.class);
- // XXX-fdesbois-2012-07-23 : used to avoid set unexpected set null during
- // selections, this is a strange behavior of setElements that clear with
- // fire remove previous elements and put selection to null
- protected boolean comboIsAdjusting;
-
protected final PersistenceService persistenceService;
protected final SelectCampaignUI ui;
@@ -65,26 +63,19 @@
persistenceService = context.getService(PersistenceService.class);
}
+ @Override
protected SelectCampaignUIModel getModel() {
return ui.getModel();
}
@Override
public void beforeInitUI() {
- }
+ SelectCampaignUIModel model = new SelectCampaignUIModel();
- @Override
- public void afterInitUI() {
-
- ui.getCampaignCombobox().setRenderer(
- newListCellRender(CampaignBean.class));
-
- ui.getSurveyCombobox().setRenderer(
- newListCellRender(SurveyBean.class));
-
List<SurveyBean> allSurveys = persistenceService.getAllSurveys();
- ui.getSurveyListModel().setElements(allSurveys);
+ model.setSurveys(allSurveys);
+
if (allSurveys.isEmpty()) {
// do nothing
@@ -94,28 +85,17 @@
String surveyId = context.getSurveyId();
SurveyBean selectedSurvey = null;
+ List<CampaignBean> allCampaigns = null;
if (surveyId != null) {
selectedSurvey = TuttiBeans.findById(allSurveys, surveyId);
+ allCampaigns = persistenceService.getAllCampaigns(surveyId);
}
- if (selectedSurvey == null) {
- // select first one
- selectedSurvey = allSurveys.get(0);
- surveyId = selectedSurvey.getId();
+ model.setSurvey(selectedSurvey);
+ model.setCampaigns(allCampaigns);
- // repush it in model
- context.setSurveyId(surveyId);
- }
+ if (CollectionUtils.isEmpty(allCampaigns)) {
- ui.getSurveyListModel().setSelectedItem(selectedSurvey);
-
- selectSurvey();
-
- List<CampaignBean> allCampaigns =
- persistenceService.getAllCampaigns(surveyId);
-
- if (allCampaigns.isEmpty()) {
-
// nothing to select
} else {
String campaignId = context.getCampaignId();
@@ -125,32 +105,57 @@
selectedCampaign =
TuttiBeans.findById(allCampaigns, campaignId);
}
+ model.setCampaign(selectedCampaign);
+ }
+ }
+ ui.setContextValue(model);
+ }
- if (selectedCampaign == null) {
+ @Override
+ public void afterInitUI() {
- // select first one
- selectedCampaign = allCampaigns.get(0);
- campaignId = selectedCampaign.getId();
+ SelectCampaignUIModel model = ui.getModel();
- // repush it in model
- context.setCampaignId(campaignId);
- }
+ initBeanComboBox(ui.getSurveyCombobox(),
+ model.getSurveys(),
+ model.getSurvey());
- ui.getCampaignListModel().setSelectedItem(selectedCampaign);
- }
- selectCampaign();
- }
+ initBeanComboBox(ui.getCampaignCombobox(),
+ model.getCampaigns(),
+ model.getCampaign());
- ui.getModel().addPropertyChangeListener("survey", new PropertyChangeListener() {
+ model.addPropertyChangeListener("survey", new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
SurveyBean newValue = (SurveyBean) evt.getNewValue();
- context.setSurveyId(newValue == null ? null : newValue.getId());
+ boolean noSurvey = newValue == null;
+ context.setSurveyId(noSurvey ? null : newValue.getId());
+ List<CampaignBean> campaigns;
+ if (noSurvey) {
+ campaigns = Lists.newArrayList();
+ } else {
+ campaigns = persistenceService.getAllCampaigns(newValue.getId());
+ }
+ SelectCampaignUIModel model = (SelectCampaignUIModel) evt.getSource();
+ model.setCampaigns(campaigns);
+ model.setCampaign(null);
}
});
- ui.getModel().addPropertyChangeListener("campaign", new PropertyChangeListener() {
+
+ model.addPropertyChangeListener("campaigns", new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
+ // reload combo box
+ BeanComboBox<CampaignBean> combobox = ui.getCampaignCombobox();
+ List<CampaignBean> campaigns = (List<CampaignBean>) evt.getNewValue();
+ combobox.setData(null);
+ combobox.setData(campaigns);
+ }
+ });
+
+ model.addPropertyChangeListener("campaign", new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
CampaignBean newValue = (CampaignBean) evt.getNewValue();
context.setCampaignId(newValue == null ? null : newValue.getId());
}
@@ -159,7 +164,6 @@
@Override
public void onCloseUI() {
- // nothing to do
PropertyChangeListener[] listeners = ui.getModel().getPropertyChangeListeners();
for (PropertyChangeListener listener : listeners) {
getModel().removePropertyChangeListener(listener);
@@ -194,38 +198,4 @@
context.setCampaignId(null);
context.setScreen(TuttiScreen.EDIT_CAMPAIGN);
}
-
- public void selectSurvey() {
-
- if (!comboIsAdjusting) {
-
- comboIsAdjusting = true;
-
- SurveyBean survey = ui.getSurveyListModel().getSelectedItem();
- getModel().setSurvey(survey);
-
- List<CampaignBean> allCampaigns =
- persistenceService.getAllCampaigns(survey.getId());
-
- ui.getCampaignListModel().setElements(allCampaigns);
- ui.getCampaignListModel().setSelectedItem(null);
- }
- comboIsAdjusting = false;
-
- selectCampaign();
- }
-
- public void selectCampaign() {
-
- if (!comboIsAdjusting) {
-
- comboIsAdjusting = true;
-
- CampaignBean campaign = ui.getCampaignListModel().getSelectedItem();
- getModel().setCampaign(campaign);
-
- comboIsAdjusting = false;
- }
- }
-
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/campaign/SelectCampaignUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/campaign/SelectCampaignUIModel.java 2012-11-23 22:18:17 UTC (rev 14)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/campaign/SelectCampaignUIModel.java 2012-11-24 13:10:24 UTC (rev 15)
@@ -6,7 +6,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2012 Ifremer, Code Lutin
+ * 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
@@ -69,7 +69,7 @@
this.surveys = surveys;
// nullify survey
- setSurvey(null);
+// setSurvey(null);
firePropertyChange(PROPERTY_SURVEYS, oldValue, surveys);
}
@@ -82,7 +82,7 @@
this.survey = survey;
// nullify campaigns
- setCampaigns(null);
+// setCampaigns(null);
firePropertyChange(PROPERTY_SURVEY, oldValue, survey);
firePropertyChange(PROPERTY_SURVEY_FOUND, oldValue != null, survey != null);
@@ -101,7 +101,7 @@
this.campaigns = campaigns;
// nullify campaign
- setCampaign(null);
+// setCampaign(null);
firePropertyChange(PROPERTY_CAMPAIGNS, oldValue, campaigns);
}
@@ -120,5 +120,4 @@
return campaign != null;
}
-
}
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-23 22:18:17 UTC (rev 14)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/CatchesUI.css 2012-11-24 13:10:24 UTC (rev 15)
@@ -4,7 +4,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2012 Ifremer, Code Lutin
+ * 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
@@ -24,7 +24,7 @@
BeanComboBox {
showReset:true;
- i18nPrefix:"tutti.common.";
+ i18nPrefix:"tutti.property.";
bean:{model};
}
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-23 22:18:17 UTC (rev 14)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/CatchesUI.jaxx 2012-11-24 13:10:24 UTC (rev 15)
@@ -4,7 +4,7 @@
$Id$
$HeadURL$
%%
- Copyright (C) 2012 Ifremer, Code Lutin
+ 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
@@ -22,7 +22,7 @@
#L%
-->
<JPanel id='homePanel' layout='{new BorderLayout()}'
- implements='fr.ifremer.tutti.ui.swing.TuttiUI<CatchesUIHandler>'>
+ implements='fr.ifremer.tutti.ui.swing.TuttiUI<CatchesUIModel, CatchesUIHandler>'>
<import>
fr.ifremer.tutti.persistence.entities.TraitBean
@@ -67,26 +67,26 @@
</Table>
<JTabbedPane id='tabPane' constraints='BorderLayout.CENTER'>
- <tab id='traitConfigTab' title='tutti.label.tab.trait'>
- <TraitConfigTabUI id='traitConfigTabContent' constructorParams='this'/>
+ <tab id='traitTab' title='tutti.label.tab.trait'>
+ <TraitTabUI id='traitTabContent' constructorParams='this'/>
</tab>
<tab id='fishesTab' title='tutti.label.tab.fishes'>
- <JLabel text='tutti.to.be.done'/>
+ <JLabel text='tutti.to.be.done' horizontalAlignment='{JLabel.CENTER}'/>
</tab>
<tab id='benthosTab' title='tutti.label.tab.benthos'>
- <JLabel text='tutti.to.be.done'/>
+ <JLabel text='tutti.to.be.done' horizontalAlignment='{JLabel.CENTER}'/>
</tab>
<tab id='planctonTab' title='tutti.label.tab.plancton'>
- <JLabel text='tutti.to.be.done'/>
+ <JLabel text='tutti.to.be.done' horizontalAlignment='{JLabel.CENTER}'/>
</tab>
<tab id='macroDechetsTab' title='tutti.label.tab.macroDechets'>
- <JLabel text='tutti.to.be.done'/>
+ <JLabel text='tutti.to.be.done' horizontalAlignment='{JLabel.CENTER}'/>
</tab>
<tab id='captureAccidentellesTab' title='tutti.label.tab.captureAccidentelles'>
- <JLabel text='tutti.to.be.done'/>
+ <JLabel text='tutti.to.be.done' horizontalAlignment='{JLabel.CENTER}'/>
</tab>
<tab id='observationIndividuellesTab' title='tutti.label.tab.observationIndividuelles'>
- <JLabel text='tutti.to.be.done'/>
+ <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-23 22:18:17 UTC (rev 14)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/CatchesUIHandler.java 2012-11-24 13:10:24 UTC (rev 15)
@@ -6,7 +6,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2012 Ifremer, Code Lutin
+ * 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
@@ -26,6 +26,7 @@
import fr.ifremer.tutti.persistence.entities.CampaignBean;
import fr.ifremer.tutti.persistence.entities.TraitBean;
+import fr.ifremer.tutti.persistence.entities.TuttiBeans;
import fr.ifremer.tutti.service.PersistenceService;
import fr.ifremer.tutti.ui.swing.AbstractTuttiUIHandler;
import fr.ifremer.tutti.ui.swing.TuttiUIContext;
@@ -34,6 +35,7 @@
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
+import java.util.Date;
import java.util.List;
/**
@@ -42,7 +44,7 @@
* @author tchemit <chemit(a)codelutin.com>
* @since 0.1
*/
-public class CatchesUIHandler extends AbstractTuttiUIHandler {
+public class CatchesUIHandler extends AbstractTuttiUIHandler<CatchesUIModel> {
/** Logger. */
private static final Log log = LogFactory.getLog(CatchesUIHandler.class);
@@ -75,11 +77,6 @@
log.info("Loaded " + traits.size() + " trait(s).");
}
- if (!traits.isEmpty()) {
-
- model.setSelectedTrait(traits.get(0));
- }
-
ui.setContextValue(model);
}
@@ -88,33 +85,58 @@
CatchesUIModel model = ui.getModel();
- initBeanComboBox(TraitBean.class,
- ui.getTraitComboBox(),
- model.getTrait(),
+ initUI(ui);
+
+ List<TraitBean> traits = model.getTrait();
+
+ initBeanComboBox(ui.getTraitComboBox(),
+ traits,
model.getSelectedTrait());
- model.addPropertyChangeListener("selectedTrait", new PropertyChangeListener() {
+ model.addPropertyChangeListener(CatchesUIModel.PROPERTY_SELECTED_TRAIT, new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
selectTrait((TraitBean) evt.getNewValue());
}
});
-// selectTrait(null);
+ model.addPropertyChangeListener(CatchesUIModel.PROPERTY_TRAIT, new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ ui.getTraitComboBox().setData(null);
+ ui.getTraitComboBox().setData((List<TraitBean>) evt.getNewValue());
+ }
+ });
+
+ if (!traits.isEmpty()) {
+
+ model.setSelectedTrait(traits.get(0));
+ }
}
@Override
public void onCloseUI() {
+
+ // ui will be saved so we do not want to keep selected tab indexes
+ ui.getTabPane().setSelectedIndex(0);
+ ui.getTraitTabContent().getTraitTabPane().setSelectedIndex(0);
}
+ @Override
+ protected CatchesUIModel getModel() {
+ return ui.getModel();
+ }
+
public void createNewTrait() {
// deselect selected trait
ui.getModel().setSelectedTrait(null);
// use a new empty trait
- TraitBean selectedTrait = new TraitBean();
- selectTrait(selectedTrait);
+ TraitBean newTrait = new TraitBean();
+ newTrait.setCampaign(ui.getModel().getCampaign());
+ newTrait.setDate(new Date());
+ selectTrait(newTrait);
}
public void selectTrait(TraitBean selectedTrait) {
@@ -122,9 +144,18 @@
if (log.isInfoEnabled()) {
log.info("New selected trait: " + selectedTrait);
}
+ // back to trait tab
+ ui.getTabPane().setSelectedIndex(0);
- ui.getTraitConfigTabContent().selectTrait(selectedTrait);
+ // back to general tab of trait tabs
+ ui.getTraitTabContent().getTraitTabPane().setSelectedIndex(0);
+ // propagate trait to his tabs
+ ui.getTraitTabContent().selectTrait(selectedTrait);
+
+ // repaint tabs
+ ui.getTabPane().repaint();
+
// ui.getFishesTabContent().selectTrait(selectedTrait);
// ui.getBenthosTabContent().selectTrait(selectedTrait);
// ui.getPlanctonTabContent().selectTrait(selectedTrait);
@@ -132,4 +163,36 @@
// ui.getCaptureAccidentellesTabContent().selectTrait(selectedTrait);
// ui.getObservationIndividuellesTabContent().selectTrait(selectedTrait);
}
+
+ public void saveTrait(TraitBean toSave) {
+
+ // persist the trait
+
+ boolean create = toSave.getId() == null;
+
+ TraitBean savedTrait;
+ if (create) {
+ savedTrait = persistenceService.createTrait(toSave);
+ } else {
+ savedTrait = persistenceService.saveTrait(toSave);
+ }
+
+ CatchesUIModel model = ui.getModel();
+
+ // add the saved trait to trait list
+
+ List<TraitBean> data = model.getTrait();
+
+ TraitBean existingTrait = TuttiBeans.findById(data, savedTrait.getId());
+ if (existingTrait != null) {
+ data.remove(existingTrait);
+ }
+ data.add(savedTrait);
+
+ // update model trait list
+ model.setTrait(data);
+
+ // update model selected trait
+ model.setSelectedTrait(savedTrait);
+ }
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/CatchesUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/CatchesUIModel.java 2012-11-23 22:18:17 UTC (rev 14)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/CatchesUIModel.java 2012-11-24 13:10:24 UTC (rev 15)
@@ -6,7 +6,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2012 Ifremer, Code Lutin
+ * 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
@@ -24,9 +24,9 @@
* #L%
*/
-import fr.ifremer.tutti.persistence.entities.AbstractTuttiEntity;
import fr.ifremer.tutti.persistence.entities.CampaignBean;
import fr.ifremer.tutti.persistence.entities.TraitBean;
+import org.jdesktop.beans.AbstractSerializableBean;
import java.util.List;
@@ -36,10 +36,16 @@
* @author tchemit <chemit(a)codelutin.com>
* @since 0.1
*/
-public class CatchesUIModel extends AbstractTuttiEntity {
+public class CatchesUIModel extends AbstractSerializableBean {
private static final long serialVersionUID = 1L;
+ public static final String PROPERTY_TRAIT = "trait";
+
+ public static final String PROPERTY_SELECTED_TRAIT = "selectedTrait";
+
+ public static final String PROPERTY_CAMPAIGN = "campaign";
+
protected List<TraitBean> trait;
protected TraitBean selectedTrait;
@@ -52,7 +58,7 @@
public void setTrait(List<TraitBean> trait) {
this.trait = trait;
- firePropertyChange("trait", null, trait);
+ firePropertyChange(PROPERTY_TRAIT, null, trait);
}
public TraitBean getSelectedTrait() {
@@ -62,7 +68,7 @@
public void setSelectedTrait(TraitBean selectedTrait) {
Object oldValue = getSelectedTrait();
this.selectedTrait = selectedTrait;
- firePropertyChange("selectedTrait", oldValue, selectedTrait);
+ firePropertyChange(PROPERTY_SELECTED_TRAIT, oldValue, selectedTrait);
}
public CampaignBean getCampaign() {
@@ -72,6 +78,6 @@
public void setCampaign(CampaignBean campaign) {
Object oldValue = getCampaign();
this.campaign = campaign;
- firePropertyChange("campaign", oldValue, campaign);
+ firePropertyChange(PROPERTY_CAMPAIGN, oldValue, campaign);
}
}
Deleted: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/TraitConfigTabUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/TraitConfigTabUI.css 2012-11-23 22:18:17 UTC (rev 14)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/TraitConfigTabUI.css 2012-11-24 13:10:24 UTC (rev 15)
@@ -1,136 +0,0 @@
-/*
- * #%L
- * Tutti :: UI
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2012 Ifremer, Code Lutin
- * %%
- * 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%
- */
-
-JToolBar {
- floatable:false;
-}
-
-BeanComboBox {
- showReset:true;
- i18nPrefix:"tutti.common.";
- bean:{model};
-}
-
-BeanListHeader {
- showReset:true;
- i18nPrefix:"tutti.common.";
-}
-
-JList {
- selectionMode:{ListSelectionModel.MULTIPLE_INTERVAL_SELECTION};
- model:{new DefaultListModel()};
-}
-
-NumberEditor {
- autoPopup:{handler.getConfig().isAutoPopupNumberEditor()};
- showPopupButton:{handler.getConfig().isShowNumberEditorButton()};
-}
-
-#stationNumberLabel {
- text:"tutti.label.trait.stationNumber";
- labelFor:{stationNumberField};
-}
-
-#stationNumberField {
- bean:{model};
- property:"stationNumber";
- model:{model.getStationNumber()};
- showReset:true;
- useFloat:false;
- numberPattern:{INT_6_DIGITS_PATTERN};
-}
-
-#traitNumberLabel {
- text:"tutti.label.trait.traitNumber";
- labelFor:{traitNumberField};
-}
-
-#traitNumberField {
- bean:{model};
- property:"traitNumber";
- model:{model.getTraitNumber()};
- showReset:true;
- useFloat:false;
- numberPattern:{INT_6_DIGITS_PATTERN};
-}
-
-#dateLabel {
- text:"tutti.label.trait.date";
- labelFor:{dateField};
-}
-
-#dateField {
- date:{model.getDate()};
- formats:{"dd/MM/yyyy"};
-}
-
-#saisisseurPane {
- horizontalScrollBarPolicy:{JScrollPane.HORIZONTAL_SCROLLBAR_NEVER};
- verticalScrollBarPolicy:{JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED};
-}
-
-#saisisseurHeader {
- labelText:{_("tutti.label.list.saisisseur")};
- list:{saisisseurList};
- beanType:{UserBean.class};
-}
-
-#commentPane {
- columnHeaderView:{new JLabel(_("tutti.label.comment"))};
- minimumSize:{new Dimension(10,50)};
-}
-
-#commentField {
- text:{getStringValue(model.getComment())};
-}
-
-#noSelectionPane {
- text:"tutti.to.be.done";
-}
-
-#saveButton {
- actionIcon:"save";
- text:"tutti.action.save";
- enabled:{validator.isValid()};
-}
-
-#cancelButton {
- actionIcon:"cancel";
- text:"tutti.action.cancel";
-}
-
-#messagePanel {
- border:{BorderFactory.createTitledBorder("Messages")};
- height:200;
- width:500;
-}
-
-#errorTable {
- rowSelectionAllowed:true;
- autoCreateRowSorter:true;
- autoResizeMode:2;
- cellSelectionEnabled:false;
- selectionMode:0;
- model:{errorTableModel};
-}
\ No newline at end of file
Deleted: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/TraitConfigTabUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/TraitConfigTabUI.jaxx 2012-11-23 22:18:17 UTC (rev 14)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/TraitConfigTabUI.jaxx 2012-11-24 13:10:24 UTC (rev 15)
@@ -1,154 +0,0 @@
-<!--
- #%L
- Tutti :: UI
- $Id$
- $HeadURL$
- %%
- Copyright (C) 2012 Ifremer, Code Lutin
- %%
- 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<TraitConfigTabUIHandler>'>
-
- <import>
- fr.ifremer.tutti.persistence.entities.CountryBean
- fr.ifremer.tutti.persistence.entities.GearBean
- fr.ifremer.tutti.persistence.entities.SurveyBean
- fr.ifremer.tutti.persistence.entities.UserBean
- fr.ifremer.tutti.persistence.entities.VesselBean
- fr.ifremer.tutti.persistence.entities.TraitBean
- fr.ifremer.tutti.ui.swing.TuttiUIContext
-
- jaxx.runtime.swing.editor.bean.BeanComboBox
- jaxx.runtime.swing.editor.bean.BeanListHeader
- jaxx.runtime.swing.editor.NumberEditor
-
- jaxx.runtime.validator.swing.SwingValidatorUtil
- jaxx.runtime.validator.swing.SwingValidatorMessageTableModel
-
- org.jdesktop.swingx.JXDatePicker
-
- java.awt.Dimension
-
- javax.swing.DefaultListModel
- javax.swing.ListSelectionModel
-
- static org.nuiton.i18n.I18n._
- static jaxx.runtime.SwingUtil.getStringValue
- </import>
-
- <script><![CDATA[
-
-public TraitConfigTabUI(CatchesUI parentUI) {
- TraitConfigTabUIHandler handler =
- new TraitConfigTabUIHandler(parentUI, this);
- setContextValue(handler);
- handler.beforeInitUI();
-}
-
-public void selectTrait(TraitBean trait) { handler.selectTrait(trait); }
-
-protected void $afterCompleteSetup() { handler.afterInitUI(); }
- ]]></script>
-
- <TraitConfigTabUIHandler id='handler'
- initializer='getContextValue(TraitConfigTabUIHandler.class)'/>
-
- <TraitConfigTabUIModel id='model'
- initializer='getContextValue(TraitConfigTabUIModel.class)'/>
-
- <SwingValidatorMessageTableModel id='errorTableModel'/>
-
- <BeanValidator id='validator' bean='model' errorTableModel='errorTableModel'
- uiClass='jaxx.runtime.validator.swing.ui.ImageValidationUI'>
- <field name='stationNumber' component='stationNumberField'/>
- <field name='traitNumber' component='traitNumberField'/>
- <field name='date' component='dateField'/>
- <field name='comment' component='commentField'/>
- <field name='saisisseur' component='saisisseurPane'/>
- </BeanValidator>
-
- <Table fill='both' id='traitForm' constraints='BorderLayout.CENTER'>
-
- <!-- Trait numero station -->
- <row>
- <cell>
- <JLabel id='stationNumberLabel'/>
- </cell>
- <cell weightx='1.0'>
- <NumberEditor id='stationNumberField' constructorParams='this'/>
- </cell>
- </row>
-
- <!-- Trait numero trait / chalut -->
- <row>
- <cell>
- <JLabel id='traitNumberLabel'/>
- </cell>
- <cell>
- <NumberEditor id='traitNumberField' constructorParams='this'/>
- </cell>
- </row>
-
- <!-- Trait date -->
- <row>
- <cell>
- <JLabel id='dateLabel'/>
- </cell>
- <cell>
- <JXDatePicker id='dateField'
- onActionPerformed='getModel().setDate(((JXDatePicker)event.getSource()).getDate())'/>
- </cell>
- </row>
-
- <!-- Trait saisisseur -->
- <row>
- <cell columns='2'>
- <JScrollPane id='saisisseurPane'
- columnHeaderView="{saisisseurHeader}"
- onFocusGained='saisisseurList.requestFocus()'>
- <JList id='saisisseurList' genericType='UserBean'
- onValueChanged='if ( !event.getValueIsAdjusting()) { handler.selectSaisisseur(((JList)event.getSource()).getSelectedValues()); }'/>
- <BeanListHeader id='saisisseurHeader' genericType='UserBean'/>
- </JScrollPane>
- </cell>
- </row>
-
- <!-- Trait comment -->
- <row weighty='0.3'>
- <cell columns='2'>
- <JScrollPane id='commentPane'
- onFocusGained='commentField.requestFocus()'>
- <JTextArea id='commentField'
- onKeyReleased='getModel().setComment(((JTextArea)event.getSource()).getText())'/>
- </JScrollPane>
- </cell>
- </row>
-
- <!-- Actions -->
- <row>
- <cell columns='2'>
- <JPanel layout='{new GridLayout(1,2,0,0)}'>
- <JButton id='cancelButton' onActionPerformed='handler.cancel()'/>
- <JButton id='saveButton' onActionPerformed='handler.save()'/>
- </JPanel>
- </cell>
- </row>
- </Table>
-
- <JLabel id='noSelectionPane'/>
-</JPanel>
Deleted: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/TraitConfigTabUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/TraitConfigTabUIHandler.java 2012-11-23 22:18:17 UTC (rev 14)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/TraitConfigTabUIHandler.java 2012-11-24 13:10:24 UTC (rev 15)
@@ -1,176 +0,0 @@
-package fr.ifremer.tutti.ui.swing.content.catches;
-
-/*
- * #%L
- * Tutti :: UI
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2012 Ifremer, Code Lutin
- * %%
- * 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.TraitBean;
-import fr.ifremer.tutti.persistence.entities.UserBean;
-import fr.ifremer.tutti.service.PersistenceService;
-import fr.ifremer.tutti.ui.swing.AbstractTuttiUIHandler;
-import jaxx.runtime.swing.Table;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import javax.swing.JLabel;
-import javax.swing.ListSelectionModel;
-import java.awt.BorderLayout;
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.util.List;
-
-/**
- * Handler for UI {@link TraitConfigTabUI}.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.1
- */
-public class TraitConfigTabUIHandler extends AbstractTuttiUIHandler {
-
- /** Logger. */
- private static final Log log =
- LogFactory.getLog(TraitConfigTabUIHandler.class);
-
- private final TraitConfigTabUI ui;
-
- private final CatchesUI parentUi;
-
- private final PersistenceService persistenceService;
-
- public TraitConfigTabUIHandler(CatchesUI parentUi,
- TraitConfigTabUI ui) {
- super(parentUi.getHandler().getContext());
- this.ui = ui;
- this.parentUi = parentUi;
- persistenceService = context.getService(PersistenceService.class);
- }
-
- @Override
- public void beforeInitUI() {
-
- TraitConfigTabUIModel model = new TraitConfigTabUIModel();
- model.addPropertyChangeListener("empty", new PropertyChangeListener() {
- @Override
- public void propertyChange(PropertyChangeEvent evt) {
- Table form = ui.getTraitForm();
- JLabel noContentPane = ui.getNoSelectionPane();
-
- Boolean empty = (Boolean) evt.getNewValue();
- ui.remove(form);
- ui.remove(noContentPane);
- if (empty) {
- ui.add(noContentPane, BorderLayout.CENTER);
- } else {
- ui.add(form, BorderLayout.CENTER);
- }
- }
- });
- ui.setContextValue(model);
- }
-
- @Override
- public void afterInitUI() {
-
- TraitConfigTabUIModel model = ui.getModel();
-
- List<UserBean> users = persistenceService.getAllUsers();
-
- initBeanList(UserBean.class,
- ui.getSaisisseurHeader(),
- users,
- model.getSaisisseur());
-
- initNumberEditor(ui.getStationNumberField());
- initNumberEditor(ui.getTraitNumberField());
- initDatePicker(ui.getDateField());
-
- model.setEmpty(true);
- }
-
- @Override
- public void onCloseUI() {
- }
-
- public void selectSaisisseur(Object... selected) {
-
- ListSelectionModel selectionModel =
- ui.getSaisisseurList().getSelectionModel();
- selectionModel.setValueIsAdjusting(true);
- try {
- List<UserBean> selectedList = Lists.newLinkedList();
- for (Object o : selected) {
- selectedList.add((UserBean) o);
- }
- ui.getModel().setSaisisseur(selectedList);
- } finally {
- selectionModel.setValueIsAdjusting(false);
- }
- }
-
- public void selectTrait(TraitBean bean) {
-
- boolean empty = bean == null;
-
- TraitConfigTabUIModel model = ui.getModel();
-
- // clean previous selection
- ui.getSaisisseurHeader().getList().clearSelection();
-
- if (empty) {
-
- model.fromBean(new TraitBean());
- } else {
-
- model.fromBean(bean);
- }
-
- model.setEmpty(empty);
-
- ui.getValidator().reloadBean();
- }
-
- public void cancel() {
-
- String id = ui.getModel().getId();
- boolean newBean = StringUtils.isBlank(id);
-
- if (newBean) {
-
- // cancel to create a new trait
- parentUi.getHandler().selectTrait(null);
-
- } else {
-
- // reselect in ui the trait
- TraitBean selectedTrait = parentUi.getModel().getSelectedTrait();
- parentUi.getHandler().selectTrait(selectedTrait);
- }
-
- }
-
- public void save() {
-
- }
-}
Deleted: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/TraitConfigTabUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/TraitConfigTabUIModel.java 2012-11-23 22:18:17 UTC (rev 14)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/TraitConfigTabUIModel.java 2012-11-24 13:10:24 UTC (rev 15)
@@ -1,415 +0,0 @@
-package fr.ifremer.tutti.ui.swing.content.catches;
-
-/*
- * #%L
- * Tutti :: UI
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2012 Ifremer, Code Lutin
- * %%
- * 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.AbstractTuttiEntity;
-import fr.ifremer.tutti.persistence.entities.CampaignBean;
-import fr.ifremer.tutti.persistence.entities.TraitBean;
-import fr.ifremer.tutti.persistence.entities.UserBean;
-import org.nuiton.util.beans.BinderFactory;
-
-import java.util.Date;
-import java.util.List;
-
-/**
- * Model for UI {@link TraitConfigTabUI}.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.1
- */
-public class TraitConfigTabUIModel extends AbstractTuttiEntity {
-
- private static final long serialVersionUID = 1L;
-
- protected boolean empty;
-
- protected CampaignBean campaign;
-
- protected Integer stationNumber;
-
- protected Integer traitNumber;
-
- protected Date date;
-
- protected Object associationStrate;
-
- protected Float enPecheLatitude;
-
- protected Float enPecheLongitude;
-
- protected Date enPecheTime;
-
- protected Float enPecheProfondeur;
-
- protected Float sortieDeLEauLatitude;
-
- protected Float sortieDeLEauLongitude;
-
- protected Date sortieDeLEauTime;
-
- protected Float sortieDeLEauProfondeur;
-
- protected Integer forceVent;
-
- protected Integer directionVent;
-
- protected Object etatMer;
-
- protected Float ouvertureHorizontale;
-
- protected Float ouvertureVerticale;
-
- protected Boolean geometrieMesuree;
-
- protected Float longueurFunes;
-
- protected Float longueurBras;
-
- protected Boolean systemeFermetureCul;
-
- protected Boolean traitRectiligne;
-
- protected Float distanceChalutee;
-
- protected Float duree;
-
- protected Boolean traitValid;
-
- protected String localite;
-
- protected String comment;
-
- protected List<UserBean> saisisseur;
-
-
- public boolean isEmpty() {
- return empty;
- }
-
- public void setEmpty(boolean empty) {
- Object oldValue = isEmpty();
- this.empty = empty;
- firePropertyChange("empty", oldValue, empty);
- }
-
- public CampaignBean getCampaign() {
- return campaign;
- }
-
- public void setCampaign(CampaignBean campaign) {
- this.campaign = campaign;
- }
-
- public Integer getStationNumber() {
- return stationNumber;
- }
-
- public void setStationNumber(Integer stationNumber) {
- Object oldValue = getStationNumber();
- this.stationNumber = stationNumber;
- firePropertyChange("stationNumber", oldValue, stationNumber);
- }
-
- public Integer getTraitNumber() {
- return traitNumber;
- }
-
- public void setTraitNumber(Integer traitNumber) {
- Object oldValue = getTraitNumber();
- this.traitNumber = traitNumber;
- firePropertyChange("traitNumber", oldValue, traitNumber);
- }
-
- public Date getDate() {
- return date;
- }
-
- public void setDate(Date date) {
- Object oldValue = getDate();
- this.date = date;
- firePropertyChange("date", oldValue, date);
- }
-
- public Object getAssociationStrate() {
- return associationStrate;
- }
-
- public void setAssociationStrate(Object associationStrate) {
- Object oldValue = getAssociationStrate();
- this.associationStrate = associationStrate;
- firePropertyChange("associationStrate", oldValue, associationStrate);
- }
-
- public Float getEnPecheLatitude() {
- return enPecheLatitude;
- }
-
- public void setEnPecheLatitude(Float enPecheLatitude) {
- Object oldValue = getEnPecheLatitude();
- this.enPecheLatitude = enPecheLatitude;
- firePropertyChange("enPecheLatitude", oldValue, enPecheLatitude);
- }
-
- public Float getEnPecheLongitude() {
- return enPecheLongitude;
- }
-
- public void setEnPecheLongitude(Float enPecheLongitude) {
- Object oldValue = getEnPecheLongitude();
- this.enPecheLongitude = enPecheLongitude;
- firePropertyChange("enPecheLongitude", oldValue, enPecheLongitude);
- }
-
- public Date getEnPecheTime() {
- return enPecheTime;
- }
-
- public void setEnPecheTime(Date enPecheTime) {
- Object oldValue = getEnPecheTime();
- this.enPecheTime = enPecheTime;
- firePropertyChange("enPecheTime", oldValue, enPecheTime);
- }
-
- public Float getEnPecheProfondeur() {
- return enPecheProfondeur;
- }
-
- public void setEnPecheProfondeur(Float enPecheProfondeur) {
- Object oldValue = getEnPecheProfondeur();
- this.enPecheProfondeur = enPecheProfondeur;
- firePropertyChange("enPecheProfondeur", oldValue, enPecheProfondeur);
- }
-
- public Float getSortieDeLEauLatitude() {
- return sortieDeLEauLatitude;
- }
-
- public void setSortieDeLEauLatitude(Float sortieDeLEauLatitude) {
- Object oldValue = getSortieDeLEauLatitude();
- this.sortieDeLEauLatitude = sortieDeLEauLatitude;
- firePropertyChange("sortieDeLEauLatitude", oldValue, sortieDeLEauLatitude);
- }
-
- public Float getSortieDeLEauLongitude() {
- return sortieDeLEauLongitude;
- }
-
- public void setSortieDeLEauLongitude(Float sortieDeLEauLongitude) {
- Object oldValue = getSortieDeLEauLongitude();
- this.sortieDeLEauLongitude = sortieDeLEauLongitude;
- firePropertyChange("sortieDeLEauLongitude", oldValue, sortieDeLEauLongitude);
- }
-
- public Date getSortieDeLEauTime() {
- return sortieDeLEauTime;
- }
-
- public void setSortieDeLEauTime(Date sortieDeLEauTime) {
- Object oldValue = getSortieDeLEauTime();
- this.sortieDeLEauTime = sortieDeLEauTime;
- firePropertyChange("sortieDeLEauTime", oldValue, sortieDeLEauTime);
- }
-
- public Float getSortieDeLEauProfondeur() {
- return sortieDeLEauProfondeur;
- }
-
- public void setSortieDeLEauProfondeur(Float sortieDeLEauProfondeur) {
- Object oldValue = getSortieDeLEauProfondeur();
- this.sortieDeLEauProfondeur = sortieDeLEauProfondeur;
- firePropertyChange("sortieDeLEauProfondeur", oldValue, sortieDeLEauProfondeur);
- }
-
- public Integer getForceVent() {
- return forceVent;
- }
-
- public void setForceVent(Integer forceVent) {
- Object oldValue = getForceVent();
- this.forceVent = forceVent;
- firePropertyChange("forceVent", oldValue, forceVent);
- }
-
- public Integer getDirectionVent() {
- return directionVent;
- }
-
- public void setDirectionVent(Integer directionVent) {
- Object oldValue = getDirectionVent();
- this.directionVent = directionVent;
- firePropertyChange("directionVent", oldValue, directionVent);
- }
-
- public Object getEtatMer() {
- return etatMer;
- }
-
- public void setEtatMer(Object etatMer) {
- Object oldValue = getEtatMer();
- this.etatMer = etatMer;
- firePropertyChange("etatMer", oldValue, etatMer);
- }
-
- public Float getOuvertureHorizontale() {
- return ouvertureHorizontale;
- }
-
- public void setOuvertureHorizontale(Float ouvertureHorizontale) {
- Object oldValue = getOuvertureHorizontale();
- this.ouvertureHorizontale = ouvertureHorizontale;
- firePropertyChange("ouvertureHorizontale", oldValue, ouvertureHorizontale);
- }
-
- public Float getOuvertureVerticale() {
- return ouvertureVerticale;
- }
-
- public void setOuvertureVerticale(Float ouvertureVerticale) {
- Object oldValue = getOuvertureVerticale();
- this.ouvertureVerticale = ouvertureVerticale;
- firePropertyChange("ouvertureVerticale", oldValue, ouvertureVerticale);
- }
-
- public Boolean getGeometrieMesuree() {
- return geometrieMesuree;
- }
-
- public void setGeometrieMesuree(Boolean geometrieMesuree) {
- Object oldValue = getGeometrieMesuree();
- this.geometrieMesuree = geometrieMesuree;
- firePropertyChange("geometrieMesuree", oldValue, geometrieMesuree);
- }
-
- public Float getLongueurFunes() {
- return longueurFunes;
- }
-
- public void setLongueurFunes(Float longueurFunes) {
- Object oldValue = getLongueurFunes();
- this.longueurFunes = longueurFunes;
- firePropertyChange("longueurFunes", oldValue, longueurFunes);
- }
-
- public Float getLongueurBras() {
- return longueurBras;
- }
-
- public void setLongueurBras(Float longueurBras) {
- Object oldValue = getLongueurBras();
- this.longueurBras = longueurBras;
- firePropertyChange("longueurBras", oldValue, longueurBras);
- }
-
- public Boolean getSystemeFermetureCul() {
- return systemeFermetureCul;
- }
-
- public void setSystemeFermetureCul(Boolean systemeFermetureCul) {
- Object oldValue = getSystemeFermetureCul();
- this.systemeFermetureCul = systemeFermetureCul;
- firePropertyChange("systemeFermetureCul", oldValue, systemeFermetureCul);
- }
-
- public Boolean getTraitRectiligne() {
- return traitRectiligne;
- }
-
- public void setTraitRectiligne(Boolean traitRectiligne) {
- Object oldValue = getTraitRectiligne();
- this.traitRectiligne = traitRectiligne;
- firePropertyChange("traitRectiligne", oldValue, traitRectiligne);
- }
-
- public Float getDistanceChalutee() {
- return distanceChalutee;
- }
-
- public void setDistanceChalutee(Float distanceChalutee) {
- Object oldValue = getDistanceChalutee();
- this.distanceChalutee = distanceChalutee;
- firePropertyChange("distanceChalutee", oldValue, distanceChalutee);
- }
-
- public Float getDuree() {
- return duree;
- }
-
- public void setDuree(Float duree) {
- Object oldValue = getDuree();
- this.duree = duree;
- firePropertyChange("duree", oldValue, duree);
- }
-
- public Boolean getTraitValid() {
- return traitValid;
- }
-
- public void setTraitValid(Boolean traitValid) {
- Object oldValue = getTraitValid();
- this.traitValid = traitValid;
- firePropertyChange("traitValid", oldValue, traitValid);
- }
-
- public String getLocalite() {
- return localite;
- }
-
- public void setLocalite(String localite) {
- Object oldValue = getLocalite();
- this.localite = localite;
- firePropertyChange("localite", oldValue, localite);
- }
-
- public String getComment() {
- return comment;
- }
-
- public void setComment(String comment) {
- Object oldValue = getComment();
- this.comment = comment;
- firePropertyChange("comment", oldValue, comment);
- }
-
- public List<UserBean> getSaisisseur() {
- return saisisseur;
- }
-
- public void setSaisisseur(List<UserBean> saisisseur) {
- this.saisisseur = saisisseur;
- firePropertyChange("saisisseur", null, saisisseur);
- }
-
- public void fromBean(TraitBean bean) {
- BinderFactory.newBinder(TraitBean.class,
- TraitConfigTabUIModel.class).copy(bean, this);
- }
-
- public TraitBean toBean() {
- TraitBean result = new TraitBean();
- BinderFactory.newBinder(TraitConfigTabUIModel.class,
- TraitBean.class).copy(this, result);
- return result;
- }
-}
\ No newline at end of file
Copied: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/TraitTabUI.css (from rev 12, trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/TraitConfigTabUI.css)
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/TraitTabUI.css (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/TraitTabUI.css 2012-11-24 13:10:24 UTC (rev 15)
@@ -0,0 +1,493 @@
+/*
+ * #%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%
+ */
+
+JToolBar {
+ floatable:false;
+}
+
+BeanComboBox {
+ showReset:true;
+ i18nPrefix:"tutti.property.";
+ bean:{model};
+}
+
+BeanListHeader {
+ showReset:true;
+ i18nPrefix:"tutti.property.";
+}
+
+JList {
+ selectionMode:{ListSelectionModel.MULTIPLE_INTERVAL_SELECTION};
+ model:{new DefaultListModel()};
+}
+
+NumberEditor {
+ autoPopup:{handler.getConfig().isAutoPopupNumberEditor()};
+ showPopupButton:{handler.getConfig().isShowNumberEditorButton()};
+ bean:{model};
+ showReset:true;
+}
+
+#stationNumberLabel {
+ text:"tutti.label.trait.stationNumber";
+ labelFor:{stationNumberField};
+}
+
+#stationNumberTraitNumberLabel {
+ text:"tutti.label.trait.stationNumberTraitNumber";
+}
+
+#stationNumberField {
+ property:"stationNumber";
+ model:{model.getStationNumber()};
+ useFloat:false;
+ numberPattern:{INT_6_DIGITS_PATTERN};
+}
+
+#traitNumberLabel {
+ text:"tutti.label.trait.traitNumber";
+ labelFor:{traitNumberField};
+}
+
+#traitNumberField {
+ property:"traitNumber";
+ model:{model.getTraitNumber()};
+ useFloat:false;
+ numberPattern:{INT_6_DIGITS_PATTERN};
+}
+
+#dateLabel {
+ text:"tutti.label.trait.date";
+ labelFor:{dateField};
+}
+
+#dateField {
+ date:{model.getDate()};
+ formats:{"dd/MM/yyyy"};
+}
+
+#strataLabel {
+ text:"tutti.label.trait.strata";
+ labelFor:{strataComboBox};
+}
+
+#strataComboBox {
+ property:"strata";
+ selectedItem:{model.getStrata()};
+}
+
+#beaufortScaleLabel {
+ text:"tutti.label.trait.beaufortScale";
+ labelFor:{beaufortScaleComboBox};
+}
+
+#beaufortScaleComboBox {
+ property:"beaufortScale";
+ selectedItem:{model.getBeaufortScale()};
+}
+
+#windDirectionLabel {
+ text:"tutti.label.trait.windDirection";
+ labelFor:{windDirectionField};
+}
+
+#windDirectionField {
+ property:"windDirection";
+ model:{model.getWindDirection()};
+ useFloat:false;
+ numberPattern:{INT_6_DIGITS_PATTERN};
+}
+
+#seaStateLabel {
+ text:"tutti.label.trait.seaState";
+ labelFor:{seaStateComboBox};
+}
+
+#seaStateComboBox {
+ property:"seaState";
+ selectedItem:{model.getSeaState()};
+}
+
+#ouvertureHorizontaleLabel {
+ text:"tutti.label.trait.ouvertureHorizontale";
+ labelFor:{ouvertureHorizontaleField};
+}
+
+#ouvertureHorizontaleVerticaleLabel {
+ text:"tutti.label.trait.ouvertureHorizontaleVerticale";
+}
+
+#ouvertureHorizontaleField {
+ property:"ouvertureHorizontale";
+ model:{model.getOuvertureHorizontale()};
+ useFloat:false;
+ numberPattern:{INT_6_DIGITS_PATTERN};
+}
+
+#ouvertureVerticaleLabel {
+ text:"tutti.label.trait.ouvertureVerticale";
+ labelFor:{ouvertureVerticaleField};
+}
+
+#ouvertureVerticaleField {
+ property:"ouvertureVerticale";
+ model:{model.getOuvertureVerticale()};
+ useFloat:false;
+ numberPattern:{INT_6_DIGITS_PATTERN};
+}
+
+#geometrieMesureeCheckBox {
+ text:"tutti.label.trait.geometrieMesuree";
+ selected:{model.isGeometrieMesuree()};
+}
+
+#longueurFunesLabel {
+ text:"tutti.label.trait.longueurFunes";
+ labelFor:{longueurFunesField};
+}
+
+#longueurFunesBrasLabel {
+ text:"tutti.label.trait.longueurFunesBras";
+}
+
+#longueurFunesField {
+ property:"longueurFunes";
+ model:{model.getLongueurFunes()};
+ useFloat:false;
+ numberPattern:{INT_6_DIGITS_PATTERN};
+}
+
+#longueurBrasLabel {
+ text:"tutti.label.trait.longueurBras";
+ labelFor:{longueurBrasField};
+}
+
+#longueurBrasField {
+ property:"longueurBras";
+ model:{model.getLongueurBras()};
+ useFloat:false;
+ numberPattern:{INT_6_DIGITS_PATTERN};
+}
+
+#systemeFermetureCulCheckBox {
+ text:"tutti.label.trait.systemeFermetureCul";
+ selected:{model.isSystemeFermetureCul()};
+}
+
+#traitRectiligneCheckBox {
+ text:"tutti.label.trait.traitRectiligne";
+ selected:{model.isTraitRectiligne()};
+}
+
+#distanceChaluteeLabel {
+ text:"tutti.label.trait.distanceChalutee";
+ labelFor:{distanceChaluteeField};
+}
+
+#distanceChaluteeDureeLabel {
+ text:"tutti.label.trait.distanceChaluteeDuree";
+}
+
+#distanceChaluteeField {
+ property:"distanceChalutee";
+ model:{model.getDistanceChalutee()};
+ useFloat:false;
+ numberPattern:{INT_6_DIGITS_PATTERN};
+}
+
+#dureeLabel {
+ text:"tutti.label.trait.duree";
+ labelFor:{dureeField};
+}
+
+#dureeField {
+ property:"duree";
+ model:{model.getDuree()};
+ useFloat:false;
+ numberPattern:{INT_6_DIGITS_PATTERN};
+}
+
+#traitValidCheckBox {
+ text:"tutti.label.trait.traitValid";
+ selected:{model.isTraitValid()};
+}
+
+#localiteLabel {
+ text:"tutti.label.trait.localite";
+ labelFor:{localiteField};
+}
+
+#localiteField {
+ text:{model.getLocalite()};
+}
+
+#saisisseurPane {
+ horizontalScrollBarPolicy:{JScrollPane.HORIZONTAL_SCROLLBAR_NEVER};
+ verticalScrollBarPolicy:{JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED};
+}
+
+#saisisseurHeader {
+ labelText:{_("tutti.label.list.saisisseur")};
+ list:{saisisseurList};
+ beanType:{UserBean.class};
+}
+
+#commentPane {
+ columnHeaderView:{new JLabel(_("tutti.label.comment"))};
+ minimumSize:{new Dimension(10,50)};
+}
+
+#commentField {
+ text:{model.getComment()};
+}
+
+#gearShootingStartLongitudeLabel {
+ text:"tutti.label.trait.gearShootingStartLongitude";
+ labelFor:{gearShootingStartLongitudeField};
+}
+
+#gearShootingStartLongitudeField {
+ text:{getStringValue(model.getGearShootingStartLongitude())};
+}
+
+#gearShootingStartLatitudeLabel {
+ text:"tutti.label.trait.gearShootingStartLatitude";
+ labelFor:{gearShootingStartLatitudeField};
+}
+
+#gearShootingStartLatitudeField {
+ text:{getStringValue(model.getGearShootingStartLatitude())};
+}
+
+#gearShootingStartTimeLabel {
+ text:"tutti.label.trait.gearShootingStartTime";
+ labelFor:{gearShootingStartTimeField};
+}
+
+#gearShootingStartTimeField {
+ text:{getStringValue(model.getGearShootingStartTime())};
+}
+
+#gearShootingStartDepthLabel {
+ text:"tutti.label.trait.gearShootingStartDepth";
+ labelFor:{gearShootingStartDepthField};
+}
+
+#gearShootingStartDepthField {
+ property:"gearShootingStartDepth";
+ model:{model.getGearShootingStartDepth()};
+ useFloat:false;
+ numberPattern:{INT_6_DIGITS_PATTERN};
+}
+
+#gearShootingEndLongitudeLabel {
+ text:"tutti.label.trait.gearShootingEndLongitude";
+ labelFor:{gearShootingEndLongitudeField};
+}
+
+#gearShootingEndLongitudeField {
+ text:{getStringValue(model.getGearShootingEndLongitude())};
+}
+
+#gearShootingEndLatitudeLabel {
+ text:"tutti.label.trait.gearShootingEndLatitude";
+ labelFor:{gearShootingEndLatitudeField};
+}
+
+#gearShootingEndLatitudeField {
+ text:{getStringValue(model.getGearShootingEndLatitude())};
+}
+
+#gearShootingEndTimeLabel {
+ text:"tutti.label.trait.gearShootingEndTime";
+ labelFor:{gearShootingEndTimeField};
+}
+
+#gearShootingEndTimeField {
+ text:{getStringValue(model.getGearShootingEndTime())};
+}
+
+#gearShootingEndDepthLabel {
+ text:"tutti.label.trait.gearShootingEndDepth";
+ labelFor:{gearShootingEndDepthField};
+}
+
+#gearShootingEndDepthField {
+ property:"gearShootingEndDepth";
+ model:{model.getGearShootingEndDepth()};
+ useFloat:false;
+ numberPattern:{INT_6_DIGITS_PATTERN};
+}
+
+#gearShootingStartSurfaceTemperatureLabel {
+ text:"tutti.label.trait.gearShootingStartSurfaceTemperature";
+ labelFor:{gearShootingStartSurfaceTemperatureField};
+}
+
+#gearShootingStartSurfaceTemperatureField {
+ property:"gearShootingStartSurfaceTemperature";
+ model:{model.getGearShootingStartSurfaceTemperature()};
+ useFloat:false;
+ numberPattern:{INT_6_DIGITS_PATTERN};
+}
+
+#gearShootingEndSurfaceTemperatureLabel {
+ text:"tutti.label.trait.gearShootingEndSurfaceTemperature";
+ labelFor:{gearShootingEndSurfaceTemperatureField};
+}
+
+#gearShootingEndSurfaceTemperatureField {
+ property:"gearShootingEndSurfaceTemperature";
+ model:{model.getGearShootingEndSurfaceTemperature()};
+ useFloat:false;
+ numberPattern:{INT_6_DIGITS_PATTERN};
+}
+
+#gearShootingStartBottomTemperatureLabel {
+ text:"tutti.label.trait.gearShootingStartBottomTemperature";
+ labelFor:{gearShootingStartBottomTemperatureField};
+}
+
+#gearShootingStartBottomTemperatureField {
+ property:"gearShootingStartBottomTemperature";
+ model:{model.getGearShootingStartBottomTemperature()};
+ useFloat:false;
+ numberPattern:{INT_6_DIGITS_PATTERN};
+}
+
+#gearShootingEndBottomTemperatureLabel {
+ text:"tutti.label.trait.gearShootingEndBottomTemperature";
+ labelFor:{gearShootingEndBottomTemperatureField};
+}
+
+#gearShootingEndBottomTemperatureField {
+ property:"gearShootingEndBottomTemperature";
+ model:{model.getGearShootingEndBottomTemperature()};
+ useFloat:false;
+ numberPattern:{INT_6_DIGITS_PATTERN};
+}
+
+#averageBottomTemperatureLabel {
+ text:"tutti.label.trait.averageBottomTemperature";
+ labelFor:{averageBottomTemperatureField};
+}
+
+#averageBottomTemperatureField {
+ property:"averageBottomTemperature";
+ model:{model.getAverageBottomTemperature()};
+ useFloat:false;
+ numberPattern:{INT_6_DIGITS_PATTERN};
+}
+
+#gearShootingStartSurfaceSalinityLabel {
+ text:"tutti.label.trait.gearShootingStartSurfaceSalinity";
+ labelFor:{gearShootingStartSurfaceSalinityField};
+}
+
+#gearShootingStartSurfaceSalinityField {
+ property:"gearShootingStartSurfaceSalinity";
+ model:{model.getGearShootingStartSurfaceSalinity()};
+ useFloat:false;
+ numberPattern:{INT_6_DIGITS_PATTERN};
+}
+
+#gearShootingEndSurfaceSalinityLabel {
+ text:"tutti.label.trait.gearShootingEndSurfaceSalinity";
+ labelFor:{gearShootingEndSurfaceSalinityField};
+}
+
+#gearShootingEndSurfaceSalinityField {
+ property:"gearShootingEndSurfaceSalinity";
+ model:{model.getGearShootingEndSurfaceSalinity()};
+ useFloat:false;
+ numberPattern:{INT_6_DIGITS_PATTERN};
+}
+
+#gearShootingStartBottomSalinityLabel {
+ text:"tutti.label.trait.gearShootingStartBottomSalinity";
+ labelFor:{gearShootingStartBottomSalinityField};
+}
+
+#gearShootingStartBottomSalinityField {
+ property:"gearShootingStartBottomSalinity";
+ model:{model.getGearShootingStartBottomSalinity()};
+ useFloat:false;
+ numberPattern:{INT_6_DIGITS_PATTERN};
+}
+
+#gearShootingEndBottomSalinityLabel {
+ text:"tutti.label.trait.gearShootingEndBottomSalinity";
+ labelFor:{gearShootingEndBottomSalinityField};
+}
+
+#gearShootingEndBottomSalinityField {
+ property:"gearShootingEndBottomSalinity";
+ model:{model.getGearShootingEndBottomSalinity()};
+ useFloat:false;
+ numberPattern:{INT_6_DIGITS_PATTERN};
+}
+
+#averageBottomSalinityLabel {
+ text:"tutti.label.trait.averageBottomSalinity";
+ labelFor:{averageBottomSalinityField};
+}
+
+#averageBottomSalinityField {
+ property:"averageBottomSalinity";
+ model:{model.getAverageBottomSalinity()};
+ useFloat:false;
+ numberPattern:{INT_6_DIGITS_PATTERN};
+}
+
+#noTraitPane {
+ text:"tutti.label.no.trait.selected";
+ horizontalAlignment:{JLabel.CENTER};
+}
+
+#saveButton {
+ actionIcon:"save";
+ text:"tutti.action.save";
+ enabled:{model.isModify() && model.isValid()};
+}
+
+#cancelButton {
+ actionIcon:"cancel";
+ text:"tutti.action.cancel";
+ enabled:{model.isModify()};
+}
+
+#messagePanel {
+ border:{BorderFactory.createTitledBorder("Messages")};
+ height:200;
+ width:500;
+}
+
+#errorTable {
+ rowSelectionAllowed:true;
+ autoCreateRowSorter:true;
+ autoResizeMode:2;
+ cellSelectionEnabled:false;
+ selectionMode:0;
+ model:{errorTableModel};
+}
\ No newline at end of file
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/TraitTabUI.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/TraitTabUI.jaxx (from rev 12, trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/TraitConfigTabUI.jaxx)
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/TraitTabUI.jaxx (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/TraitTabUI.jaxx 2012-11-24 13:10:24 UTC (rev 15)
@@ -0,0 +1,537 @@
+<!--
+ #%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<TraitTabUIModel, TraitTabUIHandler>'>
+
+ <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.bean.BeanComboBox
+ jaxx.runtime.swing.editor.bean.BeanListHeader
+ jaxx.runtime.swing.editor.NumberEditor
+
+ jaxx.runtime.validator.swing.SwingValidatorUtil
+ jaxx.runtime.validator.swing.SwingValidatorMessageTableModel
+
+ org.jdesktop.swingx.JXDatePicker
+
+ java.awt.Dimension
+
+ javax.swing.DefaultListModel
+ javax.swing.ListSelectionModel
+
+ static org.nuiton.i18n.I18n._
+ static jaxx.runtime.SwingUtil.getStringValue
+ </import>
+
+ <script><![CDATA[
+
+public TraitTabUI(CatchesUI parentUI) {
+ TraitTabUIHandler handler = new TraitTabUIHandler(parentUI, this);
+ setContextValue(handler);
+ handler.beforeInitUI();
+}
+
+public void selectTrait(TraitBean trait) { handler.selectTrait(trait); }
+
+protected void $afterCompleteSetup() { handler.afterInitUI(); }
+ ]]></script>
+
+ <TraitTabUIHandler id='handler'
+ initializer='getContextValue(TraitTabUIHandler.class)'/>
+
+ <TraitTabUIModel id='model'
+ initializer='getContextValue(TraitTabUIModel.class)'/>
+
+ <SwingValidatorMessageTableModel id='errorTableModel'/>
+
+ <BeanValidator id='validator' bean='model' errorTableModel='errorTableModel'
+ uiClass='jaxx.runtime.validator.swing.ui.ImageValidationUI'>
+ <field name='stationNumber' component='stationNumberField'/>
+ <field name='traitNumber' component='traitNumberField'/>
+ <field name='date' component='dateField'/>
+ <field name='comment' component='commentField'/>
+ <field name='saisisseur' component='saisisseurPane'/>
+ </BeanValidator>
+
+ <JPanel id='traitPane' constraints='BorderLayout.CENTER'
+ layout='{new BorderLayout()}'>
+
+ <JTabbedPane id='traitTabPane' constraints='BorderLayout.CENTER'>
+ <tab id='traitGeneralTab' title='tutti.label.tab.trait.general'>
+ <Table fill='both' id='generalForm'>
+
+ <!-- Numero station -->
+ <row>
+ <cell anchor='west'>
+ <!--JLabel id='stationNumberLabel'/-->
+ <JLabel id='stationNumberTraitNumberLabel'/>
+ </cell>
+ <cell weightx='1.0'>
+ <JPanel layout='{new GridLayout(1,0)}'>
+ <NumberEditor id='stationNumberField' constructorParams='this'/>
+ <NumberEditor id='traitNumberField' constructorParams='this'/>
+ </JPanel>
+ </cell>
+ </row>
+
+ <!-- Numero trait / chalut -->
+ <!--row>
+ <cell>
+ <JLabel id='traitNumberLabel'/>
+ </cell>
+ <cell>
+ <NumberEditor id='traitNumberField' constructorParams='this'/>
+ </cell>
+ </row-->
+
+ <!-- Date -->
+ <row>
+ <cell>
+ <JLabel id='dateLabel'/>
+ </cell>
+ <cell>
+ <JXDatePicker id='dateField'
+ onActionPerformed='model.setDate(((JXDatePicker)event.getSource()).getDate())'/>
+ </cell>
+ </row>
+
+ <!-- Strate d'association -->
+ <row>
+ <cell>
+ <JLabel id='strataLabel'/>
+ </cell>
+ <cell fill='horizontal'>
+ <BeanComboBox id='strataComboBox' constructorParams='this'
+ genericType='StrataBean'/>
+ </cell>
+ </row>
+
+ <!-- Beaufort scale -->
+ <row>
+ <cell anchor='west'>
+ <JLabel id='beaufortScaleLabel'/>
+ </cell>
+ <cell fill='horizontal'>
+ <BeanComboBox id='beaufortScaleComboBox' constructorParams='this'
+ genericType='BeaufortScaleBean'/>
+ </cell>
+ </row>
+
+ <!-- Wind direction -->
+ <row>
+ <cell anchor='west'>
+ <JLabel id='windDirectionLabel'/>
+ </cell>
+ <cell fill='horizontal'>
+ <NumberEditor id='windDirectionField' constructorParams='this'/>
+ </cell>
+ </row>
+
+ <!-- Sea state-->
+ <row>
+ <cell anchor='west'>
+ <JLabel id='seaStateLabel'/>
+ </cell>
+ <cell fill='horizontal'>
+ <BeanComboBox id='seaStateComboBox' constructorParams='this'
+ genericType='SeaStateBean'/>
+ </cell>
+ </row>
+
+ <!-- Ouverture horizontale -->
+ <row>
+ <cell anchor='west'>
+ <JLabel id='ouvertureHorizontaleVerticaleLabel'/>
+ </cell>
+ <cell fill='horizontal'>
+ <JPanel layout='{new GridLayout(1,0)}'>
+ <NumberEditor id='ouvertureHorizontaleField'
+ constructorParams='this'/>
+ <NumberEditor id='ouvertureVerticaleField'
+ constructorParams='this'/>
+ </JPanel>
+ </cell>
+ </row>
+
+ <!-- Ouverture verticale -->
+ <!--row>
+ <cell anchor='west'>
+ <JLabel id='ouvertureVerticaleLabel'/>
+ </cell>
+ <cell fill='horizontal'>
+ <NumberEditor id='ouvertureVerticaleField'
+ constructorParams='this'/>
+ </cell>
+ </row-->
+
+ <!-- Longueur funes -->
+ <row>
+ <cell anchor='west'>
+ <JLabel id='longueurFunesBrasLabel'/>
+ </cell>
+ <cell fill='horizontal'>
+ <JPanel layout='{new GridLayout(1,0)}'>
+ <NumberEditor id='longueurFunesField' constructorParams='this'/>
+ <NumberEditor id='longueurBrasField' constructorParams='this'/>
+ </JPanel>
+ </cell>
+ </row>
+
+ <!-- Longueur bras -->
+ <!--row>
+ <cell anchor='west'>
+ <JLabel id='longueurBrasLabel'/>
+ </cell>
+ <cell fill='horizontal'>
+ <NumberEditor id='longueurBrasField' constructorParams='this'/>
+ </cell>
+ </row-->
+
+ <!-- Distance chalutée -->
+ <row>
+ <cell anchor='west'>
+ <JLabel id='distanceChaluteeDureeLabel'/>
+ </cell>
+ <cell fill='horizontal'>
+ <JPanel layout='{new GridLayout(1,0)}'>
+ <NumberEditor id='distanceChaluteeField' constructorParams='this'/>
+ <NumberEditor id='dureeField' constructorParams='this'/>
+ </JPanel>
+ </cell>
+ </row>
+
+ <!-- Durée -->
+ <!--row>
+ <cell anchor='west'>
+ <JLabel id='dureeLabel'/>
+ </cell>
+ <cell fill='horizontal'>
+ <NumberEditor id='dureeField' constructorParams='this'/>
+ </cell>
+ </row-->
+
+ <!-- Localité -->
+ <row>
+ <cell>
+ <JLabel id='localiteLabel'/>
+ </cell>
+ <cell>
+ <JTextField id='localiteField'
+ onKeyReleased='handler.setText(event, "localite")'/>
+ </cell>
+ </row>
+
+ <!-- Trait valide / Rectiligne -->
+ <row>
+ <cell columns='2'>
+ <JPanel layout='{new GridLayout(1,0)}'>
+ <JCheckBox id='traitValidCheckBox'
+ onItemStateChanged='handler.setBoolean(event, "traitValid")'/>
+ <JCheckBox id='traitRectiligneCheckBox'
+ onItemStateChanged='handler.setBoolean(event, "traitRectiligne")'/>
+ </JPanel>
+ </cell>
+ </row>
+
+ <!-- Système de fermeture du cul / Geometrie mesuree -->
+ <row>
+ <cell columns='2'>
+ <JPanel layout='{new GridLayout(1,0)}'>
+ <JCheckBox id='systemeFermetureCulCheckBox'
+ onItemStateChanged='handler.setBoolean(event, "systemeFermetureCul")'/>
+ <JCheckBox id='geometrieMesureeCheckBox'
+ onItemStateChanged='handler.setBoolean(event, "geometrieMesuree")'/>
+ </JPanel>
+ </cell>
+ </row>
+
+ <!-- Trait rectiligne -->
+ <!--row>
+ <cell columns='2'>
+ <JCheckBox id='traitRectiligneCheckBox'
+ onItemStateChanged='handler.setBoolean(event, "traitRectiligne")'/>
+ </cell>
+ </row-->
+
+ <!-- Geometrie mesuree -->
+ <!--row>
+ <cell columns='2'>
+ <JCheckBox id='geometrieMesureeCheckBox'
+ onItemStateChanged='handler.setBoolean(event, "geometrieMesuree")'/>
+ </cell>
+ </row-->
+
+ <!-- Saisisseur -->
+ <row weighty='0.3'>
+ <cell columns='2'>
+ <JScrollPane id='saisisseurPane'
+ columnHeaderView="{saisisseurHeader}"
+ onFocusGained='saisisseurList.requestFocus()'>
+ <JList id='saisisseurList' genericType='UserBean'
+ onValueChanged='handler.selectListData(event, "saisisseur")'/>
+ <BeanListHeader id='saisisseurHeader' genericType='UserBean'/>
+ </JScrollPane>
+ </cell>
+ </row>
+
+ <!-- Commentaire -->
+ <row weighty='0.3'>
+ <cell columns='2'>
+ <JScrollPane id='commentPane'
+ onFocusGained='commentField.requestFocus()'>
+ <JTextArea id='commentField'
+ onKeyReleased='handler.setText(event, "comment")'/>
+ </JScrollPane>
+ </cell>
+ </row>
+ </Table>
+ </tab>
+
+ <tab id='traitGearShootingTab' title='tutti.label.tab.trait.gearShooting'>
+
+ <Table fill='both' id='gearShootingForm'>
+
+ <!-- GearShootingStart Longitude -->
+ <row>
+ <cell>
+ <JLabel id='gearShootingStartLongitudeLabel'/>
+ </cell>
+ <cell weightx='1.0'>
+ <JTextField id='gearShootingStartLongitudeField'
+ onKeyReleased='handler.setGearShootingStartLongitude(((JTextField)event.getSource()).getText())'/>
+ </cell>
+ </row>
+
+ <!-- GearShootingStart Latitude -->
+ <row>
+ <cell>
+ <JLabel id='gearShootingStartLatitudeLabel'/>
+ </cell>
+ <cell weightx='1.0'>
+ <JTextField id='gearShootingStartLatitudeField'
+ onKeyReleased='handler.setGearShootingStartLatitude(((JTextField)event.getSource()).getText())'/>
+ </cell>
+ </row>
+
+ <!-- GearShootingStart Time -->
+ <row>
+ <cell>
+ <JLabel id='gearShootingStartTimeLabel'/>
+ </cell>
+ <cell weightx='1.0'>
+ <JTextField id='gearShootingStartTimeField'
+ onKeyReleased='handler.setGearShootingStartTime(((JTextField)event.getSource()).getText())'/>
+ </cell>
+ </row>
+
+ <!-- GearShootingStart Depth -->
+ <row>
+ <cell>
+ <JLabel id='gearShootingStartDepthLabel'/>
+ </cell>
+ <cell weightx='1.0'>
+ <NumberEditor id='gearShootingStartDepthField'
+ constructorParams='this'/>
+ </cell>
+ </row>
+
+ <!-- GearShootingEnd Longitude -->
+ <row>
+ <cell>
+ <JLabel id='gearShootingEndLongitudeLabel'/>
+ </cell>
+ <cell weightx='1.0'>
+ <JTextField id='gearShootingEndLongitudeField'
+ onKeyReleased='handler.setGearShootingEndLongitude(((JTextField)event.getSource()).getText())'/>
+ </cell>
+ </row>
+
+ <!-- GearShootingEnd Latitude -->
+ <row>
+ <cell>
+ <JLabel id='gearShootingEndLatitudeLabel'/>
+ </cell>
+ <cell weightx='1.0'>
+ <JTextField id='gearShootingEndLatitudeField'
+ onKeyReleased='handler.setGearShootingEndLatitude(((JTextField)event.getSource()).getText())'/>
+ </cell>
+ </row>
+
+ <!-- GearShootingEnd Time -->
+ <row>
+ <cell>
+ <JLabel id='gearShootingEndTimeLabel'/>
+ </cell>
+ <cell weightx='1.0'>
+ <JTextField id='gearShootingEndTimeField'
+ onKeyReleased='handler.setGearShootingEndTime(((JTextField)event.getSource()).getText())'/>
+ </cell>
+ </row>
+
+ <!-- GearShootingEnd Depth -->
+ <row>
+ <cell>
+ <JLabel id='gearShootingEndDepthLabel'/>
+ </cell>
+ <cell weightx='1.0'>
+ <NumberEditor id='gearShootingEndDepthField'
+ constructorParams='this'/>
+ </cell>
+ </row>
+ </Table>
+ </tab>
+
+ <tab id='traitHydrologyTabContent' title='tutti.label.tab.trait.hydrology'>
+
+ <Table fill='both' id='hydrologyForm'>
+
+ <!-- GearShootingStartSurfaceTemperature -->
+ <row>
+ <cell>
+ <JLabel id='gearShootingStartSurfaceTemperatureLabel'/>
+ </cell>
+ <cell weightx='1.0'>
+ <NumberEditor id='gearShootingStartSurfaceTemperatureField'
+ constructorParams='this'/>
+ </cell>
+ </row>
+
+ <!-- GearShootingEndSurfaceTemperature -->
+ <row>
+ <cell>
+ <JLabel id='gearShootingEndSurfaceTemperatureLabel'/>
+ </cell>
+ <cell weightx='1.0'>
+ <NumberEditor id='gearShootingEndSurfaceTemperatureField'
+ constructorParams='this'/>
+ </cell>
+ </row>
+
+ <!-- GearShootingStartBottomTemperature -->
+ <row>
+ <cell>
+ <JLabel id='gearShootingStartBottomTemperatureLabel'/>
+ </cell>
+ <cell weightx='1.0'>
+ <NumberEditor id='gearShootingStartBottomTemperatureField'
+ constructorParams='this'/>
+ </cell>
+ </row>
+
+ <!-- GearShootingEndBottomTemperature -->
+ <row>
+ <cell>
+ <JLabel id='gearShootingEndBottomTemperatureLabel'/>
+ </cell>
+ <cell weightx='1.0'>
+ <NumberEditor id='gearShootingEndBottomTemperatureField'
+ constructorParams='this'/>
+ </cell>
+ </row>
+
+ <!-- AverageBottomTemperature -->
+ <row>
+ <cell>
+ <JLabel id='averageBottomTemperatureLabel'/>
+ </cell>
+ <cell weightx='1.0'>
+ <NumberEditor id='averageBottomTemperatureField'
+ constructorParams='this'/>
+ </cell>
+ </row>
+
+ <!-- GearShootingStartSurfaceSalinity -->
+ <row>
+ <cell>
+ <JLabel id='gearShootingStartSurfaceSalinityLabel'/>
+ </cell>
+ <cell weightx='1.0'>
+ <NumberEditor id='gearShootingStartSurfaceSalinityField'
+ constructorParams='this'/>
+ </cell>
+ </row>
+
+ <!-- GearShootingEndSurfaceSalinity -->
+ <row>
+ <cell>
+ <JLabel id='gearShootingEndSurfaceSalinityLabel'/>
+ </cell>
+ <cell weightx='1.0'>
+ <NumberEditor id='gearShootingEndSurfaceSalinityField'
+ constructorParams='this'/>
+ </cell>
+ </row>
+
+ <!-- GearShootingStartBottomSalinity -->
+ <row>
+ <cell>
+ <JLabel id='gearShootingStartBottomSalinityLabel'/>
+ </cell>
+ <cell weightx='1.0'>
+ <NumberEditor id='gearShootingStartBottomSalinityField'
+ constructorParams='this'/>
+ </cell>
+ </row>
+
+ <!-- GearShootingEndBottomSalinity -->
+ <row>
+ <cell>
+ <JLabel id='gearShootingEndBottomSalinityLabel'/>
+ </cell>
+ <cell weightx='1.0'>
+ <NumberEditor id='gearShootingEndBottomSalinityField'
+ constructorParams='this'/>
+ </cell>
+ </row>
+
+ <!-- AverageBottomSalinity -->
+ <row>
+ <cell>
+ <JLabel id='averageBottomSalinityLabel'/>
+ </cell>
+ <cell weightx='1.0'>
+ <NumberEditor id='averageBottomSalinityField'
+ constructorParams='this'/>
+ </cell>
+ </row>
+
+ </Table>
+ </tab>
+ </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>
+ </JPanel>
+
+ <JLabel id='noTraitPane'/>
+</JPanel>
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/TraitTabUI.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/TraitTabUIHandler.java (from rev 12, trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/TraitConfigTabUIHandler.java)
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/TraitTabUIHandler.java (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/TraitTabUIHandler.java 2012-11-24 13:10:24 UTC (rev 15)
@@ -0,0 +1,233 @@
+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.TraitBean;
+import fr.ifremer.tutti.persistence.entities.UserBean;
+import fr.ifremer.tutti.service.PersistenceService;
+import fr.ifremer.tutti.ui.swing.AbstractTuttiUIHandler;
+import org.apache.commons.collections.CollectionUtils;
+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;
+import java.sql.Date;
+import java.util.List;
+
+/**
+ * Handler for UI {@link TraitTabUI}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.1
+ */
+public class TraitTabUIHandler extends AbstractTuttiUIHandler<TraitTabUIModel> {
+
+ /** Logger. */
+ private static final Log log =
+ LogFactory.getLog(TraitTabUIHandler.class);
+
+ private final TraitTabUI ui;
+
+ private final CatchesUI parentUi;
+
+ private final PersistenceService persistenceService;
+
+ public TraitTabUIHandler(CatchesUI parentUi, TraitTabUI ui) {
+ super(parentUi.getHandler().getContext());
+ this.ui = ui;
+ this.parentUi = parentUi;
+ this.persistenceService = context.getService(PersistenceService.class);
+ }
+
+ @Override
+ public void beforeInitUI() {
+
+ TraitTabUIModel model = new TraitTabUIModel();
+ model.addPropertyChangeListener(TraitTabUIModel.PROPERTY_EMPTY, new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ JPanel form = ui.getTraitPane();
+ JLabel noContentPane = ui.getNoTraitPane();
+
+ Boolean empty = (Boolean) evt.getNewValue();
+ ui.remove(form);
+ ui.remove(noContentPane);
+ if (empty) {
+ ui.add(noContentPane, BorderLayout.CENTER);
+ } else {
+ ui.add(form, BorderLayout.CENTER);
+ }
+ ui.repaint();
+ }
+ });
+
+ listModelIsModify(model);
+
+ ui.setContextValue(model);
+ }
+
+ @Override
+ public void afterInitUI() {
+
+ TraitTabUIModel model = ui.getModel();
+
+ initUI(ui);
+
+ initBeanList(ui.getSaisisseurHeader(),
+ persistenceService.getAllUsers(),
+ model.getSaisisseur());
+
+ initBeanComboBox(ui.getBeaufortScaleComboBox(),
+ persistenceService.getAllBeaufortScales(),
+ model.getBeaufortScale());
+
+ initBeanComboBox(ui.getStrataComboBox(),
+ persistenceService.getAllStratas(),
+ model.getStrata());
+
+ initBeanComboBox(ui.getSeaStateComboBox(),
+ persistenceService.getAllSeaStates(),
+ model.getSeaState());
+
+ model.setEmpty(true);
+
+ listenValidatorValid(ui.getValidator(),getModel() );
+ }
+
+ @Override
+ public void onCloseUI() {
+ }
+
+ @Override
+ protected TraitTabUIModel getModel() {
+ return ui.getModel();
+ }
+
+ public void selectTrait(TraitBean bean) {
+
+ boolean empty = bean == null;
+
+ TraitTabUIModel model = ui.getModel();
+
+ // clean previous selection
+ ui.getSaisisseurHeader().getList().clearSelection();
+
+ if (empty) {
+
+ model.fromBean(new TraitBean());
+ } else {
+
+ model.fromBean(bean);
+ }
+
+ // update saisissuer selection
+ List<UserBean> saisisseur = model.getSaisisseur();
+ if (CollectionUtils.isNotEmpty(saisisseur)) {
+ updateIndices(ui.getSaisisseurList(), saisisseur);
+ }
+
+ // update model empty property
+ model.setEmpty(empty);
+
+ // reload bean in validator (? really mandatory?)
+// ui.getValidator().reloadBean();
+
+ // if new trait can already cancel his creation
+ model.setModify(!empty && model.isCreate());
+ }
+
+ public void cancel() {
+
+ String id = ui.getModel().getId();
+
+ if (log.isInfoEnabled()) {
+ log.info("Cancel edition for trait: " + id);
+ }
+ boolean newBean = StringUtils.isBlank(id);
+
+ if (newBean) {
+
+ // cancel to create a new trait
+ parentUi.getHandler().selectTrait(null);
+
+ } else {
+
+ // reselect in ui the trait
+ TraitBean selectedTrait = parentUi.getModel().getSelectedTrait();
+ parentUi.getHandler().selectTrait(selectedTrait);
+ }
+ }
+
+ public void save() {
+
+ // get trait to save
+ TraitBean toSave = ui.getModel().toBean();
+
+ if (log.isInfoEnabled()) {
+ log.info("Save edition for trait: " + toSave.getId());
+ }
+
+ // keep selected tab (to resotre it after save)
+ int selectedIndex = ui.getTraitTabPane().getSelectedIndex();
+
+ // persist current trait
+ parentUi.getHandler().saveTrait(toSave);
+
+ // reselect current tab
+ ui.getTraitTabPane().setSelectedIndex(selectedIndex);
+ }
+
+ public void setGearShootingStartLatitude(String text) {
+ ui.getModel().setGearShootingStartLatitude(Float.valueOf(text));
+ }
+
+ public void setGearShootingStartLongitude(String text) {
+ ui.getModel().setGearShootingStartLongitude(Float.valueOf(text));
+ }
+
+ public void setGearShootingStartTime(String text) {
+ ui.getModel().setGearShootingStartTime(Date.valueOf(text));
+ }
+
+ public void setGearShootingEndLatitude(String text) {
+ ui.getModel().setGearShootingEndLatitude(Float.valueOf(text));
+ }
+
+ public void setGearShootingEndLongitude(String text) {
+ ui.getModel().setGearShootingEndLongitude(Float.valueOf(text));
+ }
+
+ public void setGearShootingEndTime(String text) {
+ ui.getModel().setGearShootingEndTime(Date.valueOf(text));
+ }
+}
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/TraitTabUIHandler.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/TraitTabUIModel.java (from rev 12, trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/TraitConfigTabUIModel.java)
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/TraitTabUIModel.java (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/catches/TraitTabUIModel.java 2012-11-24 13:10:24 UTC (rev 15)
@@ -0,0 +1,615 @@
+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.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.ui.swing.AbstractTuttiBeanUIModel;
+import org.nuiton.util.beans.BinderFactory;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * Model for UI {@link TraitTabUI}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.1
+ */
+public class TraitTabUIModel extends AbstractTuttiBeanUIModel {
+
+ private static final long serialVersionUID = 1L;
+
+ public static final String PROPERTY_EMPTY = "empty";
+
+ public static final String PROPERTY_STATION_NUMBER = "stationNumber";
+
+ public static final String PROPERTY_TRAIT_NUMBER = "traitNumber";
+
+ public static final String PROPERTY_DATE = "date";
+
+ public static final String PROPERTY_STRATA = "strata";
+
+ public static final String PROPERTY_GEAR_SHOOTING_START_LATITUDE = "gearShootingStartLatitude";
+
+ public static final String PROPERTY_GEAR_SHOOTING_START_LONGITUDE = "gearShootingStartLongitude";
+
+ public static final String PROPERTY_GEAR_SHOOTING_START_TIME = "gearShootingStartTime";
+
+ public static final String PROPERTY_GEAR_SHOOTING_START_DEPTH = "gearShootingStartDepth";
+
+ public static final String PROPERTY_GEAR_SHOOTING_END_LATITUDE = "gearShootingEndLatitude";
+
+ public static final String PROPERTY_GEAR_SHOOTING_END_LONGITUDE = "gearShootingEndLongitude";
+
+ public static final String PROPERTY_GEAR_SHOOTING_END_TIME = "gearShootingEndTime";
+
+ public static final String PROPERTY_GEAR_SHOOTING_END_DEPTH = "gearShootingEndDepth";
+
+ public static final String PROPERTY_BEAUFORT_SCALE = "beaufortScale";
+
+ public static final String PROPERTY_WIND_DIRECTION = "windDirection";
+
+ public static final String PROPERTY_SEA_STATE = "seaState";
+
+ public static final String PROPERTY_OUVERTURE_HORIZONTALE = "ouvertureHorizontale";
+
+ public static final String PROPERTY_OUVERTURE_VERTICALE = "ouvertureVerticale";
+
+ public static final String PROPERTY_GEOMETRIE_MESUREE = "geometrieMesuree";
+
+ public static final String PROPERTY_LONGUEUR_FUNES = "longueurFunes";
+
+ public static final String PROPERTY_LONGUEUR_BRAS = "longueurBras";
+
+ public static final String PROPERTY_SYSTEME_FERMETURE_CUL = "systemeFermetureCul";
+
+ public static final String PROPERTY_TRAIT_RECTILIGNE = "traitRectiligne";
+
+ public static final String PROPERTY_DISTANCE_CHALUTEE = "distanceChalutee";
+
+ public static final String PROPERTY_DUREE = "duree";
+
+ public static final String PROPERTY_TRAIT_VALID = "traitValid";
+
+ public static final String PROPERTY_LOCALITE = "localite";
+
+ public static final String PROPERTY_COMMENT = "comment";
+
+ public static final String PROPERTY_SAISISSEUR = "saisisseur";
+
+ public static final String PROPERTY_GEAR_SHOOTING_START_SURFACE_TEMPERATURE = "gearShootingStartSurfaceTemperature";
+
+ public static final String PROPERTY_GEAR_SHOOTING_END_SURFACE_TEMPERATURE = "gearShootingEndSurfaceTemperature";
+
+ public static final String PROPERTY_GEAR_SHOOTING_START_BOTTOM_TEMPERATURE = "gearShootingStartBottomTemperature";
+
+ public static final String PROPERTY_GEAR_SHOOTING_END_BOTTOM_TEMPERATURE = "gearShootingEndBottomTemperature";
+
+ public static final String PROPERTY_AVERAGE_BOTTOM_TEMPERATURE = "averageBottomTemperature";
+
+ public static final String PROPERTY_GEAR_SHOOTING_START_SURFACE_SALINITY = "gearShootingStartSurfaceSalinity";
+
+ public static final String PROPERTY_GEAR_SHOOTING_END_SURFACE_SALINITY = "gearShootingEndSurfaceSalinity";
+
+ public static final String PROPERTY_GEAR_SHOOTING_START_BOTTOM_SALINITY = "gearShootingStartBottomSalinity";
+
+ public static final String PROPERTY_GEAR_SHOOTING_END_BOTTOM_SALINITY = "gearShootingEndBottomSalinity";
+
+ public static final String PROPERTY_AVERAGE_BOTTOM_SALINITY = "averageBottomSalinity";
+
+ protected boolean empty;
+
+ protected CampaignBean campaign;
+
+ protected Integer stationNumber;
+
+ protected Integer traitNumber;
+
+ protected Date date;
+
+ protected StrataBean strata;
+
+ protected Float gearShootingStartLatitude;
+
+ protected Float gearShootingStartLongitude;
+
+ protected Date gearShootingStartTime;
+
+ protected Float gearShootingStartDepth;
+
+ protected Float gearShootingEndLatitude;
+
+ protected Float gearShootingEndLongitude;
+
+ protected Date gearShootingEndTime;
+
+ protected Float gearShootingEndDepth;
+
+ protected BeaufortScaleBean beaufortScale;
+
+ protected Integer windDirection;
+
+ protected SeaStateBean seaState;
+
+ protected Float ouvertureHorizontale;
+
+ protected Float ouvertureVerticale;
+
+ protected boolean geometrieMesuree;
+
+ protected Float longueurFunes;
+
+ protected Float longueurBras;
+
+ protected boolean systemeFermetureCul;
+
+ protected boolean traitRectiligne;
+
+ protected Float distanceChalutee;
+
+ protected Float duree;
+
+ protected boolean traitValid;
+
+ protected String localite;
+
+ protected String comment;
+
+ protected List<UserBean> saisisseur;
+
+ protected Float gearShootingStartSurfaceTemperature;
+
+ protected Float gearShootingEndSurfaceTemperature;
+
+ protected Float gearShootingStartBottomTemperature;
+
+ protected Float gearShootingEndBottomTemperature;
+
+ protected Float averageBottomTemperature;
+
+ protected Float gearShootingStartSurfaceSalinity;
+
+ protected Float gearShootingEndSurfaceSalinity;
+
+ protected Float gearShootingStartBottomSalinity;
+
+ protected Float gearShootingEndBottomSalinity;
+
+ protected Float averageBottomSalinity;
+
+ public boolean isEmpty() {
+ return empty;
+ }
+
+ public void setEmpty(boolean empty) {
+ Object oldValue = isEmpty();
+ this.empty = empty;
+ firePropertyChange(PROPERTY_EMPTY, oldValue, empty);
+ }
+
+ public CampaignBean getCampaign() {
+ return campaign;
+ }
+
+ public void setCampaign(CampaignBean campaign) {
+ this.campaign = campaign;
+ }
+
+ public Integer getStationNumber() {
+ return stationNumber;
+ }
+
+ public void setStationNumber(Integer stationNumber) {
+ Object oldValue = getStationNumber();
+ this.stationNumber = stationNumber;
+ firePropertyChange(PROPERTY_STATION_NUMBER, oldValue, stationNumber);
+ }
+
+ public Integer getTraitNumber() {
+ return traitNumber;
+ }
+
+ public void setTraitNumber(Integer traitNumber) {
+ Object oldValue = getTraitNumber();
+ this.traitNumber = traitNumber;
+ firePropertyChange(PROPERTY_TRAIT_NUMBER, oldValue, traitNumber);
+ }
+
+ public Date getDate() {
+ return date;
+ }
+
+ public void setDate(Date date) {
+ Object oldValue = getDate();
+ this.date = date;
+ firePropertyChange(PROPERTY_DATE, oldValue, date);
+ }
+
+ public StrataBean getStrata() {
+ return strata;
+ }
+
+ public void setStrata(StrataBean strata) {
+ Object oldValue = getStrata();
+ this.strata = strata;
+ firePropertyChange(PROPERTY_STRATA, oldValue, strata);
+ }
+
+ public Float getGearShootingStartLatitude() {
+ return gearShootingStartLatitude;
+ }
+
+ public void setGearShootingStartLatitude(Float gearShootingStartLatitude) {
+ Object oldValue = getGearShootingStartLatitude();
+ this.gearShootingStartLatitude = gearShootingStartLatitude;
+ firePropertyChange(PROPERTY_GEAR_SHOOTING_START_LATITUDE, oldValue, gearShootingStartLatitude);
+ }
+
+ public Float getGearShootingStartLongitude() {
+ return gearShootingStartLongitude;
+ }
+
+ public void setGearShootingStartLongitude(Float gearShootingStartLongitude) {
+ Object oldValue = getGearShootingStartLongitude();
+ this.gearShootingStartLongitude = gearShootingStartLongitude;
+ firePropertyChange(PROPERTY_GEAR_SHOOTING_START_LONGITUDE, oldValue, gearShootingStartLongitude);
+ }
+
+ public Date getGearShootingStartTime() {
+ return gearShootingStartTime;
+ }
+
+ public void setGearShootingStartTime(Date gearShootingStartTime) {
+ Object oldValue = getGearShootingStartTime();
+ this.gearShootingStartTime = gearShootingStartTime;
+ firePropertyChange(PROPERTY_GEAR_SHOOTING_START_TIME, oldValue, gearShootingStartTime);
+ }
+
+ public Float getGearShootingStartDepth() {
+ return gearShootingStartDepth;
+ }
+
+ public void setGearShootingStartDepth(Float gearShootingStartDepth) {
+ Object oldValue = getGearShootingStartDepth();
+ this.gearShootingStartDepth = gearShootingStartDepth;
+ firePropertyChange(PROPERTY_GEAR_SHOOTING_START_DEPTH, oldValue, gearShootingStartDepth);
+ }
+
+ public Float getGearShootingEndLatitude() {
+ return gearShootingEndLatitude;
+ }
+
+ public void setGearShootingEndLatitude(Float gearShootingEndLatitude) {
+ Object oldValue = getGearShootingEndLatitude();
+ this.gearShootingEndLatitude = gearShootingEndLatitude;
+ firePropertyChange(PROPERTY_GEAR_SHOOTING_END_LATITUDE, oldValue, gearShootingEndLatitude);
+ }
+
+ public Float getGearShootingEndLongitude() {
+ return gearShootingEndLongitude;
+ }
+
+ public void setGearShootingEndLongitude(Float gearShootingEndLongitude) {
+ Object oldValue = getGearShootingEndLongitude();
+ this.gearShootingEndLongitude = gearShootingEndLongitude;
+ firePropertyChange(PROPERTY_GEAR_SHOOTING_END_LONGITUDE, oldValue, gearShootingEndLongitude);
+ }
+
+ public Date getGearShootingEndTime() {
+ return gearShootingEndTime;
+ }
+
+ public void setGearShootingEndTime(Date gearShootingEndTime) {
+ Object oldValue = getGearShootingEndTime();
+ this.gearShootingEndTime = gearShootingEndTime;
+ firePropertyChange(PROPERTY_GEAR_SHOOTING_END_TIME, oldValue, gearShootingEndTime);
+ }
+
+ public Float getGearShootingEndDepth() {
+ return gearShootingEndDepth;
+ }
+
+ public void setGearShootingEndDepth(Float gearShootingEndDepth) {
+ Object oldValue = getGearShootingEndDepth();
+ this.gearShootingEndDepth = gearShootingEndDepth;
+ firePropertyChange(PROPERTY_GEAR_SHOOTING_END_DEPTH, oldValue, gearShootingEndDepth);
+ }
+
+ public BeaufortScaleBean getBeaufortScale() {
+ return beaufortScale;
+ }
+
+ public void setBeaufortScale(BeaufortScaleBean beaufortScale) {
+ Object oldValue = getBeaufortScale();
+ this.beaufortScale = beaufortScale;
+ firePropertyChange(PROPERTY_BEAUFORT_SCALE, oldValue, beaufortScale);
+ }
+
+ public Integer getWindDirection() {
+ return windDirection;
+ }
+
+ public void setWindDirection(Integer windDirection) {
+ Object oldValue = getWindDirection();
+ this.windDirection = windDirection;
+ firePropertyChange(PROPERTY_WIND_DIRECTION, oldValue, windDirection);
+ }
+
+ public SeaStateBean getSeaState() {
+ return seaState;
+ }
+
+ public void setSeaState(SeaStateBean seaState) {
+ Object oldValue = getSeaState();
+ this.seaState = seaState;
+ firePropertyChange(PROPERTY_SEA_STATE, oldValue, seaState);
+ }
+
+ public Float getOuvertureHorizontale() {
+ return ouvertureHorizontale;
+ }
+
+ public void setOuvertureHorizontale(Float ouvertureHorizontale) {
+ Object oldValue = getOuvertureHorizontale();
+ this.ouvertureHorizontale = ouvertureHorizontale;
+ firePropertyChange(PROPERTY_OUVERTURE_HORIZONTALE, oldValue, ouvertureHorizontale);
+ }
+
+ public Float getOuvertureVerticale() {
+ return ouvertureVerticale;
+ }
+
+ public void setOuvertureVerticale(Float ouvertureVerticale) {
+ Object oldValue = getOuvertureVerticale();
+ this.ouvertureVerticale = ouvertureVerticale;
+ firePropertyChange(PROPERTY_OUVERTURE_VERTICALE, oldValue, ouvertureVerticale);
+ }
+
+ public boolean isGeometrieMesuree() {
+ return geometrieMesuree;
+ }
+
+ public void setGeometrieMesuree(boolean geometrieMesuree) {
+ Object oldValue = isGeometrieMesuree();
+ this.geometrieMesuree = geometrieMesuree;
+ firePropertyChange(PROPERTY_GEOMETRIE_MESUREE, oldValue, geometrieMesuree);
+ }
+
+ public Float getLongueurFunes() {
+ return longueurFunes;
+ }
+
+ public void setLongueurFunes(Float longueurFunes) {
+ Object oldValue = getLongueurFunes();
+ this.longueurFunes = longueurFunes;
+ firePropertyChange(PROPERTY_LONGUEUR_FUNES, oldValue, longueurFunes);
+ }
+
+ public Float getLongueurBras() {
+ return longueurBras;
+ }
+
+ public void setLongueurBras(Float longueurBras) {
+ Object oldValue = getLongueurBras();
+ this.longueurBras = longueurBras;
+ firePropertyChange(PROPERTY_LONGUEUR_BRAS, oldValue, longueurBras);
+ }
+
+ public boolean isSystemeFermetureCul() {
+ return systemeFermetureCul;
+ }
+
+ public void setSystemeFermetureCul(boolean systemeFermetureCul) {
+ Object oldValue = isSystemeFermetureCul();
+ this.systemeFermetureCul = systemeFermetureCul;
+ firePropertyChange(PROPERTY_SYSTEME_FERMETURE_CUL, oldValue, systemeFermetureCul);
+ }
+
+ public boolean isTraitRectiligne() {
+ return traitRectiligne;
+ }
+
+ public void setTraitRectiligne(boolean traitRectiligne) {
+ Object oldValue = isTraitRectiligne();
+ this.traitRectiligne = traitRectiligne;
+ firePropertyChange(PROPERTY_TRAIT_RECTILIGNE, oldValue, traitRectiligne);
+ }
+
+ public Float getDistanceChalutee() {
+ return distanceChalutee;
+ }
+
+ public void setDistanceChalutee(Float distanceChalutee) {
+ Object oldValue = getDistanceChalutee();
+ this.distanceChalutee = distanceChalutee;
+ firePropertyChange(PROPERTY_DISTANCE_CHALUTEE, oldValue, distanceChalutee);
+ }
+
+ public Float getDuree() {
+ return duree;
+ }
+
+ public void setDuree(Float duree) {
+ Object oldValue = getDuree();
+ this.duree = duree;
+ firePropertyChange(PROPERTY_DUREE, oldValue, duree);
+ }
+
+ public boolean isTraitValid() {
+ return traitValid;
+ }
+
+ public void setTraitValid(boolean traitValid) {
+ Object oldValue = isTraitValid();
+ this.traitValid = traitValid;
+ firePropertyChange(PROPERTY_TRAIT_VALID, oldValue, traitValid);
+ }
+
+ public String getLocalite() {
+ return localite;
+ }
+
+ public void setLocalite(String localite) {
+ Object oldValue = getLocalite();
+ this.localite = localite;
+ firePropertyChange(PROPERTY_LOCALITE, oldValue, localite);
+ }
+
+ public String getComment() {
+ return comment;
+ }
+
+ public void setComment(String comment) {
+ Object oldValue = getComment();
+ this.comment = comment;
+ firePropertyChange(PROPERTY_COMMENT, oldValue, comment);
+ }
+
+ public List<UserBean> getSaisisseur() {
+ return saisisseur;
+ }
+
+ public void setSaisisseur(List<UserBean> saisisseur) {
+ this.saisisseur = saisisseur;
+ firePropertyChange(PROPERTY_SAISISSEUR, null, saisisseur);
+ }
+
+ public Float getGearShootingStartSurfaceTemperature() {
+ return gearShootingStartSurfaceTemperature;
+ }
+
+ public void setGearShootingStartSurfaceTemperature(Float gearShootingStartSurfaceTemperature) {
+ Object oldValue = getGearShootingStartSurfaceTemperature();
+ this.gearShootingStartSurfaceTemperature = gearShootingStartSurfaceTemperature;
+ firePropertyChange(PROPERTY_GEAR_SHOOTING_START_SURFACE_TEMPERATURE, oldValue, gearShootingStartSurfaceTemperature);
+ }
+
+ public Float getGearShootingEndSurfaceTemperature() {
+ return gearShootingEndSurfaceTemperature;
+ }
+
+ public void setGearShootingEndSurfaceTemperature(Float gearShootingEndSurfaceTemperature) {
+ Object oldValue = getGearShootingEndSurfaceTemperature();
+ this.gearShootingEndSurfaceTemperature = gearShootingEndSurfaceTemperature;
+ firePropertyChange(PROPERTY_GEAR_SHOOTING_END_SURFACE_TEMPERATURE, oldValue, gearShootingEndSurfaceTemperature);
+ }
+
+ public Float getGearShootingStartBottomTemperature() {
+ return gearShootingStartBottomTemperature;
+ }
+
+ public void setGearShootingStartBottomTemperature(Float gearShootingStartBottomTemperature) {
+ Object oldValue = getGearShootingStartBottomTemperature();
+ this.gearShootingStartBottomTemperature = gearShootingStartBottomTemperature;
+ firePropertyChange(PROPERTY_GEAR_SHOOTING_START_BOTTOM_TEMPERATURE, oldValue, gearShootingStartBottomTemperature);
+ }
+
+ public Float getGearShootingEndBottomTemperature() {
+ return gearShootingEndBottomTemperature;
+ }
+
+ public void setGearShootingEndBottomTemperature(Float gearShootingEndBottomTemperature) {
+ Object oldValue = getGearShootingEndBottomTemperature();
+ this.gearShootingEndBottomTemperature = gearShootingEndBottomTemperature;
+ firePropertyChange(PROPERTY_GEAR_SHOOTING_END_BOTTOM_TEMPERATURE, oldValue, gearShootingEndBottomTemperature);
+ }
+
+ public Float getAverageBottomTemperature() {
+ return averageBottomTemperature;
+ }
+
+ public void setAverageBottomTemperature(Float averageBottomTemperature) {
+ Object oldValue = getAverageBottomTemperature();
+ this.averageBottomTemperature = averageBottomTemperature;
+ firePropertyChange(PROPERTY_AVERAGE_BOTTOM_TEMPERATURE, oldValue, averageBottomTemperature);
+ }
+
+ public Float getGearShootingStartSurfaceSalinity() {
+ return gearShootingStartSurfaceSalinity;
+ }
+
+ public void setGearShootingStartSurfaceSalinity(Float gearShootingStartSurfaceSalinity) {
+ Object oldValue = getGearShootingStartSurfaceSalinity();
+ this.gearShootingStartSurfaceSalinity = gearShootingStartSurfaceSalinity;
+ firePropertyChange(PROPERTY_GEAR_SHOOTING_START_SURFACE_SALINITY, oldValue, gearShootingStartSurfaceSalinity);
+ }
+
+ public Float getGearShootingEndSurfaceSalinity() {
+ return gearShootingEndSurfaceSalinity;
+ }
+
+ public void setGearShootingEndSurfaceSalinity(Float gearShootingEndSurfaceSalinity) {
+ Object oldValue = getGearShootingEndSurfaceSalinity();
+ this.gearShootingEndSurfaceSalinity = gearShootingEndSurfaceSalinity;
+ firePropertyChange(PROPERTY_GEAR_SHOOTING_END_SURFACE_SALINITY, oldValue, gearShootingEndSurfaceSalinity);
+ }
+
+ public Float getGearShootingStartBottomSalinity() {
+ return gearShootingStartBottomSalinity;
+ }
+
+ public void setGearShootingStartBottomSalinity(Float gearShootingStartBottomSalinity) {
+ Object oldValue = getGearShootingStartBottomSalinity();
+ this.gearShootingStartBottomSalinity = gearShootingStartBottomSalinity;
+ firePropertyChange(PROPERTY_GEAR_SHOOTING_START_BOTTOM_SALINITY, oldValue, gearShootingStartBottomSalinity);
+ }
+
+ public Float getGearShootingEndBottomSalinity() {
+ return gearShootingEndBottomSalinity;
+ }
+
+ public void setGearShootingEndBottomSalinity(Float gearShootingEndBottomSalinity) {
+ Object oldValue = getGearShootingEndBottomSalinity();
+ this.gearShootingEndBottomSalinity = gearShootingEndBottomSalinity;
+ firePropertyChange(PROPERTY_GEAR_SHOOTING_END_BOTTOM_SALINITY, oldValue, gearShootingEndBottomSalinity);
+ }
+
+ public Float getAverageBottomSalinity() {
+ return averageBottomSalinity;
+ }
+
+ public void setAverageBottomSalinity(Float averageBottomSalinity) {
+ Object oldValue = getAverageBottomSalinity();
+ this.averageBottomSalinity = averageBottomSalinity;
+ firePropertyChange(PROPERTY_AVERAGE_BOTTOM_SALINITY, oldValue, averageBottomSalinity);
+ }
+
+ public void fromBean(TraitBean bean) {
+ BinderFactory.newBinder(TraitBean.class,
+ TraitTabUIModel.class).copy(bean, this);
+ }
+
+ public TraitBean toBean() {
+ TraitBean result = new TraitBean();
+ BinderFactory.newBinder(TraitTabUIModel.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/TraitTabUIModel.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/campaign/EditCampaignUIModel-error-validation.xml
===================================================================
--- trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/campaign/EditCampaignUIModel-error-validation.xml 2012-11-23 22:18:17 UTC (rev 14)
+++ trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/campaign/EditCampaignUIModel-error-validation.xml 2012-11-24 13:10:24 UTC (rev 15)
@@ -5,7 +5,7 @@
$Id$
$HeadURL$
%%
- Copyright (C) 2012 Ifremer, Code Lutin
+ 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
@@ -22,8 +22,6 @@
<http://www.gnu.org/licenses/gpl-3.0.html>.
#L%
-->
-
-
<!DOCTYPE validators PUBLIC
"-//Apache Struts//XWork Validator 1.0.3//EN"
"http://struts.apache.org/dtds/xwork-validator-1.0.3.dtd">
Modified: trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/campaign/EditSurveyUIModel-error-validation.xml
===================================================================
--- trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/campaign/EditSurveyUIModel-error-validation.xml 2012-11-23 22:18:17 UTC (rev 14)
+++ trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/campaign/EditSurveyUIModel-error-validation.xml 2012-11-24 13:10:24 UTC (rev 15)
@@ -5,7 +5,7 @@
$Id$
$HeadURL$
%%
- Copyright (C) 2012 Ifremer, Code Lutin
+ 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
@@ -22,8 +22,6 @@
<http://www.gnu.org/licenses/gpl-3.0.html>.
#L%
-->
-
-
<!DOCTYPE validators PUBLIC
"-//Apache Struts//XWork Validator 1.0.3//EN"
"http://struts.apache.org/dtds/xwork-validator-1.0.3.dtd">
Added: trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/catches/TraitTabUIModel-error-validation.xml
===================================================================
--- trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/catches/TraitTabUIModel-error-validation.xml (rev 0)
+++ trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/catches/TraitTabUIModel-error-validation.xml 2012-11-24 13:10:24 UTC (rev 15)
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%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%
+ -->
+<!DOCTYPE validators PUBLIC
+ "-//Apache Struts//XWork Validator 1.0.3//EN"
+ "http://struts.apache.org/dtds/xwork-validator-1.0.3.dtd">
+<validators>
+
+ <field name="stationNumber">
+
+ <field-validator type="required" short-circuit="true">
+ <message>tutti.validator.error.trait.stationNumber.required</message>
+ </field-validator>
+
+ </field>
+
+ <field name="date">
+
+ <field-validator type="required" short-circuit="true">
+ <message>tutti.validator.error.trait.date.required</message>
+ </field-validator>
+
+ </field>
+</validators>
Property changes on: trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/catches/TraitTabUIModel-error-validation.xml
___________________________________________________________________
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-23 22:18:17 UTC (rev 14)
+++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2012-11-24 13:10:24 UTC (rev 15)
@@ -1,5 +1,8 @@
tutti.about.bottomText=Copyright %s - %s - version %s
-tutti.about.message=TODO
+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
@@ -37,9 +40,9 @@
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=
+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=
+tutti.config.ui.showNumberEditorButton=Afficher le pavé numérique de saisie
tutti.label.campaign=Campagne
tutti.label.campaign.country=Pays
tutti.label.campaign.name=Nom
@@ -51,6 +54,7 @@
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.no.trait.selected=< Aucun trait sélectionné >
tutti.label.survey=Série de campagne
tutti.label.survey.name=Nom
tutti.label.survey.zone=Zone
@@ -61,9 +65,45 @@
tutti.label.tab.observationIndividuelles=Observations individuelles
tutti.label.tab.plancton=Plancton
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.hydrology=Paramètres hydrologiques
+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.stationNumber=Numéro de la station
+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
+tutti.label.trait.gearShootingEndLatitude=Latitude fin de traine
+tutti.label.trait.gearShootingEndLongitude=Longitude fin de traine
+tutti.label.trait.gearShootingEndSurfaceSalinity=Salinité de surface fin de traine
+tutti.label.trait.gearShootingEndSurfaceTemperature=Temperature de surface fin de traine
+tutti.label.trait.gearShootingEndTime=Fin de traine
+tutti.label.trait.gearShootingStartBottomSalinity=Salinité de fond début de traine
+tutti.label.trait.gearShootingStartBottomTemperature=Température de fond début de traine
+tutti.label.trait.gearShootingStartDepth=Profondeur début de traine
+tutti.label.trait.gearShootingStartLatitude=Latitude début de traine
+tutti.label.trait.gearShootingStartLongitude=Longitude début de traine
+tutti.label.trait.gearShootingStartSurfaceSalinity=Salinité de surface début de traine
+tutti.label.trait.gearShootingStartSurfaceTemperature=Temperature de surface début de traine
+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
tutti.menu.actions=Actions
tutti.menu.actions.tip=Actions
tutti.menu.file=Fichier
@@ -90,7 +130,7 @@
tutti.title.noSelectedSurvey=Pas de série de campagne sélectionné
tutti.title.selectedCampaign=Campagne %s
tutti.title.selectedSurvey=Série de campagne %s
-tutti.to.be.done=A FAIRE
+tutti.to.be.done=< A FAIRE >
tutti.validator.error.campaign.country.required=Le pays est obligatoire
tutti.validator.error.campaign.gear.required=Au moins un engin doit être sélectionné
tutti.validator.error.campaign.headOfMission.required=Au moins un chef de mission doit être sélectionné
@@ -99,4 +139,6 @@
tutti.validator.error.campaign.survey.required=La série est obligatoire
tutti.validator.error.campaign.vessel.required=Au moins un bateau doit être sélectionné
tutti.validator.error.survey.name.required=Le nom de la série est obligatoire
-tutti.validator.error.survey.zone.required=La zone de a série est obligatoire
+tutti.validator.error.survey.zone.required=La zone de la série est obligatoire
+tutti.validator.error.trait.date.required=La date du trait est obligatoire
+tutti.validator.error.trait.stationNumber.required=Le numéro de station est obligatoire
Modified: trunk/tutti-ui-swing/src/main/resources/log4j.properties
===================================================================
--- trunk/tutti-ui-swing/src/main/resources/log4j.properties 2012-11-23 22:18:17 UTC (rev 14)
+++ trunk/tutti-ui-swing/src/main/resources/log4j.properties 2012-11-24 13:10:24 UTC (rev 15)
@@ -4,7 +4,7 @@
# $Id$
# $HeadURL$
# %%
-# Copyright (C) 2012 Ifremer, Code Lutin
+# 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
Modified: trunk/tutti-ui-swing/src/main/resources/validators.xml
===================================================================
--- trunk/tutti-ui-swing/src/main/resources/validators.xml 2012-11-23 22:18:17 UTC (rev 14)
+++ trunk/tutti-ui-swing/src/main/resources/validators.xml 2012-11-24 13:10:24 UTC (rev 15)
@@ -5,7 +5,7 @@
$Id$
$HeadURL$
%%
- Copyright (C) 2012 Ifremer, Code Lutin
+ 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
1
0
Author: tchemit
Date: 2012-11-23 23:18:17 +0100 (Fri, 23 Nov 2012)
New Revision: 14
Url: http://forge.codelutin.com/repositories/revision/tutti/14
Log:
update libs
Modified:
trunk/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2012-11-23 22:17:44 UTC (rev 13)
+++ trunk/pom.xml 2012-11-23 22:18:17 UTC (rev 14)
@@ -90,9 +90,9 @@
<h2Version>1.3.168</h2Version>
<postgresqlVersion>9.1-901-1.jdbc4</postgresqlVersion>
- <jaxxVersion>2.5.7-SNAPSHOT</jaxxVersion>
+ <jaxxVersion>2.5.7</jaxxVersion>
<swingXVersion>1.6.4</swingXVersion>
- <xworkVersion>2.3.4</xworkVersion>
+ <xworkVersion>2.3.4.1</xworkVersion>
<slf4jVersion>1.7.2</slf4jVersion>
1
0
r13 - in trunk: tutti-persistence/src/main/java/fr/ifremer/tutti/persistence tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities tutti-persistence-dev/src/main/java/fr/ifremer/tutti/persistence tutti-service/src/main/java/fr/ifremer/tutti/service
by tchemit@users.forge.codelutin.com 23 Nov '12
by tchemit@users.forge.codelutin.com 23 Nov '12
23 Nov '12
Author: tchemit
Date: 2012-11-23 23:17:44 +0100 (Fri, 23 Nov 2012)
New Revision: 13
Url: http://forge.codelutin.com/repositories/revision/tutti/13
Log:
add new referentials
Added:
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/BeaufortScaleBean.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/StrataBean.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/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
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-22 17:34:53 UTC (rev 12)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistence.java 2012-11-23 22:17:44 UTC (rev 13)
@@ -24,9 +24,12 @@
* #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.StrataBean;
import fr.ifremer.tutti.persistence.entities.SurveyBean;
import fr.ifremer.tutti.persistence.entities.TraitBean;
import fr.ifremer.tutti.persistence.entities.UserBean;
@@ -50,8 +53,14 @@
void open(ApplicationConfig config) throws IOException;
- void close() throws IOException ;
+ void close() throws IOException;
+ List<SeaStateBean> getAllSeaStates();
+
+ List<StrataBean> getAllStratas();
+
+ List<BeaufortScaleBean> getAllBeaufortScales();
+
List<SurveyBean> getAllSurveys();
List<ZoneBean> getAllZones();
Added: 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 (rev 0)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/BeaufortScaleBean.java 2012-11-23 22:17:44 UTC (rev 13)
@@ -0,0 +1,49 @@
+package fr.ifremer.tutti.persistence.entities;
+
+/*
+ * #%L
+ * Tutti :: Persistence API
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 Ifremer, Code Lutin
+ * %%
+ * 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 beaufort scale.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.1
+ */
+public class BeaufortScaleBean extends AbstractTuttiEntity {
+
+ private static final long serialVersionUID = 1L;
+
+ protected String name;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ Object oldValue = getName();
+ this.name = name;
+ firePropertyChange("name", oldValue, name);
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/BeaufortScaleBean.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/SeaStateBean.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/SeaStateBean.java (rev 0)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/SeaStateBean.java 2012-11-23 22:17:44 UTC (rev 13)
@@ -0,0 +1,49 @@
+package fr.ifremer.tutti.persistence.entities;
+
+/*
+ * #%L
+ * Tutti :: Persistence API
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 Ifremer, Code Lutin
+ * %%
+ * 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 AbstractTuttiEntity {
+
+ private static final long serialVersionUID = 1L;
+
+ protected String name;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ Object oldValue = getName();
+ this.name = name;
+ firePropertyChange("name", oldValue, name);
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/SeaStateBean.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/StrataBean.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/StrataBean.java (rev 0)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/StrataBean.java 2012-11-23 22:17:44 UTC (rev 13)
@@ -0,0 +1,49 @@
+package fr.ifremer.tutti.persistence.entities;
+
+/*
+ * #%L
+ * Tutti :: Persistence API
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 Ifremer, Code Lutin
+ * %%
+ * 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 strata.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.1
+ */
+public class StrataBean extends AbstractTuttiEntity {
+
+ private static final long serialVersionUID = 1L;
+
+ protected String name;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ Object oldValue = getName();
+ this.name = name;
+ firePropertyChange("name", oldValue, name);
+ }
+
+}
Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/StrataBean.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
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-22 17:34:53 UTC (rev 12)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TraitBean.java 2012-11-23 22:17:44 UTC (rev 13)
@@ -45,49 +45,49 @@
protected Date date;
- protected Object associationStrate;
+ protected StrataBean strate;
- protected Float enPecheLatitude;
+ protected Float gearShootingStartLatitude;
- protected Float enPecheLongitude;
+ protected Float gearShootingStartLongitude;
- protected Date enPecheTime;
+ protected Date gearShootingStartTime;
- protected Float enPecheProfondeur;
+ protected Float gearShootingStartDepth;
- protected Float sortieDeLEauLatitude;
+ protected Float gearShootingEndLatitude;
- protected Float sortieDeLEauLongitude;
+ protected Float gearShootingEndLongitude;
- protected Date sortieDeLEauTime;
+ protected Date gearShootingEndTime;
- protected Float sortieDeLEauProfondeur;
+ protected Float gearShootingEndDepth;
- protected Integer forceVent;
+ protected BeaufortScaleBean beaufortScale;
- protected Integer directionVent;
+ protected Integer windDirection;
- protected Object etatMer;
+ protected SeaStateBean seaState;
protected Float ouvertureHorizontale;
protected Float ouvertureVerticale;
- protected Boolean geometrieMesuree;
+ protected boolean geometrieMesuree;
protected Float longueurFunes;
protected Float longueurBras;
- protected Boolean systemeFermetureCul;
+ protected boolean systemeFermetureCul;
- protected Boolean traitRectiligne;
+ protected boolean traitRectiligne;
protected Float distanceChalutee;
protected Float duree;
- protected Boolean traitValid;
+ protected boolean traitValid;
protected String localite;
@@ -95,6 +95,27 @@
protected List<UserBean> saisisseur;
+ protected Float gearShootingStartSurfaceTemperature;
+
+ protected Float gearShootingEndSurfaceTemperature;
+
+ protected Float gearShootingStartBottomTemperature;
+
+ protected Float gearShootingEndBottomTemperature;
+
+ protected Float averageBottomTemperature;
+
+ protected Float gearShootingStartSurfaceSalinity;
+
+ protected Float gearShootingEndSurfaceSalinity;
+
+ protected Float gearShootingStartBottomSalinity;
+
+ protected Float gearShootingEndBottomSalinity;
+
+ protected Float averageBottomSalinity;
+
+
public CampaignBean getCampaign() {
return campaign;
}
@@ -127,102 +148,70 @@
this.date = date;
}
- public Object getAssociationStrate() {
- return associationStrate;
+ public Float getGearShootingStartLatitude() {
+ return gearShootingStartLatitude;
}
- public void setAssociationStrate(Object associationStrate) {
- this.associationStrate = associationStrate;
+ public void setGearShootingStartLatitude(Float gearShootingStartLatitude) {
+ this.gearShootingStartLatitude = gearShootingStartLatitude;
}
- public Float getEnPecheLatitude() {
- return enPecheLatitude;
+ public Float getGearShootingStartLongitude() {
+ return gearShootingStartLongitude;
}
- public void setEnPecheLatitude(Float enPecheLatitude) {
- this.enPecheLatitude = enPecheLatitude;
+ public void setGearShootingStartLongitude(Float gearShootingStartLongitude) {
+ this.gearShootingStartLongitude = gearShootingStartLongitude;
}
- public Float getEnPecheLongitude() {
- return enPecheLongitude;
+ public Date getGearShootingStartTime() {
+ return gearShootingStartTime;
}
- public void setEnPecheLongitude(Float enPecheLongitude) {
- this.enPecheLongitude = enPecheLongitude;
+ public void setGearShootingStartTime(Date gearShootingStartTime) {
+ this.gearShootingStartTime = gearShootingStartTime;
}
- public Date getEnPecheTime() {
- return enPecheTime;
+ public Float getGearShootingStartDepth() {
+ return gearShootingStartDepth;
}
- public void setEnPecheTime(Date enPecheTime) {
- this.enPecheTime = enPecheTime;
+ public void setGearShootingStartDepth(Float gearShootingStartDepth) {
+ this.gearShootingStartDepth = gearShootingStartDepth;
}
- public Float getEnPecheProfondeur() {
- return enPecheProfondeur;
+ public Float getGearShootingEndLatitude() {
+ return gearShootingEndLatitude;
}
- public void setEnPecheProfondeur(Float enPecheProfondeur) {
- this.enPecheProfondeur = enPecheProfondeur;
+ public void setGearShootingEndLatitude(Float gearShootingEndLatitude) {
+ this.gearShootingEndLatitude = gearShootingEndLatitude;
}
- public Float getSortieDeLEauLatitude() {
- return sortieDeLEauLatitude;
+ public Float getGearShootingEndLongitude() {
+ return gearShootingEndLongitude;
}
- public void setSortieDeLEauLatitude(Float sortieDeLEauLatitude) {
- this.sortieDeLEauLatitude = sortieDeLEauLatitude;
+ public void setGearShootingEndLongitude(Float gearShootingEndLongitude) {
+ this.gearShootingEndLongitude = gearShootingEndLongitude;
}
- public Float getSortieDeLEauLongitude() {
- return sortieDeLEauLongitude;
+ public Date getGearShootingEndTime() {
+ return gearShootingEndTime;
}
- public void setSortieDeLEauLongitude(Float sortieDeLEauLongitude) {
- this.sortieDeLEauLongitude = sortieDeLEauLongitude;
+ public void setGearShootingEndTime(Date gearShootingEndTime) {
+ this.gearShootingEndTime = gearShootingEndTime;
}
- public Date getSortieDeLEauTime() {
- return sortieDeLEauTime;
+ public Float getGearShootingEndDepth() {
+ return gearShootingEndDepth;
}
- public void setSortieDeLEauTime(Date sortieDeLEauTime) {
- this.sortieDeLEauTime = sortieDeLEauTime;
+ public void setGearShootingEndDepth(Float gearShootingEndDepth) {
+ this.gearShootingEndDepth = gearShootingEndDepth;
}
- public Float getSortieDeLEauProfondeur() {
- return sortieDeLEauProfondeur;
- }
-
- public void setSortieDeLEauProfondeur(Float sortieDeLEauProfondeur) {
- this.sortieDeLEauProfondeur = sortieDeLEauProfondeur;
- }
-
- public Integer getForceVent() {
- return forceVent;
- }
-
- public void setForceVent(Integer forceVent) {
- this.forceVent = forceVent;
- }
-
- public Integer getDirectionVent() {
- return directionVent;
- }
-
- public void setDirectionVent(Integer directionVent) {
- this.directionVent = directionVent;
- }
-
- public Object getEtatMer() {
- return etatMer;
- }
-
- public void setEtatMer(Object etatMer) {
- this.etatMer = etatMer;
- }
-
public Float getOuvertureHorizontale() {
return ouvertureHorizontale;
}
@@ -239,11 +228,11 @@
this.ouvertureVerticale = ouvertureVerticale;
}
- public Boolean getGeometrieMesuree() {
+ public boolean getGeometrieMesuree() {
return geometrieMesuree;
}
- public void setGeometrieMesuree(Boolean geometrieMesuree) {
+ public void isGeometrieMesuree(boolean geometrieMesuree) {
this.geometrieMesuree = geometrieMesuree;
}
@@ -263,19 +252,19 @@
this.longueurBras = longueurBras;
}
- public Boolean getSystemeFermetureCul() {
+ public boolean getSystemeFermetureCul() {
return systemeFermetureCul;
}
- public void setSystemeFermetureCul(Boolean systemeFermetureCul) {
+ public void setSystemeFermetureCul(boolean systemeFermetureCul) {
this.systemeFermetureCul = systemeFermetureCul;
}
- public Boolean getTraitRectiligne() {
+ public boolean isTraitRectiligne() {
return traitRectiligne;
}
- public void setTraitRectiligne(Boolean traitRectiligne) {
+ public void setTraitRectiligne(boolean traitRectiligne) {
this.traitRectiligne = traitRectiligne;
}
@@ -295,11 +284,11 @@
this.duree = duree;
}
- public Boolean getTraitValid() {
+ public boolean isTraitValid() {
return traitValid;
}
- public void setTraitValid(Boolean traitValid) {
+ public void setTraitValid(boolean traitValid) {
this.traitValid = traitValid;
}
@@ -326,4 +315,116 @@
public void setSaisisseur(List<UserBean> saisisseur) {
this.saisisseur = saisisseur;
}
+
+ public StrataBean getStrate() {
+ return strate;
+ }
+
+ public void setStrate(StrataBean strate) {
+ this.strate = strate;
+ }
+
+ public BeaufortScaleBean getBeaufortScale() {
+ return beaufortScale;
+ }
+
+ public void setBeaufortScale(BeaufortScaleBean beaufortScale) {
+ this.beaufortScale = beaufortScale;
+ }
+
+ public Integer getWindDirection() {
+ return windDirection;
+ }
+
+ public void setWindDirection(Integer windDirection) {
+ this.windDirection = windDirection;
+ }
+
+ public SeaStateBean getSeaState() {
+ return seaState;
+ }
+
+ public void setSeaState(SeaStateBean seaState) {
+ this.seaState = seaState;
+ }
+
+ public Float getGearShootingStartSurfaceTemperature() {
+ return gearShootingStartSurfaceTemperature;
+ }
+
+ public void setGearShootingStartSurfaceTemperature(Float gearShootingStartSurfaceTemperature) {
+ this.gearShootingStartSurfaceTemperature = gearShootingStartSurfaceTemperature;
+ }
+
+ public Float getGearShootingEndSurfaceTemperature() {
+ return gearShootingEndSurfaceTemperature;
+ }
+
+ public void setGearShootingEndSurfaceTemperature(Float gearShootingEndSurfaceTemperature) {
+ this.gearShootingEndSurfaceTemperature = gearShootingEndSurfaceTemperature;
+ }
+
+ public Float getGearShootingStartBottomTemperature() {
+ return gearShootingStartBottomTemperature;
+ }
+
+ public void setGearShootingStartBottomTemperature(Float gearShootingStartBottomTemperature) {
+ this.gearShootingStartBottomTemperature = gearShootingStartBottomTemperature;
+ }
+
+ public Float getGearShootingEndBottomTemperature() {
+ return gearShootingEndBottomTemperature;
+ }
+
+ public void setGearShootingEndBottomTemperature(Float gearShootingEndBottomTemperature) {
+ this.gearShootingEndBottomTemperature = gearShootingEndBottomTemperature;
+ }
+
+ public Float getAverageBottomTemperature() {
+ return averageBottomTemperature;
+ }
+
+ public void setAverageBottomTemperature(Float averageBottomTemperature) {
+ this.averageBottomTemperature = averageBottomTemperature;
+ }
+
+ public Float getGearShootingStartSurfaceSalinity() {
+ return gearShootingStartSurfaceSalinity;
+ }
+
+ public void setGearShootingStartSurfaceSalinity(Float gearShootingStartSurfaceSalinity) {
+ this.gearShootingStartSurfaceSalinity = gearShootingStartSurfaceSalinity;
+ }
+
+ public Float getGearShootingEndSurfaceSalinity() {
+ return gearShootingEndSurfaceSalinity;
+ }
+
+ public void setGearShootingEndSurfaceSalinity(Float gearShootingEndSurfaceSalinity) {
+ this.gearShootingEndSurfaceSalinity = gearShootingEndSurfaceSalinity;
+ }
+
+ public Float getGearShootingStartBottomSalinity() {
+ return gearShootingStartBottomSalinity;
+ }
+
+ public void setGearShootingStartBottomSalinity(Float gearShootingStartBottomSalinity) {
+ this.gearShootingStartBottomSalinity = gearShootingStartBottomSalinity;
+ }
+
+ public Float getGearShootingEndBottomSalinity() {
+ return gearShootingEndBottomSalinity;
+ }
+
+ public void setGearShootingEndBottomSalinity(Float gearShootingEndBottomSalinity) {
+ this.gearShootingEndBottomSalinity = gearShootingEndBottomSalinity;
+ }
+
+ public Float getAverageBottomSalinity() {
+ return averageBottomSalinity;
+ }
+
+ public void setAverageBottomSalinity(Float averageBottomSalinity) {
+ this.averageBottomSalinity = averageBottomSalinity;
+ }
}
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-22 17:34:53 UTC (rev 12)
+++ trunk/tutti-persistence-dev/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceDevFixtures.java 2012-11-23 22:17:44 UTC (rev 13)
@@ -25,9 +25,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.CountryBean;
import fr.ifremer.tutti.persistence.entities.GearBean;
+import fr.ifremer.tutti.persistence.entities.SeaStateBean;
+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;
@@ -61,6 +64,13 @@
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();
+
public TuttiPersistenceDevFixtures() {
// inject default datas
@@ -171,6 +181,60 @@
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();
+ bs.setId(UUID.randomUUID().toString());
+ bs.setName("Calme");
+ beaufortScale.add(bs);
+
+ bs = new BeaufortScaleBean();
+ bs.setId(UUID.randomUUID().toString());
+ bs.setName("Très légère brise");
+ beaufortScale.add(bs);
+
+ bs = new BeaufortScaleBean();
+ bs.setId(UUID.randomUUID().toString());
+ bs.setName("Petite brise");
+ beaufortScale.add(bs);
+
+ bs = new BeaufortScaleBean();
+ bs.setId(UUID.randomUUID().toString());
+ bs.setName("Jolie brise");
+ beaufortScale.add(bs);
+
+ bs = new BeaufortScaleBean();
+ bs.setId(UUID.randomUUID().toString());
+ bs.setName("Vent frais");
+ beaufortScale.add(bs);
+
+ bs = new BeaufortScaleBean();
+ bs.setId(UUID.randomUUID().toString());
+ bs.setName("Grand frais");
+ beaufortScale.add(bs);
+
+ bs = new BeaufortScaleBean();
+ bs.setId(UUID.randomUUID().toString());
+ bs.setName("Coup de vent");
+ beaufortScale.add(bs);
+
+ bs = new BeaufortScaleBean();
+ bs.setId(UUID.randomUUID().toString());
+ bs.setName("Fort coup de vent");
+ beaufortScale.add(bs);
+
+ SeaStateBean st;
+
+ st = new SeaStateBean();
+ st.setId(UUID.randomUUID().toString());
+ st.setName("Mer calme");
+ seaState.add(st);
+
+ st = new SeaStateBean();
+ st.setId(UUID.randomUUID().toString());
+ st.setName("Mer agitée");
+ seaState.add(st);
}
public List<CampaignBean> campaign() {
@@ -204,4 +268,16 @@
public List<UserBean> user() {
return user;
}
+
+ public List<StrataBean> strata() {
+ return strata;
+ }
+
+ public List<SeaStateBean> seaState() {
+ return seaState;
+ }
+
+ public List<BeaufortScaleBean> beaufortScale() {
+ return beaufortScale;
+ }
}
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-22 17:34:53 UTC (rev 12)
+++ trunk/tutti-persistence-dev/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceDevImpl.java 2012-11-23 22:17:44 UTC (rev 13)
@@ -30,9 +30,12 @@
import com.google.common.collect.Lists;
import fr.ifremer.tutti.persistence.config.TuttiPersistenceDevConfig;
import fr.ifremer.tutti.persistence.entities.AbstractTuttiEntity;
+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.StrataBean;
import fr.ifremer.tutti.persistence.entities.SurveyBean;
import fr.ifremer.tutti.persistence.entities.TraitBean;
import fr.ifremer.tutti.persistence.entities.TuttiBeans;
@@ -83,6 +86,12 @@
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();
+
@Override
public String getImplementationName() {
return "Persistence Dev implementation";
@@ -108,6 +117,9 @@
survey.clear();
campaign.clear();
trait.clear();
+ strata.clear();
+ seaState.clear();
+ beaufortScale.clear();
TuttiPersistenceDevFixtures fixtures =
new TuttiPersistenceDevFixtures();
@@ -120,6 +132,9 @@
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()));
}
@Override
@@ -133,6 +148,9 @@
persistToFile(SurveyBean.class, survey);
persistToFile(CampaignBean.class, campaign);
persistToFile(TraitBean.class, trait);
+ persistToFile(StrataBean.class, strata);
+ persistToFile(SeaStateBean.class, seaState);
+ persistToFile(BeaufortScaleBean.class, beaufortScale);
}
@Override
@@ -173,6 +191,24 @@
}
@Override
+ public List<SeaStateBean> getAllSeaStates() {
+ List<SeaStateBean> result = Lists.newArrayList(seaState);
+ return result;
+ }
+
+ @Override
+ public List<StrataBean> getAllStratas() {
+ List<StrataBean> result = Lists.newArrayList(strata);
+ return result;
+ }
+
+ @Override
+ public List<BeaufortScaleBean> getAllBeaufortScales() {
+ List<BeaufortScaleBean> result = Lists.newArrayList(beaufortScale);
+ return result;
+ }
+
+ @Override
public List<CampaignBean> getAllCampaigns(final String surveyId) {
List<CampaignBean> result = Lists.newArrayList(Iterables.filter(campaign, new Predicate<CampaignBean>() {
@Override
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-22 17:34:53 UTC (rev 12)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/DecoratorService.java 2012-11-23 22:17:44 UTC (rev 13)
@@ -24,9 +24,12 @@
* #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.StrataBean;
import fr.ifremer.tutti.persistence.entities.SurveyBean;
import fr.ifremer.tutti.persistence.entities.TraitBean;
import fr.ifremer.tutti.persistence.entities.UserBean;
@@ -72,12 +75,15 @@
registerMultiJXPathDecorator(SurveyBean.class, "${id}$s#${name}$s", "#", " - ");
registerMultiJXPathDecorator(CampaignBean.class, "${id}$s#${name}$s", "#", " - ");
- registerMultiJXPathDecorator(TraitBean.class, "${id}$s#${name}$s", "#", " - ");
+ registerMultiJXPathDecorator(TraitBean.class, "${id}$s#${stationNumber}$s", "#", " - ");
registerMultiJXPathDecorator(ZoneBean.class, "${id}$s#${name}$s", "#", " - ");
registerMultiJXPathDecorator(VesselBean.class, "${id}$s#${name}$s", "#", " - ");
registerMultiJXPathDecorator(CountryBean.class, "${id}$s#${name}$s", "#", " - ");
registerMultiJXPathDecorator(GearBean.class, "${id}$s#${name}$s", "#", " - ");
registerMultiJXPathDecorator(UserBean.class, "${id}$s#${name}$s", "#", " - ");
+ registerMultiJXPathDecorator(BeaufortScaleBean.class, "${id}$s#${name}$s", "#", " - ");
+ registerMultiJXPathDecorator(SeaStateBean.class, "${id}$s#${name}$s", "#", " - ");
+ registerMultiJXPathDecorator(StrataBean.class, "${id}$s#${name}$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-22 17:34:53 UTC (rev 12)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java 2012-11-23 22:17:44 UTC (rev 13)
@@ -26,9 +26,12 @@
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.CountryBean;
import fr.ifremer.tutti.persistence.entities.GearBean;
+import fr.ifremer.tutti.persistence.entities.SeaStateBean;
+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;
@@ -149,6 +152,24 @@
}
@Override
+ public List<SeaStateBean> getAllSeaStates() {
+ checkDriverExists();
+ return driver.getAllSeaStates();
+ }
+
+ @Override
+ public List<StrataBean> getAllStratas() {
+ checkDriverExists();
+ return driver.getAllStratas();
+ }
+
+ @Override
+ public List<BeaufortScaleBean> getAllBeaufortScales() {
+ checkDriverExists();
+ return driver.getAllBeaufortScales();
+ }
+
+ @Override
public List<CampaignBean> getAllCampaigns(String surveyId) {
checkDriverExists();
return driver.getAllCampaigns(surveyId);
1
0
Author: tchemit
Date: 2012-11-22 18:34:53 +0100 (Thu, 22 Nov 2012)
New Revision: 12
Url: http://forge.codelutin.com/repositories/revision/tutti/12
Log:
fix dependencies
Modified:
trunk/tutti-service/pom.xml
Modified: trunk/tutti-service/pom.xml
===================================================================
--- trunk/tutti-service/pom.xml 2012-11-22 17:30:31 UTC (rev 11)
+++ trunk/tutti-service/pom.xml 2012-11-22 17:34:53 UTC (rev 12)
@@ -50,20 +50,10 @@
</dependency>
<dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-lang3</artifactId>
- </dependency>
-
- <dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</dependency>
- <dependency>
- <groupId>org.swinglabs.swingx</groupId>
- <artifactId>swingx-common</artifactId>
- </dependency>
-
<!-- Logging -->
<dependency>
1
0