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
r91 - in trunk/tutti-ui-swing/src/main: java/fr/ifremer/tutti/ui/swing/content/operation java/fr/ifremer/tutti/ui/swing/content/operation/fishing java/fr/ifremer/tutti/ui/swing/content/operation/fishing/environment resources/i18n
by kmorin@users.forge.codelutin.com 19 Dec '12
by kmorin@users.forge.codelutin.com 19 Dec '12
19 Dec '12
Author: kmorin
Date: 2012-12-19 16:39:51 +0100 (Wed, 19 Dec 2012)
New Revision: 91
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/91
Log:
use a table instead of a form in the environment tab
Added:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/environment/
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/environment/EnvironmentRowModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/environment/EnvironmentTabUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/environment/EnvironmentTabUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/environment/EnvironmentTabUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/environment/EnvironmentTabUIModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/environment/EnvironmentTableModel.java
Removed:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentRowModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTabUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTabUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTabUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTabUIModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTableModel.java
Modified:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel.java
trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.jaxx 2012-12-19 10:49:03 UTC (rev 90)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.jaxx 2012-12-19 15:39:51 UTC (rev 91)
@@ -32,7 +32,7 @@
fr.ifremer.tutti.persistence.entities.referential.Person
fr.ifremer.tutti.ui.swing.util.editor.SimpleTimeEditor
- fr.ifremer.tutti.ui.swing.content.operation.fishing.EnvironmentTabUI
+ fr.ifremer.tutti.ui.swing.content.operation.fishing.environment.EnvironmentTabUI
jaxx.runtime.swing.editor.bean.BeanComboBox
jaxx.runtime.swing.editor.bean.BeanListHeader
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java 2012-12-19 10:49:03 UTC (rev 90)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java 2012-12-19 15:39:51 UTC (rev 91)
@@ -24,10 +24,12 @@
* #L%
*/
+import com.google.common.collect.Maps;
import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
import fr.ifremer.tutti.persistence.entities.referential.Person;
import fr.ifremer.tutti.service.PersistenceService;
import fr.ifremer.tutti.ui.swing.AbstractTuttiUIHandler;
+import fr.ifremer.tutti.ui.swing.content.operation.fishing.environment.EnvironmentTabUIModel;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -38,7 +40,10 @@
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.util.List;
+import java.util.Map;
+import static org.nuiton.i18n.I18n._;
+
/**
* Handler for UI {@link EditFishingOperationUI}.
*
@@ -97,7 +102,7 @@
ui.getFishingOperationValidPanel().remove(
ui.getFishingOperationResetRadio());
- EditFishingOperationUIModel model = ui.getModel();
+ final EditFishingOperationUIModel model = ui.getModel();
initUI(ui);
@@ -120,7 +125,37 @@
model.setEmpty(true);
listenValidatorValid(ui.getValidator(), getModel());
+
+ EnvironmentTabUIModel environmentModel =
+ ui.getEnvironmentTabContent().getModel();
+ environmentModel.addPropertyChangeListener(
+ EditFishingOperationUIModel.PROPERTY_ENVIRONMENT_PARAMETERS,
+ new PropertyChangeListener() {
+
+ public void propertyChange(PropertyChangeEvent evt) {
+ model.setModify(true);
+ }
+ }
+ );
+ environmentModel.setEnvironmentParameters(getDefaultEnvironmentParams());
}
+
+ protected Map<Object, Object> getDefaultEnvironmentParams() {
+ Map<Object, Object> environmentParams = Maps.newHashMap();
+ environmentParams.put(
+ _(new String("tutti.table.fishing.environment.keys." + EnvironmentTabUIModel.KEY_BEAUFORT_SCALE)),
+ null
+ );
+ environmentParams.put(
+ _(new String("tutti.table.fishing.environment.keys." + EnvironmentTabUIModel.KEY_WIND_DIRECTION)),
+ null
+ );
+ environmentParams.put(
+ _(new String("tutti.table.fishing.environment.keys." + EnvironmentTabUIModel.KEY_SEA_STATE)),
+ null
+ );
+ return environmentParams;
+ }
@Override
public void onCloseUI() {
@@ -155,7 +190,8 @@
// if new fishingOperation can already cancel his creation
model.setModify(!empty && model.isCreate());
- ui.getEnvironmentTabContent().getHandler().afterInitUI();
+ ui.getEnvironmentTabContent().getModel().setEnvironmentParameters(getDefaultEnvironmentParams());
+ ui.getEnvironmentTabContent().getHandler().reset();
}
public void cancel() {
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel.java 2012-12-19 10:49:03 UTC (rev 90)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel.java 2012-12-19 15:39:51 UTC (rev 91)
@@ -26,9 +26,7 @@
import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
import fr.ifremer.tutti.persistence.entities.data.Cruise;
-import fr.ifremer.tutti.persistence.entities.referential.BeaufortScale;
import fr.ifremer.tutti.persistence.entities.referential.Person;
-import fr.ifremer.tutti.persistence.entities.referential.SeaState;
import fr.ifremer.tutti.persistence.entities.referential.FishingOperationLocation;
import fr.ifremer.tutti.ui.swing.AbstractTuttiBeanUIModel;
import fr.ird.type.SexagecimalPosition;
@@ -37,6 +35,7 @@
import java.util.Date;
import java.util.List;
+import java.util.Map;
/**
* Model for UI {@link EditFishingOperationUI}.
@@ -76,12 +75,14 @@
public static final String PROPERTY_GEAR_SHOOTING_END_DEPTH = "gearShootingEndDepth";
- public static final String PROPERTY_BEAUFORT_SCALE = "beaufortScale";
+// 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_ENVIRONMENT_PARAMETERS = "environmentParameters";
- 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";
@@ -172,12 +173,14 @@
protected Float gearShootingEndDepth;
- protected BeaufortScale beaufortScale;
+// protected BeaufortScale beaufortScale;
+//
+// protected Integer windDirection;
+//
+// protected SeaState seaState;
+
+ protected Map<Object, Object> environmentParameters;
- protected Integer windDirection;
-
- protected SeaState seaState;
-
protected Float ouvertureHorizontale;
protected Float ouvertureVerticale;
@@ -383,36 +386,46 @@
firePropertyChange(PROPERTY_GEAR_SHOOTING_END_DEPTH, oldValue, gearShootingEndDepth);
}
- public BeaufortScale getBeaufortScale() {
- return beaufortScale;
+// public BeaufortScale getBeaufortScale() {
+// return beaufortScale;
+// }
+//
+// public void setBeaufortScale(BeaufortScale 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 SeaState getSeaState() {
+// return seaState;
+// }
+//
+// public void setSeaState(SeaState seaState) {
+// Object oldValue = getSeaState();
+// this.seaState = seaState;
+// firePropertyChange(PROPERTY_SEA_STATE, oldValue, seaState);
+// }
+
+ public Map<Object, Object> getEnvironmentParameters() {
+ return environmentParameters;
}
-
- public void setBeaufortScale(BeaufortScale beaufortScale) {
- Object oldValue = getBeaufortScale();
- this.beaufortScale = beaufortScale;
- firePropertyChange(PROPERTY_BEAUFORT_SCALE, oldValue, beaufortScale);
+
+ public void setEnvironmentParameters(Map<Object, Object> environmentParameters) {
+ Object oldValue = getEnvironmentParameters();
+ this.environmentParameters = environmentParameters;
+ firePropertyChange(PROPERTY_ENVIRONMENT_PARAMETERS, oldValue, environmentParameters);
}
- public Integer getWindDirection() {
- return windDirection;
- }
-
- public void setWindDirection(Integer windDirection) {
- Object oldValue = getWindDirection();
- this.windDirection = windDirection;
- firePropertyChange(PROPERTY_WIND_DIRECTION, oldValue, windDirection);
- }
-
- public SeaState getSeaState() {
- return seaState;
- }
-
- public void setSeaState(SeaState seaState) {
- Object oldValue = getSeaState();
- this.seaState = seaState;
- firePropertyChange(PROPERTY_SEA_STATE, oldValue, seaState);
- }
-
public Float getOuvertureHorizontale() {
return ouvertureHorizontale;
}
Deleted: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentRowModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentRowModel.java 2012-12-19 10:49:03 UTC (rev 90)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentRowModel.java 2012-12-19 15:39:51 UTC (rev 91)
@@ -1,94 +0,0 @@
-package fr.ifremer.tutti.ui.swing.content.operation.fishing;
-
-/*
- * #%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.ui.swing.AbstractTuttiBeanUIModel;
-import java.io.Serializable;
-import org.nuiton.util.beans.Binder;
-import org.nuiton.util.beans.BinderFactory;
-
-/**
- *
- * @author kmorin
- * @since 0.3
- */
-public class EnvironmentRowModel extends AbstractTuttiBeanUIModel<Object, EnvironmentRowModel> {
-
- public static final String PROPERTY_KEY = "key";
- public static final String PROPERTY_VALUE = "value";
-
- protected static final Binder<Object, EnvironmentRowModel> fromBeanBinder =
- BinderFactory.newBinder(Object.class,
- EnvironmentRowModel.class);
-
- protected static final Binder<EnvironmentRowModel, Object> toBeanBinder =
- BinderFactory.newBinder(EnvironmentRowModel.class,
- Object.class);
-
- protected String key;
-
- protected String value;
-
- public EnvironmentRowModel() {
- super(Object.class, fromBeanBinder, toBeanBinder);
- }
-
- public EnvironmentRowModel(String key) {
- this();
- this.key = key;
- }
-//
-// public FishingOperationEnvironmentRowModel(Object o,
-// List<SpeciesBatchFrequency> frequencies) {
-// this();
-// fromBean(aBatch);
-// List<SpeciesFrequencyRowModel> frequencyRows =
-// SpeciesFrequencyRowModel.fromBeans(frequencies);
-// frequency.addAll(frequencyRows);
-// Collections.sort(frequency);
-// updateTotalFromFrequencies();
-// }
-
- public String getKey() {
- return key;
- }
-
- public void setKey(String key) {
- Object oldValue = getKey();
- this.key = key;
- firePropertyChange(PROPERTY_KEY, oldValue, key);
- }
-
- public String getValue() {
- return value;
- }
-
- public void setValue(String value) {
- Object oldValue = getValue();
- this.value = value;
- firePropertyChange(PROPERTY_VALUE, oldValue, value);
- }
-
-}
Deleted: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTabUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTabUI.css 2012-12-19 10:49:03 UTC (rev 90)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTabUI.css 2012-12-19 15:39:51 UTC (rev 91)
@@ -1,29 +0,0 @@
-/*
- * #%L
- * Tutti :: UI
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2012 Ifremer
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-#environmentTable {
- selectionMode: {ListSelectionModel.SINGLE_SELECTION};
- selectionBackground: {null};
- selectionForeground: {Color.BLACK};
- sortable: false;
-}
\ No newline at end of file
Deleted: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTabUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTabUI.jaxx 2012-12-19 10:49:03 UTC (rev 90)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTabUI.jaxx 2012-12-19 15:39:51 UTC (rev 91)
@@ -1,69 +0,0 @@
-<!--
- #%L
- Tutti :: UI
- $Id$
- $HeadURL$
- %%
- Copyright (C) 2012 Ifremer
- %%
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as
- published by the Free Software Foundation, either version 3 of the
- License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public
- License along with this program. If not, see
- <http://www.gnu.org/licenses/gpl-3.0.html>.
- #L%
- -->
-<Table implements='fr.ifremer.tutti.ui.swing.TuttiUI<EnvironmentTabUIModel, EnvironmentTabUIHandler>'>
-
- <import>
- org.jdesktop.swingx.JXTable
- fr.ifremer.tutti.ui.swing.content.operation.EditFishingOperationUI
- javax.swing.ListSelectionModel
- java.awt.Color
- </import>
-
- <EnvironmentTabUIHandler id='handler'
- initializer='getContextValue(EnvironmentTabUIHandler.class)'/>
-
- <EnvironmentTabUIModel id='model'
- initializer='getContextValue(EnvironmentTabUIModel.class)'/>
-
- <row fill='both'>
- <cell fill='both' weightx='1'>
- <JComboBox id='newRowKey'/>
- </cell>
- <cell fill='both'>
- <JButton id='addRow' actionIcon='add'
- onActionPerformed='handler.addRow()'/>
- </cell>
- </row>
- <row fill='both' weighty='1'>
- <cell fill='both' columns='2'>
- <JScrollPane>
- <JXTable id='environmentTable'/>
- </JScrollPane>
- </cell>
- </row>
- <script><![CDATA[
-
-public EnvironmentTabUI(EditFishingOperationUI parentUI) {
- EnvironmentTabUIHandler handler = new EnvironmentTabUIHandler(parentUI, this);
- setContextValue(handler);
- handler.beforeInitUI();
-}
-
-protected void $afterCompleteSetup() {
- handler.afterInitUI();
-}
-
- ]]></script>
-
-</Table>
\ No newline at end of file
Deleted: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTabUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTabUIHandler.java 2012-12-19 10:49:03 UTC (rev 90)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTabUIHandler.java 2012-12-19 15:39:51 UTC (rev 91)
@@ -1,192 +0,0 @@
-package fr.ifremer.tutti.ui.swing.content.operation.fishing;
-
-/*
- * #%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.ui.swing.content.operation.EditFishingOperationUI;
-import fr.ifremer.tutti.ui.swing.util.table.AbstractTuttiTableModel;
-import fr.ifremer.tutti.ui.swing.util.table.AbstractTuttiTableUIHandler;
-import java.awt.event.ItemEvent;
-import java.awt.event.ItemListener;
-import java.util.List;
-import javax.swing.DefaultComboBoxModel;
-import javax.swing.JComboBox;
-import javax.swing.event.ListDataEvent;
-import javax.swing.event.ListDataListener;
-import javax.swing.table.TableColumnModel;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.jdesktop.swingx.JXTable;
-import org.jdesktop.swingx.table.DefaultTableColumnModelExt;
-
-/**
- *
- * @author kmorin
- * @since 0.3
- */
-public class EnvironmentTabUIHandler extends AbstractTuttiTableUIHandler<EnvironmentRowModel, EnvironmentTabUIModel> {
-
- private final static Log log = LogFactory.getLog(EnvironmentTabUIHandler.class);
-
- protected EnvironmentTabUI ui;
-
- public EnvironmentTabUIHandler(EditFishingOperationUI parentUi, EnvironmentTabUI ui) {
- super(parentUi.getHandler().getContext());
- this.ui = ui;
- }
-
- @Override
- protected JXTable getTable() {
- return ui.getEnvironmentTable();
- }
-
- @Override
- protected AbstractTuttiTableModel<EnvironmentRowModel> getTableModel() {
- return (EnvironmentTableModel) getTable().getModel();
- }
-
- @Override
- protected TableColumnModel createTableColumnModel() {
- DefaultTableColumnModelExt columnModel =
- new DefaultTableColumnModelExt();
-
- {
-
- addColumnToModel(columnModel, EnvironmentTableModel.KEY);
- }
-
- {
-
- addColumnToModel(columnModel, EnvironmentTableModel.VALUE);
- }
-
-
- return columnModel;
- }
-
- @Override
- protected void onRowModified(EnvironmentRowModel row, String propertyName, Object oldValue, Object newValue) {
- }
-
- @Override
- protected void onRowValidStateChanged(EnvironmentRowModel row, Boolean oldValue, Boolean newValue) {
- }
-
- @Override
- protected void onRowModifyStateChanged(EnvironmentRowModel row, Boolean oldValue, Boolean newValue) {
- }
-
- @Override
- public void beforeInitUI() {
- EnvironmentTabUIModel model = new EnvironmentTabUIModel();
- ui.setContextValue(model);
- }
-
- @Override
- public void afterInitUI() {
- initUI(ui);
-
- JXTable table = getTable();
-
- // create table column model
- TableColumnModel columnModel = createTableColumnModel();
-
- // create table model
- EnvironmentTableModel tableModel =
- new EnvironmentTableModel(columnModel);
-
- table.setModel(tableModel);
- table.setColumnModel(columnModel);
-
- final JComboBox keyCombo = ui.getNewRowKey();
- keyCombo.setModel(new DefaultComboBoxModel());
-
- keyCombo.addItemListener(new ItemListener() {
-
- public void itemStateChanged(ItemEvent e) {
- log.debug("item state changed " + e.paramString());
- }
- });
- keyCombo.getModel().addListDataListener(new ListDataListener() {
-
- public void intervalAdded(ListDataEvent e) {
- keyCombo.setEnabled(true);
- ui.getAddRow().setEnabled(true);
- }
-
- public void intervalRemoved(ListDataEvent e) {
- if (keyCombo.getItemCount() == 0) {
- keyCombo.setEnabled(false);
- ui.getAddRow().setEnabled(false);
- }
- }
-
- public void contentsChanged(ListDataEvent e) {
- keyCombo.setEnabled(true);
- ui.getAddRow().setEnabled(true);
- }
- });
-
- reset();
- }
-
- @Override
- public void onCloseUI() {
- }
-
- @Override
- protected EnvironmentTabUIModel getModel() {
- return ui.getModel();
- }
-
- public void addRow() {
- JComboBox keyCombo = ui.getNewRowKey();
- String key = (String) keyCombo.getSelectedItem();
- EnvironmentRowModel row = new EnvironmentRowModel(key);
- getTableModel().addNewRow(getTable().getRowCount(), row);
-
- keyCombo.removeItem(key);
- }
-
- public void reset() {
- List<EnvironmentRowModel> rows = Lists.newArrayList();
- List<String> defaultKeys = Lists.newArrayList(ui.getModel().getDefaultKeys());
- for (String key : defaultKeys) {
- rows.add(new EnvironmentRowModel(key));
- }
-
- AbstractTuttiTableModel<EnvironmentRowModel> tableModel = getTableModel();
- tableModel.setRows(rows);
-
- JComboBox keyCombo = ui.getNewRowKey();
- DefaultComboBoxModel keyComboModel = (DefaultComboBoxModel)keyCombo.getModel();
- for (String key : ui.getModel().getKeys()) {
- if (!defaultKeys.contains(key)) {
- keyComboModel.addElement(key);
- }
- }
- }
-
-}
Deleted: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTabUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTabUIModel.java 2012-12-19 10:49:03 UTC (rev 90)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTabUIModel.java 2012-12-19 15:39:51 UTC (rev 91)
@@ -1,83 +0,0 @@
-package fr.ifremer.tutti.ui.swing.content.operation.fishing;
-
-/*
- * #%L
- * Tutti :: UI
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2012 Ifremer
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
-import fr.ifremer.tutti.ui.swing.util.table.AbstractTuttiTableUIModel;
-import org.nuiton.util.beans.Binder;
-import org.nuiton.util.beans.BinderModelBuilder;
-
-import static org.nuiton.i18n.I18n._;
-
-/**
- *
- * @author kmorin
- */
-public class EnvironmentTabUIModel extends AbstractTuttiTableUIModel<FishingOperation, EnvironmentRowModel, EnvironmentTabUIModel> {
-
- protected FishingOperation fishingOperation;
-
- public static final String KEY_BEAUFORT_SCALE = "beaufortScale";
- public static final String KEY_WIND_DIRECTION = "windDirection";
- public static final String KEY_SEA_STATE = "seaState";
-
- protected static final Binder<FishingOperation, EnvironmentTabUIModel> fromBeanBinder = BinderModelBuilder.newEmptyBuilder(FishingOperation.class, EnvironmentTabUIModel.class)
- .toBinder();
-
- protected static final Binder<EnvironmentTabUIModel, FishingOperation> toBeanBinder = BinderModelBuilder.newEmptyBuilder(EnvironmentTabUIModel.class, FishingOperation.class)
- .toBinder();
-
- public EnvironmentTabUIModel() {
- super(FishingOperation.class, fromBeanBinder, toBeanBinder);
- }
-
- public FishingOperation getFishingOperation() {
- return fishingOperation;
- }
-
- public void setFishingOperation(FishingOperation fishingOperation) {
- this.fishingOperation = fishingOperation;
- }
-
- public String[] getKeys() {
- return new String[] {
- _("tutti.table.fishing.environment.keys." + KEY_BEAUFORT_SCALE),
- _("tutti.table.fishing.environment.keys." + KEY_WIND_DIRECTION),
- _("tutti.table.fishing.environment.keys." + KEY_SEA_STATE),
- _("tutti.table.fishing.environment.keys." + "key3"),
- _("tutti.table.fishing.environment.keys." + "key4"),
- _("tutti.table.fishing.environment.keys." + "key5")
- };
- }
-
- public String[] getDefaultKeys() {
- return new String[] {
- _("tutti.table.fishing.environment.keys." + KEY_BEAUFORT_SCALE),
- _("tutti.table.fishing.environment.keys." + KEY_WIND_DIRECTION),
- _("tutti.table.fishing.environment.keys." + KEY_SEA_STATE)
- };
- }
-
-}
Deleted: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTableModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTableModel.java 2012-12-19 10:49:03 UTC (rev 90)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTableModel.java 2012-12-19 15:39:51 UTC (rev 91)
@@ -1,62 +0,0 @@
-package fr.ifremer.tutti.ui.swing.content.operation.fishing;
-
-/*
- * #%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.ui.swing.util.table.AbstractTuttiTableModel;
-import fr.ifremer.tutti.ui.swing.util.table.ColumnIdentifier;
-import javax.swing.table.TableColumnModel;
-
-import static org.nuiton.i18n.I18n.n_;
-
-/**
- *
- * @author kmorin
- * since 0.3
- */
-public class EnvironmentTableModel extends AbstractTuttiTableModel<EnvironmentRowModel> {
-
- public static final ColumnIdentifier<EnvironmentRowModel> KEY = ColumnIdentifier.newId(
- EnvironmentRowModel.PROPERTY_KEY,
- n_("tutti.table.fishing.environment.header.key"),
- n_("tutti.table.fishing.environment.header.key"));
-
- public static final ColumnIdentifier<EnvironmentRowModel> VALUE = ColumnIdentifier.newId(
- EnvironmentRowModel.PROPERTY_VALUE,
- n_("tutti.table.fishing.environment.header.value"),
- n_("tutti.table.fishing.environment.header.value"));
-
- public EnvironmentTableModel(TableColumnModel columnModel) {
- super(columnModel);
-
- setNoneEditableCols(KEY);
- }
-
- @Override
- protected EnvironmentRowModel createNewRow() {
- EnvironmentRowModel result = new EnvironmentRowModel();
- return result;
- }
-
-}
Copied: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/environment/EnvironmentRowModel.java (from rev 90, trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentRowModel.java)
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/environment/EnvironmentRowModel.java (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/environment/EnvironmentRowModel.java 2012-12-19 15:39:51 UTC (rev 91)
@@ -0,0 +1,87 @@
+package fr.ifremer.tutti.ui.swing.content.operation.fishing.environment;
+
+/*
+ * #%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.ui.swing.AbstractTuttiBeanUIModel;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.util.beans.Binder;
+import org.nuiton.util.beans.BinderFactory;
+
+/**
+ *
+ * @author kmorin
+ * @since 0.3
+ */
+public class EnvironmentRowModel extends AbstractTuttiBeanUIModel<Object, EnvironmentRowModel> {
+
+ private static final Log log = LogFactory.getLog(EnvironmentRowModel.class);
+
+ public static final String PROPERTY_KEY = "key";
+ public static final String PROPERTY_VALUE = "value";
+
+ protected static final Binder<Object, EnvironmentRowModel> fromBeanBinder =
+ BinderFactory.newBinder(Object.class,
+ EnvironmentRowModel.class);
+
+ protected static final Binder<EnvironmentRowModel, Object> toBeanBinder =
+ BinderFactory.newBinder(EnvironmentRowModel.class,
+ Object.class);
+
+ protected String key;
+
+ protected String value;
+
+ public EnvironmentRowModel() {
+ super(Object.class, fromBeanBinder, toBeanBinder);
+ }
+
+ public EnvironmentRowModel(String key) {
+ this();
+ this.key = key;
+ }
+
+ public String getKey() {
+ return key;
+ }
+
+ public void setKey(String key) {
+ Object oldValue = getKey();
+ this.key = key;
+ firePropertyChange(PROPERTY_KEY, oldValue, key);
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(String value) {
+ log.info(">>>>>>>>>>>>>>< setValue " + value);
+ Object oldValue = getValue();
+ this.value = value;
+ firePropertyChange(PROPERTY_VALUE, oldValue, value);
+ }
+
+}
Copied: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/environment/EnvironmentTabUI.css (from rev 90, trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTabUI.css)
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/environment/EnvironmentTabUI.css (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/environment/EnvironmentTabUI.css 2012-12-19 15:39:51 UTC (rev 91)
@@ -0,0 +1,29 @@
+/*
+ * #%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%
+ */
+#environmentTable {
+ selectionMode: {ListSelectionModel.SINGLE_SELECTION};
+ selectionBackground: {null};
+ selectionForeground: {Color.BLACK};
+ sortable: false;
+}
\ No newline at end of file
Copied: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/environment/EnvironmentTabUI.jaxx (from rev 90, trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTabUI.jaxx)
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/environment/EnvironmentTabUI.jaxx (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/environment/EnvironmentTabUI.jaxx 2012-12-19 15:39:51 UTC (rev 91)
@@ -0,0 +1,69 @@
+<!--
+ #%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%
+ -->
+<Table implements='fr.ifremer.tutti.ui.swing.TuttiUI<EnvironmentTabUIModel, EnvironmentTabUIHandler>'>
+
+ <import>
+ org.jdesktop.swingx.JXTable
+ fr.ifremer.tutti.ui.swing.content.operation.EditFishingOperationUI
+ javax.swing.ListSelectionModel
+ java.awt.Color
+ </import>
+
+ <EnvironmentTabUIHandler id='handler'
+ initializer='getContextValue(EnvironmentTabUIHandler.class)'/>
+
+ <EnvironmentTabUIModel id='model'
+ initializer='getContextValue(EnvironmentTabUIModel.class)'/>
+
+ <row fill='both'>
+ <cell fill='both' weightx='1'>
+ <JComboBox id='newRowKey'/>
+ </cell>
+ <cell fill='both'>
+ <JButton id='addRow' actionIcon='add'
+ onActionPerformed='handler.addRow()'/>
+ </cell>
+ </row>
+ <row fill='both' weighty='1'>
+ <cell fill='both' columns='2'>
+ <JScrollPane>
+ <JXTable id='environmentTable'/>
+ </JScrollPane>
+ </cell>
+ </row>
+ <script><![CDATA[
+
+public EnvironmentTabUI(EditFishingOperationUI parentUI) {
+ EnvironmentTabUIHandler handler = new EnvironmentTabUIHandler(parentUI, this);
+ setContextValue(handler);
+ handler.beforeInitUI();
+}
+
+protected void $afterCompleteSetup() {
+ handler.afterInitUI();
+}
+
+ ]]></script>
+
+</Table>
\ No newline at end of file
Copied: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/environment/EnvironmentTabUIHandler.java (from rev 90, trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTabUIHandler.java)
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/environment/EnvironmentTabUIHandler.java (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/environment/EnvironmentTabUIHandler.java 2012-12-19 15:39:51 UTC (rev 91)
@@ -0,0 +1,221 @@
+package fr.ifremer.tutti.ui.swing.content.operation.fishing.environment;
+
+/*
+ * #%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.ui.swing.content.operation.EditFishingOperationUI;
+import fr.ifremer.tutti.ui.swing.util.TuttiBeanMonitor;
+import fr.ifremer.tutti.ui.swing.util.table.AbstractTuttiTableModel;
+import fr.ifremer.tutti.ui.swing.util.table.AbstractTuttiTableUIHandler;
+import fr.ifremer.tutti.ui.swing.util.table.TableRowModificationListener;
+import java.awt.event.ItemEvent;
+import java.awt.event.ItemListener;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import javax.swing.DefaultComboBoxModel;
+import javax.swing.JComboBox;
+import javax.swing.event.ListDataEvent;
+import javax.swing.event.ListDataListener;
+import javax.swing.event.ListSelectionListener;
+import javax.swing.table.TableColumnModel;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jdesktop.swingx.JXTable;
+import org.jdesktop.swingx.table.DefaultTableColumnModelExt;
+
+/**
+ *
+ * @author kmorin
+ * @since 0.3
+ */
+public class EnvironmentTabUIHandler extends AbstractTuttiTableUIHandler<EnvironmentRowModel, EnvironmentTabUIModel> {
+
+ private final static Log log = LogFactory.getLog(EnvironmentTabUIHandler.class);
+
+ protected EnvironmentTabUI ui;
+
+ public EnvironmentTabUIHandler(EditFishingOperationUI parentUi, EnvironmentTabUI ui) {
+ super(parentUi.getHandler().getContext(), EnvironmentRowModel.PROPERTY_VALUE);
+ this.ui = ui;
+ }
+
+ @Override
+ protected JXTable getTable() {
+ return ui.getEnvironmentTable();
+ }
+
+ @Override
+ protected AbstractTuttiTableModel<EnvironmentRowModel> getTableModel() {
+ return (EnvironmentTableModel) getTable().getModel();
+ }
+
+ @Override
+ protected TableColumnModel createTableColumnModel() {
+ DefaultTableColumnModelExt columnModel =
+ new DefaultTableColumnModelExt();
+
+ {
+
+ addColumnToModel(columnModel, EnvironmentTableModel.KEY);
+ }
+
+ {
+
+ addColumnToModel(columnModel, EnvironmentTableModel.VALUE);
+ }
+
+
+ return columnModel;
+ }
+
+ @Override
+ protected void onRowModified(EnvironmentRowModel row, String propertyName, Object oldValue, Object newValue) {
+ }
+
+ @Override
+ protected void onRowValidStateChanged(EnvironmentRowModel row, Boolean oldValue, Boolean newValue) {
+ }
+
+ @Override
+ protected void onRowModifyStateChanged(EnvironmentRowModel row, Boolean oldValue, Boolean newValue) {
+ }
+
+ @Override
+ public void beforeInitUI() {
+ EnvironmentTabUIModel model = new EnvironmentTabUIModel();
+ ui.setContextValue(model);
+ }
+
+ @Override
+ public void afterInitUI() {
+ initUI(ui);
+
+ JXTable table = getTable();
+
+ // create table column model
+ TableColumnModel columnModel = createTableColumnModel();
+
+ // create table model
+ EnvironmentTableModel tableModel =
+ new EnvironmentTableModel(columnModel);
+
+ table.setModel(tableModel);
+ table.setColumnModel(columnModel);
+
+ final JComboBox keyCombo = ui.getNewRowKey();
+ keyCombo.setModel(new DefaultComboBoxModel());
+
+ keyCombo.addItemListener(new ItemListener() {
+
+ public void itemStateChanged(ItemEvent e) {
+ log.debug("item state changed " + e.paramString());
+ }
+ });
+ keyCombo.getModel().addListDataListener(new ListDataListener() {
+
+ public void intervalAdded(ListDataEvent e) {
+ keyCombo.setEnabled(true);
+ ui.getAddRow().setEnabled(true);
+ }
+
+ public void intervalRemoved(ListDataEvent e) {
+ if (keyCombo.getItemCount() == 0) {
+ keyCombo.setEnabled(false);
+ ui.getAddRow().setEnabled(false);
+ }
+ }
+
+ public void contentsChanged(ListDataEvent e) {
+ keyCombo.setEnabled(true);
+ ui.getAddRow().setEnabled(true);
+ }
+ });
+
+ // modify the model when the user enters a value
+ ListSelectionListener listener = new TableRowModificationListener<EnvironmentRowModel>(
+ tableModel, getRowMonitor()) {
+
+ @Override
+ protected void saveSelectedRow() {
+ TuttiBeanMonitor<EnvironmentRowModel> monitor = getRowMonitor();
+ EnvironmentRowModel row = monitor.getBean();
+ if (row != null) {
+ ui.getModel().setParameter(row.getKey(), row.getValue());
+ }
+ }
+ };
+ table.getSelectionModel().addListSelectionListener(listener);
+
+ }
+
+ @Override
+ public void onCloseUI() {
+ }
+
+ @Override
+ protected EnvironmentTabUIModel getModel() {
+ return ui.getModel();
+ }
+
+ /**
+ * Adds a row with the parameter selected in the combo box
+ */
+ public void addRow() {
+ JComboBox keyCombo = ui.getNewRowKey();
+ String key = (String) keyCombo.getSelectedItem();
+ EnvironmentRowModel row = new EnvironmentRowModel(key);
+ getTableModel().addNewRow(getTable().getRowCount(), row);
+ ui.getModel().setParameter(key, null);
+
+ keyCombo.removeItem(key);
+ }
+
+ /**
+ * Resets the table with the data from the database
+ */
+ public void reset() {
+ Map<Object, Object> environmentParameters = ui.getModel().getEnvironmentParameters();
+
+ List<EnvironmentRowModel> rows = Lists.newArrayList();
+ Collection<Object> params = environmentParameters.keySet();
+ for (Object key : environmentParameters.keySet()) {
+ rows.add(new EnvironmentRowModel(key.toString()));
+ }
+
+ AbstractTuttiTableModel<EnvironmentRowModel> tableModel = getTableModel();
+ tableModel.setRows(rows);
+
+ JComboBox keyCombo = ui.getNewRowKey();
+ DefaultComboBoxModel keyComboModel = (DefaultComboBoxModel) keyCombo.getModel();
+ keyComboModel.removeAllElements();
+ for (String param : ui.getModel().getKeys()) {
+ if (!params.contains(param)) {
+ keyComboModel.addElement(param);
+ }
+ }
+ }
+
+}
Copied: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/environment/EnvironmentTabUIModel.java (from rev 90, trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTabUIModel.java)
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/environment/EnvironmentTabUIModel.java (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/environment/EnvironmentTabUIModel.java 2012-12-19 15:39:51 UTC (rev 91)
@@ -0,0 +1,83 @@
+package fr.ifremer.tutti.ui.swing.content.operation.fishing.environment;
+
+/*
+ * #%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 java.util.Map;
+import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
+import fr.ifremer.tutti.ui.swing.content.operation.EditFishingOperationUIModel;
+import fr.ifremer.tutti.ui.swing.util.table.AbstractTuttiTableUIModel;
+import java.util.HashMap;
+import org.nuiton.util.beans.Binder;
+import org.nuiton.util.beans.BinderModelBuilder;
+
+import static org.nuiton.i18n.I18n._;
+
+/**
+ *
+ * @author kmorin
+ */
+public class EnvironmentTabUIModel extends AbstractTuttiTableUIModel<FishingOperation, EnvironmentRowModel, EnvironmentTabUIModel> {
+
+ protected Map<Object, Object> environmentParameters;
+
+ public static final String KEY_BEAUFORT_SCALE = "beaufortScale";
+ public static final String KEY_WIND_DIRECTION = "windDirection";
+ public static final String KEY_SEA_STATE = "seaState";
+
+ protected static final Binder<FishingOperation, EnvironmentTabUIModel> fromBeanBinder = BinderModelBuilder.newEmptyBuilder(FishingOperation.class, EnvironmentTabUIModel.class)
+ .toBinder();
+
+ protected static final Binder<EnvironmentTabUIModel, FishingOperation> toBeanBinder = BinderModelBuilder.newEmptyBuilder(EnvironmentTabUIModel.class, FishingOperation.class)
+ .toBinder();
+
+ public EnvironmentTabUIModel() {
+ super(FishingOperation.class, fromBeanBinder, toBeanBinder);
+ }
+
+ public Map<Object, Object> getEnvironmentParameters() {
+ return environmentParameters;
+ }
+
+ public void setEnvironmentParameters(Map<Object, Object> environmentParameters) {
+ this.environmentParameters = environmentParameters;
+ }
+
+ public void setParameter(Object param, Object value) {
+ Object oldValue = new HashMap<Object, Object>(environmentParameters);
+ environmentParameters.put(param, value);
+ firePropertyChange(EditFishingOperationUIModel.PROPERTY_ENVIRONMENT_PARAMETERS, oldValue, environmentParameters);
+ }
+
+ public String[] getKeys() {
+ return new String[] {
+ _(new String("tutti.table.fishing.environment.keys." + KEY_BEAUFORT_SCALE)),
+ _(new String("tutti.table.fishing.environment.keys." + KEY_WIND_DIRECTION)),
+ _(new String("tutti.table.fishing.environment.keys." + KEY_SEA_STATE)),
+ _(new String("tutti.table.fishing.environment.keys." + "key3")),
+ _(new String("tutti.table.fishing.environment.keys." + "key4")),
+ _(new String("tutti.table.fishing.environment.keys." + "key5"))
+ };
+ }
+}
Copied: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/environment/EnvironmentTableModel.java (from rev 90, trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTableModel.java)
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/environment/EnvironmentTableModel.java (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/environment/EnvironmentTableModel.java 2012-12-19 15:39:51 UTC (rev 91)
@@ -0,0 +1,62 @@
+package fr.ifremer.tutti.ui.swing.content.operation.fishing.environment;
+
+/*
+ * #%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.ui.swing.util.table.AbstractTuttiTableModel;
+import fr.ifremer.tutti.ui.swing.util.table.ColumnIdentifier;
+import javax.swing.table.TableColumnModel;
+
+import static org.nuiton.i18n.I18n.n_;
+
+/**
+ *
+ * @author kmorin
+ * since 0.3
+ */
+public class EnvironmentTableModel extends AbstractTuttiTableModel<EnvironmentRowModel> {
+
+ public static final ColumnIdentifier<EnvironmentRowModel> KEY = ColumnIdentifier.newId(
+ EnvironmentRowModel.PROPERTY_KEY,
+ n_("tutti.table.fishing.environment.header.key"),
+ n_("tutti.table.fishing.environment.header.key"));
+
+ public static final ColumnIdentifier<EnvironmentRowModel> VALUE = ColumnIdentifier.newId(
+ EnvironmentRowModel.PROPERTY_VALUE,
+ n_("tutti.table.fishing.environment.header.value"),
+ n_("tutti.table.fishing.environment.header.value"));
+
+ public EnvironmentTableModel(TableColumnModel columnModel) {
+ super(columnModel);
+
+ setNoneEditableCols(KEY);
+ }
+
+ @Override
+ protected EnvironmentRowModel createNewRow() {
+ EnvironmentRowModel result = new EnvironmentRowModel();
+ return result;
+ }
+
+}
Modified: trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties
===================================================================
--- trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2012-12-19 10:49:03 UTC (rev 90)
+++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2012-12-19 15:39:51 UTC (rev 91)
@@ -165,7 +165,6 @@
tutti.table.benthos.batch.header.weight=Poids
tutti.table.fishing.environment.header.key=Clé
tutti.table.fishing.environment.header.value=Valeur
-tutti.table.fishing.environment.keys.=
tutti.table.fishing.environment.keys.beaufortScale=Force du vent
tutti.table.fishing.environment.keys.key3=Clé 3
tutti.table.fishing.environment.keys.key4=Clé 4
1
0
r90 - in trunk: . tutti-persistence/src/main/resources/META-INF/services tutti-persistence/src/main/xmi tutti-ui-swing tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation
by tchemit@users.forge.codelutin.com 19 Dec '12
by tchemit@users.forge.codelutin.com 19 Dec '12
19 Dec '12
Author: tchemit
Date: 2012-12-19 11:49:03 +0100 (Wed, 19 Dec 2012)
New Revision: 90
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/90
Log:
fix build + model for pmfm + add msaccessimporter lib
Modified:
trunk/pom.xml
trunk/tutti-persistence/src/main/resources/META-INF/services/fr.ifremer.tutti.persistence.entities.IdAware
trunk/tutti-persistence/src/main/xmi/tutti-persistence.zargo
trunk/tutti-ui-swing/pom.xml
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel.java
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2012-12-19 10:16:51 UTC (rev 89)
+++ trunk/pom.xml 2012-12-19 10:49:03 UTC (rev 90)
@@ -98,6 +98,8 @@
<slf4jVersion>1.7.2</slf4jVersion>
<adagioVersion>3.3.1-SNAPSHOT</adagioVersion>
+
+ <msaccessImporterVersion>1.4.1</msaccessImporterVersion>
<i18n.bundles>fr_FR</i18n.bundles>
<i18n.silent>true</i18n.silent>
@@ -247,6 +249,23 @@
<classifier>allegro</classifier>
</dependency>
+ <dependency>
+ <groupId>fr.ird</groupId>
+ <artifactId>msaccess-importer</artifactId>
+ <version>${msaccessImporterVersion}</version>
+ <scope>compile</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>com.healthmarketscience.jackcess</groupId>
+ <artifactId>jackcess</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.nuiton.topia</groupId>
+ <artifactId>topia-persistence</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
<!-- base h2 -->
<dependency>
<groupId>com.h2database</groupId>
Modified: trunk/tutti-persistence/src/main/resources/META-INF/services/fr.ifremer.tutti.persistence.entities.IdAware
===================================================================
--- trunk/tutti-persistence/src/main/resources/META-INF/services/fr.ifremer.tutti.persistence.entities.IdAware 2012-12-19 10:16:51 UTC (rev 89)
+++ trunk/tutti-persistence/src/main/resources/META-INF/services/fr.ifremer.tutti.persistence.entities.IdAware 2012-12-19 10:49:03 UTC (rev 90)
@@ -10,10 +10,12 @@
fr.ifremer.tutti.persistence.entities.data.SpeciesBatchFrequency
fr.ifremer.tutti.persistence.entities.protocol.TuttiProtocol
fr.ifremer.tutti.persistence.entities.referential.BeaufortScale
+fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue
fr.ifremer.tutti.persistence.entities.referential.Country
fr.ifremer.tutti.persistence.entities.referential.FishingOperationLocation
fr.ifremer.tutti.persistence.entities.referential.Gear
fr.ifremer.tutti.persistence.entities.referential.MacroWasteCategory
+fr.ifremer.tutti.persistence.entities.referential.MeasurementCaracteristic
fr.ifremer.tutti.persistence.entities.referential.Person
fr.ifremer.tutti.persistence.entities.referential.SeaState
fr.ifremer.tutti.persistence.entities.referential.Sex
Modified: trunk/tutti-persistence/src/main/xmi/tutti-persistence.zargo
===================================================================
(Binary files differ)
Modified: trunk/tutti-ui-swing/pom.xml
===================================================================
--- trunk/tutti-ui-swing/pom.xml 2012-12-19 10:16:51 UTC (rev 89)
+++ trunk/tutti-ui-swing/pom.xml 2012-12-19 10:49:03 UTC (rev 90)
@@ -198,6 +198,11 @@
</dependency>
<dependency>
+ <groupId>fr.ird</groupId>
+ <artifactId>msaccess-importer</artifactId>
+ </dependency>
+
+ <dependency>
<groupId>org.nuiton</groupId>
<artifactId>nuiton-utils</artifactId>
</dependency>
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.jaxx 2012-12-19 10:16:51 UTC (rev 89)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.jaxx 2012-12-19 10:49:03 UTC (rev 90)
@@ -100,7 +100,8 @@
<JLabel id='stationNumberLabel'/>
</cell>
<cell weightx='0.3'>
- <NumberEditor id='stationNumberField' constructorParams='this'/>
+ <JTextField id='stationNumberField'
+ onKeyReleased='handler.setText(event, "stationNumber")'/>
</cell>
<cell>
<JLabel id='fishingOperationNumberLabel'/>
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel.java 2012-12-19 10:16:51 UTC (rev 89)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel.java 2012-12-19 10:49:03 UTC (rev 90)
@@ -31,6 +31,7 @@
import fr.ifremer.tutti.persistence.entities.referential.SeaState;
import fr.ifremer.tutti.persistence.entities.referential.FishingOperationLocation;
import fr.ifremer.tutti.ui.swing.AbstractTuttiBeanUIModel;
+import fr.ird.type.SexagecimalPosition;
import org.nuiton.util.beans.Binder;
import org.nuiton.util.beans.BinderFactory;
@@ -131,7 +132,7 @@
protected Cruise cruise;
- protected Integer stationNumber;
+ protected String stationNumber;
protected Integer fishingOperationNumber;
@@ -141,6 +142,16 @@
protected FishingOperationLocation subStrata;
+ protected SexagecimalPosition gearShootingStartLatitudeAsSexagecimal;
+
+ protected SexagecimalPosition gearShootingStartLongitudeAsSexagecimal;
+
+ protected SexagecimalPosition gearShootingEndLatitudeAsSexagecimal;
+
+ protected SexagecimalPosition gearShootingEndLongitudeAsSexagecimal;
+
+ protected boolean useSexagecimalFormat;
+
protected Float gearShootingStartLatitude;
protected Float gearShootingStartLongitude;
@@ -242,11 +253,11 @@
this.cruise = cruise;
}
- public Integer getStationNumber() {
+ public String getStationNumber() {
return stationNumber;
}
- public void setStationNumber(Integer stationNumber) {
+ public void setStationNumber(String stationNumber) {
Object oldValue = getStationNumber();
this.stationNumber = stationNumber;
firePropertyChange(PROPERTY_STATION_NUMBER, oldValue, stationNumber);
1
0
19 Dec '12
Author: tchemit
Date: 2012-12-19 11:16:51 +0100 (Wed, 19 Dec 2012)
New Revision: 89
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/89
Log:
use a FishingOperationLocation instead of a Strata entity + refs #1813: [Ecran Trait] Am?\195?\169lioration du formulaire
Added:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel.java
trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-error-validation.xml
Removed:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationTabUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationTabUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationTabUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationTabUIModel.java
trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationTabUIModel-error-validation.xml
Modified:
trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceAdagioImpl.java
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/resources/META-INF/services/fr.ifremer.tutti.persistence.entities.IdAware
trunk/tutti-persistence/src/main/xmi/tutti-persistence.zargo
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/operation/FishingOperationsUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTabUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTabUIHandler.java
trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistence.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistence.java 2012-12-18 19:13:34 UTC (rev 88)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistence.java 2012-12-19 10:16:51 UTC (rev 89)
@@ -43,7 +43,7 @@
import fr.ifremer.tutti.persistence.entities.referential.Sex;
import fr.ifremer.tutti.persistence.entities.referential.SortedUnsortedCategory;
import fr.ifremer.tutti.persistence.entities.referential.Species;
-import fr.ifremer.tutti.persistence.entities.referential.Strata;
+import fr.ifremer.tutti.persistence.entities.referential.FishingOperationLocation;
import fr.ifremer.tutti.persistence.entities.referential.Vessel;
import fr.ifremer.tutti.persistence.entities.referential.WeightCategory;
import fr.ifremer.tutti.persistence.entities.referential.Zone;
@@ -85,7 +85,7 @@
List<SeaState> getAllSeaState();
- List<Strata> getAllStrata();
+ List<FishingOperationLocation> getAllStrata();
List<BeaufortScale> getAllBeaufortScale();
Modified: trunk/tutti-persistence/src/main/resources/META-INF/services/fr.ifremer.tutti.persistence.entities.IdAware
===================================================================
--- trunk/tutti-persistence/src/main/resources/META-INF/services/fr.ifremer.tutti.persistence.entities.IdAware 2012-12-18 19:13:34 UTC (rev 88)
+++ trunk/tutti-persistence/src/main/resources/META-INF/services/fr.ifremer.tutti.persistence.entities.IdAware 2012-12-19 10:16:51 UTC (rev 89)
@@ -11,6 +11,7 @@
fr.ifremer.tutti.persistence.entities.protocol.TuttiProtocol
fr.ifremer.tutti.persistence.entities.referential.BeaufortScale
fr.ifremer.tutti.persistence.entities.referential.Country
+fr.ifremer.tutti.persistence.entities.referential.FishingOperationLocation
fr.ifremer.tutti.persistence.entities.referential.Gear
fr.ifremer.tutti.persistence.entities.referential.MacroWasteCategory
fr.ifremer.tutti.persistence.entities.referential.Person
@@ -18,7 +19,6 @@
fr.ifremer.tutti.persistence.entities.referential.Sex
fr.ifremer.tutti.persistence.entities.referential.SortedUnsortedCategory
fr.ifremer.tutti.persistence.entities.referential.Species
-fr.ifremer.tutti.persistence.entities.referential.Strata
fr.ifremer.tutti.persistence.entities.referential.Vessel
fr.ifremer.tutti.persistence.entities.referential.WeightCategory
fr.ifremer.tutti.persistence.entities.referential.Zone
\ No newline at end of file
Modified: trunk/tutti-persistence/src/main/xmi/tutti-persistence.zargo
===================================================================
(Binary files differ)
Modified: trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceAdagioImpl.java
===================================================================
--- trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceAdagioImpl.java 2012-12-18 19:13:34 UTC (rev 88)
+++ trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceAdagioImpl.java 2012-12-19 10:16:51 UTC (rev 89)
@@ -44,7 +44,7 @@
import fr.ifremer.tutti.persistence.entities.referential.Sex;
import fr.ifremer.tutti.persistence.entities.referential.SortedUnsortedCategory;
import fr.ifremer.tutti.persistence.entities.referential.Species;
-import fr.ifremer.tutti.persistence.entities.referential.Strata;
+import fr.ifremer.tutti.persistence.entities.referential.FishingOperationLocation;
import fr.ifremer.tutti.persistence.entities.referential.Vessel;
import fr.ifremer.tutti.persistence.entities.referential.WeightCategory;
import fr.ifremer.tutti.persistence.entities.referential.Zone;
@@ -116,7 +116,7 @@
}
@Override
- public List<Strata> getAllStrata() {
+ public List<FishingOperationLocation> getAllStrata() {
return null;
}
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-12-18 19:13:34 UTC (rev 88)
+++ trunk/tutti-persistence-dev/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceDevFixtures.java 2012-12-19 10:16:51 UTC (rev 89)
@@ -35,7 +35,7 @@
import fr.ifremer.tutti.persistence.entities.referential.Sex;
import fr.ifremer.tutti.persistence.entities.referential.SortedUnsortedCategory;
import fr.ifremer.tutti.persistence.entities.referential.Species;
-import fr.ifremer.tutti.persistence.entities.referential.Strata;
+import fr.ifremer.tutti.persistence.entities.referential.FishingOperationLocation;
import fr.ifremer.tutti.persistence.entities.referential.Vessel;
import fr.ifremer.tutti.persistence.entities.referential.WeightCategory;
import fr.ifremer.tutti.persistence.entities.referential.Zone;
@@ -315,8 +315,8 @@
return getData(Person.class);
}
- public List<Strata> strata() {
- return getData(Strata.class);
+ public List<FishingOperationLocation> strata() {
+ return getData(FishingOperationLocation.class);
}
public List<SeaState> seaState() {
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-12-18 19:13:34 UTC (rev 88)
+++ trunk/tutti-persistence-dev/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceDevImpl.java 2012-12-19 10:16:51 UTC (rev 89)
@@ -55,7 +55,7 @@
import fr.ifremer.tutti.persistence.entities.referential.Sex;
import fr.ifremer.tutti.persistence.entities.referential.SortedUnsortedCategory;
import fr.ifremer.tutti.persistence.entities.referential.Species;
-import fr.ifremer.tutti.persistence.entities.referential.Strata;
+import fr.ifremer.tutti.persistence.entities.referential.FishingOperationLocation;
import fr.ifremer.tutti.persistence.entities.referential.Vessel;
import fr.ifremer.tutti.persistence.entities.referential.WeightCategory;
import fr.ifremer.tutti.persistence.entities.referential.Zone;
@@ -243,8 +243,8 @@
}
@Override
- public List<Strata> getAllStrata() {
- List<Strata> result = getDataInNewList(Strata.class);
+ public List<FishingOperationLocation> getAllStrata() {
+ List<FishingOperationLocation> result = getDataInNewList(FishingOperationLocation.class);
return result;
}
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/DecoratorService.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/DecoratorService.java 2012-12-18 19:13:34 UTC (rev 88)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/DecoratorService.java 2012-12-19 10:16:51 UTC (rev 89)
@@ -38,7 +38,7 @@
import fr.ifremer.tutti.persistence.entities.referential.Sex;
import fr.ifremer.tutti.persistence.entities.referential.SortedUnsortedCategory;
import fr.ifremer.tutti.persistence.entities.referential.Species;
-import fr.ifremer.tutti.persistence.entities.referential.Strata;
+import fr.ifremer.tutti.persistence.entities.referential.FishingOperationLocation;
import fr.ifremer.tutti.persistence.entities.referential.Vessel;
import fr.ifremer.tutti.persistence.entities.referential.WeightCategory;
import fr.ifremer.tutti.persistence.entities.referential.Zone;
@@ -101,7 +101,7 @@
registerMultiJXPathDecorator(Person.class, "${firstName}$s#${lastName}$s", SEPARATOR, " ");
registerMultiJXPathDecorator(BeaufortScale.class, "${name}$s", SEPARATOR, " - ");
registerMultiJXPathDecorator(SeaState.class, "${name}$s", SEPARATOR, " - ");
- registerMultiJXPathDecorator(Strata.class, "${name}$s", SEPARATOR, " - ");
+ registerMultiJXPathDecorator(FishingOperationLocation.class, "${name}$s", SEPARATOR, " - ");
registerMultiJXPathDecorator(Sex.class, "${name}$s", SEPARATOR, " - ");
registerMultiJXPathDecorator(SortedUnsortedCategory.class, "${name}$s", SEPARATOR, " - ");
registerMultiJXPathDecorator(MacroWasteCategory.class, "${name}$s", SEPARATOR, " - ");
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-12-18 19:13:34 UTC (rev 88)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java 2012-12-19 10:16:51 UTC (rev 89)
@@ -45,7 +45,7 @@
import fr.ifremer.tutti.persistence.entities.referential.Sex;
import fr.ifremer.tutti.persistence.entities.referential.SortedUnsortedCategory;
import fr.ifremer.tutti.persistence.entities.referential.Species;
-import fr.ifremer.tutti.persistence.entities.referential.Strata;
+import fr.ifremer.tutti.persistence.entities.referential.FishingOperationLocation;
import fr.ifremer.tutti.persistence.entities.referential.Vessel;
import fr.ifremer.tutti.persistence.entities.referential.WeightCategory;
import fr.ifremer.tutti.persistence.entities.referential.Zone;
@@ -202,7 +202,7 @@
}
@Override
- public List<Strata> getAllStrata() {
+ public List<FishingOperationLocation> getAllStrata() {
checkDriverExists();
return driver.getAllStrata();
}
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-12-18 19:13:34 UTC (rev 88)
+++ trunk/tutti-service/src/main/resources/i18n/tutti-service_fr_FR.properties 2012-12-19 10:16:51 UTC (rev 89)
@@ -9,7 +9,6 @@
tutti.property.country=Pays
tutti.property.cruise=Campagne
tutti.property.date=Date
-tutti.property.protocol=Protocol de saisie
tutti.property.firstName=Prénom
tutti.property.fishingOperation=Trait
tutti.property.gear=Engin
@@ -18,6 +17,7 @@
tutti.property.macroWasteCategory=Type de macro déchet
tutti.property.name=Nom
tutti.property.program=Série de campagne
+tutti.property.protocol=Protocol de saisie
tutti.property.seaState=État de la mer
tutti.property.sortedUnsortedCategory=Vrac / Hors Vrac
tutti.property.stationNumber=Numéro de station
Copied: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.css (from rev 88, trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationTabUI.css)
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.css (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.css 2012-12-19 10:16:51 UTC (rev 89)
@@ -0,0 +1,528 @@
+/*
+ * #%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};
+}
+
+BeanDoubleList {
+ bean: {model};
+}
+
+JList {
+ selectionMode: {ListSelectionModel.MULTIPLE_INTERVAL_SELECTION};
+ model: {new DefaultListModel()};
+}
+
+NumberEditor {
+ autoPopup: {handler.getConfig().isAutoPopupNumberEditor()};
+ showPopupButton: {handler.getConfig().isShowNumberEditorButton()};
+ bean: {model};
+ showReset: true;
+}
+
+SimpleTimeEditor {
+ bean: {model};
+}
+
+#stationNumberLabel {
+ text: "tutti.label.fishingOperation.stationNumber";
+ labelFor: {stationNumberField};
+}
+
+#stationNumberField {
+ text: {model.getStationNumber()};
+}
+
+#fishingOperationNumberLabel {
+ text: "tutti.label.fishingOperation.fishingOperationNumber";
+ labelFor: {fishingOperationNumberField};
+}
+
+#fishingOperationNumberField {
+ property: "fishingOperationNumber";
+ model: {model.getFishingOperationNumber()};
+ useFloat: false;
+ numberPattern: {INT_6_DIGITS_PATTERN};
+}
+
+#dateLabel {
+ text: "tutti.label.fishingOperation.date";
+ labelFor: {dateField};
+}
+
+#dateField {
+ date: {model.getDate()};
+ formats: {"dd/MM/yyyy"};
+}
+
+#strataLabel {
+ text: "tutti.label.fishingOperation.strata";
+ labelFor: {strataComboBox};
+}
+
+#strataComboBox {
+ property: "strata";
+ selectedItem: {model.getStrata()};
+}
+
+#subStrataLabel {
+ text: "tutti.label.fishingOperation.subStrata";
+ labelFor: {subStrataComboBox};
+}
+
+#subStrataComboBox {
+ property: "subStrata";
+ selectedItem: {model.getSubStrata()};
+}
+
+#localiteLabel {
+ text: "tutti.label.fishingOperation.localite";
+ labelFor: {localiteComboBox};
+}
+
+#localiteComboBox {
+ property: "localite";
+ selectedItem: {model.getLocalite()};
+}
+
+#gearLongitudeLabel {
+ text: "tutti.label.fishingOperation.gearLongitude";
+}
+
+#gearLatitudeLabel {
+ text: "tutti.label.fishingOperation.gearLatitude";
+}
+
+#gearDateLabel {
+ text: "tutti.label.fishingOperation.gearDate";
+}
+
+#gearTimeLabel {
+ text: "tutti.label.fishingOperation.gearTime";
+}
+
+#gearShootingStartLabel {
+ text: "tutti.label.fishingOperation.gearShootingStart";
+}
+
+#gearShootingEndLabel {
+ text: "tutti.label.fishingOperation.gearShootingEnd";
+}
+
+#gearShootingStartLongitudeField {
+ text: {getStringValue(model.getGearShootingStartLongitude())};
+}
+
+#gearShootingStartLatitudeField {
+ text: {getStringValue(model.getGearShootingStartLatitude())};
+}
+
+#gearShootingStartDateField {
+ date: {model.getGearShootingStartDate()};
+ formats: {"dd/MM/yyyy"};
+}
+
+#gearShootingStartTimeField {
+ property: "gearShootingStartDate";
+ date: {model.getGearShootingStartDate()};
+}
+
+#gearShootingEndLongitudeField {
+ text: {getStringValue(model.getGearShootingEndLongitude())};
+}
+
+#gearShootingEndLatitudeField {
+ text: {getStringValue(model.getGearShootingEndLatitude())};
+}
+
+#gearShootingEndDateField {
+ date: {model.getGearShootingEndDate()};
+ formats: {"dd/MM/yyyy"};
+}
+
+#gearShootingEndTimeField {
+ property: "gearShootingEndDate";
+ date: {model.getGearShootingEndDate()};
+}
+
+#fishingOperationValidPanel {
+ floatable: false;
+ borderPainted: false;
+ opaque: false;
+}
+
+#resetValidStateButton {
+ actionIcon: "reset";
+ text: "tutti.action.reset.fishingOperationValidState";
+}
+
+#fishingOperationValidRadio {
+ text: "tutti.label.fishingOperation.fishingOperationValid";
+ selected: {model.getFishingOperationValid() == Boolean.TRUE};
+ buttonGroup: "fishingOperationValid";
+}
+
+#fishingOperationInvalidRadio {
+ text: "tutti.label.fishingOperation.fishingOperationInvalid";
+ selected: {model.getFishingOperationValid() == Boolean.FALSE};
+ buttonGroup: "fishingOperationValid";
+}
+#fishingOperationResetRadio {
+ selected: {model.getFishingOperationValid() == null};
+ buttonGroup: "fishingOperationValid";
+}
+
+#fishingOperationRectiligneCheckBox {
+ text: "tutti.label.fishingOperation.fishingOperationRectiligne";
+ selected: {model.isFishingOperationRectiligne()};
+}
+
+#distanceChaluteeLabel {
+ text: "tutti.label.fishingOperation.distanceChalutee";
+ labelFor: {distanceChaluteeField};
+}
+
+#distanceChaluteeField {
+ property: "distanceChalutee";
+ model: {model.getDistanceChalutee()};
+ useFloat: false;
+ numberPattern: {INT_6_DIGITS_PATTERN};
+ enabled: {!model.isFishingOperationRectiligne()};
+}
+
+#beaufortScaleLabel {
+ text: "tutti.label.fishingOperation.beaufortScale";
+ labelFor: {beaufortScaleComboBox};
+}
+
+#beaufortScaleComboBox {
+ property: "beaufortScale";
+ selectedItem: {model.getBeaufortScale()};
+}
+
+#windDirectionLabel {
+ text: "tutti.label.fishingOperation.windDirection";
+ labelFor: {windDirectionField};
+}
+
+#windDirectionField {
+ property: "windDirection";
+ model: {model.getWindDirection()};
+ useFloat: false;
+ numberPattern: {INT_6_DIGITS_PATTERN};
+}
+
+#seaStateLabel {
+ text: "tutti.label.fishingOperation.seaState";
+ labelFor: {seaStateComboBox};
+}
+
+#seaStateComboBox {
+ property: "seaState";
+ selectedItem: {model.getSeaState()};
+}
+
+#ouvertureHorizontaleLabel {
+ text: "tutti.label.fishingOperation.ouvertureHorizontale";
+ labelFor: {ouvertureHorizontaleField};
+}
+
+#ouvertureHorizontaleVerticaleLabel {
+ text: "tutti.label.fishingOperation.ouvertureHorizontaleVerticale";
+}
+
+#ouvertureHorizontaleField {
+ property: "ouvertureHorizontale";
+ model: {model.getOuvertureHorizontale()};
+ useFloat: false;
+ numberPattern: {INT_6_DIGITS_PATTERN};
+}
+
+#ouvertureVerticaleLabel {
+ text: "tutti.label.fishingOperation.ouvertureVerticale";
+ labelFor: {ouvertureVerticaleField};
+}
+
+#ouvertureVerticaleField {
+ property: "ouvertureVerticale";
+ model: {model.getOuvertureVerticale()};
+ useFloat: false;
+ numberPattern: {INT_6_DIGITS_PATTERN};
+}
+
+#geometrieMesureeCheckBox {
+ text: "tutti.label.fishingOperation.geometrieMesuree";
+ selected: {model.isGeometrieMesuree()};
+}
+
+#longueurFunesLabel {
+ text: "tutti.label.fishingOperation.longueurFunes";
+ labelFor: {longueurFunesField};
+}
+
+#longueurFunesBrasLabel {
+ text: "tutti.label.fishingOperation.longueurFunesBras";
+}
+
+#longueurFunesField {
+ property: "longueurFunes";
+ model: {model.getLongueurFunes()};
+ useFloat: false;
+ numberPattern: {INT_6_DIGITS_PATTERN};
+}
+
+#longueurBrasLabel {
+ text: "tutti.label.fishingOperation.longueurBras";
+ labelFor: {longueurBrasField};
+}
+
+#longueurBrasField {
+ property: "longueurBras";
+ model: {model.getLongueurBras()};
+ useFloat: false;
+ numberPattern: {INT_6_DIGITS_PATTERN};
+}
+
+#systemeFermetureCulCheckBox {
+ text: "tutti.label.fishingOperation.systemeFermetureCul";
+ selected: {model.isSystemeFermetureCul()};
+}
+
+#dureeLabel {
+ text: "tutti.label.fishingOperation.duree";
+ labelFor: {dureeField};
+}
+
+#dureeField {
+ text: {getStringValue(model.getDuree())};
+ enabled: false;
+}
+
+#saisisseurList {
+ beanType: {Person.class};
+ property: "saisisseur";
+ border: {BorderFactory.createTitledBorder(_("tutti.label.list.saisisseur"))};
+}
+
+#commentPane {
+ columnHeaderView: {new JLabel(_("tutti.label.comment"))};
+ minimumSize: {new Dimension(10,50)};
+}
+
+#commentField {
+ text: {model.getComment()};
+}
+
+#gearShootingStartDepthLabel {
+ text: "tutti.label.fishingOperation.gearShootingStartDepth";
+ labelFor: {gearShootingStartDepthField};
+}
+
+#gearShootingStartDepthField {
+ property: "gearShootingStartDepth";
+ model: {model.getGearShootingStartDepth()};
+ useFloat: false;
+ numberPattern: {INT_6_DIGITS_PATTERN};
+}
+
+#gearShootingEndDepthLabel {
+ text: "tutti.label.fishingOperation.gearShootingEndDepth";
+ labelFor: {gearShootingEndDepthField};
+}
+
+#gearShootingEndDepthField {
+ property: "gearShootingEndDepth";
+ model: {model.getGearShootingEndDepth()};
+ useFloat: false;
+ numberPattern: {INT_6_DIGITS_PATTERN};
+}
+
+#gearShootingStartSurfaceTemperatureLabel {
+ text: "tutti.label.fishingOperation.gearShootingStartSurfaceTemperature";
+ labelFor: {gearShootingStartSurfaceTemperatureField};
+}
+
+#gearShootingStartSurfaceTemperatureField {
+ property: "gearShootingStartSurfaceTemperature";
+ model: {model.getGearShootingStartSurfaceTemperature()};
+ useFloat: false;
+ numberPattern: {INT_6_DIGITS_PATTERN};
+}
+
+#gearShootingEndSurfaceTemperatureLabel {
+ text: "tutti.label.fishingOperation.gearShootingEndSurfaceTemperature";
+ labelFor: {gearShootingEndSurfaceTemperatureField};
+}
+
+#gearShootingEndSurfaceTemperatureField {
+ property: "gearShootingEndSurfaceTemperature";
+ model: {model.getGearShootingEndSurfaceTemperature()};
+ useFloat: false;
+ numberPattern: {INT_6_DIGITS_PATTERN};
+}
+
+#gearShootingStartBottomTemperatureLabel {
+ text: "tutti.label.fishingOperation.gearShootingStartBottomTemperature";
+ labelFor: {gearShootingStartBottomTemperatureField};
+}
+
+#gearShootingStartBottomTemperatureField {
+ property: "gearShootingStartBottomTemperature";
+ model: {model.getGearShootingStartBottomTemperature()};
+ useFloat: false;
+ numberPattern: {INT_6_DIGITS_PATTERN};
+}
+
+#gearShootingEndBottomTemperatureLabel {
+ text: "tutti.label.fishingOperation.gearShootingEndBottomTemperature";
+ labelFor: {gearShootingEndBottomTemperatureField};
+}
+
+#gearShootingEndBottomTemperatureField {
+ property: "gearShootingEndBottomTemperature";
+ model: {model.getGearShootingEndBottomTemperature()};
+ useFloat: false;
+ numberPattern: {INT_6_DIGITS_PATTERN};
+}
+
+#averageBottomTemperatureLabel {
+ text: "tutti.label.fishingOperation.averageBottomTemperature";
+ labelFor: {averageBottomTemperatureField};
+}
+
+#averageBottomTemperatureField {
+ property: "averageBottomTemperature";
+ model: {model.getAverageBottomTemperature()};
+ useFloat: false;
+ numberPattern: {INT_6_DIGITS_PATTERN};
+}
+
+#gearShootingStartSurfaceSalinityLabel {
+ text: "tutti.label.fishingOperation.gearShootingStartSurfaceSalinity";
+ labelFor: {gearShootingStartSurfaceSalinityField};
+}
+
+#gearShootingStartSurfaceSalinityField {
+ property: "gearShootingStartSurfaceSalinity";
+ model: {model.getGearShootingStartSurfaceSalinity()};
+ useFloat: false;
+ numberPattern: {INT_6_DIGITS_PATTERN};
+}
+
+#gearShootingEndSurfaceSalinityLabel {
+ text: "tutti.label.fishingOperation.gearShootingEndSurfaceSalinity";
+ labelFor: {gearShootingEndSurfaceSalinityField};
+}
+
+#gearShootingEndSurfaceSalinityField {
+ property: "gearShootingEndSurfaceSalinity";
+ model: {model.getGearShootingEndSurfaceSalinity()};
+ useFloat: false;
+ numberPattern: {INT_6_DIGITS_PATTERN};
+}
+
+#gearShootingStartBottomSalinityLabel {
+ text: "tutti.label.fishingOperation.gearShootingStartBottomSalinity";
+ labelFor: {gearShootingStartBottomSalinityField};
+}
+
+#gearShootingStartBottomSalinityField {
+ property: "gearShootingStartBottomSalinity";
+ model: {model.getGearShootingStartBottomSalinity()};
+ useFloat: false;
+ numberPattern: {INT_6_DIGITS_PATTERN};
+}
+
+#gearShootingEndBottomSalinityLabel {
+ text: "tutti.label.fishingOperation.gearShootingEndBottomSalinity";
+ labelFor: {gearShootingEndBottomSalinityField};
+}
+
+#gearShootingEndBottomSalinityField {
+ property: "gearShootingEndBottomSalinity";
+ model: {model.getGearShootingEndBottomSalinity()};
+ useFloat: false;
+ numberPattern: {INT_6_DIGITS_PATTERN};
+}
+
+#averageBottomSalinityLabel {
+ text: "tutti.label.fishingOperation.averageBottomSalinity";
+ labelFor: {averageBottomSalinityField};
+}
+
+#averageBottomSalinityField {
+ property: "averageBottomSalinity";
+ model: {model.getAverageBottomSalinity()};
+ useFloat: false;
+ numberPattern: {INT_6_DIGITS_PATTERN};
+}
+
+#noTraitPane {
+ text: "tutti.label.no.fishingOperation.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()};
+}
+
+#importPupitriButton {
+ actionIcon: "pupitri-import";
+ text: "tutti.action.pupitri-import";
+}
+
+#importCasinoButton {
+ actionIcon: "casino-import";
+ text: "tutti.action.casino-import";
+}
+
+#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/operation/EditFishingOperationUI.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/operation/EditFishingOperationUI.jaxx (from rev 88, trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationTabUI.jaxx)
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.jaxx (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.jaxx 2012-12-19 10:16:51 UTC (rev 89)
@@ -0,0 +1,558 @@
+<!--
+ #%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<EditFishingOperationUIModel, EditFishingOperationUIHandler>'>
+
+ <import>
+ fr.ifremer.tutti.persistence.entities.referential.BeaufortScale
+ fr.ifremer.tutti.persistence.entities.referential.SeaState
+ fr.ifremer.tutti.persistence.entities.referential.FishingOperationLocation
+ fr.ifremer.tutti.persistence.entities.data.FishingOperation
+ fr.ifremer.tutti.persistence.entities.referential.Person
+
+ fr.ifremer.tutti.ui.swing.util.editor.SimpleTimeEditor
+ fr.ifremer.tutti.ui.swing.content.operation.fishing.EnvironmentTabUI
+
+ jaxx.runtime.swing.editor.bean.BeanComboBox
+ jaxx.runtime.swing.editor.bean.BeanListHeader
+ jaxx.runtime.swing.editor.bean.BeanDoubleList
+ jaxx.runtime.swing.editor.NumberEditor
+ jaxx.runtime.swing.editor.TimeEditor
+
+ jaxx.runtime.validator.swing.SwingValidatorUtil
+ jaxx.runtime.validator.swing.SwingValidatorMessageTableModel
+
+ org.jdesktop.swingx.JXDatePicker
+ org.jdesktop.swingx.JXTable
+
+ java.awt.Dimension
+
+ javax.swing.DefaultListModel
+ javax.swing.ListSelectionModel
+
+ static org.nuiton.i18n.I18n._
+ static jaxx.runtime.SwingUtil.getStringValue
+ </import>
+
+ <script><![CDATA[
+
+public EditFishingOperationUI(FishingOperationsUI parentUI) {
+ EditFishingOperationUIHandler handler = new EditFishingOperationUIHandler(parentUI, this);
+ setContextValue(handler);
+ handler.beforeInitUI();
+}
+
+public void selectFishingOperation(FishingOperation fishingOperation) { handler.selectFishingOperation(fishingOperation); }
+
+protected void $afterCompleteSetup() { handler.afterInitUI(); }
+ ]]></script>
+
+ <EditFishingOperationUIHandler id='handler'
+ initializer='getContextValue(EditFishingOperationUIHandler.class)'/>
+
+ <EditFishingOperationUIModel id='model'
+ initializer='getContextValue(EditFishingOperationUIModel.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='fishingOperationNumber'
+ component='fishingOperationNumberField'/>
+ <field name='date' component='dateField'/>
+ <field name='comment' component='commentField'/>
+ <field name='saisisseur' component='saisisseurList'/>
+ </BeanValidator>
+
+ <JPanel id='fishingOperationPane' constraints='BorderLayout.CENTER'
+ layout='{new BorderLayout()}'>
+
+ <JTabbedPane id='fishingOperationTabPane' constraints='BorderLayout.CENTER'>
+ <tab id='traitGeneralTab'
+ title='tutti.label.tab.fishingOperation.general'>
+ <Table fill='both' id='generalForm'>
+
+ <!-- Numero station / Numéro trait / Date -->
+ <row>
+ <cell anchor='west'>
+ <JLabel id='stationNumberLabel'/>
+ </cell>
+ <cell weightx='0.3'>
+ <NumberEditor id='stationNumberField' constructorParams='this'/>
+ </cell>
+ <cell>
+ <JLabel id='fishingOperationNumberLabel'/>
+ </cell>
+ <cell weightx='0.3'>
+ <NumberEditor id='fishingOperationNumberField'
+ constructorParams='this'/>
+ </cell>
+ <cell>
+ <JLabel id='dateLabel'/>
+ </cell>
+ <cell weightx='0.3'>
+ <JXDatePicker id='dateField'
+ onActionPerformed='handler.setDate(event, "date")'/>
+ </cell>
+ </row>
+
+ <!-- Strate d'association / Sous Strate / Localité -->
+ <row>
+ <cell>
+ <JLabel id='strataLabel'/>
+ </cell>
+ <cell weightx='0.3'>
+ <BeanComboBox id='strataComboBox' constructorParams='this'
+ genericType='FishingOperationLocation'/>
+ </cell>
+ <cell>
+ <JLabel id='subStrataLabel'/>
+ </cell>
+ <cell weightx='0.3'>
+ <BeanComboBox id='subStrataComboBox' constructorParams='this'
+ genericType='FishingOperationLocation'/>
+ </cell>
+ <cell>
+ <JLabel id='localiteLabel'/>
+ </cell>
+ <cell weightx='0.3'>
+ <BeanComboBox id='localiteComboBox' constructorParams='this'
+ genericType='FishingOperationLocation'/>
+ </cell>
+ </row>
+
+ <!-- début de traine long-lat-date-heure
+ fin de traine long-lat-date-heure -->
+ <row>
+ <cell columns='6'>
+ <JPanel layout="{new BorderLayout()}">
+ <Table id="gearCaracteristicsTable" fill="both" weightx='1'
+ constraints='BorderLayout.CENTER'>
+ <row>
+ <cell>
+ <JLabel/>
+ </cell>
+ <cell>
+ <JLabel id='gearLatitudeLabel'/>
+ </cell>
+ <cell>
+ <JLabel id='gearLongitudeLabel'/>
+ </cell>
+ <cell>
+ <JLabel id='gearDateLabel'/>
+ </cell>
+ <cell>
+ <JLabel id='gearTimeLabel'/>
+ </cell>
+ </row>
+
+ <row>
+ <cell>
+ <JLabel id='gearShootingStartLabel'/>
+ </cell>
+ <cell>
+ <JTextField id='gearShootingStartLatitudeLabel'
+ onKeyReleased='handler.setGearShootingStartLatitude(((JTextField)event.getSource()).getText())'/>
+ </cell>
+ <cell>
+ <JTextField id='gearShootingStartLongitudeField'
+ onKeyReleased='handler.setGearShootingStartLongitude(((JTextField)event.getSource()).getText())'/>
+ </cell>
+ <cell>
+ <JXDatePicker id='gearShootingStartDateField'
+ onActionPerformed='handler.setDate(event, "gearShootingStartDate")'/>
+ </cell>
+ <cell>
+ <SimpleTimeEditor id='gearShootingStartTimeField'
+ constructorParams='this'/>
+ </cell>
+ </row>
+ <row>
+ <cell>
+ <JLabel id='gearShootingEndLabel'/>
+ </cell>
+ <cell>
+ <JTextField id='gearShootingEndLatitudeLabel'
+ onKeyReleased='handler.setGearShootingEndLatitude(((JTextField)event.getSource()).getText())'/>
+ </cell>
+ <cell>
+ <JTextField id='gearShootingEndLongitudeField'
+ onKeyReleased='handler.setGearShootingEndLongitude(((JTextField)event.getSource()).getText())'/>
+ </cell>
+ <cell>
+ <JXDatePicker id='gearShootingEndDateField'
+ onActionPerformed='handler.setDate(event, "gearShootingEndDate")'/>
+ </cell>
+ <cell>
+ <SimpleTimeEditor id='gearShootingEndTimeField'
+ constructorParams='this'/>
+ </cell>
+ </row>
+ </Table>
+ </JPanel>
+ </cell>
+ </row>
+
+ <!-- Fishing operation valid / invalid-->
+ <row>
+ <cell>
+ <JToolBar id='fishingOperationValidPanel'
+ layout='{new BorderLayout()}'>
+ <JButton id='resetValidStateButton'
+ constraints='BorderLayout.WEST'
+ onActionPerformed="model.setFishingOperationValid(null)"/>
+ <JRadioButton id='fishingOperationResetRadio'
+ constraints='BorderLayout.EAST'/>
+ </JToolBar>
+ </cell>
+ <cell>
+ <HBox>
+ <JRadioButton id='fishingOperationValidRadio'
+ onActionPerformed='model.setFishingOperationValid(Boolean.TRUE)'/>
+ <JRadioButton id='fishingOperationInvalidRadio'
+ onActionPerformed='model.setFishingOperationValid(Boolean.FALSE)'/>
+ </HBox>
+ </cell>
+ <cell columns="4">
+ <JPanel/>
+ </cell>
+ </row>
+
+ <!-- FishingOperation rectiligne / distance chalutee / durée -->
+ <row>
+ <cell>
+ <JCheckBox id='fishingOperationRectiligneCheckBox'
+ onItemStateChanged='handler.setBoolean(event, "fishingOperationRectiligne")'/>
+ </cell>
+ <cell columns="3">
+ <JPanel layout="{new BorderLayout()}">
+ <JLabel id='distanceChaluteeLabel'
+ constraints='BorderLayout.WEST'/>
+ <NumberEditor id='distanceChaluteeField'
+ constraints='BorderLayout.CENTER'
+ constructorParams='this'/>
+ </JPanel>
+ </cell>
+ <cell anchor='west'>
+ <JLabel id='dureeLabel'/>
+ </cell>
+ <cell fill='horizontal'>
+ <JTextField id='dureeField'/>
+ </cell>
+ </row>
+
+ <!-- Actions d'import -->
+ <row>
+ <cell columns='6'>
+ <JPanel layout='{new GridLayout(1,0)}'>
+ <JButton id='importPupitriButton'
+ onActionPerformed='handler.importPupitri()'/>
+ <JButton id='importCasinoButton'
+ onActionPerformed='handler.importCasino()'/>
+ </JPanel>
+ </cell>
+ </row>
+
+ <!-- Saisisseur -->
+ <row weighty='0.3'>
+ <cell columns='6'>
+ <!-- <JScrollPane id='saisisseurPane'
+ columnHeaderView="{saisisseurHeader}"
+ onFocusGained='saisisseurList.requestFocus()'>
+ <JList id='saisisseurList'
+ onValueChanged='handler.selectListData(event, "saisisseur")'/>
+ <BeanListHeader id='saisisseurHeader' genericType='Person'/>
+ </JScrollPane>-->
+ <BeanDoubleList id='saisisseurList' genericType='Person'/>
+ </cell>
+ </row>
+
+ <!-- Commentaire -->
+ <row weighty='0.3'>
+ <cell columns='6'>
+ <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.fishingOperation.gearShooting'>
+
+ <Table fill='both' id='gearShootingForm'>
+
+ <!-- GearShootingStart Depth -->
+ <row>
+ <cell>
+ <JLabel id='gearShootingStartDepthLabel'/>
+ </cell>
+ <cell weightx='1.0'>
+ <NumberEditor id='gearShootingStartDepthField'
+ constructorParams='this'/>
+ </cell>
+ </row>
+
+ <!-- GearShootingEnd Depth -->
+ <row>
+ <cell>
+ <JLabel id='gearShootingEndDepthLabel'/>
+ </cell>
+ <cell weightx='1.0'>
+ <NumberEditor id='gearShootingEndDepthField'
+ constructorParams='this'/>
+ </cell>
+ </row>
+
+ <!-- Ouverture horizontale -->
+ <row>
+ <cell anchor='west'>
+ <JLabel id='ouvertureHorizontaleLabel'/>
+ </cell>
+ <cell fill='horizontal'>
+ <NumberEditor id='ouvertureHorizontaleField'
+ constructorParams='this'/>
+ </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='longueurFunesLabel'/>
+ </cell>
+ <cell fill='horizontal'>
+ <NumberEditor id='longueurFunesField' constructorParams='this'/>
+ </cell>
+ </row>
+
+ <!-- Longueur bras -->
+ <row>
+ <cell anchor='west'>
+ <JLabel id='longueurBrasLabel'/>
+ </cell>
+ <cell fill='horizontal'>
+ <NumberEditor id='longueurBrasField' constructorParams='this'/>
+ </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>
+ </Table>
+ </tab>
+
+ <tab id='environmentTab'
+ title='tutti.label.tab.fishingOperation.environment'>
+
+ <EnvironmentTabUI id='environmentTabContent' constructorParams='this'/>
+<!-- <Table fill='both' id='environmentForm'>
+
+ Beaufort scale
+ <row>
+ <cell anchor='west'>
+ <JLabel id='beaufortScaleLabel'/>
+ </cell>
+ <cell weightx='1.0'>
+ <BeanComboBox id='beaufortScaleComboBox' constructorParams='this'
+ genericType='BeaufortScale'/>
+ </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='SeaState'/>
+ </cell>
+ </row>
+ </Table>-->
+ </tab>
+
+ <tab id='traitHydrologyTabContent'
+ title='tutti.label.tab.fishingOperation.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 BorderLayout()}' constraints='BorderLayout.SOUTH'>
+ <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'/>
+</JPanel>
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.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/operation/EditFishingOperationUIHandler.java (from rev 88, trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationTabUIHandler.java)
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java 2012-12-19 10:16:51 UTC (rev 89)
@@ -0,0 +1,227 @@
+package fr.ifremer.tutti.ui.swing.content.operation;
+
+/*
+ * #%L
+ * Tutti :: UI
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
+import fr.ifremer.tutti.persistence.entities.referential.Person;
+import fr.ifremer.tutti.service.PersistenceService;
+import fr.ifremer.tutti.ui.swing.AbstractTuttiUIHandler;
+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.JPanel;
+import java.awt.BorderLayout;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.util.List;
+
+/**
+ * Handler for UI {@link EditFishingOperationUI}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.1
+ */
+public class EditFishingOperationUIHandler extends AbstractTuttiUIHandler<EditFishingOperationUIModel> {
+
+ /** Logger. */
+ private static final Log log =
+ LogFactory.getLog(EditFishingOperationUIHandler.class);
+
+ private final EditFishingOperationUI ui;
+
+ private final FishingOperationsUI parentUi;
+
+ private final PersistenceService persistenceService;
+
+ public EditFishingOperationUIHandler(FishingOperationsUI parentUi, EditFishingOperationUI ui) {
+ super(parentUi.getHandler().getContext());
+ this.ui = ui;
+ this.parentUi = parentUi;
+ this.persistenceService = context.getService(PersistenceService.class);
+ }
+
+ @Override
+ public void beforeInitUI() {
+
+ EditFishingOperationUIModel model = new EditFishingOperationUIModel();
+ model.addPropertyChangeListener(EditFishingOperationUIModel.PROPERTY_EMPTY, new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ JPanel form = ui.getFishingOperationPane();
+ 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() {
+
+ ui.getFishingOperationValidPanel().remove(
+ ui.getFishingOperationResetRadio());
+
+ EditFishingOperationUIModel model = ui.getModel();
+
+ initUI(ui);
+
+ initBeanList(ui.getSaisisseurList(),
+ persistenceService.getAllPerson(),
+ model.getSaisisseur());
+
+// initBeanComboBox(ui.getBeaufortScaleComboBox(),
+// persistenceService.getAllBeaufortScale(),
+// model.getBeaufortScale());
+//
+// initBeanComboBox(ui.getStrataComboBox(),
+// persistenceService.getAllStrata(),
+// model.getStrata());
+//
+// initBeanComboBox(ui.getSeaStateComboBox(),
+// persistenceService.getAllSeaState(),
+// model.getSeaState());
+
+ model.setEmpty(true);
+
+ listenValidatorValid(ui.getValidator(), getModel());
+ }
+
+ @Override
+ public void onCloseUI() {
+ }
+
+ @Override
+ protected EditFishingOperationUIModel getModel() {
+ return ui.getModel();
+ }
+
+ public void selectFishingOperation(FishingOperation bean) {
+
+ boolean empty = bean == null;
+
+ EditFishingOperationUIModel model = getModel();
+
+ if (empty) {
+
+ model.fromBean(new FishingOperation());
+ } else {
+
+ model.fromBean(bean);
+ }
+
+ // update saisissuer selection
+ List<Person> saisisseur = model.getSaisisseur();
+ ui.getSaisisseurList().getModel().setSelected(saisisseur);
+
+ // update model empty property
+ model.setEmpty(empty);
+
+ // if new fishingOperation can already cancel his creation
+ model.setModify(!empty && model.isCreate());
+
+ ui.getEnvironmentTabContent().getHandler().afterInitUI();
+ }
+
+ public void cancel() {
+
+ String id = getModel().getId();
+
+ if (log.isInfoEnabled()) {
+ log.info("Cancel edition for fishingOperation: " + id);
+ }
+ boolean newBean = StringUtils.isBlank(id);
+
+ if (newBean) {
+
+ // cancel to create a new fishingOperation
+ parentUi.getHandler().selectFishingOperation(null);
+
+ } else {
+
+ // reselect in ui the fishingOperation
+ FishingOperation selectedFishingOperation = parentUi.getModel().getSelectedFishingOperation();
+ parentUi.getHandler().selectFishingOperation(selectedFishingOperation);
+ }
+ }
+
+ public void save() {
+
+ // get fishingOperation to save
+ FishingOperation toSave = getModel().toBean();
+
+ if (log.isInfoEnabled()) {
+ log.info("Save edition for fishingOperation: " + toSave.getId());
+ }
+
+ // keep selected tab (to resotre it after save)
+ int selectedIndex = ui.getFishingOperationTabPane().getSelectedIndex();
+
+ // persist current fishingOperation
+ parentUi.getHandler().saveFishingOperation(toSave);
+
+ // reselect current tab
+ ui.getFishingOperationTabPane().setSelectedIndex(selectedIndex);
+
+ getModel().setModify(false);
+ }
+
+ public void importPupitri() {
+ //TODO
+ }
+
+ public void importCasino() {
+ //TODO
+ }
+
+ public void setGearShootingStartLatitude(String text) {
+ getModel().setGearShootingStartLatitude(Float.valueOf(text));
+ }
+
+ public void setGearShootingStartLongitude(String text) {
+ getModel().setGearShootingStartLongitude(Float.valueOf(text));
+ }
+
+ public void setGearShootingEndLatitude(String text) {
+ getModel().setGearShootingEndLatitude(Float.valueOf(text));
+ }
+
+ public void setGearShootingEndLongitude(String text) {
+ getModel().setGearShootingEndLongitude(Float.valueOf(text));
+ }
+}
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.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/operation/EditFishingOperationUIModel.java (from rev 88, trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationTabUIModel.java)
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel.java (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel.java 2012-12-19 10:16:51 UTC (rev 89)
@@ -0,0 +1,633 @@
+package fr.ifremer.tutti.ui.swing.content.operation;
+
+/*
+ * #%L
+ * Tutti :: UI
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
+import fr.ifremer.tutti.persistence.entities.data.Cruise;
+import fr.ifremer.tutti.persistence.entities.referential.BeaufortScale;
+import fr.ifremer.tutti.persistence.entities.referential.Person;
+import fr.ifremer.tutti.persistence.entities.referential.SeaState;
+import fr.ifremer.tutti.persistence.entities.referential.FishingOperationLocation;
+import fr.ifremer.tutti.ui.swing.AbstractTuttiBeanUIModel;
+import org.nuiton.util.beans.Binder;
+import org.nuiton.util.beans.BinderFactory;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * Model for UI {@link EditFishingOperationUI}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.1
+ */
+public class EditFishingOperationUIModel extends AbstractTuttiBeanUIModel<FishingOperation, EditFishingOperationUIModel> {
+
+ 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_FISHING_OPERATION_NUMBER = "fishingOperationNumber";
+
+ public static final String PROPERTY_DATE = "date";
+
+ public static final String PROPERTY_STRATA = "strata";
+
+ public static final String PROPERTY_SUB_STRATA = "subStrata";
+
+ 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_DATE = "gearShootingStartDate";
+
+ 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_DATE = "gearShootingEndDate";
+
+ 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_FISHING_OPERATION_RECTILIGNE = "fishingOperationRectiligne";
+
+ public static final String PROPERTY_DISTANCE_CHALUTEE = "distanceChalutee";
+
+ public static final String PROPERTY_DUREE = "duree";
+
+ public static final String PROPERTY_FISHING_OPERATION_VALID = "fishingOperationValid";
+
+ 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 Cruise cruise;
+
+ protected Integer stationNumber;
+
+ protected Integer fishingOperationNumber;
+
+ protected Date date;
+
+ protected FishingOperationLocation strata;
+
+ protected FishingOperationLocation subStrata;
+
+ protected Float gearShootingStartLatitude;
+
+ protected Float gearShootingStartLongitude;
+
+ protected Date gearShootingStartDate;
+
+ protected Integer gearShootingStartTime;
+
+ protected Float gearShootingStartDepth;
+
+ protected Float gearShootingEndLatitude;
+
+ protected Float gearShootingEndLongitude;
+
+ protected Date gearShootingEndDate;
+
+ protected Integer gearShootingEndTime;
+
+ protected Float gearShootingEndDepth;
+
+ protected BeaufortScale beaufortScale;
+
+ protected Integer windDirection;
+
+ protected SeaState seaState;
+
+ protected Float ouvertureHorizontale;
+
+ protected Float ouvertureVerticale;
+
+ protected boolean geometrieMesuree;
+
+ protected Float longueurFunes;
+
+ protected Float longueurBras;
+
+ protected boolean systemeFermetureCul;
+
+ protected boolean fishingOperationRectiligne;
+
+ protected Float distanceChalutee;
+
+ protected Float duree;
+
+ protected Boolean fishingOperationValid;
+
+ protected FishingOperationLocation localite;
+
+ protected String comment;
+
+ protected List<Person> 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;
+
+ protected static Binder<EditFishingOperationUIModel, FishingOperation> toBeanBinder =
+ BinderFactory.newBinder(EditFishingOperationUIModel.class,
+ FishingOperation.class);
+
+ protected static Binder<FishingOperation, EditFishingOperationUIModel> fromBeanBinder =
+ BinderFactory.newBinder(FishingOperation.class, EditFishingOperationUIModel.class);
+
+ public EditFishingOperationUIModel() {
+ super(FishingOperation.class, fromBeanBinder, toBeanBinder);
+ }
+
+ public boolean isEmpty() {
+ return empty;
+ }
+
+ public void setEmpty(boolean empty) {
+ Object oldValue = isEmpty();
+ this.empty = empty;
+ firePropertyChange(PROPERTY_EMPTY, oldValue, empty);
+ }
+
+ public Cruise getCruise() {
+ return cruise;
+ }
+
+ public void setCruise(Cruise cruise) {
+ this.cruise = cruise;
+ }
+
+ public Integer getStationNumber() {
+ return stationNumber;
+ }
+
+ public void setStationNumber(Integer stationNumber) {
+ Object oldValue = getStationNumber();
+ this.stationNumber = stationNumber;
+ firePropertyChange(PROPERTY_STATION_NUMBER, oldValue, stationNumber);
+ }
+
+ public Integer getFishingOperationNumber() {
+ return fishingOperationNumber;
+ }
+
+ public void setFishingOperationNumber(Integer fishingOperationNumber) {
+ Object oldValue = getFishingOperationNumber();
+ this.fishingOperationNumber = fishingOperationNumber;
+ firePropertyChange(PROPERTY_FISHING_OPERATION_NUMBER, oldValue, fishingOperationNumber);
+ }
+
+ public Date getDate() {
+ return date;
+ }
+
+ public void setDate(Date date) {
+ Object oldValue = getDate();
+ this.date = date;
+ firePropertyChange(PROPERTY_DATE, oldValue, date);
+ }
+
+ public FishingOperationLocation getStrata() {
+ return strata;
+ }
+
+ public void setStrata(FishingOperationLocation strata) {
+ Object oldValue = getStrata();
+ this.strata = strata;
+ firePropertyChange(PROPERTY_STRATA, oldValue, strata);
+ }
+
+ public FishingOperationLocation getSubStrata() {
+ return subStrata;
+ }
+
+ public void setSubStrata(FishingOperationLocation subStrata) {
+ Object oldValue = getSubStrata();
+ this.subStrata = subStrata;
+ firePropertyChange(PROPERTY_SUB_STRATA, oldValue, subStrata);
+ }
+
+ 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 getGearShootingStartDate() {
+ return gearShootingStartDate;
+ }
+
+ public void setGearShootingStartDate(Date gearShootingStartDate) {
+ Object oldValue = getGearShootingStartDate();
+ this.gearShootingStartDate = gearShootingStartDate;
+ firePropertyChange(PROPERTY_GEAR_SHOOTING_START_DATE, oldValue, gearShootingStartDate);
+ }
+
+ 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 getGearShootingEndDate() {
+ return gearShootingEndDate;
+ }
+
+ public void setGearShootingEndDate(Date gearShootingEndDate) {
+ Object oldValue = getGearShootingEndDate();
+ this.gearShootingEndDate = gearShootingEndDate;
+ firePropertyChange(PROPERTY_GEAR_SHOOTING_END_DATE, oldValue, gearShootingEndDate);
+ }
+
+ 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 BeaufortScale getBeaufortScale() {
+ return beaufortScale;
+ }
+
+ public void setBeaufortScale(BeaufortScale 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 SeaState getSeaState() {
+ return seaState;
+ }
+
+ public void setSeaState(SeaState 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 isFishingOperationRectiligne() {
+ return fishingOperationRectiligne;
+ }
+
+ public void setFishingOperationRectiligne(boolean fishingOperationRectiligne) {
+ Object oldValue = isFishingOperationRectiligne();
+ this.fishingOperationRectiligne = fishingOperationRectiligne;
+ firePropertyChange(PROPERTY_FISHING_OPERATION_RECTILIGNE, oldValue, fishingOperationRectiligne);
+ }
+
+ 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 getFishingOperationValid() {
+ return fishingOperationValid;
+ }
+
+ public void setFishingOperationValid(Boolean fishingOperationValid) {
+ Object oldValue = getFishingOperationValid();
+ this.fishingOperationValid = fishingOperationValid;
+ firePropertyChange(PROPERTY_FISHING_OPERATION_VALID, oldValue, fishingOperationValid);
+ }
+
+ public FishingOperationLocation getLocalite() {
+ return localite;
+ }
+
+ public void setLocalite(FishingOperationLocation 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<Person> getSaisisseur() {
+ return saisisseur;
+ }
+
+ public void setSaisisseur(List<Person> 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);
+ }
+}
\ No newline at end of file
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationTabUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationTabUI.css 2012-12-18 19:13:34 UTC (rev 88)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationTabUI.css 2012-12-19 10:16:51 UTC (rev 89)
@@ -1,532 +0,0 @@
-/*
- * #%L
- * Tutti :: UI
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2012 Ifremer
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-JToolBar {
- floatable: false;
-}
-
-BeanComboBox {
- showReset: true;
- i18nPrefix: "tutti.property.";
- bean: {model};
-}
-
-BeanDoubleList {
- bean: {model};
-}
-
-JList {
- selectionMode: {ListSelectionModel.MULTIPLE_INTERVAL_SELECTION};
- model: {new DefaultListModel()};
-}
-
-NumberEditor {
- autoPopup: {handler.getConfig().isAutoPopupNumberEditor()};
- showPopupButton: {handler.getConfig().isShowNumberEditorButton()};
- bean: {model};
- showReset: true;
-}
-
-SimpleTimeEditor {
- bean: {model};
-}
-
-#stationNumberLabel {
- text: "tutti.label.fishingOperation.stationNumber";
- labelFor: {stationNumberField};
-}
-
-#stationNumberField {
- property: "stationNumber";
- model: {model.getStationNumber()};
- useFloat: false;
- numberPattern: {INT_6_DIGITS_PATTERN};
-}
-
-#fishingOperationNumberLabel {
- text: "tutti.label.fishingOperation.fishingOperationNumber";
- labelFor: {fishingOperationNumberField};
-}
-
-#fishingOperationNumberField {
- property: "fishingOperationNumber";
- model: {model.getFishingOperationNumber()};
- useFloat: false;
- numberPattern: {INT_6_DIGITS_PATTERN};
-}
-
-#dateLabel {
- text: "tutti.label.fishingOperation.date";
- labelFor: {dateField};
-}
-
-#dateField {
- date: {model.getDate()};
- formats: {"dd/MM/yyyy"};
-}
-
-#strataLabel {
- text: "tutti.label.fishingOperation.strata";
- labelFor: {strataComboBox};
-}
-
-#strataComboBox {
- property: "strata";
- selectedItem: {model.getStrata()};
-}
-
-#subStrataLabel {
- text: "tutti.label.fishingOperation.subStrata";
- labelFor: {subStrataComboBox};
-}
-
-#subStrataComboBox {
- property: "subStrata";
- selectedItem: {model.getSubStrata()};
-}
-
-#localiteLabel {
- text: "tutti.label.fishingOperation.localite";
- labelFor: {localiteField};
-}
-
-#localiteField {
- text: {model.getLocalite()};
-}
-
-#gearLongitudeLabel {
- text: "tutti.label.fishingOperation.gearLongitude";
-}
-
-#gearLatitudeLabel {
- text: "tutti.label.fishingOperation.gearLatitude";
-}
-
-#gearDateLabel {
- text: "tutti.label.fishingOperation.gearDate";
-}
-
-#gearTimeLabel {
- text: "tutti.label.fishingOperation.gearTime";
-}
-
-#gearShootingStartLabel {
- text: "tutti.label.fishingOperation.gearShootingStart";
-}
-
-#gearShootingEndLabel {
- text: "tutti.label.fishingOperation.gearShootingEnd";
-}
-
-#gearShootingStartLongitudeField {
- text: {getStringValue(model.getGearShootingStartLongitude())};
-}
-
-#gearShootingStartLatitudeField {
- text: {getStringValue(model.getGearShootingStartLatitude())};
-}
-
-#gearShootingStartDateField {
- date: {model.getGearShootingStartDate()};
- formats: {"dd/MM/yyyy"};
-}
-
-#gearShootingStartTimeField {
- property: "gearShootingStartDate";
- date: {model.getGearShootingStartDate()};
-}
-
-#gearShootingEndLongitudeField {
- text: {getStringValue(model.getGearShootingEndLongitude())};
-}
-
-#gearShootingEndLatitudeField {
- text: {getStringValue(model.getGearShootingEndLatitude())};
-}
-
-#gearShootingEndDateField {
- date: {model.getGearShootingEndDate()};
- formats: {"dd/MM/yyyy"};
-}
-
-#gearShootingEndTimeField {
- property: "gearShootingEndDate";
- date: {model.getGearShootingEndDate()};
-}
-
-#fishingOperationValidPanel {
- floatable: false;
- borderPainted: false;
- opaque: false;
-}
-
-#resetValidStateButton {
- actionIcon: "reset";
- text: "tutti.action.reset.fishingOperationValidState";
-}
-
-#fishingOperationValidRadio {
- text: "tutti.label.fishingOperation.fishingOperationValid";
- selected: {model.getFishingOperationValid() == Boolean.TRUE};
- buttonGroup: "fishingOperationValid";
-}
-
-#fishingOperationInvalidRadio {
- text: "tutti.label.fishingOperation.fishingOperationInvalid";
- selected: {model.getFishingOperationValid() == Boolean.FALSE};
- buttonGroup: "fishingOperationValid";
-}
-#fishingOperationResetRadio {
- selected: {model.getFishingOperationValid() == null};
- buttonGroup: "fishingOperationValid";
-}
-
-#fishingOperationRectiligneCheckBox {
- text: "tutti.label.fishingOperation.fishingOperationRectiligne";
- selected: {model.isFishingOperationRectiligne()};
-}
-
-#distanceChaluteeLabel {
- text: "tutti.label.fishingOperation.distanceChalutee";
- labelFor: {distanceChaluteeField};
-}
-
-#distanceChaluteeField {
- property: "distanceChalutee";
- model: {model.getDistanceChalutee()};
- useFloat: false;
- numberPattern: {INT_6_DIGITS_PATTERN};
- enabled: {!model.isFishingOperationRectiligne()};
-}
-
-#beaufortScaleLabel {
- text: "tutti.label.fishingOperation.beaufortScale";
- labelFor: {beaufortScaleComboBox};
-}
-
-#beaufortScaleComboBox {
- property: "beaufortScale";
- selectedItem: {model.getBeaufortScale()};
-}
-
-#windDirectionLabel {
- text: "tutti.label.fishingOperation.windDirection";
- labelFor: {windDirectionField};
-}
-
-#windDirectionField {
- property: "windDirection";
- model: {model.getWindDirection()};
- useFloat: false;
- numberPattern: {INT_6_DIGITS_PATTERN};
-}
-
-#seaStateLabel {
- text: "tutti.label.fishingOperation.seaState";
- labelFor: {seaStateComboBox};
-}
-
-#seaStateComboBox {
- property: "seaState";
- selectedItem: {model.getSeaState()};
-}
-
-#ouvertureHorizontaleLabel {
- text: "tutti.label.fishingOperation.ouvertureHorizontale";
- labelFor: {ouvertureHorizontaleField};
-}
-
-#ouvertureHorizontaleVerticaleLabel {
- text: "tutti.label.fishingOperation.ouvertureHorizontaleVerticale";
-}
-
-#ouvertureHorizontaleField {
- property: "ouvertureHorizontale";
- model: {model.getOuvertureHorizontale()};
- useFloat: false;
- numberPattern: {INT_6_DIGITS_PATTERN};
-}
-
-#ouvertureVerticaleLabel {
- text: "tutti.label.fishingOperation.ouvertureVerticale";
- labelFor: {ouvertureVerticaleField};
-}
-
-#ouvertureVerticaleField {
- property: "ouvertureVerticale";
- model: {model.getOuvertureVerticale()};
- useFloat: false;
- numberPattern: {INT_6_DIGITS_PATTERN};
-}
-
-#geometrieMesureeCheckBox {
- text: "tutti.label.fishingOperation.geometrieMesuree";
- selected: {model.isGeometrieMesuree()};
-}
-
-#longueurFunesLabel {
- text: "tutti.label.fishingOperation.longueurFunes";
- labelFor: {longueurFunesField};
-}
-
-#longueurFunesBrasLabel {
- text: "tutti.label.fishingOperation.longueurFunesBras";
-}
-
-#longueurFunesField {
- property: "longueurFunes";
- model: {model.getLongueurFunes()};
- useFloat: false;
- numberPattern: {INT_6_DIGITS_PATTERN};
-}
-
-#longueurBrasLabel {
- text: "tutti.label.fishingOperation.longueurBras";
- labelFor: {longueurBrasField};
-}
-
-#longueurBrasField {
- property: "longueurBras";
- model: {model.getLongueurBras()};
- useFloat: false;
- numberPattern: {INT_6_DIGITS_PATTERN};
-}
-
-#systemeFermetureCulCheckBox {
- text: "tutti.label.fishingOperation.systemeFermetureCul";
- selected: {model.isSystemeFermetureCul()};
-}
-
-#dureeLabel {
- text: "tutti.label.fishingOperation.duree";
- labelFor: {dureeField};
-}
-
-#dureeField {
- property: "duree";
- model: {model.getDuree()};
- useFloat: false;
- numberPattern: {INT_6_DIGITS_PATTERN};
-}
-
-#saisisseurList {
- beanType: {Person.class};
- property: "saisisseur";
- border: {BorderFactory.createTitledBorder(_("tutti.label.list.saisisseur"))};
-}
-
-#commentPane {
- columnHeaderView: {new JLabel(_("tutti.label.comment"))};
- minimumSize: {new Dimension(10,50)};
-}
-
-#commentField {
- text: {model.getComment()};
-}
-
-#gearShootingStartDepthLabel {
- text: "tutti.label.fishingOperation.gearShootingStartDepth";
- labelFor: {gearShootingStartDepthField};
-}
-
-#gearShootingStartDepthField {
- property: "gearShootingStartDepth";
- model: {model.getGearShootingStartDepth()};
- useFloat: false;
- numberPattern: {INT_6_DIGITS_PATTERN};
-}
-
-#gearShootingEndDepthLabel {
- text: "tutti.label.fishingOperation.gearShootingEndDepth";
- labelFor: {gearShootingEndDepthField};
-}
-
-#gearShootingEndDepthField {
- property: "gearShootingEndDepth";
- model: {model.getGearShootingEndDepth()};
- useFloat: false;
- numberPattern: {INT_6_DIGITS_PATTERN};
-}
-
-#gearShootingStartSurfaceTemperatureLabel {
- text: "tutti.label.fishingOperation.gearShootingStartSurfaceTemperature";
- labelFor: {gearShootingStartSurfaceTemperatureField};
-}
-
-#gearShootingStartSurfaceTemperatureField {
- property: "gearShootingStartSurfaceTemperature";
- model: {model.getGearShootingStartSurfaceTemperature()};
- useFloat: false;
- numberPattern: {INT_6_DIGITS_PATTERN};
-}
-
-#gearShootingEndSurfaceTemperatureLabel {
- text: "tutti.label.fishingOperation.gearShootingEndSurfaceTemperature";
- labelFor: {gearShootingEndSurfaceTemperatureField};
-}
-
-#gearShootingEndSurfaceTemperatureField {
- property: "gearShootingEndSurfaceTemperature";
- model: {model.getGearShootingEndSurfaceTemperature()};
- useFloat: false;
- numberPattern: {INT_6_DIGITS_PATTERN};
-}
-
-#gearShootingStartBottomTemperatureLabel {
- text: "tutti.label.fishingOperation.gearShootingStartBottomTemperature";
- labelFor: {gearShootingStartBottomTemperatureField};
-}
-
-#gearShootingStartBottomTemperatureField {
- property: "gearShootingStartBottomTemperature";
- model: {model.getGearShootingStartBottomTemperature()};
- useFloat: false;
- numberPattern: {INT_6_DIGITS_PATTERN};
-}
-
-#gearShootingEndBottomTemperatureLabel {
- text: "tutti.label.fishingOperation.gearShootingEndBottomTemperature";
- labelFor: {gearShootingEndBottomTemperatureField};
-}
-
-#gearShootingEndBottomTemperatureField {
- property: "gearShootingEndBottomTemperature";
- model: {model.getGearShootingEndBottomTemperature()};
- useFloat: false;
- numberPattern: {INT_6_DIGITS_PATTERN};
-}
-
-#averageBottomTemperatureLabel {
- text: "tutti.label.fishingOperation.averageBottomTemperature";
- labelFor: {averageBottomTemperatureField};
-}
-
-#averageBottomTemperatureField {
- property: "averageBottomTemperature";
- model: {model.getAverageBottomTemperature()};
- useFloat: false;
- numberPattern: {INT_6_DIGITS_PATTERN};
-}
-
-#gearShootingStartSurfaceSalinityLabel {
- text: "tutti.label.fishingOperation.gearShootingStartSurfaceSalinity";
- labelFor: {gearShootingStartSurfaceSalinityField};
-}
-
-#gearShootingStartSurfaceSalinityField {
- property: "gearShootingStartSurfaceSalinity";
- model: {model.getGearShootingStartSurfaceSalinity()};
- useFloat: false;
- numberPattern: {INT_6_DIGITS_PATTERN};
-}
-
-#gearShootingEndSurfaceSalinityLabel {
- text: "tutti.label.fishingOperation.gearShootingEndSurfaceSalinity";
- labelFor: {gearShootingEndSurfaceSalinityField};
-}
-
-#gearShootingEndSurfaceSalinityField {
- property: "gearShootingEndSurfaceSalinity";
- model: {model.getGearShootingEndSurfaceSalinity()};
- useFloat: false;
- numberPattern: {INT_6_DIGITS_PATTERN};
-}
-
-#gearShootingStartBottomSalinityLabel {
- text: "tutti.label.fishingOperation.gearShootingStartBottomSalinity";
- labelFor: {gearShootingStartBottomSalinityField};
-}
-
-#gearShootingStartBottomSalinityField {
- property: "gearShootingStartBottomSalinity";
- model: {model.getGearShootingStartBottomSalinity()};
- useFloat: false;
- numberPattern: {INT_6_DIGITS_PATTERN};
-}
-
-#gearShootingEndBottomSalinityLabel {
- text: "tutti.label.fishingOperation.gearShootingEndBottomSalinity";
- labelFor: {gearShootingEndBottomSalinityField};
-}
-
-#gearShootingEndBottomSalinityField {
- property: "gearShootingEndBottomSalinity";
- model: {model.getGearShootingEndBottomSalinity()};
- useFloat: false;
- numberPattern: {INT_6_DIGITS_PATTERN};
-}
-
-#averageBottomSalinityLabel {
- text: "tutti.label.fishingOperation.averageBottomSalinity";
- labelFor: {averageBottomSalinityField};
-}
-
-#averageBottomSalinityField {
- property: "averageBottomSalinity";
- model: {model.getAverageBottomSalinity()};
- useFloat: false;
- numberPattern: {INT_6_DIGITS_PATTERN};
-}
-
-#noTraitPane {
- text: "tutti.label.no.fishingOperation.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()};
-}
-
-#importPupitriButton {
- actionIcon: "pupitri-import";
- text: "tutti.action.pupitri-import";
-}
-
-#importCasinoButton {
- actionIcon: "casino-import";
- text: "tutti.action.casino-import";
-}
-
-#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/operation/FishingOperationTabUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationTabUI.jaxx 2012-12-18 19:13:34 UTC (rev 88)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationTabUI.jaxx 2012-12-19 10:16:51 UTC (rev 89)
@@ -1,558 +0,0 @@
-<!--
- #%L
- Tutti :: UI
- $Id$
- $HeadURL$
- %%
- Copyright (C) 2012 Ifremer
- %%
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as
- published by the Free Software Foundation, either version 3 of the
- License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public
- License along with this program. If not, see
- <http://www.gnu.org/licenses/gpl-3.0.html>.
- #L%
- -->
-<JPanel id='homePanel' layout='{new BorderLayout()}'
- implements='fr.ifremer.tutti.ui.swing.TuttiUI<FishingOperationTabUIModel, FishingOperationTabUIHandler>'>
-
- <import>
- fr.ifremer.tutti.persistence.entities.referential.BeaufortScale
- fr.ifremer.tutti.persistence.entities.referential.SeaState
- fr.ifremer.tutti.persistence.entities.referential.Strata
- fr.ifremer.tutti.persistence.entities.data.FishingOperation
- fr.ifremer.tutti.persistence.entities.referential.Person
-
- fr.ifremer.tutti.ui.swing.util.editor.SimpleTimeEditor
- fr.ifremer.tutti.ui.swing.content.operation.fishing.EnvironmentTabUI
-
- jaxx.runtime.swing.editor.bean.BeanComboBox
- jaxx.runtime.swing.editor.bean.BeanListHeader
- jaxx.runtime.swing.editor.bean.BeanDoubleList
- jaxx.runtime.swing.editor.NumberEditor
- jaxx.runtime.swing.editor.TimeEditor
-
- jaxx.runtime.validator.swing.SwingValidatorUtil
- jaxx.runtime.validator.swing.SwingValidatorMessageTableModel
-
- org.jdesktop.swingx.JXDatePicker
- org.jdesktop.swingx.JXTable
-
- java.awt.Dimension
-
- javax.swing.DefaultListModel
- javax.swing.ListSelectionModel
-
- static org.nuiton.i18n.I18n._
- static jaxx.runtime.SwingUtil.getStringValue
- </import>
-
- <script><![CDATA[
-
-public FishingOperationTabUI(FishingOperationsUI parentUI) {
- FishingOperationTabUIHandler handler = new FishingOperationTabUIHandler(parentUI, this);
- setContextValue(handler);
- handler.beforeInitUI();
-}
-
-public void selectFishingOperation(FishingOperation fishingOperation) { handler.selectFishingOperation(fishingOperation); }
-
-protected void $afterCompleteSetup() { handler.afterInitUI(); }
- ]]></script>
-
- <FishingOperationTabUIHandler id='handler'
- initializer='getContextValue(FishingOperationTabUIHandler.class)'/>
-
- <FishingOperationTabUIModel id='model'
- initializer='getContextValue(FishingOperationTabUIModel.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='fishingOperationNumber'
- component='fishingOperationNumberField'/>
- <field name='date' component='dateField'/>
- <field name='comment' component='commentField'/>
- <field name='saisisseur' component='saisisseurList'/>
- </BeanValidator>
-
- <JPanel id='fishingOperationPane' constraints='BorderLayout.CENTER'
- layout='{new BorderLayout()}'>
-
- <JTabbedPane id='fishingOperationTabPane' constraints='BorderLayout.CENTER'>
- <tab id='traitGeneralTab'
- title='tutti.label.tab.fishingOperation.general'>
- <Table fill='both' id='generalForm'>
-
- <!-- Numero station / Numéro trait / Date -->
- <row>
- <cell anchor='west'>
- <JLabel id='stationNumberLabel'/>
- </cell>
- <cell weightx='0.3'>
- <NumberEditor id='stationNumberField' constructorParams='this'/>
- </cell>
- <cell>
- <JLabel id='fishingOperationNumberLabel'/>
- </cell>
- <cell weightx='0.3'>
- <NumberEditor id='fishingOperationNumberField'
- constructorParams='this'/>
- </cell>
- <cell>
- <JLabel id='dateLabel'/>
- </cell>
- <cell weightx='0.3'>
- <JXDatePicker id='dateField'
- onActionPerformed='handler.setDate(event, "date")'/>
- </cell>
- </row>
-
- <!-- Strate d'association / Sous Strate / Localité -->
- <row>
- <cell>
- <JLabel id='strataLabel'/>
- </cell>
- <cell weightx='0.3'>
- <BeanComboBox id='strataComboBox' constructorParams='this'
- genericType='Strata'/>
- </cell>
- <cell>
- <JLabel id='subStrataLabel'/>
- </cell>
- <cell weightx='0.3'>
- <BeanComboBox id='subStrataComboBox' constructorParams='this'
- genericType='Strata'/>
- </cell>
- <cell>
- <JLabel id='localiteLabel'/>
- </cell>
- <cell weightx='0.3'>
- <JTextField id='localiteField'
- onKeyReleased='handler.setText(event, "localite")'/>
- </cell>
- </row>
-
- <!-- début de traine long-lat-date-heure
- fin de traine long-lat-date-heure -->
- <row>
- <cell columns='6'>
- <JPanel layout="{new BorderLayout()}">
- <Table id="gearCaracteristicsTable" fill="both" weightx='1'
- constraints='BorderLayout.CENTER'>
- <row>
- <cell>
- <JLabel/>
- </cell>
- <cell>
- <JLabel id='gearLongitudeLabel'/>
- </cell>
- <cell>
- <JLabel id='gearLatitudeLabel'/>
- </cell>
- <cell>
- <JLabel id='gearDateLabel'/>
- </cell>
- <cell>
- <JLabel id='gearTimeLabel'/>
- </cell>
- </row>
-
- <row>
- <cell>
- <JLabel id='gearShootingStartLabel'/>
- </cell>
- <cell>
- <JTextField id='gearShootingStartLongitudeField'
- onKeyReleased='handler.setGearShootingStartLongitude(((JTextField)event.getSource()).getText())'/>
- </cell>
- <cell>
- <JTextField id='gearShootingStartLatitudeLabel'
- onKeyReleased='handler.setGearShootingStartLatitude(((JTextField)event.getSource()).getText())'/>
- </cell>
- <cell>
- <JXDatePicker id='gearShootingStartDateField'
- onActionPerformed='handler.setDate(event, "gearShootingStartDate")'/>
- </cell>
- <cell>
- <SimpleTimeEditor id='gearShootingStartTimeField'
- constructorParams='this'/>
- </cell>
- </row>
- <row>
- <cell>
- <JLabel id='gearShootingEndLabel'/>
- </cell>
- <cell>
- <JTextField id='gearShootingEndLongitudeField'
- onKeyReleased='handler.setGearShootingEndLongitude(((JTextField)event.getSource()).getText())'/>
- </cell>
- <cell>
- <JTextField id='gearShootingEndLatitudeLabel'
- onKeyReleased='handler.setGearShootingEndLatitude(((JTextField)event.getSource()).getText())'/>
- </cell>
- <cell>
- <JXDatePicker id='gearShootingEndDateField'
- onActionPerformed='handler.setDate(event, "gearShootingEndDate")'/>
- </cell>
- <cell>
- <SimpleTimeEditor id='gearShootingEndTimeField'
- constructorParams='this'/>
- </cell>
- </row>
- </Table>
- </JPanel>
- </cell>
- </row>
-
- <!-- Fishing operation valid / invalid-->
- <row>
- <cell>
- <JToolBar id='fishingOperationValidPanel'
- layout='{new BorderLayout()}'>
- <JButton id='resetValidStateButton'
- constraints='BorderLayout.WEST'
- onActionPerformed="model.setFishingOperationValid(null)"/>
- <JRadioButton id='fishingOperationResetRadio'
- constraints='BorderLayout.EAST'/>
- </JToolBar>
- </cell>
- <cell>
- <HBox>
- <JRadioButton id='fishingOperationValidRadio'
- onActionPerformed='model.setFishingOperationValid(Boolean.TRUE)'/>
- <JRadioButton id='fishingOperationInvalidRadio'
- onActionPerformed='model.setFishingOperationValid(Boolean.FALSE)'/>
- </HBox>
- </cell>
- <cell columns="4">
- <JPanel/>
- </cell>
- </row>
-
- <!-- FishingOperation rectiligne / distance chalutee / durée -->
- <row>
- <cell>
- <JCheckBox id='fishingOperationRectiligneCheckBox'
- onItemStateChanged='handler.setBoolean(event, "fishingOperationRectiligne")'/>
- </cell>
- <cell columns="3">
- <JPanel layout="{new BorderLayout()}">
- <JLabel id='distanceChaluteeLabel'
- constraints='BorderLayout.WEST'/>
- <NumberEditor id='distanceChaluteeField'
- constraints='BorderLayout.CENTER'
- constructorParams='this'/>
- </JPanel>
- </cell>
- <cell anchor='west'>
- <JLabel id='dureeLabel'/>
- </cell>
- <cell fill='horizontal'>
- <NumberEditor id='dureeField' constructorParams='this'/>
- </cell>
- </row>
-
- <!-- Actions d'import -->
- <row>
- <cell columns='6'>
- <JPanel layout='{new GridLayout(1,0)}'>
- <JButton id='importPupitriButton'
- onActionPerformed='handler.importPupitri()'/>
- <JButton id='importCasinoButton'
- onActionPerformed='handler.importCasino()'/>
- </JPanel>
- </cell>
- </row>
-
- <!-- Saisisseur -->
- <row weighty='0.3'>
- <cell columns='6'>
- <!-- <JScrollPane id='saisisseurPane'
- columnHeaderView="{saisisseurHeader}"
- onFocusGained='saisisseurList.requestFocus()'>
- <JList id='saisisseurList'
- onValueChanged='handler.selectListData(event, "saisisseur")'/>
- <BeanListHeader id='saisisseurHeader' genericType='Person'/>
- </JScrollPane>-->
- <BeanDoubleList id='saisisseurList' genericType='Person'/>
- </cell>
- </row>
-
- <!-- Commentaire -->
- <row weighty='0.3'>
- <cell columns='6'>
- <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.fishingOperation.gearShooting'>
-
- <Table fill='both' id='gearShootingForm'>
-
- <!-- GearShootingStart Depth -->
- <row>
- <cell>
- <JLabel id='gearShootingStartDepthLabel'/>
- </cell>
- <cell weightx='1.0'>
- <NumberEditor id='gearShootingStartDepthField'
- constructorParams='this'/>
- </cell>
- </row>
-
- <!-- GearShootingEnd Depth -->
- <row>
- <cell>
- <JLabel id='gearShootingEndDepthLabel'/>
- </cell>
- <cell weightx='1.0'>
- <NumberEditor id='gearShootingEndDepthField'
- constructorParams='this'/>
- </cell>
- </row>
-
- <!-- Ouverture horizontale -->
- <row>
- <cell anchor='west'>
- <JLabel id='ouvertureHorizontaleLabel'/>
- </cell>
- <cell fill='horizontal'>
- <NumberEditor id='ouvertureHorizontaleField'
- constructorParams='this'/>
- </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='longueurFunesLabel'/>
- </cell>
- <cell fill='horizontal'>
- <NumberEditor id='longueurFunesField' constructorParams='this'/>
- </cell>
- </row>
-
- <!-- Longueur bras -->
- <row>
- <cell anchor='west'>
- <JLabel id='longueurBrasLabel'/>
- </cell>
- <cell fill='horizontal'>
- <NumberEditor id='longueurBrasField' constructorParams='this'/>
- </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>
- </Table>
- </tab>
-
- <tab id='environmentTab'
- title='tutti.label.tab.fishingOperation.environment'>
-
- <EnvironmentTabUI id='environmentTabContent' constructorParams='this'/>
-<!-- <Table fill='both' id='environmentForm'>
-
- Beaufort scale
- <row>
- <cell anchor='west'>
- <JLabel id='beaufortScaleLabel'/>
- </cell>
- <cell weightx='1.0'>
- <BeanComboBox id='beaufortScaleComboBox' constructorParams='this'
- genericType='BeaufortScale'/>
- </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='SeaState'/>
- </cell>
- </row>
- </Table>-->
- </tab>
-
- <tab id='traitHydrologyTabContent'
- title='tutti.label.tab.fishingOperation.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 BorderLayout()}' constraints='BorderLayout.SOUTH'>
- <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'/>
-</JPanel>
Deleted: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationTabUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationTabUIHandler.java 2012-12-18 19:13:34 UTC (rev 88)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationTabUIHandler.java 2012-12-19 10:16:51 UTC (rev 89)
@@ -1,227 +0,0 @@
-package fr.ifremer.tutti.ui.swing.content.operation;
-
-/*
- * #%L
- * Tutti :: UI
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2012 Ifremer
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
-import fr.ifremer.tutti.persistence.entities.referential.Person;
-import fr.ifremer.tutti.service.PersistenceService;
-import fr.ifremer.tutti.ui.swing.AbstractTuttiUIHandler;
-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.JPanel;
-import java.awt.BorderLayout;
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.util.List;
-
-/**
- * Handler for UI {@link FishingOperationTabUI}.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.1
- */
-public class FishingOperationTabUIHandler extends AbstractTuttiUIHandler<FishingOperationTabUIModel> {
-
- /** Logger. */
- private static final Log log =
- LogFactory.getLog(FishingOperationTabUIHandler.class);
-
- private final FishingOperationTabUI ui;
-
- private final FishingOperationsUI parentUi;
-
- private final PersistenceService persistenceService;
-
- public FishingOperationTabUIHandler(FishingOperationsUI parentUi, FishingOperationTabUI ui) {
- super(parentUi.getHandler().getContext());
- this.ui = ui;
- this.parentUi = parentUi;
- this.persistenceService = context.getService(PersistenceService.class);
- }
-
- @Override
- public void beforeInitUI() {
-
- FishingOperationTabUIModel model = new FishingOperationTabUIModel();
- model.addPropertyChangeListener(FishingOperationTabUIModel.PROPERTY_EMPTY, new PropertyChangeListener() {
- @Override
- public void propertyChange(PropertyChangeEvent evt) {
- JPanel form = ui.getFishingOperationPane();
- 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() {
-
- ui.getFishingOperationValidPanel().remove(
- ui.getFishingOperationResetRadio());
-
- FishingOperationTabUIModel model = ui.getModel();
-
- initUI(ui);
-
- initBeanList(ui.getSaisisseurList(),
- persistenceService.getAllPerson(),
- model.getSaisisseur());
-
-// initBeanComboBox(ui.getBeaufortScaleComboBox(),
-// persistenceService.getAllBeaufortScale(),
-// model.getBeaufortScale());
-//
-// initBeanComboBox(ui.getStrataComboBox(),
-// persistenceService.getAllStrata(),
-// model.getStrata());
-//
-// initBeanComboBox(ui.getSeaStateComboBox(),
-// persistenceService.getAllSeaState(),
-// model.getSeaState());
-
- model.setEmpty(true);
-
- listenValidatorValid(ui.getValidator(), getModel());
- }
-
- @Override
- public void onCloseUI() {
- }
-
- @Override
- protected FishingOperationTabUIModel getModel() {
- return ui.getModel();
- }
-
- public void selectFishingOperation(FishingOperation bean) {
-
- boolean empty = bean == null;
-
- FishingOperationTabUIModel model = getModel();
-
- if (empty) {
-
- model.fromBean(new FishingOperation());
- } else {
-
- model.fromBean(bean);
- }
-
- // update saisissuer selection
- List<Person> saisisseur = model.getSaisisseur();
- ui.getSaisisseurList().getModel().setSelected(saisisseur);
-
- // update model empty property
- model.setEmpty(empty);
-
- // if new fishingOperation can already cancel his creation
- model.setModify(!empty && model.isCreate());
-
- ui.getEnvironmentTabContent().getHandler().afterInitUI();
- }
-
- public void cancel() {
-
- String id = getModel().getId();
-
- if (log.isInfoEnabled()) {
- log.info("Cancel edition for fishingOperation: " + id);
- }
- boolean newBean = StringUtils.isBlank(id);
-
- if (newBean) {
-
- // cancel to create a new fishingOperation
- parentUi.getHandler().selectFishingOperation(null);
-
- } else {
-
- // reselect in ui the fishingOperation
- FishingOperation selectedFishingOperation = parentUi.getModel().getSelectedFishingOperation();
- parentUi.getHandler().selectFishingOperation(selectedFishingOperation);
- }
- }
-
- public void save() {
-
- // get fishingOperation to save
- FishingOperation toSave = getModel().toBean();
-
- if (log.isInfoEnabled()) {
- log.info("Save edition for fishingOperation: " + toSave.getId());
- }
-
- // keep selected tab (to resotre it after save)
- int selectedIndex = ui.getFishingOperationTabPane().getSelectedIndex();
-
- // persist current fishingOperation
- parentUi.getHandler().saveFishingOperation(toSave);
-
- // reselect current tab
- ui.getFishingOperationTabPane().setSelectedIndex(selectedIndex);
-
- getModel().setModify(false);
- }
-
- public void importPupitri() {
- //TODO
- }
-
- public void importCasino() {
- //TODO
- }
-
- public void setGearShootingStartLatitude(String text) {
- getModel().setGearShootingStartLatitude(Float.valueOf(text));
- }
-
- public void setGearShootingStartLongitude(String text) {
- getModel().setGearShootingStartLongitude(Float.valueOf(text));
- }
-
- public void setGearShootingEndLatitude(String text) {
- getModel().setGearShootingEndLatitude(Float.valueOf(text));
- }
-
- public void setGearShootingEndLongitude(String text) {
- getModel().setGearShootingEndLongitude(Float.valueOf(text));
- }
-}
Deleted: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationTabUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationTabUIModel.java 2012-12-18 19:13:34 UTC (rev 88)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationTabUIModel.java 2012-12-19 10:16:51 UTC (rev 89)
@@ -1,633 +0,0 @@
-package fr.ifremer.tutti.ui.swing.content.operation;
-
-/*
- * #%L
- * Tutti :: UI
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2012 Ifremer
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
-import fr.ifremer.tutti.persistence.entities.data.Cruise;
-import fr.ifremer.tutti.persistence.entities.referential.BeaufortScale;
-import fr.ifremer.tutti.persistence.entities.referential.Person;
-import fr.ifremer.tutti.persistence.entities.referential.SeaState;
-import fr.ifremer.tutti.persistence.entities.referential.Strata;
-import fr.ifremer.tutti.ui.swing.AbstractTuttiBeanUIModel;
-import org.nuiton.util.beans.Binder;
-import org.nuiton.util.beans.BinderFactory;
-
-import java.util.Date;
-import java.util.List;
-
-/**
- * Model for UI {@link FishingOperationTabUI}.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.1
- */
-public class FishingOperationTabUIModel extends AbstractTuttiBeanUIModel<FishingOperation, FishingOperationTabUIModel> {
-
- 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_FISHING_OPERATION_NUMBER = "fishingOperationNumber";
-
- public static final String PROPERTY_DATE = "date";
-
- public static final String PROPERTY_STRATA = "strata";
-
- public static final String PROPERTY_SUB_STRATA = "subStrata";
-
- 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_DATE = "gearShootingStartDate";
-
- 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_DATE = "gearShootingEndDate";
-
- 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_FISHING_OPERATION_RECTILIGNE = "fishingOperationRectiligne";
-
- public static final String PROPERTY_DISTANCE_CHALUTEE = "distanceChalutee";
-
- public static final String PROPERTY_DUREE = "duree";
-
- public static final String PROPERTY_FISHING_OPERATION_VALID = "fishingOperationValid";
-
- 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 Cruise cruise;
-
- protected Integer stationNumber;
-
- protected Integer fishingOperationNumber;
-
- protected Date date;
-
- protected Strata strata;
-
- protected Strata subStrata;
-
- protected Float gearShootingStartLatitude;
-
- protected Float gearShootingStartLongitude;
-
- protected Date gearShootingStartDate;
-
- protected Integer gearShootingStartTime;
-
- protected Float gearShootingStartDepth;
-
- protected Float gearShootingEndLatitude;
-
- protected Float gearShootingEndLongitude;
-
- protected Date gearShootingEndDate;
-
- protected Integer gearShootingEndTime;
-
- protected Float gearShootingEndDepth;
-
- protected BeaufortScale beaufortScale;
-
- protected Integer windDirection;
-
- protected SeaState seaState;
-
- protected Float ouvertureHorizontale;
-
- protected Float ouvertureVerticale;
-
- protected boolean geometrieMesuree;
-
- protected Float longueurFunes;
-
- protected Float longueurBras;
-
- protected boolean systemeFermetureCul;
-
- protected boolean fishingOperationRectiligne;
-
- protected Float distanceChalutee;
-
- protected Float duree;
-
- protected Boolean fishingOperationValid;
-
- protected String localite;
-
- protected String comment;
-
- protected List<Person> 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;
-
- protected static Binder<FishingOperationTabUIModel, FishingOperation> toBeanBinder =
- BinderFactory.newBinder(FishingOperationTabUIModel.class,
- FishingOperation.class);
-
- protected static Binder<FishingOperation, FishingOperationTabUIModel> fromBeanBinder =
- BinderFactory.newBinder(FishingOperation.class, FishingOperationTabUIModel.class);
-
- public FishingOperationTabUIModel() {
- super(FishingOperation.class, fromBeanBinder, toBeanBinder);
- }
-
- public boolean isEmpty() {
- return empty;
- }
-
- public void setEmpty(boolean empty) {
- Object oldValue = isEmpty();
- this.empty = empty;
- firePropertyChange(PROPERTY_EMPTY, oldValue, empty);
- }
-
- public Cruise getCruise() {
- return cruise;
- }
-
- public void setCruise(Cruise cruise) {
- this.cruise = cruise;
- }
-
- public Integer getStationNumber() {
- return stationNumber;
- }
-
- public void setStationNumber(Integer stationNumber) {
- Object oldValue = getStationNumber();
- this.stationNumber = stationNumber;
- firePropertyChange(PROPERTY_STATION_NUMBER, oldValue, stationNumber);
- }
-
- public Integer getFishingOperationNumber() {
- return fishingOperationNumber;
- }
-
- public void setFishingOperationNumber(Integer fishingOperationNumber) {
- Object oldValue = getFishingOperationNumber();
- this.fishingOperationNumber = fishingOperationNumber;
- firePropertyChange(PROPERTY_FISHING_OPERATION_NUMBER, oldValue, fishingOperationNumber);
- }
-
- public Date getDate() {
- return date;
- }
-
- public void setDate(Date date) {
- Object oldValue = getDate();
- this.date = date;
- firePropertyChange(PROPERTY_DATE, oldValue, date);
- }
-
- public Strata getStrata() {
- return strata;
- }
-
- public void setStrata(Strata strata) {
- Object oldValue = getStrata();
- this.strata = strata;
- firePropertyChange(PROPERTY_STRATA, oldValue, strata);
- }
-
- public Strata getSubStrata() {
- return subStrata;
- }
-
- public void setSubStrata(Strata subStrata) {
- Object oldValue = getSubStrata();
- this.subStrata = subStrata;
- firePropertyChange(PROPERTY_SUB_STRATA, oldValue, subStrata);
- }
-
- 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 getGearShootingStartDate() {
- return gearShootingStartDate;
- }
-
- public void setGearShootingStartDate(Date gearShootingStartDate) {
- Object oldValue = getGearShootingStartDate();
- this.gearShootingStartDate = gearShootingStartDate;
- firePropertyChange(PROPERTY_GEAR_SHOOTING_START_DATE, oldValue, gearShootingStartDate);
- }
-
- 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 getGearShootingEndDate() {
- return gearShootingEndDate;
- }
-
- public void setGearShootingEndDate(Date gearShootingEndDate) {
- Object oldValue = getGearShootingEndDate();
- this.gearShootingEndDate = gearShootingEndDate;
- firePropertyChange(PROPERTY_GEAR_SHOOTING_END_DATE, oldValue, gearShootingEndDate);
- }
-
- 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 BeaufortScale getBeaufortScale() {
- return beaufortScale;
- }
-
- public void setBeaufortScale(BeaufortScale 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 SeaState getSeaState() {
- return seaState;
- }
-
- public void setSeaState(SeaState 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 isFishingOperationRectiligne() {
- return fishingOperationRectiligne;
- }
-
- public void setFishingOperationRectiligne(boolean fishingOperationRectiligne) {
- Object oldValue = isFishingOperationRectiligne();
- this.fishingOperationRectiligne = fishingOperationRectiligne;
- firePropertyChange(PROPERTY_FISHING_OPERATION_RECTILIGNE, oldValue, fishingOperationRectiligne);
- }
-
- 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 getFishingOperationValid() {
- return fishingOperationValid;
- }
-
- public void setFishingOperationValid(Boolean fishingOperationValid) {
- Object oldValue = getFishingOperationValid();
- this.fishingOperationValid = fishingOperationValid;
- firePropertyChange(PROPERTY_FISHING_OPERATION_VALID, oldValue, fishingOperationValid);
- }
-
- 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<Person> getSaisisseur() {
- return saisisseur;
- }
-
- public void setSaisisseur(List<Person> 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);
- }
-}
\ No newline at end of file
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationsUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationsUI.jaxx 2012-12-18 19:13:34 UTC (rev 88)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationsUI.jaxx 2012-12-19 10:16:51 UTC (rev 89)
@@ -74,7 +74,7 @@
<JTabbedPane id='tabPane' constraints='BorderLayout.CENTER'>
<tab id='fishingOperationTab' title='tutti.label.tab.fishingOperation'>
- <FishingOperationTabUI id='fishingOperationTabContent' constructorParams='this'/>
+ <EditFishingOperationUI id='fishingOperationTabContent' constructorParams='this'/>
</tab>
<tab id='speciesTab' title='tutti.label.tab.species'>
<SpeciesBatchUI id='speciesTabContent' constructorParams='this'/>
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTabUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTabUI.jaxx 2012-12-18 19:13:34 UTC (rev 88)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTabUI.jaxx 2012-12-19 10:16:51 UTC (rev 89)
@@ -25,7 +25,7 @@
<import>
org.jdesktop.swingx.JXTable
- fr.ifremer.tutti.ui.swing.content.operation.FishingOperationTabUI
+ fr.ifremer.tutti.ui.swing.content.operation.EditFishingOperationUI
javax.swing.ListSelectionModel
java.awt.Color
</import>
@@ -54,7 +54,7 @@
</row>
<script><![CDATA[
-public EnvironmentTabUI(FishingOperationTabUI parentUI) {
+public EnvironmentTabUI(EditFishingOperationUI parentUI) {
EnvironmentTabUIHandler handler = new EnvironmentTabUIHandler(parentUI, this);
setContextValue(handler);
handler.beforeInitUI();
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTabUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTabUIHandler.java 2012-12-18 19:13:34 UTC (rev 88)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTabUIHandler.java 2012-12-19 10:16:51 UTC (rev 89)
@@ -25,18 +25,16 @@
*/
import com.google.common.collect.Lists;
-import fr.ifremer.tutti.ui.swing.content.operation.FishingOperationTabUI;
+import fr.ifremer.tutti.ui.swing.content.operation.EditFishingOperationUI;
import fr.ifremer.tutti.ui.swing.util.table.AbstractTuttiTableModel;
import fr.ifremer.tutti.ui.swing.util.table.AbstractTuttiTableUIHandler;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.util.List;
-import java.util.logging.Logger;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JComboBox;
import javax.swing.event.ListDataEvent;
import javax.swing.event.ListDataListener;
-import javax.swing.plaf.basic.BasicComboBoxUI.ListDataHandler;
import javax.swing.table.TableColumnModel;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -54,7 +52,7 @@
protected EnvironmentTabUI ui;
- public EnvironmentTabUIHandler(FishingOperationTabUI parentUi, EnvironmentTabUI ui) {
+ public EnvironmentTabUIHandler(EditFishingOperationUI parentUi, EnvironmentTabUI ui) {
super(parentUi.getHandler().getContext());
this.ui = ui;
}
Copied: trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-error-validation.xml (from rev 88, trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationTabUIModel-error-validation.xml)
===================================================================
--- trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-error-validation.xml (rev 0)
+++ trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-error-validation.xml 2012-12-19 10:16:51 UTC (rev 89)
@@ -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.fishingOperation.stationNumber.required</message>
+ </field-validator>
+
+ </field>
+
+ <field name="date">
+
+ <field-validator type="required" short-circuit="true">
+ <message>tutti.validator.error.fishingOperation.date.required</message>
+ </field-validator>
+
+ </field>
+</validators>
Property changes on: trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-error-validation.xml
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationTabUIModel-error-validation.xml
===================================================================
--- trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationTabUIModel-error-validation.xml 2012-12-18 19:13:34 UTC (rev 88)
+++ trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationTabUIModel-error-validation.xml 2012-12-19 10:16:51 UTC (rev 89)
@@ -1,45 +0,0 @@
-<?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.fishingOperation.stationNumber.required</message>
- </field-validator>
-
- </field>
-
- <field name="date">
-
- <field-validator type="required" short-circuit="true">
- <message>tutti.validator.error.fishingOperation.date.required</message>
- </field-validator>
-
- </field>
-</validators>
Modified: trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties
===================================================================
--- trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2012-12-18 19:13:34 UTC (rev 88)
+++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2012-12-19 10:16:51 UTC (rev 89)
@@ -90,7 +90,7 @@
tutti.label.fishingOperation.ouvertureHorizontale=Ouverture horizontale
tutti.label.fishingOperation.ouvertureVerticale=Ouverture verticale
tutti.label.fishingOperation.seaState=Etat de la mer
-tutti.label.fishingOperation.stationNumber=Numéro de la station
+tutti.label.fishingOperation.stationNumber=Code Station
tutti.label.fishingOperation.strata=Strate
tutti.label.fishingOperation.subStrata=Sous strate
tutti.label.fishingOperation.systemeFermetureCul=Système de fermeture de cul
1
0
18 Dec '12
Author: tchemit
Date: 2012-12-18 20:13:34 +0100 (Tue, 18 Dec 2012)
New Revision: 88
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/88
Log:
add protocol + pmfm (refs #1811: [Protocole] S?\195?\169lection d'un protocole)
Added:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/protocol/EditProtocolUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/protocol/EditProtocolUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/protocol/EditProtocolUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/protocol/EditProtocolUIModel.java
Removed:
trunk/tutti-application/
Modified:
trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceAdagioImpl.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/resources/META-INF/services/fr.ifremer.tutti.persistence.entities.IdAware
trunk/tutti-persistence/src/main/xmi/tutti-persistence.properties
trunk/tutti-persistence/src/main/xmi/tutti-persistence.zargo
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/MainUI.css
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/TuttiUIContext.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/cruise/EditCruiseUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/home/SelectCruiseUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/home/SelectCruiseUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/home/SelectCruiseUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/home/SelectCruiseUIModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentRowModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTabUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTabUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTabUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTabUIModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTableModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/program/EditProgramUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/program/EditProgramUIHandler.java
trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistence.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistence.java 2012-12-18 13:07:34 UTC (rev 87)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistence.java 2012-12-18 19:13:34 UTC (rev 88)
@@ -33,6 +33,7 @@
import fr.ifremer.tutti.persistence.entities.data.Program;
import fr.ifremer.tutti.persistence.entities.data.SpeciesBatch;
import fr.ifremer.tutti.persistence.entities.data.SpeciesBatchFrequency;
+import fr.ifremer.tutti.persistence.entities.protocol.TuttiProtocol;
import fr.ifremer.tutti.persistence.entities.referential.BeaufortScale;
import fr.ifremer.tutti.persistence.entities.referential.Country;
import fr.ifremer.tutti.persistence.entities.referential.Gear;
@@ -113,7 +114,7 @@
Program saveProgram(Program bean);
//------------------------------------------------------------------------//
- //-- Cruise methods --//
+ //-- Cruise methods --//
//------------------------------------------------------------------------//
List<Cruise> getAllCruise(String programId);
@@ -125,6 +126,18 @@
Cruise saveCruise(Cruise bean);
//------------------------------------------------------------------------//
+ //-- Protocol methods --//
+ //------------------------------------------------------------------------//
+
+ List<TuttiProtocol> getAllProtocol();
+
+ TuttiProtocol getProtocol(String id);
+
+ TuttiProtocol createProtocol(TuttiProtocol bean);
+
+ TuttiProtocol saveProtocol(TuttiProtocol bean);
+
+ //------------------------------------------------------------------------//
//-- FishingOperation methods --//
//------------------------------------------------------------------------//
Modified: trunk/tutti-persistence/src/main/resources/META-INF/services/fr.ifremer.tutti.persistence.entities.IdAware
===================================================================
--- trunk/tutti-persistence/src/main/resources/META-INF/services/fr.ifremer.tutti.persistence.entities.IdAware 2012-12-18 13:07:34 UTC (rev 87)
+++ trunk/tutti-persistence/src/main/resources/META-INF/services/fr.ifremer.tutti.persistence.entities.IdAware 2012-12-18 19:13:34 UTC (rev 88)
@@ -8,6 +8,7 @@
fr.ifremer.tutti.persistence.entities.data.Cruise
fr.ifremer.tutti.persistence.entities.data.SpeciesBatch
fr.ifremer.tutti.persistence.entities.data.SpeciesBatchFrequency
+fr.ifremer.tutti.persistence.entities.protocol.TuttiProtocol
fr.ifremer.tutti.persistence.entities.referential.BeaufortScale
fr.ifremer.tutti.persistence.entities.referential.Country
fr.ifremer.tutti.persistence.entities.referential.Gear
Modified: trunk/tutti-persistence/src/main/xmi/tutti-persistence.properties
===================================================================
--- trunk/tutti-persistence/src/main/xmi/tutti-persistence.properties 2012-12-18 13:07:34 UTC (rev 87)
+++ trunk/tutti-persistence/src/main/xmi/tutti-persistence.properties 2012-12-18 19:13:34 UTC (rev 88)
@@ -22,7 +22,7 @@
# #L%
###
-model.tagvalue.version=0.2
+model.tagvalue.version=0.3
model.tagvalue.constantPrefix=PROPERTY_
model.tagvalue.doNotGenerateBooleanGetMethods=true
model.tagvalue.noPCS=true
@@ -33,3 +33,9 @@
fr.ifremer.tutti.persistence.entities.data.Cruise.attribute.headOfSortRoom.stereotype=ordered
fr.ifremer.tutti.persistence.entities.data.Cruise.attribute.vessel.stereotype=ordered
fr.ifremer.tutti.persistence.entities.data.FishingOperation.attribute.saisisseur.stereotype=ordered
+
+fr.ifremer.tutti.persistence.entities.protocol.TuttiProtocol.attribute.gearPmfmId.stereotype=ordered
+fr.ifremer.tutti.persistence.entities.protocol.TuttiProtocol.attribute.environmentPmfmId.stereotype=ordered
+fr.ifremer.tutti.persistence.entities.protocol.TuttiProtocol.attribute.hydrologyPmfmId.stereotype=ordered
+fr.ifremer.tutti.persistence.entities.protocol.TuttiProtocol.attribute.species.stereotype=ordered
+
Modified: trunk/tutti-persistence/src/main/xmi/tutti-persistence.zargo
===================================================================
(Binary files differ)
Modified: trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceAdagioImpl.java
===================================================================
--- trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceAdagioImpl.java 2012-12-18 13:07:34 UTC (rev 87)
+++ trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceAdagioImpl.java 2012-12-18 19:13:34 UTC (rev 88)
@@ -34,6 +34,7 @@
import fr.ifremer.tutti.persistence.entities.data.Program;
import fr.ifremer.tutti.persistence.entities.data.SpeciesBatch;
import fr.ifremer.tutti.persistence.entities.data.SpeciesBatchFrequency;
+import fr.ifremer.tutti.persistence.entities.protocol.TuttiProtocol;
import fr.ifremer.tutti.persistence.entities.referential.BeaufortScale;
import fr.ifremer.tutti.persistence.entities.referential.Country;
import fr.ifremer.tutti.persistence.entities.referential.Gear;
@@ -85,6 +86,10 @@
public void close() throws IOException {
}
+ //------------------------------------------------------------------------//
+ //-- Referential methods --//
+ //------------------------------------------------------------------------//
+
@Override
public List<SortedUnsortedCategory> getAllSortedUnsortedCategory() {
return null;
@@ -150,6 +155,10 @@
return null;
}
+ //------------------------------------------------------------------------//
+ //-- Program methods --//
+ //------------------------------------------------------------------------//
+
@Override
public List<Program> getAllProgram() {
return null;
@@ -170,6 +179,10 @@
return null;
}
+ //------------------------------------------------------------------------//
+ //-- Cruise methods --//
+ //------------------------------------------------------------------------//
+
@Override
public List<Cruise> getAllCruise(String programId) {
return null;
@@ -190,7 +203,35 @@
return null;
}
+ //------------------------------------------------------------------------//
+ //-- Protocol methods --//
+ //------------------------------------------------------------------------//
+
@Override
+ public List<TuttiProtocol> getAllProtocol() {
+ return null;
+ }
+
+ @Override
+ public TuttiProtocol getProtocol(String id) {
+ return null;
+ }
+
+ @Override
+ public TuttiProtocol createProtocol(TuttiProtocol bean) {
+ return null;
+ }
+
+ @Override
+ public TuttiProtocol saveProtocol(TuttiProtocol bean) {
+ return null;
+ }
+
+ //------------------------------------------------------------------------//
+ //-- Fishing operation methods --//
+ //------------------------------------------------------------------------//
+
+ @Override
public List<FishingOperation> getAllFishingOperation(String cruiseId) {
return null;
}
@@ -210,6 +251,10 @@
return null;
}
+ //------------------------------------------------------------------------//
+ //-- Species Batch methods --//
+ //------------------------------------------------------------------------//
+
@Override
public List<SpeciesBatch> getAllSpeciesBatch(String fishingOperationId) {
return null;
@@ -244,6 +289,10 @@
return null;
}
+ //------------------------------------------------------------------------//
+ //-- Benthos Batch methods --//
+ //------------------------------------------------------------------------//
+
@Override
public List<BenthosBatch> getAllBenthosBatch(String fishingOperationId) {
return null;
@@ -268,6 +317,10 @@
public void deleteBenthosBatch(String id) {
}
+ //------------------------------------------------------------------------//
+ //-- Plancton Batch methods --//
+ //------------------------------------------------------------------------//
+
@Override
public List<PlanktonBatch> getAllPlanktonBatch(String fishingOperationId) {
return null;
@@ -292,6 +345,10 @@
public void deletePlanktonBatch(String id) {
}
+ //------------------------------------------------------------------------//
+ //-- Macrodechet Batch methods --//
+ //------------------------------------------------------------------------//
+
@Override
public List<MacroWasteBatch> getAllMacroWasteBatch(String fishingOperationId) {
return null;
@@ -316,6 +373,10 @@
public void deleteMacroWasteBatch(String id) {
}
+ //------------------------------------------------------------------------//
+ //-- Accidental Batch methods --//
+ //------------------------------------------------------------------------//
+
@Override
public List<AccidentalBatch> getAllAccidentalBatch(String fishingOperationId) {
return null;
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-12-18 13:07:34 UTC (rev 87)
+++ trunk/tutti-persistence-dev/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceDevImpl.java 2012-12-18 19:13:34 UTC (rev 88)
@@ -45,6 +45,7 @@
import fr.ifremer.tutti.persistence.entities.data.Program;
import fr.ifremer.tutti.persistence.entities.data.SpeciesBatch;
import fr.ifremer.tutti.persistence.entities.data.SpeciesBatchFrequency;
+import fr.ifremer.tutti.persistence.entities.protocol.TuttiProtocol;
import fr.ifremer.tutti.persistence.entities.referential.BeaufortScale;
import fr.ifremer.tutti.persistence.entities.referential.Country;
import fr.ifremer.tutti.persistence.entities.referential.Gear;
@@ -316,6 +317,35 @@
}
//------------------------------------------------------------------------//
+ //-- Protocol methods --//
+ //------------------------------------------------------------------------//
+
+ @Override
+ public List<TuttiProtocol> getAllProtocol() {
+ List<TuttiProtocol> result = getDataInNewList(TuttiProtocol.class);
+ return result;
+ }
+
+ @Override
+ public TuttiProtocol getProtocol(String id) {
+ TuttiProtocol result = getBean(TuttiProtocol.class, id);
+ return result;
+ }
+
+ @Override
+ public TuttiProtocol createProtocol(TuttiProtocol bean) {
+ TuttiProtocol result = create(TuttiProtocol.class, bean);
+ return result;
+ }
+
+ @Override
+ public TuttiProtocol saveProtocol(TuttiProtocol bean) {
+ TuttiProtocol result = save(TuttiProtocol.class, bean);
+ return result;
+ }
+
+
+ //------------------------------------------------------------------------//
//-- FishingOperation methods --//
//------------------------------------------------------------------------//
@@ -511,7 +541,7 @@
}
//------------------------------------------------------------------------//
- //-- Accidentel Batch methods --//
+ //-- Accidental Batch methods --//
//------------------------------------------------------------------------//
@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-12-18 13:07:34 UTC (rev 87)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/DecoratorService.java 2012-12-18 19:13:34 UTC (rev 88)
@@ -28,6 +28,7 @@
import fr.ifremer.tutti.persistence.entities.data.Cruise;
import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
import fr.ifremer.tutti.persistence.entities.data.Program;
+import fr.ifremer.tutti.persistence.entities.protocol.TuttiProtocol;
import fr.ifremer.tutti.persistence.entities.referential.BeaufortScale;
import fr.ifremer.tutti.persistence.entities.referential.Country;
import fr.ifremer.tutti.persistence.entities.referential.Gear;
@@ -91,6 +92,7 @@
registerMultiJXPathDecorator(Program.class, "${name}$s", SEPARATOR, " - ");
registerMultiJXPathDecorator(Cruise.class, "${name}$s", SEPARATOR, " - ");
+ registerMultiJXPathDecorator(TuttiProtocol.class, "${name}$s", SEPARATOR, " - ");
registerMultiJXPathDecorator(FishingOperation.class, "${stationNumber}$s#${fishingOperationNumber}$s#${date}$td/%3$tm/%3$tY", SEPARATOR, " - ");
registerMultiJXPathDecorator(Zone.class, "${name}$s", SEPARATOR, " - ");
registerMultiJXPathDecorator(Vessel.class, "${name}$s", SEPARATOR, " - ");
@@ -114,6 +116,7 @@
}
static {
+ n_("tutti.property.protocol");
n_("tutti.property.name");
n_("tutti.property.firstName");
n_("tutti.property.lastName");
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-12-18 13:07:34 UTC (rev 87)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java 2012-12-18 19:13:34 UTC (rev 88)
@@ -35,6 +35,7 @@
import fr.ifremer.tutti.persistence.entities.data.Program;
import fr.ifremer.tutti.persistence.entities.data.SpeciesBatch;
import fr.ifremer.tutti.persistence.entities.data.SpeciesBatchFrequency;
+import fr.ifremer.tutti.persistence.entities.protocol.TuttiProtocol;
import fr.ifremer.tutti.persistence.entities.referential.BeaufortScale;
import fr.ifremer.tutti.persistence.entities.referential.Country;
import fr.ifremer.tutti.persistence.entities.referential.Gear;
@@ -241,7 +242,7 @@
}
//------------------------------------------------------------------------//
- //-- Cruise methods --//
+ //-- Cruise methods --//
//------------------------------------------------------------------------//
@Override
@@ -269,6 +270,35 @@
}
//------------------------------------------------------------------------//
+ //-- Protocol methods --//
+ //------------------------------------------------------------------------//
+
+ @Override
+ public List<TuttiProtocol> getAllProtocol() {
+ checkDriverExists();
+ return driver.getAllProtocol();
+ }
+
+ @Override
+ public TuttiProtocol getProtocol(String id) {
+ checkDriverExists();
+ return driver.getProtocol(id);
+ }
+
+ @Override
+ public TuttiProtocol createProtocol(TuttiProtocol bean) {
+ checkDriverExists();
+ return driver.createProtocol(bean);
+ }
+
+ @Override
+ public TuttiProtocol saveProtocol(TuttiProtocol bean) {
+ checkDriverExists();
+ return driver.saveProtocol(bean);
+ }
+
+
+ //------------------------------------------------------------------------//
//-- FishingOperation methods --//
//------------------------------------------------------------------------//
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-12-18 13:07:34 UTC (rev 87)
+++ trunk/tutti-service/src/main/resources/i18n/tutti-service_fr_FR.properties 2012-12-18 19:13:34 UTC (rev 88)
@@ -9,6 +9,7 @@
tutti.property.country=Pays
tutti.property.cruise=Campagne
tutti.property.date=Date
+tutti.property.protocol=Protocol de saisie
tutti.property.firstName=Prénom
tutti.property.fishingOperation=Trait
tutti.property.gear=Engin
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-12-18 13:07:34 UTC (rev 87)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/MainUI.css 2012-12-18 19:13:34 UTC (rev 88)
@@ -57,7 +57,7 @@
text: "tutti.action.manageProtocol";
toolTipText: "tutti.action.manageProtocol.tip";
mnemonic: P;
- enabled: {model.getScreen() != TuttiScreen.EDIT_PROTOCOL};
+ enabled: {model.getScreen() != TuttiScreen.EDIT_PROTOCOL && model.getProtocolId() != null};
/*actionIcon: "protocol";*/
}
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-12-18 13:07:34 UTC (rev 87)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/MainUIHandler.java 2012-12-18 19:13:34 UTC (rev 88)
@@ -26,6 +26,7 @@
import fr.ifremer.tutti.persistence.entities.data.Cruise;
import fr.ifremer.tutti.persistence.entities.data.Program;
+import fr.ifremer.tutti.persistence.entities.protocol.TuttiProtocol;
import fr.ifremer.tutti.service.PersistenceService;
import fr.ifremer.tutti.service.config.TuttiServiceConfigOption;
import fr.ifremer.tutti.ui.swing.config.TuttiConfig;
@@ -34,6 +35,7 @@
import fr.ifremer.tutti.ui.swing.content.home.SelectCruiseUI;
import fr.ifremer.tutti.ui.swing.content.operation.FishingOperationsUI;
import fr.ifremer.tutti.ui.swing.content.program.EditProgramUI;
+import fr.ifremer.tutti.ui.swing.protocol.EditProtocolUI;
import fr.ifremer.tutti.ui.swing.util.TuttiUIUtil;
import jaxx.runtime.SwingUtil;
import jaxx.runtime.swing.AboutPanel;
@@ -319,8 +321,9 @@
closeCurrentBody();
- String surveyId = context.getProgramId();
- String campaignId = context.getCruiseId();
+ String programId = context.getProgramId();
+ String cruiseId = context.getCruiseId();
+ String protocolId = context.getProtocolId();
JComponent screenUI;
String screenTitle;
@@ -335,7 +338,7 @@
case EDIT_PROGRAM:
- if (surveyId == null) {
+ if (programId == null) {
screenTitle = _("tutti.title.create.program");
} else {
screenTitle = _("tutti.title.edit.program");
@@ -346,7 +349,7 @@
case EDIT_CRUISE:
- if (campaignId == null) {
+ if (cruiseId == null) {
screenTitle = _("tutti.title.create.cruise");
} else {
screenTitle = _("tutti.title.edit.cruise");
@@ -355,6 +358,17 @@
screenUI = new EditCruiseUI(context);
break;
+ case EDIT_PROTOCOL:
+
+ if (protocolId == null) {
+ screenTitle = _("tutti.title.create.protocol");
+ } else {
+ screenTitle = _("tutti.title.edit.protocol");
+ }
+
+ screenUI = new EditProtocolUI(context);
+ break;
+
case EDIT_FISHING_OPERATION:
screenTitle = _("tutti.title.edit.operations", getSelectedCruiseTitle());
@@ -438,11 +452,11 @@
protected String getSelectedCruiseTitle() {
- String surveyId = context.getProgramId();
+ String programId = context.getProgramId();
String title;
- if (surveyId == null) {
+ if (programId == null) {
// no program selected (so neither cruise)
@@ -452,27 +466,47 @@
// selected program
- Program program = persistenceService.getProgram(surveyId);
+ Program program = persistenceService.getProgram(programId);
title = _("tutti.title.selectedProgram", program.getName()) + " / ";
- String campaignId = context.getCruiseId();
+ String cruiseId = context.getCruiseId();
- if (campaignId == null) {
+ if (cruiseId == null) {
// no selected cruise
title += _("tutti.title.noSelectedCruise");
-
} else {
// selected cruise
Cruise cruise;
- cruise = persistenceService.getCruise(campaignId);
+ cruise = persistenceService.getCruise(cruiseId);
title += _("tutti.title.selectedCruise", cruise.getName());
}
+
+ title += " / ";
+
+ String protocolId = context.getProtocolId();
+
+ if (protocolId == null) {
+
+ // no selected protocol
+
+ title += _("tutti.title.noSelectedProtocol");
+
+
+ } else {
+
+ // selected protocol
+ TuttiProtocol protocol = persistenceService.getProtocol(protocolId);
+
+ title += _("tutti.title.selectedProtocol", protocol.getName());
+ }
+
+
}
return title;
}
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-12-18 13:07:34 UTC (rev 87)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiUIContext.java 2012-12-18 19:13:34 UTC (rev 88)
@@ -59,6 +59,8 @@
public static final String PROPERTY_CRUISE_ID = "cruiseId";
+ public static final String PROPERTY_PROTOCOL_ID = "protocolId";
+
public static final String PROPERTY_SCREEN = "screen";
public static final String PROPERTY_CRUISE_CONTEXT_FILLED = "cruiseContextFilled";
@@ -106,6 +108,13 @@
protected String cruiseId;
/**
+ * Id of last selected protocol (can be null if none ever selected).
+ *
+ * @since 0.1
+ */
+ protected String protocolId;
+
+ /**
* Current screen displayed in ui.
*
* @since 0.1
@@ -146,6 +155,10 @@
return cruiseId;
}
+ public String getProtocolId() {
+ return protocolId;
+ }
+
public boolean isCruiseContextFilled() {
return StringUtils.isNotBlank(programId) &&
StringUtils.isNotBlank(cruiseId);
@@ -177,6 +190,15 @@
oldValue, isCruiseContextFilled());
}
+ public void setProtocolId(String protocolId) {
+
+ this.protocolId = protocolId;
+
+ // always propagate the change
+ firePropertyChange(PROPERTY_PROTOCOL_ID, null, protocolId);
+
+ }
+
public void setScreen(TuttiScreen screen) {
Object oldValue = getScreen();
this.screen = screen;
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-12-18 13:07:34 UTC (rev 87)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/config/TuttiConfig.java 2012-12-18 19:13:34 UTC (rev 88)
@@ -89,7 +89,6 @@
} catch (IOException e) {
throw Throwables.propagate(e);
}
-
}
public ApplicationConfig getApplicationConfig() {
@@ -130,6 +129,11 @@
return applicationConfig.getOption(TuttiConfigOption.CRUISE_ID.getKey());
}
+ public String getProtocolId() {
+ return applicationConfig.getOption(TuttiConfigOption.PROTOCOL_ID.getKey());
+ }
+
+
public KeyStroke getShortCut(String actionName) {
KeyStroke result = applicationConfig.getOptionAsKeyStroke(
"tutti.ui." + actionName);
@@ -170,7 +174,6 @@
applicationConfig.setOption(TuttiConfigOption.PROGRAM_ID.getKey(), programId);
}
-
}
public void setCruiseId(String cruiseId) {
@@ -182,4 +185,14 @@
applicationConfig.setOption(TuttiConfigOption.CRUISE_ID.getKey(), cruiseId);
}
}
+
+ public void setProtocolId(String protocolId) {
+ if (protocolId == null) {
+ Properties options = applicationConfig.getOptions();
+ options.remove(TuttiConfigOption.PROTOCOL_ID.getKey());
+ applicationConfig.setOptions(options);
+ } else {
+ applicationConfig.setOption(TuttiConfigOption.PROTOCOL_ID.getKey(), protocolId);
+ }
+ }
}
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-12-18 13:07:34 UTC (rev 87)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/config/TuttiConfigOption.java 2012-12-18 19:13:34 UTC (rev 88)
@@ -53,6 +53,11 @@
null,
String.class
),
+ PROTOCOL_ID("tutti.protocolId",
+ n_("tutti.config.protocolId"),
+ null,
+ String.class
+ ),
// UI CONFIG (should be moved to ui module)
AUTO_POPUP_NUMBER_EDITOR("tutti.ui.autoPopupNumberEditor",
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUI.css 2012-12-18 13:07:34 UTC (rev 87)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUI.css 2012-12-18 19:13:34 UTC (rev 88)
@@ -182,7 +182,7 @@
enabled: {model.isCanGenerateName()};
}
#messagePanel {
- border: {BorderFactory.createTitledBorder("Messages")};
+ border: {BorderFactory.createTitledBorder(_("tutti.title.messages"))};
height: 200;
width: 500;
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUIHandler.java 2012-12-18 13:07:34 UTC (rev 87)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUIHandler.java 2012-12-18 19:13:34 UTC (rev 88)
@@ -25,8 +25,8 @@
*/
import fr.ifremer.tutti.persistence.entities.TuttiEntities;
+import fr.ifremer.tutti.persistence.entities.data.Cruise;
import fr.ifremer.tutti.persistence.entities.data.Program;
-import fr.ifremer.tutti.persistence.entities.data.Cruise;
import fr.ifremer.tutti.persistence.entities.referential.Person;
import fr.ifremer.tutti.service.PersistenceService;
import fr.ifremer.tutti.ui.swing.AbstractTuttiUIHandler;
@@ -35,6 +35,8 @@
import jaxx.runtime.validator.swing.SwingValidatorMessageTableRenderer;
import jaxx.runtime.validator.swing.SwingValidatorUtil;
import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import java.util.List;
@@ -46,8 +48,21 @@
*/
public class EditCruiseUIHandler extends AbstractTuttiUIHandler<EditCruiseUIModel> {
+ /** Logger. */
+ private static final Log log = LogFactory.getLog(EditCruiseUIHandler.class);
+
+ /**
+ * UI.
+ *
+ * @since 0.1
+ */
private final EditCruiseUI ui;
+ /**
+ * Persistence service.
+ *
+ * @since 0.1
+ */
private final PersistenceService persistenceService;
public EditCruiseUIHandler(TuttiUIContext context, EditCruiseUI ui) {
@@ -61,21 +76,28 @@
EditCruiseUIModel model = new EditCruiseUIModel();
- String campaignId = context.getCruiseId();
- if (campaignId == null) {
+ String cruiseId = context.getCruiseId();
+ if (cruiseId == null) {
// create new cruise
Program program =
persistenceService.getProgram(context.getProgramId());
model.setProgram(program);
model.setPoche(1);
+
+ if (log.isDebugEnabled()) {
+ log.debug("Will create a new cruise from program: " + program);
+ }
} else {
// load existing program
Cruise cruise =
- persistenceService.getCruise(campaignId);
+ persistenceService.getCruise(cruiseId);
model.fromBean(cruise);
+ if (log.isDebugEnabled()) {
+ log.debug("Will edit cruise: " + cruiseId);
+ }
}
listModelIsModify(model);
ui.setContextValue(model);
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/home/SelectCruiseUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/home/SelectCruiseUI.css 2012-12-18 13:07:34 UTC (rev 87)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/home/SelectCruiseUI.css 2012-12-18 19:13:34 UTC (rev 88)
@@ -71,6 +71,28 @@
text: "tutti.action.new";
}
+#protocolLabel {
+ text: "tutti.label.protocol";
+ labelFor: {protocolCombobox};
+}
+
+#protocolCombobox {
+ property: "protocol";
+ selectedItem: {model.getProtocol()};
+}
+
+#editProtocolButton {
+ enabled: {model.isProtocolFound()};
+ text: "tutti.action.edit";
+ actionIcon: "edit";
+}
+
+#newProtocolButton {
+ actionIcon: "add";
+ enabled: true;
+ text: "tutti.action.new";
+}
+
#showFishingOperationsButton {
text: "tutti.action.catches";
enabled: {uiContext.isCruiseContextFilled()};
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/home/SelectCruiseUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/home/SelectCruiseUI.jaxx 2012-12-18 13:07:34 UTC (rev 87)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/home/SelectCruiseUI.jaxx 2012-12-18 19:13:34 UTC (rev 88)
@@ -27,6 +27,7 @@
<import>
fr.ifremer.tutti.persistence.entities.data.Program
fr.ifremer.tutti.persistence.entities.data.Cruise
+ fr.ifremer.tutti.persistence.entities.protocol.TuttiProtocol
fr.ifremer.tutti.ui.swing.TuttiUIContext
jaxx.runtime.swing.editor.bean.BeanComboBox
@@ -93,6 +94,23 @@
</cell>
</row>
<row>
+ <cell>
+ <JLabel id='protocolLabel'/>
+ </cell>
+ <cell>
+ <BeanComboBox id='protocolCombobox' constructorParams='this'
+ genericType='TuttiProtocol'/>
+ </cell>
+ <cell>
+ <JPanel layout='{new GridLayout(1,0)}'>
+ <JButton id='editProtocolButton'
+ onActionPerformed='handler.showSelectedProtocol()'/>
+ <JButton id='newProtocolButton'
+ onActionPerformed='handler.showNewProtocol()'/>
+ </JPanel>
+ </cell>
+ </row>
+ <row>
<cell columns='3'>
<JButton id='showFishingOperationsButton'
onActionPerformed='handler.showFishingOperations()'/>
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/home/SelectCruiseUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/home/SelectCruiseUIHandler.java 2012-12-18 13:07:34 UTC (rev 87)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/home/SelectCruiseUIHandler.java 2012-12-18 19:13:34 UTC (rev 88)
@@ -26,8 +26,9 @@
import com.google.common.collect.Lists;
import fr.ifremer.tutti.persistence.entities.TuttiEntities;
+import fr.ifremer.tutti.persistence.entities.data.Cruise;
import fr.ifremer.tutti.persistence.entities.data.Program;
-import fr.ifremer.tutti.persistence.entities.data.Cruise;
+import fr.ifremer.tutti.persistence.entities.protocol.TuttiProtocol;
import fr.ifremer.tutti.service.PersistenceService;
import fr.ifremer.tutti.ui.swing.AbstractTuttiUIHandler;
import fr.ifremer.tutti.ui.swing.TuttiScreen;
@@ -72,11 +73,10 @@
public void beforeInitUI() {
SelectCruiseUIModel model = new SelectCruiseUIModel();
- List<Program> allPrograms = persistenceService.getAllProgram();
+ List<Program> programs = persistenceService.getAllProgram();
+ model.setPrograms(programs);
- model.setPrograms(allPrograms);
-
- if (allPrograms.isEmpty()) {
+ if (programs.isEmpty()) {
// do nothing
if (log.isDebugEnabled()) {
@@ -88,29 +88,48 @@
String programId = context.getProgramId();
Program selectedProgram = null;
- List<Cruise> allCruises = null;
+ List<Cruise> cruises = null;
if (programId != null) {
- selectedProgram = TuttiEntities.findById(allPrograms, programId);
- allCruises = persistenceService.getAllCruise(programId);
+ selectedProgram = TuttiEntities.findById(programs, programId);
+ cruises = persistenceService.getAllCruise(programId);
}
model.setProgram(selectedProgram);
- model.setCruises(allCruises);
+ model.setCruises(cruises);
- if (CollectionUtils.isEmpty(allCruises)) {
+ if (CollectionUtils.isEmpty(cruises)) {
// nothing to select
} else {
String cruiseId = context.getCruiseId();
- Cruise selectedCampaign = null;
+ Cruise selectedCruise = null;
if (cruiseId != null) {
- selectedCampaign =
- TuttiEntities.findById(allCruises, cruiseId);
+ selectedCruise =
+ TuttiEntities.findById(cruises, cruiseId);
}
- model.setCruise(selectedCampaign);
+ model.setCruise(selectedCruise);
}
}
+
+ List<TuttiProtocol> protocols = persistenceService.getAllProtocol();
+ model.setProtocols(protocols);
+
+ if (protocols.isEmpty()) {
+ // do nothing
+
+ if (log.isDebugEnabled()) {
+ log.debug("No protocol found.");
+ }
+ } else {
+
+ String protocolId = context.getProtocolId();
+ TuttiProtocol selectedProtocol = null;
+ if (protocolId != null) {
+ selectedProtocol = TuttiEntities.findById(protocols, protocolId);
+ }
+ model.setProtocol(selectedProtocol);
+ }
ui.setContextValue(model);
}
@@ -127,6 +146,10 @@
model.getCruises(),
model.getCruise());
+ initBeanComboBox(ui.getProtocolCombobox(),
+ model.getProtocols(),
+ model.getProtocol());
+
model.addPropertyChangeListener(SelectCruiseUIModel.PROPERTY_PROGRAM, new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
@@ -163,6 +186,14 @@
context.setCruiseId(newValue == null ? null : newValue.getId());
}
});
+
+ model.addPropertyChangeListener(SelectCruiseUIModel.PROPERTY_PROTOCOL, new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ TuttiProtocol newValue = (TuttiProtocol) evt.getNewValue();
+ context.setProtocolId(newValue == null ? null : newValue.getId());
+ }
+ });
}
@Override
@@ -201,4 +232,15 @@
context.setCruiseId(null);
context.setScreen(TuttiScreen.EDIT_CRUISE);
}
+
+ public void showSelectedProtocol() {
+ TuttiProtocol protocol = getModel().getProtocol();
+ context.setProtocolId(protocol.getId());
+ context.setScreen(TuttiScreen.EDIT_PROTOCOL);
+ }
+
+ public void showNewProtocol() {
+ context.setProtocolId(null);
+ context.setScreen(TuttiScreen.EDIT_PROTOCOL);
+ }
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/home/SelectCruiseUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/home/SelectCruiseUIModel.java 2012-12-18 13:07:34 UTC (rev 87)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/home/SelectCruiseUIModel.java 2012-12-18 19:13:34 UTC (rev 88)
@@ -26,6 +26,7 @@
import fr.ifremer.tutti.persistence.entities.data.Cruise;
import fr.ifremer.tutti.persistence.entities.data.Program;
+import fr.ifremer.tutti.persistence.entities.protocol.TuttiProtocol;
import org.jdesktop.beans.AbstractSerializableBean;
import java.util.List;
@@ -48,10 +49,16 @@
public static final String PROPERTY_CRUISE = "cruise";
+ public static final String PROPERTY_PROTOCOLS = "protocols";
+
+ public static final String PROPERTY_PROTOCOL = "protocol";
+
public static final String PROPERTY_PROGRAM_FOUND = "programFound";
public static final String PROPERTY_CRUISE_FOUND = "cruiseFound";
+ public static final String PROPERTY_PROTOCOL_FOUND = "protocolFound";
+
protected List<Program> programs;
protected Program program;
@@ -60,6 +67,10 @@
protected Cruise cruise;
+ protected List<TuttiProtocol> protocols;
+
+ protected TuttiProtocol protocol;
+
public List<Program> getPrograms() {
return programs;
}
@@ -67,9 +78,6 @@
public void setPrograms(List<Program> programs) {
Object oldValue = getPrograms();
this.programs = programs;
-
- // nullify program
-// setProgram(null);
firePropertyChange(PROPERTY_PROGRAMS, oldValue, programs);
}
@@ -80,10 +88,6 @@
public void setProgram(Program program) {
Program oldValue = getProgram();
this.program = program;
-
- // nullify cruises
-// setCruises(null);
-
firePropertyChange(PROPERTY_PROGRAM, oldValue, program);
firePropertyChange(PROPERTY_PROGRAM_FOUND, oldValue != null, program != null);
}
@@ -99,9 +103,6 @@
public void setCruises(List<Cruise> cruises) {
Object oldValue = getCruises();
this.cruises = cruises;
-
- // nullify cruise
-// setCruise(null);
firePropertyChange(PROPERTY_CRUISES, oldValue, cruises);
}
@@ -120,4 +121,29 @@
return cruise != null;
}
+ public List<TuttiProtocol> getProtocols() {
+ return protocols;
+ }
+
+ public void setProtocols(List<TuttiProtocol> protocols) {
+ Object oldValue = getProtocols();
+ this.protocols = protocols;
+ firePropertyChange(PROPERTY_PROTOCOLS, oldValue, protocols);
+ }
+
+ public TuttiProtocol getProtocol() {
+ return protocol;
+ }
+
+ public void setProtocol(TuttiProtocol protocol) {
+ Object oldValue = getProtocol();
+ this.protocol = protocol;
+ firePropertyChange(PROPERTY_PROTOCOL, oldValue, protocol);
+ firePropertyChange(PROPERTY_PROTOCOL_FOUND, oldValue != null, protocol != null);
+ }
+
+ public boolean isProtocolFound() {
+ return protocol != null;
+ }
+
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentRowModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentRowModel.java 2012-12-18 13:07:34 UTC (rev 87)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentRowModel.java 2012-12-18 19:13:34 UTC (rev 88)
@@ -1,5 +1,29 @@
package fr.ifremer.tutti.ui.swing.content.operation.fishing;
+/*
+ * #%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.ui.swing.AbstractTuttiBeanUIModel;
import java.io.Serializable;
import org.nuiton.util.beans.Binder;
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentRowModel.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTabUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTabUI.css 2012-12-18 13:07:34 UTC (rev 87)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTabUI.css 2012-12-18 19:13:34 UTC (rev 88)
@@ -1,3 +1,26 @@
+/*
+ * #%L
+ * Tutti :: UI
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
#environmentTable {
selectionMode: {ListSelectionModel.SINGLE_SELECTION};
selectionBackground: {null};
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTabUI.css
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTabUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTabUI.jaxx 2012-12-18 13:07:34 UTC (rev 87)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTabUI.jaxx 2012-12-18 19:13:34 UTC (rev 88)
@@ -1,3 +1,26 @@
+<!--
+ #%L
+ Tutti :: UI
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2012 Ifremer
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public
+ License along with this program. If not, see
+ <http://www.gnu.org/licenses/gpl-3.0.html>.
+ #L%
+ -->
<Table implements='fr.ifremer.tutti.ui.swing.TuttiUI<EnvironmentTabUIModel, EnvironmentTabUIHandler>'>
<import>
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTabUI.jaxx
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTabUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTabUIHandler.java 2012-12-18 13:07:34 UTC (rev 87)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTabUIHandler.java 2012-12-18 19:13:34 UTC (rev 88)
@@ -1,5 +1,29 @@
package fr.ifremer.tutti.ui.swing.content.operation.fishing;
+/*
+ * #%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.ui.swing.content.operation.FishingOperationTabUI;
import fr.ifremer.tutti.ui.swing.util.table.AbstractTuttiTableModel;
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTabUIHandler.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTabUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTabUIModel.java 2012-12-18 13:07:34 UTC (rev 87)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTabUIModel.java 2012-12-18 19:13:34 UTC (rev 88)
@@ -1,5 +1,29 @@
package fr.ifremer.tutti.ui.swing.content.operation.fishing;
+/*
+ * #%L
+ * Tutti :: UI
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
import fr.ifremer.tutti.ui.swing.util.table.AbstractTuttiTableUIModel;
import org.nuiton.util.beans.Binder;
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTabUIModel.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTableModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTableModel.java 2012-12-18 13:07:34 UTC (rev 87)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTableModel.java 2012-12-18 19:13:34 UTC (rev 88)
@@ -1,5 +1,29 @@
package fr.ifremer.tutti.ui.swing.content.operation.fishing;
+/*
+ * #%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.ui.swing.util.table.AbstractTuttiTableModel;
import fr.ifremer.tutti.ui.swing.util.table.ColumnIdentifier;
import javax.swing.table.TableColumnModel;
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTableModel.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/program/EditProgramUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/program/EditProgramUI.css 2012-12-18 13:07:34 UTC (rev 87)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/program/EditProgramUI.css 2012-12-18 19:13:34 UTC (rev 88)
@@ -79,7 +79,7 @@
}
#messagePanel {
- border: {BorderFactory.createTitledBorder("Messages")};
+ border: {BorderFactory.createTitledBorder(_("tutti.title.messages"))};
height: 200;
width: 500;
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/program/EditProgramUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/program/EditProgramUIHandler.java 2012-12-18 13:07:34 UTC (rev 87)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/program/EditProgramUIHandler.java 2012-12-18 19:13:34 UTC (rev 88)
@@ -47,8 +47,18 @@
private static final Log log =
LogFactory.getLog(EditProgramUIHandler.class);
+ /**
+ * UI.
+ *
+ * @since 0.1
+ */
private final EditProgramUI ui;
+ /**
+ * Persistence service.
+ *
+ * @since 0.1
+ */
private final PersistenceService persistenceService;
public EditProgramUIHandler(TuttiUIContext context, EditProgramUI ui) {
Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/protocol/EditProtocolUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/protocol/EditProtocolUI.css (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/protocol/EditProtocolUI.css 2012-12-18 19:13:34 UTC (rev 88)
@@ -0,0 +1,83 @@
+/*
+ * #%L
+ * Tutti :: UI
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+BeanComboBox {
+ showReset: true;
+ i18nPrefix: "tutti.property.";
+ bean: {model};
+}
+
+#splitPane {
+ orientation: {JSplitPane.VERTICAL_SPLIT};
+ resizeWeight: 0.3;
+ oneTouchExpandable: true;
+ continuousLayout: true;
+}
+
+#form {
+ border: {BorderFactory.createTitledBorder((String)null)};
+}
+
+#nameLabel {
+ text: "tutti.label.program.name";
+ labelFor: {nameField};
+}
+
+#nameField {
+ text: {model.getName()};
+}
+
+#commentPane {
+ columnHeaderView: {new JLabel(_("tutti.label.comment"))};
+ minimumSize: {new Dimension(10,50)};
+}
+
+#commentField {
+ text: {getStringValue(model.getComment())};
+}
+
+#saveButton {
+ text: "tutti.action.save";
+ enabled: {model.isModify() && model.isValid()};
+ actionIcon: "save";
+}
+
+#cancelButton {
+ text: "tutti.action.cancel";
+ actionIcon: "cancel";
+}
+
+#messagePanel {
+ border: {BorderFactory.createTitledBorder(_("tutti.title.messages"))};
+ height: 200;
+ width: 500;
+}
+
+#errorTable {
+ rowSelectionAllowed: true;
+ autoCreateRowSorter: true;
+ autoResizeMode: 2;
+ cellSelectionEnabled: false;
+ selectionMode: 0;
+ model: {errorTableModel};
+}
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/protocol/EditProtocolUI.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/protocol/EditProtocolUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/protocol/EditProtocolUI.jaxx (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/protocol/EditProtocolUI.jaxx 2012-12-18 19:13:34 UTC (rev 88)
@@ -0,0 +1,113 @@
+<!--
+ #%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<EditProtocolUIModel, EditProtocolUIHandler>'>
+
+ <import>
+ fr.ifremer.tutti.persistence.entities.referential.Zone
+ fr.ifremer.tutti.ui.swing.TuttiUIContext
+
+ jaxx.runtime.swing.editor.bean.BeanComboBox
+ jaxx.runtime.validator.swing.SwingValidatorUtil
+ jaxx.runtime.validator.swing.SwingValidatorMessageTableModel
+
+ java.awt.Dimension
+
+ static org.nuiton.i18n.I18n._
+ static jaxx.runtime.SwingUtil.getStringValue
+
+ </import>
+
+ <script><![CDATA[
+
+ public EditProtocolUI(TuttiUIContext context) {
+ EditProtocolUIHandler handler = new EditProtocolUIHandler(context, this);
+ setContextValue(handler);
+ handler.beforeInitUI();
+ }
+
+ protected void $afterCompleteSetup() {
+ handler.afterInitUI();
+ }
+ ]]></script>
+
+ <EditProtocolUIHandler id='handler'
+ initializer='getContextValue(EditProtocolUIHandler.class)'/>
+
+ <EditProtocolUIModel id='model'
+ initializer='getContextValue(EditProtocolUIModel.class)'/>
+
+ <SwingValidatorMessageTableModel id='errorTableModel'/>
+
+ <BeanValidator id='validator' bean='model' errorTableModel='errorTableModel'
+ uiClass='jaxx.runtime.validator.swing.ui.ImageValidationUI'>
+ <field name='name' component='nameField'/>
+ <field name='comment' component='commentField'/>
+ </BeanValidator>
+
+ <JSplitPane id='splitPane' constraints='BorderLayout.CENTER'>
+
+ <Table id='form' fill='both'>
+
+ <!-- protocol name -->
+ <row>
+ <cell anchor='west'>
+ <JLabel id='nameLabel'/>
+ </cell>
+ <cell weightx='1.0'>
+ <JTextField id='nameField'
+ onKeyReleased='handler.setText(event, "name")'/>
+ </cell>
+ </row>
+
+ <!-- program comment -->
+ <row weighty='0.8'>
+ <cell columns='2'>
+ <JScrollPane id='commentPane'
+ onFocusGained='commentField.requestFocus()'>
+ <JTextArea id='commentField'
+ onKeyReleased='handler.setText(event, "comment")'/>
+ </JScrollPane>
+ </cell>
+ </row>
+
+ <!-- actions -->
+ <row anchor='south'>
+ <cell columns='2'>
+ <JPanel layout='{new GridLayout(1, 0)}'>
+ <JButton id='cancelButton' onActionPerformed='handler.cancel()'/>
+ <JButton id='saveButton' onActionPerformed='handler.save()'/>
+ </JPanel>
+ </cell>
+ </row>
+ </Table>
+
+ <!-- validation messages -->
+ <JPanel id='messagePanel' layout='{new GridLayout()}'>
+ <JScrollPane columnHeaderView='{errorTable.getTableHeader()}'>
+ <JTable id='errorTable' />
+ </JScrollPane>
+ </JPanel>
+ </JSplitPane>
+</JPanel>
\ No newline at end of file
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/protocol/EditProtocolUI.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/protocol/EditProtocolUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/protocol/EditProtocolUIHandler.java (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/protocol/EditProtocolUIHandler.java 2012-12-18 19:13:34 UTC (rev 88)
@@ -0,0 +1,146 @@
+package fr.ifremer.tutti.ui.swing.protocol;
+
+/*
+ * #%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.TuttiEntities;
+import fr.ifremer.tutti.persistence.entities.protocol.TuttiProtocol;
+import fr.ifremer.tutti.service.PersistenceService;
+import fr.ifremer.tutti.ui.swing.AbstractTuttiUIHandler;
+import fr.ifremer.tutti.ui.swing.TuttiScreen;
+import fr.ifremer.tutti.ui.swing.TuttiUIContext;
+import jaxx.runtime.validator.swing.SwingValidatorMessageTableRenderer;
+import jaxx.runtime.validator.swing.SwingValidatorUtil;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * TODO
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+public class EditProtocolUIHandler extends AbstractTuttiUIHandler<EditProtocolUIModel> {
+
+ /** Logger. */
+ private static final Log log =
+ LogFactory.getLog(EditProtocolUIHandler.class);
+
+ /**
+ * UI.
+ *
+ * @since 0.3
+ */
+ private final EditProtocolUI ui;
+
+ /**
+ * Persistence service.
+ *
+ * @since 0.3
+ */
+ private final PersistenceService persistenceService;
+
+ public EditProtocolUIHandler(TuttiUIContext context, EditProtocolUI ui) {
+ super(context);
+ this.ui = ui;
+ persistenceService = context.getService(PersistenceService.class);
+ }
+
+ @Override
+ public void beforeInitUI() {
+
+ EditProtocolUIModel model = new EditProtocolUIModel();
+
+ String protocolId = context.getProtocolId();
+ if (protocolId == null) {
+
+ // create new protocol
+
+ if (log.isDebugEnabled()) {
+ log.debug("Will create a new protocol");
+ }
+ } else {
+
+ // load existing program
+ TuttiProtocol protocol =
+ persistenceService.getProtocol(protocolId);
+
+ model.fromBean(protocol);
+ if (log.isDebugEnabled()) {
+ log.debug("Will edit protocol: " + protocolId);
+ }
+ }
+ listModelIsModify(model);
+ ui.setContextValue(model);
+ }
+
+ @Override
+ public void afterInitUI() {
+
+ initUI(ui);
+
+ EditProtocolUIModel model = ui.getModel();
+
+ SwingValidatorUtil.installUI(ui.getErrorTable(),
+ new SwingValidatorMessageTableRenderer());
+
+ listenValidatorValid(ui.getValidator(), model);
+
+ // if new protocol can already cancel his creation
+ model.setModify(model.isCreate());
+ }
+
+ @Override
+ public void onCloseUI() {
+ }
+
+ @Override
+ protected EditProtocolUIModel getModel() {
+ return ui.getModel();
+ }
+
+ public void cancel() {
+
+ context.setScreen(TuttiScreen.SELECT_CRUISE);
+ }
+
+ public void save() {
+
+ EditProtocolUIModel model = ui.getModel();
+
+ TuttiProtocol bean = model.toBean();
+
+ TuttiProtocol saved;
+ if (TuttiEntities.isNew(bean)) {
+
+ saved = persistenceService.createProtocol(bean);
+ } else {
+ saved = persistenceService.saveProtocol(bean);
+ }
+
+ context.setProtocolId(saved.getId());
+
+ context.setScreen(TuttiScreen.SELECT_CRUISE);
+ }
+}
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/protocol/EditProtocolUIHandler.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/protocol/EditProtocolUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/protocol/EditProtocolUIModel.java (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/protocol/EditProtocolUIModel.java 2012-12-18 19:13:34 UTC (rev 88)
@@ -0,0 +1,80 @@
+package fr.ifremer.tutti.ui.swing.protocol;
+
+/*
+ * #%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.protocol.TuttiProtocol;
+import fr.ifremer.tutti.ui.swing.AbstractTuttiBeanUIModel;
+import org.nuiton.util.beans.Binder;
+import org.nuiton.util.beans.BinderFactory;
+
+/**
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+public class EditProtocolUIModel extends AbstractTuttiBeanUIModel<TuttiProtocol, EditProtocolUIModel> {
+
+ private static final long serialVersionUID = 1L;
+
+ public static final String PROPERTY_COMMENT = "comment";
+
+ public static final String PROPERTY_NAME = "name";
+
+ protected String name;
+
+ protected String comment;
+
+ protected static Binder<EditProtocolUIModel, TuttiProtocol> toBeanBinder =
+ BinderFactory.newBinder(EditProtocolUIModel.class,
+ TuttiProtocol.class);
+
+ protected static Binder<TuttiProtocol, EditProtocolUIModel> fromBeanBinder =
+ BinderFactory.newBinder(TuttiProtocol.class, EditProtocolUIModel.class);
+
+
+ public EditProtocolUIModel() {
+ super(TuttiProtocol.class, fromBeanBinder, toBeanBinder);
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ Object oldValue = getName();
+ this.name = name;
+ firePropertyChange(PROPERTY_NAME, oldValue, name);
+ }
+
+ public String getComment() {
+ return comment;
+ }
+
+ public void setComment(String comment) {
+ Object oldValue = getComment();
+ this.comment = comment;
+ firePropertyChange(PROPERTY_COMMENT, oldValue, comment);
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/protocol/EditProtocolUIModel.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-12-18 13:07:34 UTC (rev 87)
+++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2012-12-18 19:13:34 UTC (rev 88)
@@ -38,6 +38,7 @@
tutti.config.category.shortcuts.description=Liste des raccourcis clavier
tutti.config.cruiseId=Identifiant de la dernière campagne utilisée
tutti.config.programId=Identifiant de la dernière série de campagne utilisée
+tutti.config.protocolId=Identifiant du dernier protocole utilisé
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
@@ -117,6 +118,7 @@
tutti.label.program=Série de campagne
tutti.label.program.name=Nom
tutti.label.program.zone=Zone
+tutti.label.protocol=Protocol de saisie
tutti.label.species.sampleVracWeight=Poids total vrac échant.
tutti.label.species.totalHorsVracWeight=Poids total hors vrac
tutti.label.species.totalVracWeight=Poids total vrac
@@ -205,15 +207,20 @@
tutti.title.about=À propos de Tutti
tutti.title.create.cruise=Créer une nouvelle campagne
tutti.title.create.program=Créer une nouvelle série de campagne
-tutti.title.edit.cruise=Editer une campagne existante
+tutti.title.create.protocol=Créer un nouveau protocol de saisie
+tutti.title.edit.cruise=Éditer une campagne existante
tutti.title.edit.operations=Saisie des opérations de pêches (%s)
-tutti.title.edit.program=Editer une série de campagne existante
+tutti.title.edit.program=Éditer une série de campagne existante
+tutti.title.edit.protocol=Éditer un protocol de saisie existant
tutti.title.frequency=Saisie des mensurations
tutti.title.home=Sélection de la campagne
+tutti.title.messages=Rapport de contrôles
tutti.title.noSelectedCruise=Pas de campagne sélectionné
tutti.title.noSelectedProgram=Pas de série de campagne sélectionné
+tutti.title.noSelectedProtocol=Pas de protocol sélectionné
tutti.title.selectedCruise=Campagne %s
tutti.title.selectedProgram=Série de campagne %s
+tutti.title.selectedProtocol=Protocol %s
tutti.to.be.done=< A FAIRE >
tutti.tooltip.attachment.none=Pas de pièce-jointes
tutti.tooltip.comment.none=Pas de commentaire
1
0
r87 - in trunk/tutti-ui-swing/src/main: java/fr/ifremer/tutti/ui/swing/content/operation java/fr/ifremer/tutti/ui/swing/content/operation/fishing java/fr/ifremer/tutti/ui/swing/content/operation/species java/fr/ifremer/tutti/ui/swing/util/editor resources/i18n
by kmorin@users.forge.codelutin.com 18 Dec '12
by kmorin@users.forge.codelutin.com 18 Dec '12
18 Dec '12
Author: kmorin
Date: 2012-12-18 14:07:34 +0100 (Tue, 18 Dec 2012)
New Revision: 87
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/87
Log:
- use a table instead of a form in the environment tab
- keep the ofcus on the table after exiting an editor
Added:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentRowModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTabUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTabUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTabUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTabUIModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTableModel.java
Modified:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationTabUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationTabUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/species/FrequencyCellComponent.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/AttachmentCellComponent.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/AttachmentEditorUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/AttachmentEditorUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/LongTextCellComponent.java
trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationTabUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationTabUI.jaxx 2012-12-18 10:50:00 UTC (rev 86)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationTabUI.jaxx 2012-12-18 13:07:34 UTC (rev 87)
@@ -32,6 +32,7 @@
fr.ifremer.tutti.persistence.entities.referential.Person
fr.ifremer.tutti.ui.swing.util.editor.SimpleTimeEditor
+ fr.ifremer.tutti.ui.swing.content.operation.fishing.EnvironmentTabUI
jaxx.runtime.swing.editor.bean.BeanComboBox
jaxx.runtime.swing.editor.bean.BeanListHeader
@@ -43,6 +44,7 @@
jaxx.runtime.validator.swing.SwingValidatorMessageTableModel
org.jdesktop.swingx.JXDatePicker
+ org.jdesktop.swingx.JXTable
java.awt.Dimension
@@ -386,9 +388,10 @@
<tab id='environmentTab'
title='tutti.label.tab.fishingOperation.environment'>
- <Table fill='both' id='environmentForm'>
+ <EnvironmentTabUI id='environmentTabContent' constructorParams='this'/>
+<!-- <Table fill='both' id='environmentForm'>
- <!-- Beaufort scale -->
+ Beaufort scale
<row>
<cell anchor='west'>
<JLabel id='beaufortScaleLabel'/>
@@ -399,7 +402,7 @@
</cell>
</row>
- <!-- Wind direction -->
+ Wind direction
<row>
<cell anchor='west'>
<JLabel id='windDirectionLabel'/>
@@ -409,7 +412,7 @@
</cell>
</row>
- <!-- Sea state-->
+ Sea state
<row>
<cell anchor='west'>
<JLabel id='seaStateLabel'/>
@@ -419,7 +422,7 @@
genericType='SeaState'/>
</cell>
</row>
- </Table>
+ </Table>-->
</tab>
<tab id='traitHydrologyTabContent'
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationTabUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationTabUIHandler.java 2012-12-18 10:50:00 UTC (rev 86)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationTabUIHandler.java 2012-12-18 13:07:34 UTC (rev 87)
@@ -105,18 +105,18 @@
persistenceService.getAllPerson(),
model.getSaisisseur());
- initBeanComboBox(ui.getBeaufortScaleComboBox(),
- persistenceService.getAllBeaufortScale(),
- model.getBeaufortScale());
+// initBeanComboBox(ui.getBeaufortScaleComboBox(),
+// persistenceService.getAllBeaufortScale(),
+// model.getBeaufortScale());
+//
+// initBeanComboBox(ui.getStrataComboBox(),
+// persistenceService.getAllStrata(),
+// model.getStrata());
+//
+// initBeanComboBox(ui.getSeaStateComboBox(),
+// persistenceService.getAllSeaState(),
+// model.getSeaState());
- initBeanComboBox(ui.getStrataComboBox(),
- persistenceService.getAllStrata(),
- model.getStrata());
-
- initBeanComboBox(ui.getSeaStateComboBox(),
- persistenceService.getAllSeaState(),
- model.getSeaState());
-
model.setEmpty(true);
listenValidatorValid(ui.getValidator(), getModel());
@@ -154,6 +154,8 @@
// if new fishingOperation can already cancel his creation
model.setModify(!empty && model.isCreate());
+
+ ui.getEnvironmentTabContent().getHandler().afterInitUI();
}
public void cancel() {
Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentRowModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentRowModel.java (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentRowModel.java 2012-12-18 13:07:34 UTC (rev 87)
@@ -0,0 +1,70 @@
+package fr.ifremer.tutti.ui.swing.content.operation.fishing;
+
+import fr.ifremer.tutti.ui.swing.AbstractTuttiBeanUIModel;
+import java.io.Serializable;
+import org.nuiton.util.beans.Binder;
+import org.nuiton.util.beans.BinderFactory;
+
+/**
+ *
+ * @author kmorin
+ * @since 0.3
+ */
+public class EnvironmentRowModel extends AbstractTuttiBeanUIModel<Object, EnvironmentRowModel> {
+
+ public static final String PROPERTY_KEY = "key";
+ public static final String PROPERTY_VALUE = "value";
+
+ protected static final Binder<Object, EnvironmentRowModel> fromBeanBinder =
+ BinderFactory.newBinder(Object.class,
+ EnvironmentRowModel.class);
+
+ protected static final Binder<EnvironmentRowModel, Object> toBeanBinder =
+ BinderFactory.newBinder(EnvironmentRowModel.class,
+ Object.class);
+
+ protected String key;
+
+ protected String value;
+
+ public EnvironmentRowModel() {
+ super(Object.class, fromBeanBinder, toBeanBinder);
+ }
+
+ public EnvironmentRowModel(String key) {
+ this();
+ this.key = key;
+ }
+//
+// public FishingOperationEnvironmentRowModel(Object o,
+// List<SpeciesBatchFrequency> frequencies) {
+// this();
+// fromBean(aBatch);
+// List<SpeciesFrequencyRowModel> frequencyRows =
+// SpeciesFrequencyRowModel.fromBeans(frequencies);
+// frequency.addAll(frequencyRows);
+// Collections.sort(frequency);
+// updateTotalFromFrequencies();
+// }
+
+ public String getKey() {
+ return key;
+ }
+
+ public void setKey(String key) {
+ Object oldValue = getKey();
+ this.key = key;
+ firePropertyChange(PROPERTY_KEY, oldValue, key);
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(String value) {
+ Object oldValue = getValue();
+ this.value = value;
+ firePropertyChange(PROPERTY_VALUE, oldValue, value);
+ }
+
+}
Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTabUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTabUI.css (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTabUI.css 2012-12-18 13:07:34 UTC (rev 87)
@@ -0,0 +1,6 @@
+#environmentTable {
+ selectionMode: {ListSelectionModel.SINGLE_SELECTION};
+ selectionBackground: {null};
+ selectionForeground: {Color.BLACK};
+ sortable: false;
+}
\ No newline at end of file
Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTabUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTabUI.jaxx (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTabUI.jaxx 2012-12-18 13:07:34 UTC (rev 87)
@@ -0,0 +1,46 @@
+<Table implements='fr.ifremer.tutti.ui.swing.TuttiUI<EnvironmentTabUIModel, EnvironmentTabUIHandler>'>
+
+ <import>
+ org.jdesktop.swingx.JXTable
+ fr.ifremer.tutti.ui.swing.content.operation.FishingOperationTabUI
+ javax.swing.ListSelectionModel
+ java.awt.Color
+ </import>
+
+ <EnvironmentTabUIHandler id='handler'
+ initializer='getContextValue(EnvironmentTabUIHandler.class)'/>
+
+ <EnvironmentTabUIModel id='model'
+ initializer='getContextValue(EnvironmentTabUIModel.class)'/>
+
+ <row fill='both'>
+ <cell fill='both' weightx='1'>
+ <JComboBox id='newRowKey'/>
+ </cell>
+ <cell fill='both'>
+ <JButton id='addRow' actionIcon='add'
+ onActionPerformed='handler.addRow()'/>
+ </cell>
+ </row>
+ <row fill='both' weighty='1'>
+ <cell fill='both' columns='2'>
+ <JScrollPane>
+ <JXTable id='environmentTable'/>
+ </JScrollPane>
+ </cell>
+ </row>
+ <script><![CDATA[
+
+public EnvironmentTabUI(FishingOperationTabUI parentUI) {
+ EnvironmentTabUIHandler handler = new EnvironmentTabUIHandler(parentUI, this);
+ setContextValue(handler);
+ handler.beforeInitUI();
+}
+
+protected void $afterCompleteSetup() {
+ handler.afterInitUI();
+}
+
+ ]]></script>
+
+</Table>
\ No newline at end of file
Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTabUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTabUIHandler.java (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTabUIHandler.java 2012-12-18 13:07:34 UTC (rev 87)
@@ -0,0 +1,170 @@
+package fr.ifremer.tutti.ui.swing.content.operation.fishing;
+
+import com.google.common.collect.Lists;
+import fr.ifremer.tutti.ui.swing.content.operation.FishingOperationTabUI;
+import fr.ifremer.tutti.ui.swing.util.table.AbstractTuttiTableModel;
+import fr.ifremer.tutti.ui.swing.util.table.AbstractTuttiTableUIHandler;
+import java.awt.event.ItemEvent;
+import java.awt.event.ItemListener;
+import java.util.List;
+import java.util.logging.Logger;
+import javax.swing.DefaultComboBoxModel;
+import javax.swing.JComboBox;
+import javax.swing.event.ListDataEvent;
+import javax.swing.event.ListDataListener;
+import javax.swing.plaf.basic.BasicComboBoxUI.ListDataHandler;
+import javax.swing.table.TableColumnModel;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jdesktop.swingx.JXTable;
+import org.jdesktop.swingx.table.DefaultTableColumnModelExt;
+
+/**
+ *
+ * @author kmorin
+ * @since 0.3
+ */
+public class EnvironmentTabUIHandler extends AbstractTuttiTableUIHandler<EnvironmentRowModel, EnvironmentTabUIModel> {
+
+ private final static Log log = LogFactory.getLog(EnvironmentTabUIHandler.class);
+
+ protected EnvironmentTabUI ui;
+
+ public EnvironmentTabUIHandler(FishingOperationTabUI parentUi, EnvironmentTabUI ui) {
+ super(parentUi.getHandler().getContext());
+ this.ui = ui;
+ }
+
+ @Override
+ protected JXTable getTable() {
+ return ui.getEnvironmentTable();
+ }
+
+ @Override
+ protected AbstractTuttiTableModel<EnvironmentRowModel> getTableModel() {
+ return (EnvironmentTableModel) getTable().getModel();
+ }
+
+ @Override
+ protected TableColumnModel createTableColumnModel() {
+ DefaultTableColumnModelExt columnModel =
+ new DefaultTableColumnModelExt();
+
+ {
+
+ addColumnToModel(columnModel, EnvironmentTableModel.KEY);
+ }
+
+ {
+
+ addColumnToModel(columnModel, EnvironmentTableModel.VALUE);
+ }
+
+
+ return columnModel;
+ }
+
+ @Override
+ protected void onRowModified(EnvironmentRowModel row, String propertyName, Object oldValue, Object newValue) {
+ }
+
+ @Override
+ protected void onRowValidStateChanged(EnvironmentRowModel row, Boolean oldValue, Boolean newValue) {
+ }
+
+ @Override
+ protected void onRowModifyStateChanged(EnvironmentRowModel row, Boolean oldValue, Boolean newValue) {
+ }
+
+ @Override
+ public void beforeInitUI() {
+ EnvironmentTabUIModel model = new EnvironmentTabUIModel();
+ ui.setContextValue(model);
+ }
+
+ @Override
+ public void afterInitUI() {
+ initUI(ui);
+
+ JXTable table = getTable();
+
+ // create table column model
+ TableColumnModel columnModel = createTableColumnModel();
+
+ // create table model
+ EnvironmentTableModel tableModel =
+ new EnvironmentTableModel(columnModel);
+
+ table.setModel(tableModel);
+ table.setColumnModel(columnModel);
+
+ final JComboBox keyCombo = ui.getNewRowKey();
+ keyCombo.setModel(new DefaultComboBoxModel());
+
+ keyCombo.addItemListener(new ItemListener() {
+
+ public void itemStateChanged(ItemEvent e) {
+ log.debug("item state changed " + e.paramString());
+ }
+ });
+ keyCombo.getModel().addListDataListener(new ListDataListener() {
+
+ public void intervalAdded(ListDataEvent e) {
+ keyCombo.setEnabled(true);
+ ui.getAddRow().setEnabled(true);
+ }
+
+ public void intervalRemoved(ListDataEvent e) {
+ if (keyCombo.getItemCount() == 0) {
+ keyCombo.setEnabled(false);
+ ui.getAddRow().setEnabled(false);
+ }
+ }
+
+ public void contentsChanged(ListDataEvent e) {
+ keyCombo.setEnabled(true);
+ ui.getAddRow().setEnabled(true);
+ }
+ });
+
+ reset();
+ }
+
+ @Override
+ public void onCloseUI() {
+ }
+
+ @Override
+ protected EnvironmentTabUIModel getModel() {
+ return ui.getModel();
+ }
+
+ public void addRow() {
+ JComboBox keyCombo = ui.getNewRowKey();
+ String key = (String) keyCombo.getSelectedItem();
+ EnvironmentRowModel row = new EnvironmentRowModel(key);
+ getTableModel().addNewRow(getTable().getRowCount(), row);
+
+ keyCombo.removeItem(key);
+ }
+
+ public void reset() {
+ List<EnvironmentRowModel> rows = Lists.newArrayList();
+ List<String> defaultKeys = Lists.newArrayList(ui.getModel().getDefaultKeys());
+ for (String key : defaultKeys) {
+ rows.add(new EnvironmentRowModel(key));
+ }
+
+ AbstractTuttiTableModel<EnvironmentRowModel> tableModel = getTableModel();
+ tableModel.setRows(rows);
+
+ JComboBox keyCombo = ui.getNewRowKey();
+ DefaultComboBoxModel keyComboModel = (DefaultComboBoxModel)keyCombo.getModel();
+ for (String key : ui.getModel().getKeys()) {
+ if (!defaultKeys.contains(key)) {
+ keyComboModel.addElement(key);
+ }
+ }
+ }
+
+}
Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTabUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTabUIModel.java (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTabUIModel.java 2012-12-18 13:07:34 UTC (rev 87)
@@ -0,0 +1,59 @@
+package fr.ifremer.tutti.ui.swing.content.operation.fishing;
+
+import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
+import fr.ifremer.tutti.ui.swing.util.table.AbstractTuttiTableUIModel;
+import org.nuiton.util.beans.Binder;
+import org.nuiton.util.beans.BinderModelBuilder;
+
+import static org.nuiton.i18n.I18n._;
+
+/**
+ *
+ * @author kmorin
+ */
+public class EnvironmentTabUIModel extends AbstractTuttiTableUIModel<FishingOperation, EnvironmentRowModel, EnvironmentTabUIModel> {
+
+ protected FishingOperation fishingOperation;
+
+ public static final String KEY_BEAUFORT_SCALE = "beaufortScale";
+ public static final String KEY_WIND_DIRECTION = "windDirection";
+ public static final String KEY_SEA_STATE = "seaState";
+
+ protected static final Binder<FishingOperation, EnvironmentTabUIModel> fromBeanBinder = BinderModelBuilder.newEmptyBuilder(FishingOperation.class, EnvironmentTabUIModel.class)
+ .toBinder();
+
+ protected static final Binder<EnvironmentTabUIModel, FishingOperation> toBeanBinder = BinderModelBuilder.newEmptyBuilder(EnvironmentTabUIModel.class, FishingOperation.class)
+ .toBinder();
+
+ public EnvironmentTabUIModel() {
+ super(FishingOperation.class, fromBeanBinder, toBeanBinder);
+ }
+
+ public FishingOperation getFishingOperation() {
+ return fishingOperation;
+ }
+
+ public void setFishingOperation(FishingOperation fishingOperation) {
+ this.fishingOperation = fishingOperation;
+ }
+
+ public String[] getKeys() {
+ return new String[] {
+ _("tutti.table.fishing.environment.keys." + KEY_BEAUFORT_SCALE),
+ _("tutti.table.fishing.environment.keys." + KEY_WIND_DIRECTION),
+ _("tutti.table.fishing.environment.keys." + KEY_SEA_STATE),
+ _("tutti.table.fishing.environment.keys." + "key3"),
+ _("tutti.table.fishing.environment.keys." + "key4"),
+ _("tutti.table.fishing.environment.keys." + "key5")
+ };
+ }
+
+ public String[] getDefaultKeys() {
+ return new String[] {
+ _("tutti.table.fishing.environment.keys." + KEY_BEAUFORT_SCALE),
+ _("tutti.table.fishing.environment.keys." + KEY_WIND_DIRECTION),
+ _("tutti.table.fishing.environment.keys." + KEY_SEA_STATE)
+ };
+ }
+
+}
Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTableModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTableModel.java (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/EnvironmentTableModel.java 2012-12-18 13:07:34 UTC (rev 87)
@@ -0,0 +1,38 @@
+package fr.ifremer.tutti.ui.swing.content.operation.fishing;
+
+import fr.ifremer.tutti.ui.swing.util.table.AbstractTuttiTableModel;
+import fr.ifremer.tutti.ui.swing.util.table.ColumnIdentifier;
+import javax.swing.table.TableColumnModel;
+
+import static org.nuiton.i18n.I18n.n_;
+
+/**
+ *
+ * @author kmorin
+ * since 0.3
+ */
+public class EnvironmentTableModel extends AbstractTuttiTableModel<EnvironmentRowModel> {
+
+ public static final ColumnIdentifier<EnvironmentRowModel> KEY = ColumnIdentifier.newId(
+ EnvironmentRowModel.PROPERTY_KEY,
+ n_("tutti.table.fishing.environment.header.key"),
+ n_("tutti.table.fishing.environment.header.key"));
+
+ public static final ColumnIdentifier<EnvironmentRowModel> VALUE = ColumnIdentifier.newId(
+ EnvironmentRowModel.PROPERTY_VALUE,
+ n_("tutti.table.fishing.environment.header.value"),
+ n_("tutti.table.fishing.environment.header.value"));
+
+ public EnvironmentTableModel(TableColumnModel columnModel) {
+ super(columnModel);
+
+ setNoneEditableCols(KEY);
+ }
+
+ @Override
+ protected EnvironmentRowModel createNewRow() {
+ EnvironmentRowModel result = new EnvironmentRowModel();
+ return result;
+ }
+
+}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/species/FrequencyCellComponent.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/species/FrequencyCellComponent.java 2012-12-18 10:50:00 UTC (rev 86)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/species/FrequencyCellComponent.java 2012-12-18 13:07:34 UTC (rev 87)
@@ -158,6 +158,7 @@
// reselect this cell
AbstractSelectTableAction.doSelectCell(table, r, c);
+ table.requestFocus();
}
@Override
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/AttachmentCellComponent.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/AttachmentCellComponent.java 2012-12-18 10:50:00 UTC (rev 86)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/AttachmentCellComponent.java 2012-12-18 13:07:34 UTC (rev 87)
@@ -193,6 +193,7 @@
// reselect this cell
AbstractSelectTableAction.doSelectCell(table, r, c);
+ table.requestFocus();
}
@Override
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/AttachmentEditorUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/AttachmentEditorUI.jaxx 2012-12-18 10:50:00 UTC (rev 86)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/AttachmentEditorUI.jaxx 2012-12-18 13:07:34 UTC (rev 87)
@@ -26,6 +26,7 @@
<import>
fr.ifremer.tutti.ui.swing.AbstractTuttiBeanUIModel
fr.ifremer.tutti.persistence.entities.data.Attachment
+ jaxx.runtime.swing.editor.FileEditor
</import>
<!-- bean property linked state -->
@@ -40,8 +41,6 @@
<AttachmentEditorUIHandler id='handler' constructorParams='this'/>
- <Attachment id='model' javaBean='null'/>
-
<row fill='both'>
<cell fill='both' weightx='1' columns='3'>
<VBox id='attachments'></VBox>
@@ -52,8 +51,7 @@
<JLabel id='fileLabel'/>
</cell>
<cell fill='both' weightx='1'>
- <JTextField id='file'
- onMouseClicked='handler.chooseFile()'/>
+ <FileEditor id='file'/>
</cell>
<cell fill='both' rows='3'>
<JButton id='addButton'
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/AttachmentEditorUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/AttachmentEditorUIHandler.java 2012-12-18 10:50:00 UTC (rev 86)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/AttachmentEditorUIHandler.java 2012-12-18 13:07:34 UTC (rev 87)
@@ -40,6 +40,7 @@
import javax.swing.JLabel;
import javax.swing.SwingConstants;
import java.awt.Cursor;
+import java.awt.Font;
import java.awt.Window;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
@@ -62,8 +63,6 @@
private final AttachmentEditorUI ui;
- private JFileChooser fileChooser = new JFileChooser();
-
public AttachmentEditorUIHandler(AttachmentEditorUI attachmentEditorUI) {
ui = attachmentEditorUI;
@@ -150,13 +149,13 @@
SwingUtil.getParentContainer(ui, Window.class).dispose();
}
- public void chooseFile() {
- if (fileChooser.showOpenDialog(ui) == JFileChooser.APPROVE_OPTION) {
- File file = fileChooser.getSelectedFile();
- ui.getModel().setFile(file);
- ui.getFile().setText(file.getAbsolutePath());
- }
- }
+// public void chooseFile() {
+// if (fileChooser.showOpenDialog(ui) == JFileChooser.APPROVE_OPTION) {
+// File file = fileChooser.getSelectedFile();
+// ui.getModel().setFile(file);
+// ui.getFile().setText(file.getAbsolutePath());
+// }
+// }
public void addAttachment() {
AbstractTuttiBeanUIModel bean = ui.getBean();
@@ -165,9 +164,10 @@
if (list == null) {
list = Lists.newArrayList();
}
- Attachment attachment = ui.getModel();
- File file = attachment.getFile();
+ Attachment attachment = new Attachment();
+ File file = ui.getFile().getSelectedFile();
if (file != null) {
+ attachment.setFile(file);
String name = ui.getFileName().getText();
if (StringUtils.isEmpty(name)) {
name = file.getName();
@@ -186,9 +186,7 @@
}
protected void resetFields() {
- ui.setModel(new Attachment());
- fileChooser.setSelectedFile(null);
- ui.getFile().setText("");
+ ui.getFile().setSelectedFile((File)null);
ui.getFileName().setText("");
ui.getFileComment().setText("");
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/LongTextCellComponent.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/LongTextCellComponent.java 2012-12-18 10:50:00 UTC (rev 86)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/LongTextCellComponent.java 2012-12-18 13:07:34 UTC (rev 87)
@@ -32,6 +32,7 @@
import fr.ifremer.tutti.ui.swing.util.table.AbstractSelectTableAction;
import fr.ifremer.tutti.ui.swing.util.table.AbstractTuttiTableModel;
import fr.ifremer.tutti.ui.swing.util.table.ColumnIdentifier;
+import java.awt.event.FocusEvent;
import jaxx.runtime.JAXXUtil;
import jaxx.runtime.SwingUtil;
import org.apache.commons.lang3.StringUtils;
@@ -49,6 +50,7 @@
import java.awt.Color;
import java.awt.Component;
import java.awt.Frame;
+import java.awt.event.FocusListener;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.event.MouseAdapter;
@@ -156,7 +158,7 @@
ComponentMover cm = new ComponentMover();
cm.setDragInsets(cr.getDragInsets());
cm.registerComponent(editor);
-
+
editor.addWindowListener(new WindowAdapter() {
@Override
@@ -194,6 +196,7 @@
// reselect this cell
AbstractSelectTableAction.doSelectCell(table, r, c);
+ table.requestFocus();
}
@Override
Modified: trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties
===================================================================
--- trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2012-12-18 10:50:00 UTC (rev 86)
+++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2012-12-18 13:07:34 UTC (rev 87)
@@ -161,6 +161,15 @@
tutti.table.benthos.batch.header.speciesByGenusCode=Espèce
tutti.table.benthos.batch.header.toConfirm=A Confirmer
tutti.table.benthos.batch.header.weight=Poids
+tutti.table.fishing.environment.header.key=Clé
+tutti.table.fishing.environment.header.value=Valeur
+tutti.table.fishing.environment.keys.=
+tutti.table.fishing.environment.keys.beaufortScale=Force du vent
+tutti.table.fishing.environment.keys.key3=Clé 3
+tutti.table.fishing.environment.keys.key4=Clé 4
+tutti.table.fishing.environment.keys.key5=Clé 5
+tutti.table.fishing.environment.keys.seaState=État de la mer
+tutti.table.fishing.environment.keys.windDirection=Direction du vent
tutti.table.macrowaste.batch.header.comment=Commentaire
tutti.table.macrowaste.batch.header.file=Pièces jointes
tutti.table.macrowaste.batch.header.macroWasteCategory=Catégorie
1
0
r86 - in trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing: content/operation/species util/editor
by tchemit@users.forge.codelutin.com 18 Dec '12
by tchemit@users.forge.codelutin.com 18 Dec '12
18 Dec '12
Author: tchemit
Date: 2012-12-18 11:50:00 +0100 (Tue, 18 Dec 2012)
New Revision: 86
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/86
Log:
change keystroke to esapce popup (Alt+F)
Modified:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/species/FrequencyCellComponent.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/species/SpeciesFrequencyUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/AttachmentCellComponent.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/AttachmentEditorUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/LongTextCellComponent.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/LongTextEditorUI.css
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/species/FrequencyCellComponent.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/species/FrequencyCellComponent.java 2012-12-17 09:22:54 UTC (rev 85)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/species/FrequencyCellComponent.java 2012-12-18 10:50:00 UTC (rev 86)
@@ -32,7 +32,6 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import javax.swing.AbstractAction;
import javax.swing.AbstractCellEditor;
import javax.swing.JButton;
import javax.swing.JTable;
@@ -42,7 +41,6 @@
import java.awt.Color;
import java.awt.Component;
import java.awt.Frame;
-import java.awt.event.ActionEvent;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.event.MouseAdapter;
@@ -146,16 +144,8 @@
// open frequency dialog
TuttiUIUtil.openInDialog(
- ui, frame, _("tutti.title.frequency"), true,
- new AbstractAction() {
- private static final long serialVersionUID = 1L;
+ ui, frame, _("tutti.title.frequency"), true, null);
- @Override
- public void actionPerformed(ActionEvent e) {
- ui.getHandler().close();
- }
- });
-
// at close, synch back frequencies
editRow.updateTotalFromFrequencies();
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/species/SpeciesFrequencyUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/species/SpeciesFrequencyUI.css 2012-12-17 09:22:54 UTC (rev 85)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/species/SpeciesFrequencyUI.css 2012-12-18 10:50:00 UTC (rev 86)
@@ -131,6 +131,7 @@
#closeButton {
actionIcon: "close";
text: "tutti.action.close";
+ mnemonic: F;
}
#table {
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/AttachmentCellComponent.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/AttachmentCellComponent.java 2012-12-17 09:22:54 UTC (rev 85)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/AttachmentCellComponent.java 2012-12-18 10:50:00 UTC (rev 86)
@@ -39,22 +39,17 @@
import org.apache.commons.logging.LogFactory;
import org.nuiton.util.decorator.Decorator;
-import javax.swing.AbstractAction;
import javax.swing.AbstractCellEditor;
import javax.swing.BorderFactory;
import javax.swing.JButton;
-import javax.swing.JComponent;
import javax.swing.JDialog;
-import javax.swing.JRootPane;
import javax.swing.JTable;
-import javax.swing.KeyStroke;
import javax.swing.border.LineBorder;
import javax.swing.table.TableCellEditor;
import javax.swing.table.TableCellRenderer;
import java.awt.Color;
import java.awt.Component;
import java.awt.Frame;
-import java.awt.event.ActionEvent;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.event.MouseAdapter;
@@ -153,16 +148,6 @@
editor.setUndecorated(true);
editor.add(ui);
editor.setResizable(true);
- JRootPane rootPane = editor.getRootPane();
- rootPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("ESCAPE"), "close");
- rootPane.getActionMap().put("close", new AbstractAction() {
- private static final long serialVersionUID = 1L;
-
- @Override
- public void actionPerformed(ActionEvent e) {
- ui.getHandler().close();
- }
- });
editor.pack();
ComponentResizer cr = new ComponentResizer();
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/AttachmentEditorUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/AttachmentEditorUI.css 2012-12-17 09:22:54 UTC (rev 85)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/AttachmentEditorUI.css 2012-12-18 10:50:00 UTC (rev 86)
@@ -43,4 +43,5 @@
#closeButton {
actionIcon: "close";
text: "tutti.action.close";
+ mnemonic: F;
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/LongTextCellComponent.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/LongTextCellComponent.java 2012-12-17 09:22:54 UTC (rev 85)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/LongTextCellComponent.java 2012-12-18 10:50:00 UTC (rev 86)
@@ -38,22 +38,17 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import javax.swing.AbstractAction;
import javax.swing.AbstractCellEditor;
import javax.swing.BorderFactory;
import javax.swing.JButton;
-import javax.swing.JComponent;
import javax.swing.JDialog;
-import javax.swing.JRootPane;
import javax.swing.JTable;
-import javax.swing.KeyStroke;
import javax.swing.border.LineBorder;
import javax.swing.table.TableCellEditor;
import javax.swing.table.TableCellRenderer;
import java.awt.Color;
import java.awt.Component;
import java.awt.Frame;
-import java.awt.event.ActionEvent;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.event.MouseAdapter;
@@ -156,16 +151,6 @@
editor.add(ui);
editor.setSize(DEFAULT_EDITOR_WIDTH, DEFAULT_EDITOR_HEIGHT);
editor.setResizable(true);
- JRootPane rootPane = editor.getRootPane();
- rootPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("ESCAPE"), "close");
- rootPane.getActionMap().put("close", new AbstractAction() {
- private static final long serialVersionUID = 1L;
-
- @Override
- public void actionPerformed(ActionEvent e) {
- ui.getHandler().close();
- }
- });
ComponentResizer cr = new ComponentResizer();
cr.registerComponent(editor);
ComponentMover cm = new ComponentMover();
@@ -290,7 +275,7 @@
// String text;
String textValue;
- if (StringUtils.isBlank((String)value)) {
+ if (StringUtils.isBlank((String) value)) {
if (propertyName == null) {
AbstractTuttiTableModel tableModel =
(AbstractTuttiTableModel) table.getModel();
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/LongTextEditorUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/LongTextEditorUI.css 2012-12-17 09:22:54 UTC (rev 85)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/LongTextEditorUI.css 2012-12-18 10:50:00 UTC (rev 86)
@@ -24,4 +24,5 @@
#closeButton {
actionIcon: "close";
text: "tutti.action.close";
+ mnemonic: F;
}
1
0
r85 - in trunk: . tutti-persistence tutti-persistence-dev tutti-service tutti-ui-swing
by tchemit@users.forge.codelutin.com 17 Dec '12
by tchemit@users.forge.codelutin.com 17 Dec '12
17 Dec '12
Author: tchemit
Date: 2012-12-17 10:22:54 +0100 (Mon, 17 Dec 2012)
New Revision: 85
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/85
Log:
[maven-release-plugin] prepare for next development iteration
Modified:
trunk/pom.xml
trunk/tutti-persistence-dev/pom.xml
trunk/tutti-persistence/pom.xml
trunk/tutti-service/pom.xml
trunk/tutti-ui-swing/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2012-12-17 09:22:46 UTC (rev 84)
+++ trunk/pom.xml 2012-12-17 09:22:54 UTC (rev 85)
@@ -11,7 +11,7 @@
<groupId>fr.ifremer</groupId>
<artifactId>tutti</artifactId>
- <version>0.2</version>
+ <version>0.3-SNAPSHOT</version>
<modules>
<module>tutti-persistence</module>
@@ -58,12 +58,12 @@
</developers>
<scm>
- <url>http://svn.forge.codelutin.com/svn/tutti/tags/tutti-0.2</url>
+ <url>http://svn.forge.codelutin.com/svn/tutti/trunk</url>
<connection>
- scm:svn:http://svn.forge.codelutin.com/svn/tutti/tags/tutti-0.2
+ scm:svn:http://svn.forge.codelutin.com/svn/tutti/trunk
</connection>
<developerConnection>
- scm:svn:http://svn.forge.codelutin.com/svn/tutti/tags/tutti-0.2
+ scm:svn:http://svn.forge.codelutin.com/svn/tutti/trunk
</developerConnection>
</scm>
Modified: trunk/tutti-persistence/pom.xml
===================================================================
--- trunk/tutti-persistence/pom.xml 2012-12-17 09:22:46 UTC (rev 84)
+++ trunk/tutti-persistence/pom.xml 2012-12-17 09:22:54 UTC (rev 85)
@@ -6,7 +6,7 @@
<parent>
<groupId>fr.ifremer</groupId>
<artifactId>tutti</artifactId>
- <version>0.2</version>
+ <version>0.3-SNAPSHOT</version>
</parent>
<groupId>fr.ifremer.tutti</groupId>
Modified: trunk/tutti-persistence-dev/pom.xml
===================================================================
--- trunk/tutti-persistence-dev/pom.xml 2012-12-17 09:22:46 UTC (rev 84)
+++ trunk/tutti-persistence-dev/pom.xml 2012-12-17 09:22:54 UTC (rev 85)
@@ -6,7 +6,7 @@
<parent>
<groupId>fr.ifremer</groupId>
<artifactId>tutti</artifactId>
- <version>0.2</version>
+ <version>0.3-SNAPSHOT</version>
</parent>
<groupId>fr.ifremer.tutti</groupId>
Modified: trunk/tutti-service/pom.xml
===================================================================
--- trunk/tutti-service/pom.xml 2012-12-17 09:22:46 UTC (rev 84)
+++ trunk/tutti-service/pom.xml 2012-12-17 09:22:54 UTC (rev 85)
@@ -6,7 +6,7 @@
<parent>
<groupId>fr.ifremer</groupId>
<artifactId>tutti</artifactId>
- <version>0.2</version>
+ <version>0.3-SNAPSHOT</version>
</parent>
<groupId>fr.ifremer.tutti</groupId>
Modified: trunk/tutti-ui-swing/pom.xml
===================================================================
--- trunk/tutti-ui-swing/pom.xml 2012-12-17 09:22:46 UTC (rev 84)
+++ trunk/tutti-ui-swing/pom.xml 2012-12-17 09:22:54 UTC (rev 85)
@@ -6,7 +6,7 @@
<parent>
<groupId>fr.ifremer</groupId>
<artifactId>tutti</artifactId>
- <version>0.2</version>
+ <version>0.3-SNAPSHOT</version>
</parent>
<groupId>fr.ifremer.tutti</groupId>
1
0
Author: tchemit
Date: 2012-12-17 10:22:46 +0100 (Mon, 17 Dec 2012)
New Revision: 84
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/84
Log:
[maven-release-plugin] copy for tag tutti-0.2
Added:
tags/tutti-0.2/
1
0
r83 - in trunk: . tutti-persistence tutti-persistence-dev tutti-service tutti-ui-swing
by tchemit@users.forge.codelutin.com 17 Dec '12
by tchemit@users.forge.codelutin.com 17 Dec '12
17 Dec '12
Author: tchemit
Date: 2012-12-17 10:22:38 +0100 (Mon, 17 Dec 2012)
New Revision: 83
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/83
Log:
[maven-release-plugin] prepare release tutti-0.2
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-12-17 09:18:52 UTC (rev 82)
+++ trunk/pom.xml 2012-12-17 09:22:38 UTC (rev 83)
@@ -11,7 +11,7 @@
<groupId>fr.ifremer</groupId>
<artifactId>tutti</artifactId>
- <version>0.2-SNAPSHOT</version>
+ <version>0.2</version>
<modules>
<module>tutti-persistence</module>
@@ -58,12 +58,12 @@
</developers>
<scm>
- <url>http://svn.forge.codelutin.com/svn/tutti/trunk</url>
+ <url>http://svn.forge.codelutin.com/svn/tutti/tags/tutti-0.2</url>
<connection>
- scm:svn:http://svn.forge.codelutin.com/svn/tutti/trunk
+ scm:svn:http://svn.forge.codelutin.com/svn/tutti/tags/tutti-0.2
</connection>
<developerConnection>
- scm:svn:http://svn.forge.codelutin.com/svn/tutti/trunk
+ scm:svn:http://svn.forge.codelutin.com/svn/tutti/tags/tutti-0.2
</developerConnection>
</scm>
Modified: trunk/tutti-persistence/pom.xml
===================================================================
--- trunk/tutti-persistence/pom.xml 2012-12-17 09:18:52 UTC (rev 82)
+++ trunk/tutti-persistence/pom.xml 2012-12-17 09:22:38 UTC (rev 83)
@@ -6,7 +6,7 @@
<parent>
<groupId>fr.ifremer</groupId>
<artifactId>tutti</artifactId>
- <version>0.2-SNAPSHOT</version>
+ <version>0.2</version>
</parent>
<groupId>fr.ifremer.tutti</groupId>
Modified: trunk/tutti-persistence-dev/pom.xml
===================================================================
--- trunk/tutti-persistence-dev/pom.xml 2012-12-17 09:18:52 UTC (rev 82)
+++ trunk/tutti-persistence-dev/pom.xml 2012-12-17 09:22:38 UTC (rev 83)
@@ -6,7 +6,7 @@
<parent>
<groupId>fr.ifremer</groupId>
<artifactId>tutti</artifactId>
- <version>0.2-SNAPSHOT</version>
+ <version>0.2</version>
</parent>
<groupId>fr.ifremer.tutti</groupId>
Modified: trunk/tutti-service/pom.xml
===================================================================
--- trunk/tutti-service/pom.xml 2012-12-17 09:18:52 UTC (rev 82)
+++ trunk/tutti-service/pom.xml 2012-12-17 09:22:38 UTC (rev 83)
@@ -6,7 +6,7 @@
<parent>
<groupId>fr.ifremer</groupId>
<artifactId>tutti</artifactId>
- <version>0.2-SNAPSHOT</version>
+ <version>0.2</version>
</parent>
<groupId>fr.ifremer.tutti</groupId>
Modified: trunk/tutti-ui-swing/pom.xml
===================================================================
--- trunk/tutti-ui-swing/pom.xml 2012-12-17 09:18:52 UTC (rev 82)
+++ trunk/tutti-ui-swing/pom.xml 2012-12-17 09:22:38 UTC (rev 83)
@@ -6,7 +6,7 @@
<parent>
<groupId>fr.ifremer</groupId>
<artifactId>tutti</artifactId>
- <version>0.2-SNAPSHOT</version>
+ <version>0.2</version>
</parent>
<groupId>fr.ifremer.tutti</groupId>
1
0
r82 - in trunk/tutti-ui-swing/src/main: java/fr/ifremer/tutti/ui/swing/content/operation java/fr/ifremer/tutti/ui/swing/content/operation/accidental java/fr/ifremer/tutti/ui/swing/content/operation/benthos java/fr/ifremer/tutti/ui/swing/content/operation/macrowaste java/fr/ifremer/tutti/ui/swing/content/operation/plankton java/fr/ifremer/tutti/ui/swing/content/operation/species resources/i18n resources/icons
by tchemit@users.forge.codelutin.com 17 Dec '12
by tchemit@users.forge.codelutin.com 17 Dec '12
17 Dec '12
Author: tchemit
Date: 2012-12-17 10:18:52 +0100 (Mon, 17 Dec 2012)
New Revision: 82
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/82
Log:
ajout rappel du trait en haut de chaque onglet de batch
Modified:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationTabUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/accidental/AccidentalBatchUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/accidental/AccidentalBatchUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/benthos/BenthosBatchUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/benthos/BenthosBatchUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/macrowaste/MacroWasteBatchUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/macrowaste/MacroWasteBatchUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/plankton/PlanktonBatchUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/plankton/PlanktonBatchUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/species/SpeciesBatchUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/species/SpeciesBatchUIHandler.java
trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties
trunk/tutti-ui-swing/src/main/resources/icons/action-edit-comment.png
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationTabUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationTabUI.jaxx 2012-12-17 07:39:44 UTC (rev 81)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationTabUI.jaxx 2012-12-17 09:18:52 UTC (rev 82)
@@ -215,7 +215,7 @@
<!-- Fishing operation valid / invalid-->
<row>
- <cell columns="2">
+ <cell>
<JToolBar id='fishingOperationValidPanel'
layout='{new BorderLayout()}'>
<JButton id='resetValidStateButton'
@@ -225,13 +225,16 @@
constraints='BorderLayout.EAST'/>
</JToolBar>
</cell>
- <cell columns="2">
- <JRadioButton id='fishingOperationValidRadio'
- onActionPerformed='model.setFishingOperationValid(Boolean.TRUE)'/>
+ <cell>
+ <HBox>
+ <JRadioButton id='fishingOperationValidRadio'
+ onActionPerformed='model.setFishingOperationValid(Boolean.TRUE)'/>
+ <JRadioButton id='fishingOperationInvalidRadio'
+ onActionPerformed='model.setFishingOperationValid(Boolean.FALSE)'/>
+ </HBox>
</cell>
- <cell columns="2">
- <JRadioButton id='fishingOperationInvalidRadio'
- onActionPerformed='model.setFishingOperationValid(Boolean.FALSE)'/>
+ <cell columns="4">
+ <JPanel/>
</cell>
</row>
@@ -273,13 +276,13 @@
<!-- Saisisseur -->
<row weighty='0.3'>
<cell columns='6'>
-<!-- <JScrollPane id='saisisseurPane'
- columnHeaderView="{saisisseurHeader}"
- onFocusGained='saisisseurList.requestFocus()'>
- <JList id='saisisseurList'
- onValueChanged='handler.selectListData(event, "saisisseur")'/>
- <BeanListHeader id='saisisseurHeader' genericType='Person'/>
- </JScrollPane>-->
+ <!-- <JScrollPane id='saisisseurPane'
+ columnHeaderView="{saisisseurHeader}"
+ onFocusGained='saisisseurList.requestFocus()'>
+ <JList id='saisisseurList'
+ onValueChanged='handler.selectListData(event, "saisisseur")'/>
+ <BeanListHeader id='saisisseurHeader' genericType='Person'/>
+ </JScrollPane>-->
<BeanDoubleList id='saisisseurList' genericType='Person'/>
</cell>
</row>
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/accidental/AccidentalBatchUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/accidental/AccidentalBatchUI.jaxx 2012-12-17 07:39:44 UTC (rev 81)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/accidental/AccidentalBatchUI.jaxx 2012-12-17 09:18:52 UTC (rev 82)
@@ -65,7 +65,11 @@
<LongTextEditorUI id='longTextEditor'/>
<AttachmentEditorUI id='attachmentEditor'/>
-
+ <JPanel constraints='BorderLayout.NORTH' layout='{new BorderLayout()}'>
+ <JLabel id='fishingOperationReminderLabel'
+ constraints='BorderLayout.NORTH'/>
+ <JSeparator constraints='BorderLayout.CENTER'/>
+ </JPanel>
<JScrollPane id='tableScrollPane' constraints='BorderLayout.CENTER'>
<JXTable id='table' onFocusLost='handler.saveSelectedRowIfRequired(event)'/>
</JScrollPane>
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/accidental/AccidentalBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/accidental/AccidentalBatchUIHandler.java 2012-12-17 07:39:44 UTC (rev 81)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/accidental/AccidentalBatchUIHandler.java 2012-12-17 09:18:52 UTC (rev 82)
@@ -47,6 +47,7 @@
import javax.swing.table.TableColumnModel;
import java.util.List;
+import static org.nuiton.i18n.I18n._;
import static org.nuiton.i18n.I18n.n_;
/**
@@ -300,14 +301,24 @@
List<AccidentalBatchRowModel> rows;
+ String fishingoperationText;
+
if (empty) {
rows = null;
bean = new FishingOperation();
model.setFishingOperation(null);
+ fishingoperationText = "";
} else {
+ Decorator<FishingOperation> decorator =
+ getDecorator(FishingOperation.class, null);
+
+ fishingoperationText =
+ _("tutti.label.traitReminder", decorator.toString(bean));
+
if (log.isInfoEnabled()) {
- log.info("Get species batch for fishingOperation: " + bean.getId());
+ log.info("Get species batch for fishingOperation: " +
+ bean.getId() + " - " + fishingoperationText);
}
rows = Lists.newArrayList();
@@ -327,6 +338,8 @@
model.setRows(rows);
fishingOperationMonitor.clearModified();
+
+ ui.getFishingOperationReminderLabel().setText(fishingoperationText);
}
//------------------------------------------------------------------------//
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/benthos/BenthosBatchUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/benthos/BenthosBatchUI.jaxx 2012-12-17 07:39:44 UTC (rev 81)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/benthos/BenthosBatchUI.jaxx 2012-12-17 09:18:52 UTC (rev 82)
@@ -60,16 +60,16 @@
]]></script>
<BenthosBatchUIHandler id='handler'
- initializer='getContextValue(BenthosBatchUIHandler.class)'/>
+ initializer='getContextValue(BenthosBatchUIHandler.class)'/>
<BenthosBatchUIModel id='model'
- initializer='getContextValue(BenthosBatchUIModel.class)'/>
+ initializer='getContextValue(BenthosBatchUIModel.class)'/>
<SwingValidatorMessageTableModel id='errorTableModel'/>
<BeanValidator id='validator' bean='model' errorTableModel='errorTableModel'
uiClass='jaxx.runtime.validator.swing.ui.ImageValidationUI'>
- <field name='totalWeight' component='totalWeightField'/>
+ <field name='totalWeight' component='totalWeightField'/>
<field name='sampleTotalWeight' component='sampleTotalWeightField'/>
</BeanValidator>
@@ -77,31 +77,38 @@
<AttachmentEditorUI id='attachmentEditor'/>
- <Table id='form' fill='both' constraints='BorderLayout.NORTH'>
+ <JPanel constraints='BorderLayout.NORTH' layout='{new BorderLayout()}'>
+ <JLabel id='fishingOperationReminderLabel'
+ constraints='BorderLayout.NORTH'/>
+ <JSeparator constraints='BorderLayout.CENTER'/>
- <!-- Poids total -->
- <row>
- <cell anchor='west'>
- <JLabel id='totalWeightLabel'/>
- </cell>
- <cell weightx='1.0'>
+ <Table id='form' fill='both' constraints='BorderLayout.SOUTH'>
+
+ <!-- Poids total -->
+ <row>
+ <cell anchor='west'>
+ <JLabel id='totalWeightLabel'/>
+ </cell>
+ <cell weightx='1.0'>
<NumberEditor id='totalWeightField' constructorParams='this'/>
- </cell>
- </row>
+ </cell>
+ </row>
- <!-- Poids total échantillonné -->
- <row>
- <cell>
- <JLabel id='sampleTotalWeightLabel'/>
- </cell>
- <cell>
- <NumberEditor id='sampleTotalWeightField' constructorParams='this'/>
- </cell>
- </row>
- </Table>
+ <!-- Poids total échantillonné -->
+ <row>
+ <cell>
+ <JLabel id='sampleTotalWeightLabel'/>
+ </cell>
+ <cell>
+ <NumberEditor id='sampleTotalWeightField' constructorParams='this'/>
+ </cell>
+ </row>
+ </Table>
+ </JPanel>
<JScrollPane id='tableScrollPane' constraints='BorderLayout.CENTER'>
- <JXTable id='table' onFocusLost='handler.saveSelectedRowIfRequired(event);'/>
+ <JXTable id='table'
+ onFocusLost='handler.saveSelectedRowIfRequired(event);'/>
</JScrollPane>
</JPanel>
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/benthos/BenthosBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/benthos/BenthosBatchUIHandler.java 2012-12-17 07:39:44 UTC (rev 81)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/benthos/BenthosBatchUIHandler.java 2012-12-17 09:18:52 UTC (rev 82)
@@ -46,6 +46,7 @@
import javax.swing.table.TableColumnModel;
import java.util.List;
+import static org.nuiton.i18n.I18n._;
import static org.nuiton.i18n.I18n.n_;
/**
@@ -331,14 +332,24 @@
List<BenthosBatchRowModel> rows;
+ String fishingoperationText;
+
if (empty) {
rows = null;
bean = new FishingOperation();
model.setFishingOperation(null);
+ fishingoperationText = "";
} else {
+ Decorator<FishingOperation> decorator =
+ getDecorator(FishingOperation.class, null);
+
+ fishingoperationText =
+ _("tutti.label.traitReminder", decorator.toString(bean));
+
if (log.isInfoEnabled()) {
- log.info("Get species batch for fishingOperation: " + bean.getId());
+ log.info("Get species batch for fishingOperation: " +
+ bean.getId() + " - " + fishingoperationText);
}
rows = Lists.newArrayList();
@@ -358,6 +369,8 @@
model.setRows(rows);
fishingOperationMonitor.clearModified();
+
+ ui.getFishingOperationReminderLabel().setText(fishingoperationText);
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/macrowaste/MacroWasteBatchUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/macrowaste/MacroWasteBatchUI.jaxx 2012-12-17 07:39:44 UTC (rev 81)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/macrowaste/MacroWasteBatchUI.jaxx 2012-12-17 09:18:52 UTC (rev 82)
@@ -60,37 +60,43 @@
]]></script>
<MacroWasteBatchUIHandler id='handler'
- initializer='getContextValue(MacroWasteBatchUIHandler.class)'/>
+ initializer='getContextValue(MacroWasteBatchUIHandler.class)'/>
<MacroWasteBatchUIModel id='model'
- initializer='getContextValue(MacroWasteBatchUIModel.class)'/>
+ initializer='getContextValue(MacroWasteBatchUIModel.class)'/>
<SwingValidatorMessageTableModel id='errorTableModel'/>
<BeanValidator id='validator' bean='model' errorTableModel='errorTableModel'
uiClass='jaxx.runtime.validator.swing.ui.ImageValidationUI'>
- <field name='totalWeight' component='totalWeightField'/>
+ <field name='totalWeight' component='totalWeightField'/>
</BeanValidator>
<LongTextEditorUI id='longTextEditor'/>
<AttachmentEditorUI id='attachmentEditor'/>
+ <JPanel constraints='BorderLayout.NORTH' layout='{new BorderLayout()}'>
+ <JLabel id='fishingOperationReminderLabel'
+ constraints='BorderLayout.NORTH'/>
+ <JSeparator constraints='BorderLayout.CENTER'/>
- <Table id='form' fill='both' constraints='BorderLayout.NORTH'>
+ <Table id='form' fill='both' constraints='BorderLayout.SOUTH'>
- <!-- Poids total -->
- <row>
- <cell anchor='west'>
- <JLabel id='totalWeightLabel'/>
- </cell>
- <cell weightx='1.0'>
+ <!-- Poids total -->
+ <row>
+ <cell anchor='west'>
+ <JLabel id='totalWeightLabel'/>
+ </cell>
+ <cell weightx='1.0'>
<NumberEditor id='totalWeightField' constructorParams='this'/>
- </cell>
- </row>
- </Table>
+ </cell>
+ </row>
+ </Table>
+ </JPanel>
<JScrollPane id='tableScrollPane' constraints='BorderLayout.CENTER'>
- <JXTable id='table' onFocusLost='handler.saveSelectedRowIfRequired(event);'/>
+ <JXTable id='table'
+ onFocusLost='handler.saveSelectedRowIfRequired(event);'/>
</JScrollPane>
</JPanel>
\ No newline at end of file
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/macrowaste/MacroWasteBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/macrowaste/MacroWasteBatchUIHandler.java 2012-12-17 07:39:44 UTC (rev 81)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/macrowaste/MacroWasteBatchUIHandler.java 2012-12-17 09:18:52 UTC (rev 82)
@@ -45,6 +45,7 @@
import javax.swing.table.TableColumnModel;
import java.util.List;
+import static org.nuiton.i18n.I18n._;
import static org.nuiton.i18n.I18n.n_;
/**
@@ -285,14 +286,24 @@
List<MacroWasteBatchRowModel> rows;
+ String fishingoperationText;
+
if (empty) {
rows = null;
bean = new FishingOperation();
model.setFishingOperation(null);
+ fishingoperationText="";
} else {
+ Decorator<FishingOperation> decorator =
+ getDecorator(FishingOperation.class, null);
+
+ fishingoperationText =
+ _("tutti.label.traitReminder", decorator.toString(bean));
+
if (log.isInfoEnabled()) {
- log.info("Get species batch for fishingOperation: " + bean.getId());
+ log.info("Get species batch for fishingOperation: " +
+ bean.getId() + " - " + fishingoperationText);
}
rows = Lists.newArrayList();
@@ -312,6 +323,8 @@
model.setRows(rows);
fishingOperationMonitor.clearModified();
+
+ ui.getFishingOperationReminderLabel().setText(fishingoperationText);
}
//------------------------------------------------------------------------//
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/plankton/PlanktonBatchUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/plankton/PlanktonBatchUI.jaxx 2012-12-17 07:39:44 UTC (rev 81)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/plankton/PlanktonBatchUI.jaxx 2012-12-17 09:18:52 UTC (rev 82)
@@ -60,48 +60,54 @@
]]></script>
<PlanktonBatchUIHandler id='handler'
- initializer='getContextValue(PlanktonBatchUIHandler.class)'/>
+ initializer='getContextValue(PlanktonBatchUIHandler.class)'/>
<PlanktonBatchUIModel id='model'
- initializer='getContextValue(PlanktonBatchUIModel.class)'/>
+ initializer='getContextValue(PlanktonBatchUIModel.class)'/>
<SwingValidatorMessageTableModel id='errorTableModel'/>
<BeanValidator id='validator' bean='model' errorTableModel='errorTableModel'
uiClass='jaxx.runtime.validator.swing.ui.ImageValidationUI'>
- <field name='totalWeight' component='totalWeightField'/>
+ <field name='totalWeight' component='totalWeightField'/>
<field name='sampleTotalWeight' component='sampleTotalWeightField'/>
</BeanValidator>
<LongTextEditorUI id='longTextEditor'/>
<AttachmentEditorUI id='attachmentEditor'/>
+ <JPanel constraints='BorderLayout.NORTH' layout='{new BorderLayout()}'>
+ <JLabel id='fishingOperationReminderLabel'
+ constraints='BorderLayout.NORTH'/>
+ <JSeparator constraints='BorderLayout.CENTER'/>
- <Table id='form' fill='both' constraints='BorderLayout.NORTH'>
+ <Table id='form' fill='both' constraints='BorderLayout.SOUTH'>
- <!-- Poids total -->
- <row>
- <cell anchor='west'>
- <JLabel id='totalWeightLabel'/>
- </cell>
- <cell weightx='1.0'>
+ <!-- Poids total -->
+ <row>
+ <cell anchor='west'>
+ <JLabel id='totalWeightLabel'/>
+ </cell>
+ <cell weightx='1.0'>
<NumberEditor id='totalWeightField' constructorParams='this'/>
- </cell>
- </row>
+ </cell>
+ </row>
- <!-- Poids total échantillonné -->
- <row>
- <cell>
- <JLabel id='sampleTotalWeightLabel'/>
- </cell>
- <cell>
- <NumberEditor id='sampleTotalWeightField' constructorParams='this'/>
- </cell>
- </row>
- </Table>
+ <!-- Poids total échantillonné -->
+ <row>
+ <cell>
+ <JLabel id='sampleTotalWeightLabel'/>
+ </cell>
+ <cell>
+ <NumberEditor id='sampleTotalWeightField' constructorParams='this'/>
+ </cell>
+ </row>
+ </Table>
+ </JPanel>
<JScrollPane id='tableScrollPane' constraints='BorderLayout.CENTER'>
- <JXTable id='table' onFocusLost='handler.saveSelectedRowIfRequired(event);'/>
+ <JXTable id='table'
+ onFocusLost='handler.saveSelectedRowIfRequired(event);'/>
</JScrollPane>
</JPanel>
\ No newline at end of file
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/plankton/PlanktonBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/plankton/PlanktonBatchUIHandler.java 2012-12-17 07:39:44 UTC (rev 81)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/plankton/PlanktonBatchUIHandler.java 2012-12-17 09:18:52 UTC (rev 82)
@@ -46,6 +46,7 @@
import javax.swing.table.TableColumnModel;
import java.util.List;
+import static org.nuiton.i18n.I18n._;
import static org.nuiton.i18n.I18n.n_;
/**
@@ -327,14 +328,24 @@
List<PlanktonBatchRowModel> rows;
+ String fishingoperationText;
+
if (empty) {
rows = null;
bean = new FishingOperation();
model.setFishingOperation(null);
+ fishingoperationText = "";
} else {
+ Decorator<FishingOperation> decorator =
+ getDecorator(FishingOperation.class, null);
+
+ fishingoperationText =
+ _("tutti.label.traitReminder", decorator.toString(bean));
+
if (log.isInfoEnabled()) {
- log.info("Get species batch for fishingOperation: " + bean.getId());
+ log.info("Get species batch for fishingOperation: " +
+ bean.getId() + " - " + fishingoperationText);
}
rows = Lists.newArrayList();
@@ -354,6 +365,8 @@
model.setRows(rows);
fishingOperationMonitor.clearModified();
+
+ ui.getFishingOperationReminderLabel().setText(fishingoperationText);
}
//------------------------------------------------------------------------//
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/species/SpeciesBatchUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/species/SpeciesBatchUI.jaxx 2012-12-17 07:39:44 UTC (rev 81)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/species/SpeciesBatchUI.jaxx 2012-12-17 09:18:52 UTC (rev 82)
@@ -62,61 +62,67 @@
]]></script>
<SpeciesBatchUIHandler id='handler'
- initializer='getContextValue(SpeciesBatchUIHandler.class)'/>
+ initializer='getContextValue(SpeciesBatchUIHandler.class)'/>
<SpeciesBatchUIModel id='model'
- initializer='getContextValue(SpeciesBatchUIModel.class)'/>
+ initializer='getContextValue(SpeciesBatchUIModel.class)'/>
<SwingValidatorMessageTableModel id='errorTableModel'/>
<BeanValidator id='validator' bean='model' errorTableModel='errorTableModel'
uiClass='jaxx.runtime.validator.swing.ui.ImageValidationUI'>
- <field name='totalWeight' component='totalWeightField'/>
- <field name='totalVracWeight' component='totalVracWeightField'/>
- <field name='sampleVracWeight' component='sampleVracWeightField'/>
+ <field name='totalWeight' component='totalWeightField'/>
+ <field name='totalVracWeight' component='totalVracWeightField'/>
+ <field name='sampleVracWeight' component='sampleVracWeightField'/>
<field name='totalHorsVracWeight' component='totalHorsVracWeightField'/>
</BeanValidator>
- <SpeciesFrequencyUI id='frequencyEditor' constructorParams='handler.getContext()'/>
-
+ <SpeciesFrequencyUI id='frequencyEditor'
+ constructorParams='handler.getContext()'/>
+
<LongTextEditorUI id='longTextEditor'/>
-
+
<AttachmentEditorUI id='attachmentEditor'/>
+ <JPanel constraints='BorderLayout.NORTH' layout='{new BorderLayout()}'>
+ <JLabel id='fishingOperationReminderLabel'
+ constraints='BorderLayout.NORTH'/>
+ <JSeparator constraints='BorderLayout.CENTER'/>
+ <Table id='form' fill='both' constraints='BorderLayout.SOUTH'>
- <Table id='form' fill='both' constraints='BorderLayout.NORTH'>
+ <!-- Poids total / Poids total vrac -->
+ <row>
+ <cell anchor='west'>
+ <JLabel id='totalWeightLabel'/>
+ </cell>
+ <cell weightx='1.0'>
+ <NumberEditor id='totalWeightField' constructorParams='this'/>
+ </cell>
+ <cell anchor='west'>
+ <JLabel id='totalVracWeightLabel'/>
+ </cell>
+ <cell weightx='1.0'>
+ <NumberEditor id='totalVracWeightField' constructorParams='this'/>
+ </cell>
+ </row>
- <!-- Poids total / Poids total vrac -->
- <row>
- <cell anchor='west'>
- <JLabel id='totalWeightLabel'/>
- </cell>
- <cell weightx='1.0'>
- <NumberEditor id='totalWeightField' constructorParams='this'/>
- </cell>
- <cell anchor='west'>
- <JLabel id='totalVracWeightLabel'/>
- </cell>
- <cell weightx='1.0'>
- <NumberEditor id='totalVracWeightField' constructorParams='this'/>
- </cell>
- </row>
+ <!-- Poids échantillonné vrac / Poids total hors vrac -->
+ <row>
+ <cell>
+ <JLabel id='sampleVracWeightLabel'/>
+ </cell>
+ <cell>
+ <NumberEditor id='sampleVracWeightField' constructorParams='this'/>
+ </cell>
+ <cell>
+ <JLabel id='totalHorsVracWeightLabel'/>
+ </cell>
+ <cell>
+ <JTextField id='totalHorsVracWeightField'/>
+ </cell>
+ </row>
+ </Table>
+ </JPanel>
- <!-- Poids échantillonné vrac / Poids total hors vrac -->
- <row>
- <cell>
- <JLabel id='sampleVracWeightLabel'/>
- </cell>
- <cell>
- <NumberEditor id='sampleVracWeightField' constructorParams='this'/>
- </cell>
- <cell>
- <JLabel id='totalHorsVracWeightLabel'/>
- </cell>
- <cell>
- <JTextField id='totalHorsVracWeightField'/>
- </cell>
- </row>
- </Table>
<JScrollPane id='tableScrollPane' constraints='BorderLayout.CENTER'>
<JXTable id='table' onFocusLost='handler.saveSelectedRowIfRequired(event)'/>
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/species/SpeciesBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/species/SpeciesBatchUIHandler.java 2012-12-17 07:39:44 UTC (rev 81)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/species/SpeciesBatchUIHandler.java 2012-12-17 09:18:52 UTC (rev 82)
@@ -53,6 +53,7 @@
import java.util.List;
import java.util.Set;
+import static org.nuiton.i18n.I18n._;
import static org.nuiton.i18n.I18n.n_;
/**
@@ -150,8 +151,6 @@
@Override
protected TableColumnModel createTableColumnModel() {
- List<String> samplingOrder = getModel().getSamplingOrder();
-
DefaultTableColumnModelExt columnModel =
new DefaultTableColumnModelExt();
@@ -188,7 +187,7 @@
}
- if (samplingOrder.contains(SpeciesBatchRowModel.PROPERTY_SORTED_UNSORTED_CATEGORY)) {
+ {
// SortedUnsortedCategory column
@@ -203,7 +202,7 @@
decorator, data);
}
- if (samplingOrder.contains(SpeciesBatchRowModel.PROPERTY_WEIGHT_CATEGORY)) {
+ {
// WeightCategory column
@@ -219,7 +218,7 @@
decorator, data);
}
- if (samplingOrder.contains(SpeciesBatchRowModel.PROPERTY_SEX)) {
+ {
// Sex column
@@ -233,7 +232,7 @@
decorator, data);
}
- if (samplingOrder.contains(SpeciesBatchRowModel.PROPERTY_MATURITY)) {
+ {
// Maturity column
@@ -242,7 +241,7 @@
TuttiUI.DECIMAL3_PATTERN);
}
- if (samplingOrder.contains(SpeciesBatchRowModel.PROPERTY_AGE)) {
+ {
// Age column
@@ -530,14 +529,24 @@
List<SpeciesBatchRowModel> rows;
+ String fishingoperationText;
+
if (empty) {
rows = null;
bean = new FishingOperation();
model.setFishingOperation(null);
+ fishingoperationText = "";
} else {
+ Decorator<FishingOperation> decorator =
+ getDecorator(FishingOperation.class, null);
+
+ fishingoperationText =
+ _("tutti.label.traitReminder", decorator.toString(bean));
+
if (log.isInfoEnabled()) {
- log.info("Get species batch for fishingOperation: " + bean.getId());
+ log.info("Get species batch for fishingOperation: " +
+ bean.getId() + " - " + fishingoperationText);
}
rows = Lists.newArrayList();
@@ -559,6 +568,8 @@
model.setRows(rows);
fishingOperationMonitor.clearModified();
+
+ ui.getFishingOperationReminderLabel().setText(fishingoperationText);
}
//------------------------------------------------------------------------//
@@ -592,7 +603,9 @@
SpeciesBatchRowModel.PROPERTY_SPECIES,
SpeciesBatchRowModel.PROPERTY_SORTED_UNSORTED_CATEGORY,
SpeciesBatchRowModel.PROPERTY_WEIGHT_CATEGORY,
- SpeciesBatchRowModel.PROPERTY_SEX
+ SpeciesBatchRowModel.PROPERTY_SEX,
+ SpeciesBatchRowModel.PROPERTY_MATURITY,
+ SpeciesBatchRowModel.PROPERTY_AGE
);
getModel().setSamplingOrder(samplingOrder);
Modified: trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties
===================================================================
--- trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2012-12-17 07:39:44 UTC (rev 81)
+++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2012-12-17 09:18:52 UTC (rev 82)
@@ -132,6 +132,7 @@
tutti.label.tab.observationIndividuel=Observations individuelles
tutti.label.tab.plancton=Plancton
tutti.label.tab.species=Espèces
+tutti.label.traitReminder=Trait \: %s
tutti.legend.frequencyConfiguration=Configuration
tutti.menu.actions=Actions
tutti.menu.actions.tip=Actions
Modified: trunk/tutti-ui-swing/src/main/resources/icons/action-edit-comment.png
===================================================================
(Binary files differ)
1
0