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
January 2013
- 4 participants
- 143 discussions
30 Jan '13
Author: tchemit
Date: 2013-01-30 09:41:21 +0100 (Wed, 30 Jan 2013)
New Revision: 259
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/259
Log:
add CatchBatch bean (still not used)
Modified:
trunk/tutti-persistence/src/main/xmi/tutti-persistence.zargo
Modified: trunk/tutti-persistence/src/main/xmi/tutti-persistence.zargo
===================================================================
(Binary files differ)
1
0
r258 - in trunk/tutti-service/src/main: java/fr/ifremer/tutti/service resources/i18n
by tchemit@users.forge.codelutin.com 30 Jan '13
by tchemit@users.forge.codelutin.com 30 Jan '13
30 Jan '13
Author: tchemit
Date: 2013-01-30 09:40:52 +0100 (Wed, 30 Jan 2013)
New Revision: 258
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/258
Log:
add trawlNetNumber in fishing operation decoration
Modified:
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/DecoratorService.java
trunk/tutti-service/src/main/resources/i18n/tutti-service_fr_FR.properties
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 2013-01-29 18:13:04 UTC (rev 257)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/DecoratorService.java 2013-01-30 08:40:52 UTC (rev 258)
@@ -104,7 +104,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#${gearShootingStartDate}$td/%3$tm/%3$tY", SEPARATOR, " - ");
+ registerMultiJXPathDecorator(FishingOperation.class, "${stationNumber}$s#${fishingOperationNumber}$s#${trawlNetNumber}$s#${gearShootingStartDate}$td/%3$tm/%3$tY", SEPARATOR, " - ");
registerMultiJXPathDecorator(Zone.class, "${label}$s#${name}$s", SEPARATOR, " - ");
registerMultiJXPathDecorator(Vessel.class, "${name}$s#${internalRegistrationCode}$s", SEPARATOR, " - ");
registerMultiJXPathDecorator(Country.class, "${label}$s#${name}$s", SEPARATOR, " - ");
@@ -161,6 +161,7 @@
n_("tutti.property.sortedUnsortedCategory");
n_("tutti.property.macroWasteCategory");
n_("tutti.property.attachment");
+ n_("tutti.property.trawlNetNumber");
}
}
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 2013-01-29 18:13:04 UTC (rev 257)
+++ trunk/tutti-service/src/main/resources/i18n/tutti-service_fr_FR.properties 2013-01-30 08:40:52 UTC (rev 258)
@@ -16,6 +16,7 @@
tutti.property.genusSpecies=Nom scientifique
tutti.property.internalRegistrationCode=Immatriculation internationale
tutti.property.label=Code
+tutti.property.trawlNetNumber=Numéro de poche
tutti.property.lastName=Nom de Famille
tutti.property.macroWasteCategory=Type de macro déchet
tutti.property.matrixName=Support
1
0
29 Jan '13
Author: kmorin
Date: 2013-01-29 19:13:04 +0100 (Tue, 29 Jan 2013)
New Revision: 257
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/257
Log:
- add icons
- cruise: layout
- protocol: the columns cannot be reoder + the rows are always valid, even if the size class is not set
- fishing operation: compute distance + set color to the tab if the operation is valid or not + set the gear and vessel if only one in the cruise + disable the trawlnet number if there is only one in the cruise
Added:
trunk/tutti-ui-swing/src/main/resources/icons/action-allegro.png
trunk/tutti-ui-swing/src/main/resources/icons/action-calendar.png
trunk/tutti-ui-swing/src/main/resources/icons/action-coordinates.png
trunk/tutti-ui-swing/src/main/resources/icons/action-cruise.png
trunk/tutti-ui-swing/src/main/resources/icons/action-filter.png
trunk/tutti-ui-swing/src/main/resources/icons/action-gear.png
trunk/tutti-ui-swing/src/main/resources/icons/action-location.png
trunk/tutti-ui-swing/src/main/resources/icons/action-person.png
trunk/tutti-ui-swing/src/main/resources/icons/action-prelevements.png
trunk/tutti-ui-swing/src/main/resources/icons/action-program.png
trunk/tutti-ui-swing/src/main/resources/icons/action-psfm.png
trunk/tutti-ui-swing/src/main/resources/icons/action-samplingOperation.png
trunk/tutti-ui-swing/src/main/resources/icons/action-time.png
trunk/tutti-ui-swing/src/main/resources/icons/action-vessel.png
Modified:
trunk/tutti-ui-swing/pom.xml
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/EditSelectedCruiseAction.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/EditSelectedProgramAction.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/MainUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUI.jaxx
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/EditFishingOperationUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationsUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/CustomTab.java
trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties
Modified: trunk/tutti-ui-swing/pom.xml
===================================================================
--- trunk/tutti-ui-swing/pom.xml 2013-01-29 18:06:46 UTC (rev 256)
+++ trunk/tutti-ui-swing/pom.xml 2013-01-29 18:13:04 UTC (rev 257)
@@ -240,19 +240,7 @@
<version>${project.version}</version>
<!--<scope>runtime</scope>-->
</dependency>
-
-
- <!--dependency>
- <groupId>com.jidesoft</groupId>
- <artifactId>jide-oss</artifactId>
- <version>3.5.0</version>
- </dependency-->
-
- <!--dependency>
- <groupId>fr.ird</groupId>
- <artifactId>msaccess-importer</artifactId>
- </dependency-->
-
+
<dependency>
<groupId>org.nuiton</groupId>
<artifactId>nuiton-utils</artifactId>
@@ -366,6 +354,11 @@
<artifactId>junit</artifactId>
</dependency>
+ <dependency>
+ <groupId>com.javadocmd</groupId>
+ <artifactId>simplelatlng</artifactId>
+ </dependency>
+
</dependencies>
<profiles>
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/EditSelectedCruiseAction.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/EditSelectedCruiseAction.java 2013-01-29 18:06:46 UTC (rev 256)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/EditSelectedCruiseAction.java 2013-01-29 18:13:04 UTC (rev 257)
@@ -48,7 +48,7 @@
public EditSelectedCruiseAction(MainUIHandler handler) {
super(handler,
"editCruise",
- "edit",
+ "cruise",
_("tutti.action.editSelectedCruise"),
_("tutti.action.editSelectedCruise.tip"),
true
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/EditSelectedProgramAction.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/EditSelectedProgramAction.java 2013-01-29 18:06:46 UTC (rev 256)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/EditSelectedProgramAction.java 2013-01-29 18:13:04 UTC (rev 257)
@@ -48,7 +48,7 @@
public EditSelectedProgramAction(MainUIHandler handler) {
super(handler,
"editProgram",
- "edit",
+ "program",
_("tutti.action.editSelectedProgram"),
_("tutti.action.editSelectedProgram.tip"),
true
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/MainUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/MainUI.css 2013-01-29 18:06:46 UTC (rev 256)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/MainUI.css 2013-01-29 18:13:04 UTC (rev 257)
@@ -119,6 +119,7 @@
toolTipText: "tutti.menu.synchronisationAllegro.tip";
mnemonic: A;
enabled: false;
+ actionIcon: allegro;
}
#menuHelp {
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 2013-01-29 18:06:46 UTC (rev 256)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUI.css 2013-01-29 18:13:04 UTC (rev 257)
@@ -123,14 +123,6 @@
numberPattern: {INT_1_DIGITS_PATTERN};
}
-#vesselList {
- property: vessel;
-}
-
-#vesselListPane {
- border: {BorderFactory.createTitledBorder(_("tutti.label.list.vessel"))};
-}
-
#filterVesselLabel {
text: "tutti.label.filterVesselType";
}
@@ -159,6 +151,11 @@
buttonGroup: "filterVesselType";
}
+#vesselList {
+ property: vessel;
+ border: {BorderFactory.createTitledBorder(_("tutti.label.list.vessel"))};
+}
+
#gearList {
property: gear;
border: {BorderFactory.createTitledBorder(_("tutti.label.list.gear"))};
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUI.jaxx 2013-01-29 18:06:46 UTC (rev 256)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUI.jaxx 2013-01-29 18:13:04 UTC (rev 257)
@@ -44,7 +44,9 @@
org.jdesktop.swingx.JXDatePicker
javax.swing.DefaultListModel
+ javax.swing.JSeparator
javax.swing.ListSelectionModel
+ javax.swing.SwingConstants
java.awt.Dimension
@@ -168,21 +170,28 @@
</row>
<!-- cruise vessel / gear -->
+ <row>
+ <cell columns='6'>
+ <JSeparator constructorParams='SwingConstants.HORIZONTAL'/>
+ </cell>
+ </row>
+ <row>
+ <cell columns='6'>
+ <JPanel id='vesselFilterPane'>
+ <JLabel id='filterVesselLabel'/>
+ <JRadioButton id='filterVesselAllButton'
+ onActionPerformed='model.setVesselType(VesselTypeEnum.ALL)'/>
+ <JRadioButton id='filterVesselScientificButton'
+ onActionPerformed='model.setVesselType(VesselTypeEnum.SCIENTIFIC)'/>
+ <JRadioButton id='filterVesselFishingButton'
+ onActionPerformed='model.setVesselType(VesselTypeEnum.FISHING)'/>
+ </JPanel>
+ </cell>
+ </row>
<row weighty='0.3'>
<cell columns='6'>
<JPanel layout='{new GridLayout(1, 0)}'>
- <JPanel id='vesselListPane' layout="{new BorderLayout()}">
- <JPanel id='vesselFilterPane' constraints='BorderLayout.NORTH'>
- <JLabel id='filterVesselLabel'/>
- <JRadioButton id='filterVesselAllButton'
- onActionPerformed='model.setVesselType(VesselTypeEnum.ALL)'/>
- <JRadioButton id='filterVesselScientificButton'
- onActionPerformed='model.setVesselType(VesselTypeEnum.SCIENTIFIC)'/>
- <JRadioButton id='filterVesselFishingButton'
- onActionPerformed='model.setVesselType(VesselTypeEnum.FISHING)'/>
- </JPanel>
- <BeanDoubleList id='vesselList' genericType='Vessel' constraints='BorderLayout.CENTER'/>
- </JPanel>
+ <BeanDoubleList id='vesselList' genericType='Vessel'/>
<BeanDoubleList id='gearList' genericType='Gear'/>
</JPanel>
</cell>
Modified: 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.css 2013-01-29 18:06:46 UTC (rev 256)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.css 2013-01-29 18:13:04 UTC (rev 257)
@@ -109,18 +109,22 @@
#gearLongitudeLabel {
text: "tutti.label.fishingOperation.gearLongitude";
+ actionIcon: "coordinates";
}
#gearLatitudeLabel {
text: "tutti.label.fishingOperation.gearLatitude";
+ actionIcon: "coordinates";
}
#gearDateLabel {
text: "tutti.label.fishingOperation.gearDate";
+ actionIcon: "calendar";
}
#gearTimeLabel {
text: "tutti.label.fishingOperation.gearTime";
+ actionIcon: "time";
}
#gearShootingStartLabel {
@@ -136,11 +140,13 @@
}
#traitVesselPanel {
- border: {BorderFactory.createTitledBorder((String)null)};
+ border: {BorderFactory.createTitledBorder(_("tutti.label.fishingOperation.other"))};
}
+
#vesselLabel {
text: "tutti.label.fishingOperation.vessel";
labelFor: {vesselComboBox};
+ actionIcon: "vessel";
}
#vesselComboBox {
@@ -151,6 +157,7 @@
#gearLabel {
text: "tutti.label.fishingOperation.gear";
labelFor: {gearComboBox};
+ actionIcon: "gear";
}
#gearComboBox {
@@ -167,7 +174,7 @@
showReset: false;
useFloat: false;
useSign: false;
- numberPattern: {INT_1_DIGITS_PATTERN};
+ numberPattern: {INT_2_DIGITS_PATTERN};
property: trawlNetNumber;
model: {model.getTrawlNetNumber()};
}
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 2013-01-29 18:06:46 UTC (rev 256)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java 2013-01-29 18:13:04 UTC (rev 257)
@@ -26,6 +26,9 @@
import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
+import com.javadocmd.simplelatlng.LatLng;
+import com.javadocmd.simplelatlng.LatLngTool;
+import com.javadocmd.simplelatlng.util.LengthUnit;
import fr.ifremer.tutti.persistence.entities.data.Cruise;
import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
import fr.ifremer.tutti.persistence.entities.data.Program;
@@ -49,7 +52,6 @@
import fr.ifremer.tutti.ui.swing.util.TabHandler;
import fr.ifremer.tutti.ui.swing.util.TuttiBeanMonitor;
import fr.ifremer.tutti.ui.swing.util.TuttiUIUtil;
-import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -58,6 +60,8 @@
import javax.swing.JPanel;
import javax.swing.JTabbedPane;
import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.Component;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.util.List;
@@ -158,7 +162,50 @@
onSelectedSubStrata(source, newStrata);
}
});
+
+ model.addPropertyChangeListener(EditFishingOperationUIModel.PROPERTY_FISHING_OPERATION_RECTILIGNE, new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ Boolean rectiligne = (Boolean) evt.getNewValue();
+ if (rectiligne) {
+ EditFishingOperationUIModel source = (EditFishingOperationUIModel) evt.getSource();
+ Float latS = source.getGearShootingStartLatitude();
+ Float longS = source.getGearShootingStartLongitude();
+ Float latE = source.getGearShootingEndLatitude();
+ Float longE = source.getGearShootingEndLongitude();
+
+ if (latS != null && longS != null
+ && latE != null && longE != null) {
+ LatLng start = new LatLng(latS, longS);
+ LatLng end = new LatLng(latE, longE);
+ Double distance = LatLngTool.distance(start, end, LengthUnit.KILOMETER);
+ source.setTrawlDistance(distance.floatValue());
+ }
+ }
+ }
+ });
+
+ model.addPropertyChangeListener(EditFishingOperationUIModel.PROPERTY_FISHING_OPERATION_VALID, new PropertyChangeListener() {
+
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ Boolean valid = (Boolean) evt.getNewValue();
+ Color color = null;
+ Color fontColor = Color.BLACK;
+ if (valid == Boolean.TRUE) {
+ color = Color.GREEN;
+
+ } else if (valid == Boolean.FALSE) {
+ color = Color.RED;
+ fontColor = Color.WHITE;
+ }
+ Component tab = getTabPanel().getTabComponentAt(0);
+ tab.setForeground(fontColor);
+ tab.setBackground(color);
+ }
+ });
+
getContext().addPropertyChangeListener(TuttiUIContext.PROPERTY_VALIDATION_CONTEXT, new PropertyChangeListener() {
@Override
@@ -194,6 +241,11 @@
Lists.<Gear>newArrayList(),
null);
+ Cruise cruise = TuttiUIUtil.getCruise(ui);
+ Preconditions.checkNotNull(cruise,
+ "Could not find cruise in ui context");
+ ui.getTrawlNetNumberField().setEnabled(cruise.getTrawlNet() != 1);
+
Program program = TuttiUIUtil.getProgram(ui);
Preconditions.checkNotNull(program,
"Could not find program in ui context");
@@ -232,7 +284,7 @@
setCustomTab(0, model);
listModelIsModify(model);
-
+
//init gear shooting
GearShootingTabUIModel gearShootingModel =
ui.getGearShootingTabContent().getModel();
@@ -277,7 +329,6 @@
});
}
-
MainUI main = ui.getContextValue(MainUI.class, MainUI.class.getName());
main.clearValidators();
main.registerValidator(ui.getValidator());
@@ -404,7 +455,7 @@
// update saisissuer selection
List<Person> saisisseur = model.getSaisisseur();
ui.getSaisisseurList().getModel().setSelected(saisisseur);
-
+
// update model empty property
model.setEmpty(empty);
@@ -463,40 +514,40 @@
// reset sub strata combo
ui.getSubStrataComboBox().setData(null);
- Zone zone =
- model.getFishingOperation().getCruise().getProgram().getZone();
-
- String zoneId = zone.getId();
- String strataId = newStrata == null ? null : newStrata.getId();
-
- List<FishingOperationLocation> subStrata =
- persistenceService.getAllFishingOperationSubStrata(zoneId, strataId);
-
- List<FishingOperationLocation> location =
- persistenceService.getAllFishingOperationLocation(zoneId, strataId, null);
-
- ui.getSubStrataComboBox().setData(subStrata);
-
- ui.getLocationComboBox().setData(location);
-
- if (newStrata == null) {
-
- // reset strata, keep focus on it
- ui.getStrataComboBox().grabFocus();
-
- } else {
-
- // try to load substrata
-
-
- if (CollectionUtils.isEmpty(subStrata)) {
-
- // try to load localite
-
-
- ui.getLocationComboBox().grabFocus();
- }
- }
+// Zone zone =
+// model.getFishingOperation().getCruise().getProgram().getZone();
+//
+// String zoneId = zone.getId();
+// String strataId = newStrata == null ? null : newStrata.getId();
+//
+// List<FishingOperationLocation> subStrata =
+// persistenceService.getAllFishingOperationSubStrata(zoneId, strataId);
+//
+// List<FishingOperationLocation> location =
+// persistenceService.getAllFishingOperationLocation(zoneId, strataId, null);
+//
+// ui.getSubStrataComboBox().setData(subStrata);
+//
+// ui.getLocationComboBox().setData(location);
+//
+// if (newStrata == null) {
+//
+// // reset strata, keep focus on it
+// ui.getStrataComboBox().grabFocus();
+//
+// } else {
+//
+// // try to load substrata
+//
+//
+// if (CollectionUtils.isEmpty(subStrata)) {
+//
+// // try to load localite
+//
+//
+// ui.getLocationComboBox().grabFocus();
+// }
+// }
}
protected void onSelectedSubStrata(EditFishingOperationUIModel model,
@@ -507,25 +558,25 @@
// reset localite combo
ui.getLocationComboBox().setData(null);
- Zone zone =
- getModel().getFishingOperation().getCruise().getProgram().getZone();
- String zoneId = zone.getId();
-
- FishingOperationLocation strata = model.getStrata();
- String subStrataId = newSubStrata == null ? null : newSubStrata.getId();
-
- String strataId = strata == null ? null : strata.getId();
-
- List<FishingOperationLocation> location =
- persistenceService.getAllFishingOperationLocation(zoneId, strataId, subStrataId);
-
- ui.getLocationComboBox().setData(location);
-
- if (newSubStrata == null) {
-
- // reset substrata, keep focus on it
- ui.getSubStrataComboBox().grabFocus();
- }
+// Zone zone =
+// getModel().getFishingOperation().getCruise().getProgram().getZone();
+// String zoneId = zone.getId();
+//
+// FishingOperationLocation strata = model.getStrata();
+// String subStrataId = newSubStrata == null ? null : newSubStrata.getId();
+//
+// String strataId = strata == null ? null : strata.getId();
+//
+// List<FishingOperationLocation> location =
+// persistenceService.getAllFishingOperationLocation(zoneId, strataId, subStrataId);
+//
+// ui.getLocationComboBox().setData(location);
+//
+// if (newSubStrata == null) {
+//
+// // reset substrata, keep focus on it
+// ui.getSubStrataComboBox().grabFocus();
+// }
}
protected boolean areAllModelsValid() {
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationsUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationsUIHandler.java 2013-01-29 18:06:46 UTC (rev 256)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationsUIHandler.java 2013-01-29 18:13:04 UTC (rev 257)
@@ -197,23 +197,31 @@
// use a new empty fishingOperation
FishingOperation newFishingOperation = new FishingOperation();
- newFishingOperation.setCruise(TuttiUIUtil.getCruise(ui));
+ Cruise cruise = TuttiUIUtil.getCruise(ui);
+ newFishingOperation.setCruise(cruise);
//TODO Should select vessel from possible one ?
- Vessel vessel = newFishingOperation.getCruise().getVessel(0);
- newFishingOperation.setVessel(vessel);
+ List<Vessel> vessels = cruise.getVessel();
+ if (vessels.size() == 1) {
+ newFishingOperation.setVessel(vessels.get(0));
+ }
//TODO Should select gear from possible one ?
- Gear gear = newFishingOperation.getCruise().getGear(0);
- newFishingOperation.setGear(gear);
- newFishingOperation.setTrawlNetNumber(1);
+ List<Gear> gears = cruise.getGear();
+ if (gears.size() == 1) {
+ newFishingOperation.setGear(gears.get(0));
+ }
+
+ if (cruise.getTrawlNet() == 1) {
+ newFishingOperation.setTrawlNetNumber(1);
+ }
// by default use the current day with no time information
- Date currentDate = DateUtils.setMinutes(
- DateUtils.setHours(new Date(), 0), 0);
+// Date currentDate = DateUtils.setMinutes(
+// DateUtils.setHours(new Date(), 0), 0);
- newFishingOperation.setGearShootingStartDate(currentDate);
- newFishingOperation.setGearShootingEndDate(currentDate);
+ newFishingOperation.setGearShootingStartDate(null);
+ newFishingOperation.setGearShootingEndDate(null);
selectFishingOperation(newFishingOperation);
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIHandler.java 2013-01-29 18:06:46 UTC (rev 256)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIHandler.java 2013-01-29 18:13:04 UTC (rev 257)
@@ -161,7 +161,7 @@
if (fishingOperationMonitor.wasModified()) {
save();
}
-
+
ui.getSpeciesTabContent().getHandler().clearTableSelection();
ui.getBenthosTabContent().getHandler().clearTableSelection();
ui.getPlanktonTabContent().getHandler().clearTableSelection();
@@ -194,7 +194,6 @@
fishingOperationMonitor.clearModified();
// 3) Propagate title to others tabs
-
ui.getCatchesCaracteristicsTabPane().setTitle(fishingOperationText);
ui.getSpeciesTabFishingOperationReminderLabel().setTitle(fishingOperationText);
ui.getBenthosTabFishingOperationReminderLabel().setTitle(fishingOperationText);
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUI.css 2013-01-29 18:06:46 UTC (rev 256)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUI.css 2013-01-29 18:13:04 UTC (rev 257)
@@ -126,6 +126,7 @@
text: "tutti.label.filterSpeciesBatchMode.label";
toolTipText: "tutti.label.filterSpeciesBatchMode.label.tip";
_strongStyle: true;
+ actionIcon: filter;
}
#filterSpeciesBatchAllButton {
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUIHandler.java 2013-01-29 18:06:46 UTC (rev 256)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUIHandler.java 2013-01-29 18:13:04 UTC (rev 257)
@@ -120,8 +120,7 @@
@Override
protected boolean isRowValid(EditProtocolSpeciesRowModel row) {
- boolean result = row.getLengthStepPmfm() != null;
- return result;
+ return true;
}
@Override
@@ -226,6 +225,7 @@
if (mustClone != null && mustClone) {
ui.setContextValue(false, MainUIHandler.CLONE_PROTOCOL);
model.setId(null);
+ model.setName(null);
}
} else {
@@ -284,25 +284,6 @@
}
}
- columnModel.addColumnModelListener(new TableColumnModelListener() {
-
- public void columnAdded(TableColumnModelEvent e) {
- }
-
- public void columnRemoved(TableColumnModelEvent e) {
- }
-
- public void columnMoved(TableColumnModelEvent e) {
- getModel().setModify(true);
- }
-
- public void columnMarginChanged(ChangeEvent e) {
- }
-
- public void columnSelectionChanged(ListSelectionEvent e) {
- }
- });
-
EditProtocolSpeciesTableModel tableModel =
new EditProtocolSpeciesTableModel(columnModel);
table.setModel(tableModel);
@@ -310,9 +291,6 @@
initTable(table);
- // Authorize to change column orders
- table.getTableHeader().setReorderingAllowed(true);
-
List<Species> speciesList = Lists.newArrayList(allSpecies.values());
List<EditProtocolSpeciesRowModel> rows = Lists.newArrayList();
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/CustomTab.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/CustomTab.java 2013-01-29 18:06:46 UTC (rev 256)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/CustomTab.java 2013-01-29 18:13:04 UTC (rev 257)
@@ -59,7 +59,7 @@
public CustomTab(AbstractTuttiBeanUIModel model) {
this.model = model;
title.setText(_(model.getTitle()));
- setBackground(new Color(0, 0, 0, 0));
+ setBackground(null);
this.model.addPropertyChangeListener(AbstractTuttiBeanUIModel.PROPERTY_MODIFY, new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent evt) {
@@ -73,5 +73,22 @@
});
add(title);
}
+
+ @Override
+ public void setBackground(Color bg) {
+ if (bg == null) {
+ bg = new Color(0, 0, 0, 0);
+ }
+ super.setBackground(bg);
+ revalidate();
+ }
+
+ @Override
+ public void setForeground(Color fg) {
+ super.setForeground(fg);
+ if (title != null) {
+ title.setForeground(fg);
+ }
+ }
}
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 2013-01-29 18:06:46 UTC (rev 256)
+++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2013-01-29 18:13:04 UTC (rev 257)
@@ -168,6 +168,7 @@
tutti.label.fishingOperation.gearShootingStart=Début de traine
tutti.label.fishingOperation.gearTime=Heure
tutti.label.fishingOperation.location=Localité
+tutti.label.fishingOperation.other=Autres caractéristiques
tutti.label.fishingOperation.stationNumber=Code Station
tutti.label.fishingOperation.strata=Strate
tutti.label.fishingOperation.subStrata=Sous strate
Added: trunk/tutti-ui-swing/src/main/resources/icons/action-allegro.png
===================================================================
(Binary files differ)
Property changes on: trunk/tutti-ui-swing/src/main/resources/icons/action-allegro.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/tutti-ui-swing/src/main/resources/icons/action-calendar.png
===================================================================
(Binary files differ)
Property changes on: trunk/tutti-ui-swing/src/main/resources/icons/action-calendar.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/tutti-ui-swing/src/main/resources/icons/action-coordinates.png
===================================================================
(Binary files differ)
Property changes on: trunk/tutti-ui-swing/src/main/resources/icons/action-coordinates.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/tutti-ui-swing/src/main/resources/icons/action-cruise.png
===================================================================
(Binary files differ)
Property changes on: trunk/tutti-ui-swing/src/main/resources/icons/action-cruise.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/tutti-ui-swing/src/main/resources/icons/action-filter.png
===================================================================
(Binary files differ)
Property changes on: trunk/tutti-ui-swing/src/main/resources/icons/action-filter.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/tutti-ui-swing/src/main/resources/icons/action-gear.png
===================================================================
(Binary files differ)
Property changes on: trunk/tutti-ui-swing/src/main/resources/icons/action-gear.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/tutti-ui-swing/src/main/resources/icons/action-location.png
===================================================================
(Binary files differ)
Property changes on: trunk/tutti-ui-swing/src/main/resources/icons/action-location.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/tutti-ui-swing/src/main/resources/icons/action-person.png
===================================================================
(Binary files differ)
Property changes on: trunk/tutti-ui-swing/src/main/resources/icons/action-person.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/tutti-ui-swing/src/main/resources/icons/action-prelevements.png
===================================================================
(Binary files differ)
Property changes on: trunk/tutti-ui-swing/src/main/resources/icons/action-prelevements.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/tutti-ui-swing/src/main/resources/icons/action-program.png
===================================================================
(Binary files differ)
Property changes on: trunk/tutti-ui-swing/src/main/resources/icons/action-program.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/tutti-ui-swing/src/main/resources/icons/action-psfm.png
===================================================================
(Binary files differ)
Property changes on: trunk/tutti-ui-swing/src/main/resources/icons/action-psfm.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/tutti-ui-swing/src/main/resources/icons/action-samplingOperation.png
===================================================================
(Binary files differ)
Property changes on: trunk/tutti-ui-swing/src/main/resources/icons/action-samplingOperation.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/tutti-ui-swing/src/main/resources/icons/action-time.png
===================================================================
(Binary files differ)
Property changes on: trunk/tutti-ui-swing/src/main/resources/icons/action-time.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/tutti-ui-swing/src/main/resources/icons/action-vessel.png
===================================================================
(Binary files differ)
Property changes on: trunk/tutti-ui-swing/src/main/resources/icons/action-vessel.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
1
0
Author: kmorin
Date: 2013-01-29 19:06:46 +0100 (Tue, 29 Jan 2013)
New Revision: 256
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/256
Log:
add dependency
Modified:
trunk/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2013-01-29 12:29:44 UTC (rev 255)
+++ trunk/pom.xml 2013-01-29 18:06:46 UTC (rev 256)
@@ -410,6 +410,12 @@
<artifactId>yamlbeans</artifactId>
<version>1.06</version>
</dependency>
+
+ <dependency>
+ <groupId>com.javadocmd</groupId>
+ <artifactId>simplelatlng</artifactId>
+ <version>1.0.1</version>
+ </dependency>
</dependencies>
@@ -484,7 +490,17 @@
</plugins>
</pluginManagement>
-
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.3.2</version>
+ <configuration>
+ <source>1.7</source>
+ <target>1.7</target>
+ </configuration>
+ </plugin>
+ </plugins>
</build>
<!-- Repositories needed to find the dependencies -->
1
0
r255 - in trunk: tutti-persistence tutti-persistence/src/license tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/service/synchro tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation
by tchemit@users.forge.codelutin.com 29 Jan '13
by tchemit@users.forge.codelutin.com 29 Jan '13
29 Jan '13
Author: tchemit
Date: 2013-01-29 13:29:44 +0100 (Tue, 29 Jan 2013)
New Revision: 255
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/255
Log:
- fix dependencies + third parties
- refs #1912: [Ecran Trait] Filtrage des strates - sous-strates - localit?\195?\169s
Modified:
trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/service/synchro/ReferentialSynchronizeHelperTest.java
trunk/tutti-persistence/pom.xml
trunk/tutti-persistence/src/license/THIRD-PARTY.properties
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java
Modified: trunk/tutti-persistence/pom.xml
===================================================================
--- trunk/tutti-persistence/pom.xml 2013-01-29 08:24:13 UTC (rev 254)
+++ trunk/tutti-persistence/pom.xml 2013-01-29 12:29:44 UTC (rev 255)
@@ -21,7 +21,9 @@
#L%
-->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
@@ -59,6 +61,11 @@
</dependency>
<dependency>
+ <groupId>commons-collections</groupId>
+ <artifactId>commons-collections</artifactId>
+ </dependency>
+
+ <dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</dependency>
@@ -95,8 +102,10 @@
<execution>
<phase>generate-sources</phase>
<configuration>
- <defaultPackage>fr.ifremer.tutti.persistence.entities</defaultPackage>
- <fullPackagePath>fr.ifremer.tutti.persistence.entities</fullPackagePath>
+ <defaultPackage>fr.ifremer.tutti.persistence.entities
+ </defaultPackage>
+ <fullPackagePath>fr.ifremer.tutti.persistence.entities
+ </fullPackagePath>
<inputs>zargo</inputs>
</configuration>
<goals>
Modified: trunk/tutti-persistence/src/license/THIRD-PARTY.properties
===================================================================
--- trunk/tutti-persistence/src/license/THIRD-PARTY.properties 2013-01-29 08:24:13 UTC (rev 254)
+++ trunk/tutti-persistence/src/license/THIRD-PARTY.properties 2013-01-29 12:29:44 UTC (rev 255)
@@ -15,5 +15,8 @@
#
#
#Sat Jan 19 08:25:52 CET 2013
+antlr--antlr--2.7.6=BSD License
commons-primitives--commons-primitives--1.0=The Apache Software License, Version 2.0
-regexp--regexp--1.3=The Apache Software License, Version 2.0
+dom4j--dom4j--1.6.1=BSD License
+javax.transaction--jta--1.1=COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
+regexp--regexp--1.3=The Apache Software License, Version 2.0
\ No newline at end of file
Modified: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/service/synchro/ReferentialSynchronizeHelperTest.java
===================================================================
--- trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/service/synchro/ReferentialSynchronizeHelperTest.java 2013-01-29 08:24:13 UTC (rev 254)
+++ trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/service/synchro/ReferentialSynchronizeHelperTest.java 2013-01-29 12:29:44 UTC (rev 255)
@@ -28,7 +28,7 @@
import fr.ifremer.tutti.persistence.DatabaseResource;
import fr.ifremer.tutti.persistence.entities.TuttiEntities;
import fr.ifremer.tutti.persistence.service.TuttiPersistenceServiceLocator;
-import org.apache.commons.lang.ObjectUtils;
+import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.time.DateUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
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 2013-01-29 08:24:13 UTC (rev 254)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java 2013-01-29 12:29:44 UTC (rev 255)
@@ -49,17 +49,18 @@
import fr.ifremer.tutti.ui.swing.util.TabHandler;
import fr.ifremer.tutti.ui.swing.util.TuttiBeanMonitor;
import fr.ifremer.tutti.ui.swing.util.TuttiUIUtil;
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import javax.swing.JLabel;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.JTabbedPane;
import java.awt.BorderLayout;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.util.List;
-import javax.swing.JLabel;
-import javax.swing.JOptionPane;
-import javax.swing.JPanel;
-import javax.swing.JTabbedPane;
-import org.apache.commons.collections.CollectionUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
/**
* Handler for UI {@link EditFishingOperationUI}.
@@ -68,7 +69,7 @@
* @since 0.1
*/
public class EditFishingOperationUIHandler extends AbstractTuttiTabContainerUIHandler<EditFishingOperationUIModel>
- implements TabHandler {
+ implements TabHandler {
/** Logger. */
private static final Log log =
@@ -208,29 +209,16 @@
FishingOperationLocation location = model.getLocation();
+ String zoneId = zone.getId();
List<FishingOperationLocation> stratas =
- persistenceService.getAllFishingOperationStrata(zone.getId());
+ persistenceService.getAllFishingOperationStrata(zoneId);
- List<FishingOperationLocation> subStratas;
+ List<FishingOperationLocation> subStratas =
+ persistenceService.getAllFishingOperationSubStrata(zoneId, strataId);
- if (strataId == null) {
- subStratas = Lists.newArrayList();
- } else {
+ List<FishingOperationLocation> locations =
+ persistenceService.getAllFishingOperationLocation(zoneId, strataId, substrataId);
- // load substratas
- subStratas = persistenceService.getAllFishingOperationSubStrata(strataId);
- }
-
- List<FishingOperationLocation> locations;
-
- if (substrataId == null) {
- locations = Lists.newArrayList();
- } else {
-
- // load localites
- locations = persistenceService.getAllFishingOperationLocation(substrataId);
- }
-
initBeanComboBox(ui.getStrataComboBox(), stratas, strata);
initBeanComboBox(ui.getSubStrataComboBox(), subStratas, subStrata);
@@ -275,7 +263,7 @@
environmentModel.addPropertyChangeListener(AbstractTuttiBeanUIModel.PROPERTY_VALID, pcl);
hydrologyModel.addPropertyChangeListener(AbstractTuttiBeanUIModel.PROPERTY_VALID, pcl);
model.addPropertyChangeListener(AbstractTuttiBeanUIModel.PROPERTY_VALID, pcl);
-
+
} else {
model.addPropertyChangeListener(AbstractTuttiBeanUIModel.PROPERTY_VALID, new PropertyChangeListener() {
@@ -288,8 +276,8 @@
}
});
}
-
-
+
+
MainUI main = ui.getContextValue(MainUI.class, MainUI.class.getName());
main.clearValidators();
main.registerValidator(ui.getValidator());
@@ -320,11 +308,11 @@
case JOptionPane.OK_OPTION:
ui.getSaveFishingOperationAction().actionPerformed(null);
break;
-
+
case JOptionPane.NO_OPTION:
parentUi.getHandler().reloadFishingOperation();
break;
-
+
case JOptionPane.CANCEL_OPTION:
result = false;
}
@@ -335,7 +323,7 @@
@Override
public void onShowTab() {
}
-
+
@Override
protected JTabbedPane getTabPanel() {
return ui.getFishingOperationTabPane();
@@ -351,13 +339,13 @@
//------------------------------------------------------------------------//
public CaracteristicTabUIModel[] getSubModels() {
- return new CaracteristicTabUIModel[] {
- ui.getGearShootingTabContent().getModel(),
- ui.getEnvironmentTabContent().getModel(),
- ui.getHydrologyTabContent().getModel()
+ return new CaracteristicTabUIModel[]{
+ ui.getGearShootingTabContent().getModel(),
+ ui.getEnvironmentTabContent().getModel(),
+ ui.getHydrologyTabContent().getModel()
};
}
-
+
public void clearFishingOperation() {
EditFishingOperationUIModel model = getModel();
model.fromBean(new FishingOperation());
@@ -444,7 +432,7 @@
}
// cancel to create a new fishingOperation
parentUi.getHandler().closeCurrentFishingOperation();
-
+
} else {
parentUi.getHandler().reloadFishingOperation();
}
@@ -461,7 +449,7 @@
public TuttiBeanMonitor<EditFishingOperationUIModel> getFishingOperationMonitor() {
return fishingOperationMonitor;
}
-
+
//------------------------------------------------------------------------//
//-- Protected methods --//
//------------------------------------------------------------------------//
@@ -475,6 +463,22 @@
// reset sub strata combo
ui.getSubStrataComboBox().setData(null);
+ Zone zone =
+ model.getFishingOperation().getCruise().getProgram().getZone();
+
+ String zoneId = zone.getId();
+ String strataId = newStrata == null ? null : newStrata.getId();
+
+ List<FishingOperationLocation> subStrata =
+ persistenceService.getAllFishingOperationSubStrata(zoneId, strataId);
+
+ List<FishingOperationLocation> location =
+ persistenceService.getAllFishingOperationLocation(zoneId, strataId, null);
+
+ ui.getSubStrataComboBox().setData(subStrata);
+
+ ui.getLocationComboBox().setData(location);
+
if (newStrata == null) {
// reset strata, keep focus on it
@@ -484,20 +488,12 @@
// try to load substrata
- List<FishingOperationLocation> subStrata =
- persistenceService.getAllFishingOperationSubStrata(newStrata.getId());
- ui.getSubStrataComboBox().setData(subStrata);
-
if (CollectionUtils.isEmpty(subStrata)) {
// try to load localite
- List<FishingOperationLocation> location =
- persistenceService.getAllFishingOperationLocation(newStrata.getId());
- ui.getLocationComboBox().setData(location);
-
ui.getLocationComboBox().grabFocus();
}
}
@@ -511,21 +507,27 @@
// reset localite combo
ui.getLocationComboBox().setData(null);
+ Zone zone =
+ getModel().getFishingOperation().getCruise().getProgram().getZone();
+ String zoneId = zone.getId();
+
+ FishingOperationLocation strata = model.getStrata();
+ String subStrataId = newSubStrata == null ? null : newSubStrata.getId();
+
+ String strataId = strata == null ? null : strata.getId();
+
+ List<FishingOperationLocation> location =
+ persistenceService.getAllFishingOperationLocation(zoneId, strataId, subStrataId);
+
+ ui.getLocationComboBox().setData(location);
+
if (newSubStrata == null) {
// reset substrata, keep focus on it
ui.getSubStrataComboBox().grabFocus();
- } else {
-
- // try to load localite
-
- List<FishingOperationLocation> location =
- persistenceService.getAllFishingOperationLocation(newSubStrata.getId());
-
- ui.getLocationComboBox().setData(location);
}
}
-
+
protected boolean areAllModelsValid() {
boolean result = getModel().isValid();
CaracteristicTabUIModel[] subModels = getSubModels();
@@ -534,7 +536,7 @@
}
return result;
}
-
+
protected boolean isAModelModified() {
boolean result = getModel().isModify();
CaracteristicTabUIModel[] subModels = getSubModels();
@@ -543,5 +545,5 @@
}
return result;
}
-
+
}
1
0
29 Jan '13
Author: tchemit
Date: 2013-01-29 09:24:13 +0100 (Tue, 29 Jan 2013)
New Revision: 254
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/254
Log:
refs #1912: [Ecran Trait] Filtrage des strates - sous-strates - localit?\195?\169s
refs #1893: [TECH] - Mise ?\195?\160 jour automatique de l'outil
refs #1919: [Persistence] Adagio r?\195?\169f?\195?\169rentiel
+ add missing svn properties + license header
Added:
trunk/src/site/resources/
trunk/src/site/resources/update/
trunk/src/site/resources/update/update-application.properties
Removed:
trunk/tutti-persistence-adagio/src/main/site/
trunk/tutti-ui-swing/src/main/assembly/min/update-application.properties
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiJreUpdaterCallBack.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiUpdaterCallBack.java
Modified:
trunk/pom.xml
trunk/src/site/rst/referential.rst
trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceAdagioImpl.java
trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/config/TuttiPersistenceAdagioConfigOption.java
trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/service/MeasurementService.java
trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceServiceImpl.java
trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/service/TuttiEnumerationFile.java
trunk/tutti-persistence-adagio/src/main/resources/queries-override.hbm.xml
trunk/tutti-persistence-adagio/src/main/resources/tutti-db-enumerations.properties
trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/DatabaseFixtures.java
trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceServiceTest.java
trunk/tutti-persistence-dev/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceDevImpl.java
trunk/tutti-persistence-dev/src/main/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceServiceDevImpl.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/RessourceClassLoader.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistence.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceService.java
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java
trunk/tutti-ui-swing/pom.xml
trunk/tutti-ui-swing/src/main/assembly/full/tutti.sh
trunk/tutti-ui-swing/src/main/assembly/min/update-database.properties
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/RunTutti.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiApplicationUpdaterCallBack.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiDatabaseUpdaterCallBack.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/operation/catches/species/split/AddSpeciesAction.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/AddSpeciesUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/AddSpeciesUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/AddSpeciesUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/AddSpeciesUIModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/CaracteristicRowModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/CaracteristicTabUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/CaracteristicTabUIModel.java
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/gearshooting/GearShootingRowModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/CoordinateEditorType.java
trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties
trunk/tutti-ui-swing/src/main/resources/icons/action-warning.png
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2013-01-28 18:29:58 UTC (rev 253)
+++ trunk/pom.xml 2013-01-29 08:24:13 UTC (rev 254)
@@ -163,6 +163,9 @@
<hsqldb.version>2.2.9</hsqldb.version>
<jdbc.hsqldb.version>1.8.0.7</jdbc.hsqldb.version>
+ <!-- Last JRE version to use -->
+ <jreVersion>1.7.10</jreVersion>
+
</properties>
<dependencyManagement>
Copied: trunk/src/site/resources/update/update-application.properties (from rev 250, trunk/tutti-ui-swing/src/main/assembly/min/update-application.properties)
===================================================================
--- trunk/src/site/resources/update/update-application.properties (rev 0)
+++ trunk/src/site/resources/update/update-application.properties 2013-01-29 08:24:13 UTC (rev 254)
@@ -0,0 +1,34 @@
+###
+# #%L
+# Tutti
+# $Id$
+# $HeadURL$
+# %%
+# Copyright (C) 2012 - 2013 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%
+###
+tutti.version=${project.Version}
+tutti.url=zip:http://nexus.nuiton.org/nexus/content/repositories/other-releases/fr/ifremer/tutti/tutti-ui-swing/tutti-${project.Version}-standalone.zip
+jre.version=${jreVersion}
+#linux.amd64.jre.version=${jreVersion}
+linux.amd64.jre.url=zip:http://nexus.nuiton.org/nexus/content/repositories/jvm/com/oracle/jre/${jreVersion}/jre-${jreVersion}-linux-x64.jar
+#linux.i386.jre.version=${jreVersion}
+linux.i386.jre.url=zip:http://nexus.nuiton.org/nexus/content/repositories/jvm/com/oracle/jre/${jreVersion}/jre-${jreVersion}-linux-i586.jar
+#windows.amd64.jre.version=${jreVersion}
+windows.amd64.jre.url=zip:http://nexus.nuiton.org/nexus/content/repositories/jvm/com/oracle/jre/${jreVersion}/jre-${jreVersion}-windows-x64.jar
+#windows.i386.jre.version=${jreVersion}
+windows.i386.jre.url=zip:http://nexus.nuiton.org/nexus/content/repositories/jvm/com/oracle/jre/${jreVersion}/jre-${jreVersion}-windows-i586.jar
Modified: trunk/src/site/rst/referential.rst
===================================================================
--- trunk/src/site/rst/referential.rst 2013-01-28 18:29:58 UTC (rev 253)
+++ trunk/src/site/rst/referential.rst 2013-01-29 08:24:13 UTC (rev 254)
@@ -36,61 +36,51 @@
Les requètes métier
~~~~~~~~~~~~~~~~~~~
-+-----------------------------------------------------+------+-----------------------------------------------------+
-| Nom requète | Etat | Commentaire |
-+=====================================================+======+=====================================================+
-| [REF-01] Liste des zones d'une série de campagne | KO | Définir le niveau LocationLevel |
-+-----------------------------------------------------+------+-----------------------------------------------------+
-| [REF-02] Liste des pays | OK | |
-+-----------------------------------------------------+------+-----------------------------------------------------+
-| [REF-03] Liste des navires (scientifique) | OK | Requète très longue il faut optimiser |
-+-----------------------------------------------------+------+-----------------------------------------------------+
-| [REF-04] Liste des navires (pro) | OK | Requète très longue il faut optimiser |
-+-----------------------------------------------------+------+-----------------------------------------------------+
-| [REF-05] Liste des engins (scientifique) | OK | |
-+-----------------------------------------------------+------+-----------------------------------------------------+
-| [REF-06] Liste des engins (pro) | OK | |
-+-----------------------------------------------------+------+-----------------------------------------------------+
-| [REF-07] Liste des utilisateurs | OK | Doit-on utliser limiter aux membres de l'Ifremer ? |
-+-----------------------------------------------------+------+-----------------------------------------------------+
-| [REF-08] Liste des espèces | OK | Utilisation de synonymes via import refTax ? |
-+-----------------------------------------------------+------+-----------------------------------------------------+
-| [REF-09] Liste des psfm mesure de classe de taille | OK | |
-+-----------------------------------------------------+------+-----------------------------------------------------+
-| [REF-10] Liste des psfm (mise en oeuvre de l'engin) | OK | |
-+-----------------------------------------------------+------+-----------------------------------------------------+
-| [REF-11] Liste des psfm (environnement) | OK | |
-+-----------------------------------------------------+------+-----------------------------------------------------+
-| [REF-12] Liste des psfm (hydrologique) | KO | Données à regrouper en base avec un ParameterGroup ?|
-+-----------------------------------------------------+------+-----------------------------------------------------+
-| [REF-13] Liste des strates | KO | Pouvoir les lier aux zones |
-+-----------------------------------------------------+------+-----------------------------------------------------+
-| [REF-14] Liste des sous-strates | KO | Pouvoir les lier aux zones / strates |
-+-----------------------------------------------------+------+-----------------------------------------------------+
-| [REF-15] Liste des localités | KO | Pouvoir les lier aux zones / strates / sous-strates|
-+-----------------------------------------------------+------+-----------------------------------------------------+
-| [REF-16] Conversion Taille-poids | TODO | |
-+-----------------------------------------------------+------+-----------------------------------------------------+
-| [REF-17] Liste des espèces (écran benthos) | KO | Valider comment on filtre (sur le protocole ?) |
-+-----------------------------------------------------+------+-----------------------------------------------------+
-| [REF-18] Liste des espèces (écran plancton) | KO | Valider comment on filtre (sur le protocole ?) |
-+-----------------------------------------------------+------+-----------------------------------------------------+
-| [REF-19] Catégorie de macro-déchets | KO | Créer les données en base |
-+-----------------------------------------------------+------+-----------------------------------------------------+
-| [REF-20] Catégorie de taille macro-déchets | KO | Créer les données en base |
-+-----------------------------------------------------+------+-----------------------------------------------------+
-| [REF-21] Liste des espèces (écran accidentelles) | OK | |
-+-----------------------------------------------------+------+-----------------------------------------------------+
-| [REF-22] Liste des psfm (écran accidentelles) | TODO | Définir ce qu'on peut mettre ici (protocole ?) |
-+-----------------------------------------------------+------+-----------------------------------------------------+
-| [REF-23] Catégorie H/VC | OK | |
-+-----------------------------------------------------+------+-----------------------------------------------------+
-| [REF-24] Catégorie Classe. Tri | OK | |
-+-----------------------------------------------------+------+-----------------------------------------------------+
-| [REF-25] Catégorie Sexe | OK | |
-+-----------------------------------------------------+------+-----------------------------------------------------+
-| [REF-26] Catégorie Maturité | KO | psfm à utiliser (MATURITY \ MATURITY_STAGE_5_VISUAL)|
-+-----------------------------------------------------+------+-----------------------------------------------------+
++-----------------------------------------------------+-------+-----------------------------------------------------+
+| Nom requète | Etat | Commentaire |
++=====================================================+=======+=====================================================+
+| [REF-01] Liste des zones d'une série de campagne | OK | |
++-----------------------------------------------------+-------+-----------------------------------------------------+
+| [REF-02] Liste des pays | OK | |
++-----------------------------------------------------+-------+-----------------------------------------------------+
+| [REF-03] Liste des strates / sstrates/ localites |TESTING| En attente de nouvelle base |
++-----------------------------------------------------+-------+-----------------------------------------------------+
+| [REF-04] Liste des navires (scientifique) | OK | Requète très longue il faut optimiser |
++-----------------------------------------------------+-------+-----------------------------------------------------+
+| [REF-05] Liste des navires (pro) | OK | Requète très longue il faut optimiser |
++-----------------------------------------------------+-------+-----------------------------------------------------+
+| [REF-06] Liste des engins (scientifique) | OK | |
++-----------------------------------------------------+-------+-----------------------------------------------------+
+| [REF-07] Liste des engins (pro) | OK | |
++-----------------------------------------------------+-------+-----------------------------------------------------+
+| [REF-08] Liste des utilisateurs | OK | Doit-on utiliser limiter aux membres de l'Ifremer ? |
++-----------------------------------------------------+-------+-----------------------------------------------------+
+| [REF-09] Liste des espèces | OK | Utilisation de synonymes via import refTax ? |
++-----------------------------------------------------+-------+-----------------------------------------------------+
+| [REF-10] Catégorie de macro-déchets |TESTING| En attente de nouvelle base |
++-----------------------------------------------------+-------+-----------------------------------------------------+
+| [REF-11] Catégorie de taille macro-déchets |TESTING| En attente de nouvelle base |
++-----------------------------------------------------+-------+-----------------------------------------------------+
+| [REF-12] Catégorie H/VC | OK | |
++-----------------------------------------------------+-------+-----------------------------------------------------+
+| [REF-13] Catégorie Classe. Tri | OK | |
++-----------------------------------------------------+-------+-----------------------------------------------------+
+| [REF-14] Catégorie Sexe | OK | |
++-----------------------------------------------------+-------+-----------------------------------------------------+
+| [REF-15] Catégorie Maturité |TESTING| En attente de nouvelle base |
++-----------------------------------------------------+-------+-----------------------------------------------------+
+| [REF-16] Liste des psfm mesure de classe de taille | KO | Ne plus utiliser (import protocole) |
++-----------------------------------------------------+-------+-----------------------------------------------------+
+| [REF-17] Liste des psfm (mise en oeuvre de l'engin) | KO | Ne plus utiliser (import protocole) |
++-----------------------------------------------------+-------+-----------------------------------------------------+
+| [REF-18] Liste des psfm (environnement) | KO | Ne plus utiliser (import protocole) |
++-----------------------------------------------------+-------+-----------------------------------------------------+
+| [REF-19] Liste des psfm (hydrologique) | KO | Ne plus utiliser (import protocole) |
++-----------------------------------------------------+-------+-----------------------------------------------------+
+| [REF-20] Liste des psfm (écran accidentelles) |TODO V2| Ne plus utiliser (import protocole) |
++-----------------------------------------------------+-------+-----------------------------------------------------+
+| [REF-21] Conversion Taille-poids |TODO V2| A voir si vraiment à faire |
++-----------------------------------------------------+-------+-----------------------------------------------------+
[REF-01] Liste des zones d'une série de campagne
------------------------------------------------
@@ -98,18 +88,22 @@
::
SELECT
- l.id,
- l.label,
- l.name,
- l.status
+ l.id,
+ l.label,
+ l.name,
+ l.status
FROM LocationImpl l
WHERE
l.locationLevel.id = :locationLevelId
- AND l.status.code IN (1, 2)
+ AND l.locationClassification.id = :locationClassificationId
+ AND l.status.code IN (:statusValidCode, :statusTemporaryCode)
Paramètres :
- :locationLevelId = *LocationLevelId.PROGRAM*
+- :locationClassificationId = *LocationClassificationId.SECTOR*
+- :statusValidCode = *StatusCode.ENABLE*
+- :statusTemporaryCode = *StatusCode.TEMPORARY*
*État:* À Valider et définir la valeur de la constante.
@@ -119,23 +113,58 @@
::
SELECT
- l.id,
- l.label,
- l.name,
- l.status
+ l.id,
+ l.label,
+ l.name,
+ l.status
FROM LocationImpl l
WHERE
l.locationLevel.id = :locationLevelId
- AND l.status.code IN (1, 2)
+ AND l.status.code IN (:statusValidCode, :statusTemporaryCode)
Paramètres :
- :locationLevelId = *LocationLevelId.PAYS_ISO3*
+- :statusValidCode = *StatusCode.ENABLE*
+- :statusTemporaryCode = *StatusCode.TEMPORARY*
*État:* Valide.
-[REF-03] Liste des navires (scientifique)
+[REF-03] Liste des strates / sous-strates / localités
+-----------------------------------------------------
+
+::
+
+ SELECT
+ l.id as locationId,
+ l.label as locationLabel,
+ l.name as locationName,
+ l.locationLevel.id as locationLevelId,
+ l.status as status
+ FROM
+ LocationImpl l,
+ LocationHierarchyImpl lh
+ WHERE
+ l.status.code IN (:statusValidCode, :statusTemporaryCode)
+ AND l.locationLevel.id = :locationLevelId
+ AND l.locationClassification.id = :locationClassificationId
+ AND l.id = lh.locationHierarchyPk.location.id
+ AND lh.locationHierarchyPk.parent.id = :parentId
+ AND lh.locationHierarchyPk.parent.locationLevel.id = :parentLocationLevelId
+
+Paramètres :
+
+- :parentId = *l'id de la zone / strate / sous-strate*
+- :parentLocationLevelId = *LocationLevelId.PROGRAM / LocationLevelId.STRATA / LocationLevelId.SUB_STRATA*
+- :locationLevelId = *LocationLevelId.STRATA / LocationLevelId.SUB_STRATA / LocationLevelId.LOCALITE*
+- :locationClassificationId = *LocationClassificationId.SECTOR*
+- :statusValidCode = *StatusCode.ENABLE*
+- :statusTemporaryCode = *StatusCode.TEMPORARY*
+
+*État:* Valide.
+
+[REF-04] Liste des navires (scientifique)
-----------------------------------------
::
@@ -151,7 +180,7 @@
INNER JOIN v.vesselRegistrationPeriods AS vrp
LEFT OUTER JOIN v.vesselFeatures AS vf
WHERE v.vesselType.id = :vesselTypeId
- AND v.status.code IN (1, 2)
+ AND v.status.code IN (:statusValidCode, :statusTemporaryCode)
AND vrp.vesselRegistrationPeriodPk.startDateTime =
(
SELECT MAX(vrp2.vesselRegistrationPeriodPk.startDateTime)
@@ -173,10 +202,12 @@
- :gearClassificiationId = *VesselTypeId.SCIENTIFIC_RESEARCH_VESSEL*
- :refDate = date (ou null)
+- :statusValidCode = *StatusCode.ENABLE*
+- :statusTemporaryCode = *StatusCode.TEMPORARY*
*État:* Valide mais à optimiser.
-[REF-04] Liste des navires (pro)
+[REF-05] Liste des navires (pro)
--------------------------------
::
@@ -192,7 +223,7 @@
INNER JOIN v.vesselRegistrationPeriods AS vrp
LEFT OUTER JOIN v.vesselFeatures AS vf
WHERE v.vesselType.id = :vesselTypeId
- AND v.status.code IN (1, 2)
+ AND v.status.code IN (:statusValidCode, :statusTemporaryCode)
AND vrp.vesselRegistrationPeriodPk.startDateTime =
(
SELECT MAX(vrp2.vesselRegistrationPeriodPk.startDateTime)
@@ -215,10 +246,12 @@
- :gearClassificiationId = *VesselTypeId.FISHING_VESSEL*
- :refDate = date (ou null)
+- :statusValidCode = *StatusCode.ENABLE*
+- :statusTemporaryCode = *StatusCode.TEMPORARY*
*État:* Valide mais à optimiser.
-[REF-05] Liste des engins (scientifique)
+[REF-06] Liste des engins (scientifique)
----------------------------------------
::
@@ -231,16 +264,18 @@
FROM GearImpl g
WHERE
g.gearClassification.id= :gearClassificiationId
- AND g.status.code IN (1, 2)
+ AND g.status.code IN (:statusValidCode, :statusTemporaryCode)
Paramètres :
- :gearClassificiationId = *GearClassificationId.SCIENTIFIC_CRUISE*
+- :statusValidCode = *StatusCode.ENABLE*
+- :statusTemporaryCode = *StatusCode.TEMPORARY*
*État:* Valide.
-[REF-06] Liste des engins (pro)
+[REF-07] Liste des engins (pro)
-------------------------------
::
@@ -253,16 +288,18 @@
FROM GearImpl g
WHERE
g.gearClassification.id= :gearClassificiationId
- AND g.status.code IN (1, 2)
+ AND g.status.code IN (:statusValidCode, :statusTemporaryCode)
Paramètres :
- :gearClassificiationId = *GearClassificationId.FAO*
+- :statusValidCode = *StatusCode.ENABLE*
+- :statusTemporaryCode = *StatusCode.TEMPORARY*
*État:* Valide.
-[REF-07] Liste des utilisateurs
+[REF-08] Liste des utilisateurs
-------------------------------
::
@@ -277,7 +314,7 @@
PersonImpl p
LEFT OUTER JOIN p.profils pp
WHERE
- p.status.code in (1,2)
+ p.status.code IN (:statusValidCode, :statusTemporaryCode)
AND pp.id IN (
:observerProfilId,
:projectMemberProfilId,
@@ -290,11 +327,12 @@
- :observerProfilId = *UserProfilId.OBSERVER*
- :projectMemberProfilId = *UserProfilId.PROJECT_MEMBER*
- :userProfilId = *UserProfilId.USER*
+- :statusValidCode = *StatusCode.ENABLE*
+- :statusTemporaryCode = *StatusCode.TEMPORARY*
*État:* Valide.
-
-[REF-08] Liste des espèces
+[REF-09] Liste des espèces
--------------------------
::
@@ -303,7 +341,50 @@
*État:* Valide.
-[REF-09] Liste des psfm mesure de classe de taille
+[REF-10] Catégorie de macro-déchets
+-----------------------------------
+
+[REF-T01] + [REF-T02] avec :pmfmId = *PmfmId.MACRO_WASTE_CATEGORY*
+
+*État:* les données sont à créer en base.
+
+[REF-11] Catégorie de taille macro-déchets
+-------------------------------------------
+
+[REF-T01] + [REF-T02] avec :pmfmId = *PmfmId.MACRO_WASTE_SIZE_CATEGORY*
+
+*État:* les données sont à créer en base.
+
+[REF-12] Catégorie H/VC
+-----------------------
+
+[REF-T01] + [REF-T02] avec :pmfmId = *PmfmId.SORTED_UNSORTED*
+
+*État:* Valide.
+
+[REF-13] Catégorie Classe. Tri
+------------------------------
+
+[REF-T01] + [REF-T02] avec :pmfmId = *PmfmId.SIZE_CATEGORY*
+
+*État:* Valide.
+
+[REF-14] Catégorie Sexe
+-----------------------
+
+[REF-T01] + [REF-T02] avec :pmfmId = *PmfmId.SEX*
+
+*État:* Valide.
+
+[REF-15] Catégorie Maturité
+---------------------------
+
+[REF-T01] + [REF-T02] avec :pmfmId = *PmfmId.MATURITY*
+
+*État:* Valide.
+
+
+[REF-16] Liste des psfm mesure de classe de taille
--------------------------------------------------
::
@@ -340,176 +421,53 @@
*État:* Valide.
-[REF-10] Liste des psfm (mise en oeuvre de l'engin)
+[REF-17] Liste des psfm (mise en oeuvre de l'engin)
---------------------------------------------------
[REF-T03] avec :matrixId= *MatrixId.GEAR*
*État:* Valide.
-[REF-11] Liste des psfm (environnement)
+[REF-18] Liste des psfm (environnement)
---------------------------------------
[REF-T03] avec :parameterGroupId= *ParameterGroupId.ENVIRONEMENT_MEASUREMENT*
*État:* Valide.
-[REF-12] Liste des psfm (hydrologique)
+[REF-19] Liste des psfm (hydrologique)
--------------------------------------
[REF-T03] avec :parameterGroupId= *ParameterGroupId.HYDROLOGIC_MEASUREMENT*
*État:* Données non présentes en base.
-[REF-13] Liste des strates
---------------------------
+[REF-20] Liste des psfm pour les captures accidentelles
+-------------------------------------------------------
-::
+*État:* A FAIRE.
- SELECT
- l.id as locationId,
- l.label as locationLabel,
- l.name as locationName,
- l.locationLevel.id as locationLevelId,
- l.status as status
- FROM LocationImpl l
- WHERE
- l.status.code IN (1, 2)
- AND l.locationLevel.id = :locationLevelId
-
-Paramètres :
-
-- :locationLevelId = *LocationLevelId.STRATA*
-
-*État:* A lier aux zones de série de camapgnes et au rectangle statistique.
-
-[REF-14] Liste des sous-strates
--------------------------------
-
-::
-
- SELECT
- l.id as locationId,
- l.label as locationLabel,
- l.name as locationName,
- l.locationLevel.id as locationLevelId,
- l.status as status
- FROM LocationImpl l
- WHERE
- l.status.code IN (1, 2)
- AND l.locationLevel.id = :locationLevelId
-
-Paramètres :
-
-- :locationLevelId = *LocationLevelId.SUBSTRATA*
-
-*État:* Pouvoir les lier aux zones et rectangle statistique et strates.
-
-[REF-15] Liste des localités
-----------------------------
-
-::
-
- SELECT
- l.id as locationId,
- l.label as locationLabel,
- l.name as locationName,
- l.locationLevel.id as locationLevelId,
- l.status as status
- FROM LocationImpl l
- WHERE
- l.status.code IN (1, 2)
- AND l.locationLevel.id = :locationLevelId
-
-Paramètres :
-
-- :locationLevelId = *LocationLevelId.LOCALITE*
-
-*État:* Pouvoir les lier aux zones et rectangle statistique et strates .
-
-[REF-16] Conversion Taille-poids
+[REF-21] Conversion Taille-poids
--------------------------------
-*État:* A faire.
-
-[REF-17] Liste des espèces (écran benthos)
-------------------------------------------
-
-*État:* Valider comment on filtre (sur le protocole ?).
-
-[REF-18] Liste des espèces (écran plancton)
--------------------------------------------
-
-*État:* Valider comment on filtre (sur le protocole ?).
-
-[REF-19] Catégorie de macro-déchets
------------------------------------
-
-[REF-T01] + [REF-T02] avec :pmfmId = *PmfmId.MACRO_WASTE_CATEGORY*
-
-*État:* les données sont à créer en base.
-
-[REF-20] Catégorie de taille macro-déchets
--------------------------------------------
-
-[REF-T01] + [REF-T02] avec :pmfmId = *PmfmId.MACRO_WASTE_SIZE_CATEGORY*
-
-*État:* les données sont à créer en base.
-
-[REF-21] Liste des espèces (écran capture accidentelles)
---------------------------------------------------------
-
-*État:* Valide (on prend toutes les espèces).
-
-[REF-22] Liste des psfm pour les captures accidentelles
--------------------------------------------------------
-
*État:* A FAIRE.
-[REF-23] Catégorie H/VC
------------------------
-
-[REF-T01] + [REF-T02] avec :pmfmId = *PmfmId.SORTED_UNSORTED*
-
-*État:* Valide.
-
-[REF-24] Catégorie Classe. Tri
-------------------------------
-
-[REF-T01] + [REF-T02] avec :pmfmId = *PmfmId.SIZE_CATEGORY*
-
-*État:* Valide.
-
-[REF-25] Catégorie Sexe
------------------------
-
-[REF-T01] + [REF-T02] avec :pmfmId = *PmfmId.SEX*
-
-*État:* Valide.
-
-[REF-26] Catégorie Maturité
----------------------------
-
-[REF-T01] + [REF-T02] avec :pmfmId = *PmfmId.MATURITY*
-
-*État:* Valider l'id utilisé.
-
Les requètes techniques
~~~~~~~~~~~~~~~~~~~~~~~
-+-----------------------------------------------------+------+-----------------------------------------------------+
++-----------------------------------------------------+-------+-----------------------------------------------------+
| Nom requète | Etat | Commentaire |
+=====================================================+======+=====================================================+
-| [REF-T01] Détail d'un psfm par son id | OK | |
-+-----------------------------------------------------+------+-----------------------------------------------------+
-| [REF-T02] Valeurs qualitatives d'un psfm | OK | |
-+-----------------------------------------------------+------+-----------------------------------------------------+
-| [REF-T03] Liste de psfm à partir d'un support | OK | |
-+-----------------------------------------------------+------+-----------------------------------------------------+
-| [REF-T04] Liste de psfm à partir d'un parameterGroup| OK | |
-+-----------------------------------------------------+------+-----------------------------------------------------+
-| [REF-T05] Lieu statistique à partir de lat/long | OK | |
-+-----------------------------------------------------+------+-----------------------------------------------------+
+| [REF-T01] Détail d'un psfm par son id | OK | |
++-----------------------------------------------------+-------+-----------------------------------------------------+
+| [REF-T02] Valeurs qualitatives d'un psfm | OK | |
++-----------------------------------------------------+-------+-----------------------------------------------------+
+| [REF-T03] Liste de psfm à partir d'un support | OK | |
++-----------------------------------------------------+-------+-----------------------------------------------------+
+| [REF-T04] Liste de psfm à partir d'un parameterGroup| OK | |
++-----------------------------------------------------+-------+-----------------------------------------------------+
+| [REF-T05] Lieu statistique à partir de lat/long | OK | |
++-----------------------------------------------------+-------+-----------------------------------------------------+
[REF-T01] Détail d'un psfm par son id
-------------------------------------
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/RessourceClassLoader.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/RessourceClassLoader.java 2013-01-28 18:29:58 UTC (rev 253)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/RessourceClassLoader.java 2013-01-29 08:24:13 UTC (rev 254)
@@ -78,6 +78,9 @@
for (File directory : directories) {
if (!this.directories.contains(directory)) {
this.directories.add(directory);
+
+ // force to create directory
+ FileUtils.forceMkdir(directory);
}
}
loader = null;
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 2013-01-28 18:29:58 UTC (rev 253)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistence.java 2013-01-29 08:24:13 UTC (rev 254)
@@ -86,6 +86,12 @@
*/
List<Country> getAllCountry();
+ List<FishingOperationLocation> getAllFishingOperationStrata(String zoneId);
+
+ List<FishingOperationLocation> getAllFishingOperationSubStrata(String zoneId, String startaId);
+
+ List<FishingOperationLocation> getAllFishingOperationLocation(String zoneId, String startaId, String subStrataId);
+
/**
* @return all scientific vessels (used by a {@link Cruise}).
* @see Cruise#getVessel()
@@ -104,18 +110,8 @@
List<Species> getAllSpecies();
- List<Species> getAllBenthosSpecies();
-
- List<Species> getAllPlanktonSpecies();
-
Species getSpecies(String speciesId);
- List<FishingOperationLocation> getAllFishingOperationStrata(String zoneId);
-
- List<FishingOperationLocation> getAllFishingOperationSubStrata(String locationId);
-
- List<FishingOperationLocation> getAllFishingOperationLocation(String locationId);
-
List<Caracteristic> getAllFishingOperationEnvironmentCaracteristic();
List<Caracteristic> getAllFishingOperationGearCaracteristic();
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceService.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceService.java 2013-01-28 18:29:58 UTC (rev 253)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceService.java 2013-01-29 08:24:13 UTC (rev 254)
@@ -68,6 +68,12 @@
*/
List<Country> getAllCountry();
+ List<FishingOperationLocation> getAllFishingOperationStrata(String zoneId);
+
+ List<FishingOperationLocation> getAllFishingOperationSubStrata(String zoneId, String startaId);
+
+ List<FishingOperationLocation> getAllFishingOperationLocation(String zoneId, String startaId, String subStrataId);
+
/**
* @return all scientific vessels (used by a {@link Cruise}).
* @see Cruise#getVessel()
@@ -88,18 +94,8 @@
List<Species> getAllSpecies();
- List<Species> getAllBenthosSpecies();
-
- List<Species> getAllPlanktonSpecies();
-
Species getSpecies(String speciesId);
- List<FishingOperationLocation> getAllFishingOperationStrata(String zoneId);
-
- List<FishingOperationLocation> getAllFishingOperationSubStrata(String locationId);
-
- List<FishingOperationLocation> getAllFishingOperationLocation(String locationId);
-
List<Caracteristic> getAllFishingOperationEnvironmentCaracteristic();
List<Caracteristic> getAllFishingOperationGearCaracteristic();
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 2013-01-28 18:29:58 UTC (rev 253)
+++ trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceAdagioImpl.java 2013-01-29 08:24:13 UTC (rev 254)
@@ -137,51 +137,47 @@
}
@Override
- public List<Vessel> getAllScientificVessel() {
- return referentialService.getAllScientificVessel();
+ public List<FishingOperationLocation> getAllFishingOperationStrata(String zoneId) {
+ return referentialService.getAllFishingOperationStrata(zoneId);
}
@Override
- public List<Vessel> getAllFishingVessel() {
- return referentialService.getAllFishingVessel();
+ public List<FishingOperationLocation> getAllFishingOperationSubStrata(String zoneId,
+ String strataId) {
+ return referentialService.getAllFishingOperationSubStrata(zoneId,
+ strataId);
}
@Override
- public List<Species> getAllSpecies() {
- return referentialService.getAllSpecies();
+ public List<FishingOperationLocation> getAllFishingOperationLocation(String zoneId,
+ String strataId,
+ String subStrataId) {
+ return referentialService.getAllFishingOperationLocation(zoneId,
+ strataId,
+ subStrataId);
}
@Override
- public List<Species> getAllBenthosSpecies() {
- return referentialService.getAllBenthosSpecies();
+ public List<Vessel> getAllScientificVessel() {
+ return referentialService.getAllScientificVessel();
}
@Override
- public List<Species> getAllPlanktonSpecies() {
- return referentialService.getAllPlanktonSpecies();
+ public List<Vessel> getAllFishingVessel() {
+ return referentialService.getAllFishingVessel();
}
@Override
- public Species getSpecies(String speciesId) {
- return referentialService.getSpecies(speciesId);
+ public List<Species> getAllSpecies() {
+ return referentialService.getAllSpecies();
}
@Override
- public List<FishingOperationLocation> getAllFishingOperationStrata(String zoneId) {
- return referentialService.getAllFishingOperationStrata(zoneId);
+ public Species getSpecies(String speciesId) {
+ return referentialService.getSpecies(speciesId);
}
@Override
- public List<FishingOperationLocation> getAllFishingOperationSubStrata(String locationId) {
- return referentialService.getAllFishingOperationSubStrata(locationId);
- }
-
- @Override
- public List<FishingOperationLocation> getAllFishingOperationLocation(String locationId) {
- return referentialService.getAllFishingOperationLocation(locationId);
- }
-
- @Override
public List<Caracteristic> getAllFishingOperationEnvironmentCaracteristic() {
return referentialService.getAllFishingOperationEnvironmentCaracteristic();
}
Modified: trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/config/TuttiPersistenceAdagioConfigOption.java
===================================================================
--- trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/config/TuttiPersistenceAdagioConfigOption.java 2013-01-28 18:29:58 UTC (rev 253)
+++ trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/config/TuttiPersistenceAdagioConfigOption.java 2013-01-29 08:24:13 UTC (rev 254)
@@ -49,7 +49,7 @@
DB_CONFIGURATION_PATH(
"tutti.persistence.db.configurationPath",
"Chemin du fichier de configuration d'Adagio",
- "${tutti.persistence.db.directory}/conf.properties",
+ "${tutti.data.directory}/resources/conf.properties",
File.class,
true,
true),
@@ -57,7 +57,7 @@
DB_ENUMERATION_PATH(
"tutti.persistence.db.enumerationPath",
"Chemin du fichier de correspondance des constantes",
- "${tutti.persistence.db.directory}/enumerations-v3.properties",
+ "${tutti.data.directory}/resources/enumerations-v3.properties",
File.class,
true,
true),
Modified: trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/service/MeasurementService.java
===================================================================
--- trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/service/MeasurementService.java 2013-01-28 18:29:58 UTC (rev 253)
+++ trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/service/MeasurementService.java 2013-01-29 08:24:13 UTC (rev 254)
@@ -1,13 +1,38 @@
-package fr.ifremer.tutti.persistence.service;
-
-import fr.ifremer.adagio.core.dao.data.measure.GearPhysicalMeasurement;
-import fr.ifremer.adagio.core.dao.data.survey.fishingTrip.FishingTrip;
-import fr.ifremer.adagio.core.dao.data.vessel.feature.physical.GearPhysicalFeatures;
-
-public interface MeasurementService {
-
- GearPhysicalFeatures getGearPhysicalfeatures(FishingTrip fishingTrip, Integer gearId);
-
- GearPhysicalMeasurement getGearPhysicalMeasurement(GearPhysicalFeatures gearPhysicalFeatures, Integer pmfmId);
-
-}
+package fr.ifremer.tutti.persistence.service;
+
+/*
+ * #%L
+ * Tutti :: Persistence Adagio (impl)
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 - 2013 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.adagio.core.dao.data.measure.GearPhysicalMeasurement;
+import fr.ifremer.adagio.core.dao.data.survey.fishingTrip.FishingTrip;
+import fr.ifremer.adagio.core.dao.data.vessel.feature.physical.GearPhysicalFeatures;
+
+public interface MeasurementService {
+
+ GearPhysicalFeatures getGearPhysicalfeatures(FishingTrip fishingTrip, Integer gearId);
+
+ GearPhysicalMeasurement getGearPhysicalMeasurement(GearPhysicalFeatures gearPhysicalFeatures, Integer pmfmId);
+
+}
\ No newline at end of file
Property changes on: trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/service/MeasurementService.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceServiceImpl.java
===================================================================
--- trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceServiceImpl.java 2013-01-28 18:29:58 UTC (rev 253)
+++ trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceServiceImpl.java 2013-01-29 08:24:13 UTC (rev 254)
@@ -24,7 +24,9 @@
* #L%
*/
+import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
+import com.google.common.collect.Sets;
import fr.ifremer.adagio.core.dao.referential.StatusDao;
import fr.ifremer.adagio.core.dao.referential.taxon.TaxonNameExtendDao;
import fr.ifremer.adagio.core.dao.referential.taxon.TaxonRefTaxVO;
@@ -53,6 +55,7 @@
import java.util.Date;
import java.util.Iterator;
import java.util.List;
+import java.util.Set;
/**
* Implementation of the {@link ReferentialPersistenceService} using a adagio
@@ -82,7 +85,8 @@
public List<Zone> getAllProgramZone() {
Iterator<Object[]> list = queryListWithStatus(
"allProgramZones",
- "locationLevelId", IntegerType.INSTANCE, enumeration.LOCATION_LEVEL_ID_PROGRAMM);
+ "locationClassificationId", IntegerType.INSTANCE, enumeration.LOCATION_CLASSIFICATION_ID_SECTOR,
+ "locationLevelId", IntegerType.INSTANCE, enumeration.LOCATION_LEVEL_ID_PROGRAM);
List<Zone> result = Lists.newArrayList();
while (list.hasNext()) {
@@ -117,6 +121,78 @@
}
@Override
+ public List<FishingOperationLocation> getAllFishingOperationStrata(String zoneId) {
+ List<FishingOperationLocation> result = getFishingOperationLocations(
+ enumeration.LOCATION_LEVEL_ID_STRATA,
+ Integer.valueOf(zoneId),
+ enumeration.LOCATION_LEVEL_ID_PROGRAM);
+ return result;
+ }
+
+ @Override
+ public List<FishingOperationLocation> getAllFishingOperationSubStrata(String zoneId,
+ String strataId) {
+
+ String parentId;
+ Integer parentLocationLevelId;
+
+ if (strataId != null) {
+
+ // use strata as parent
+ parentId = strataId;
+ parentLocationLevelId = enumeration.LOCATION_LEVEL_ID_STRATA;
+
+ } else {
+
+ // use zoneId as parent
+ parentId = zoneId;
+ parentLocationLevelId = enumeration.LOCATION_LEVEL_ID_PROGRAM;
+ }
+
+ Preconditions.checkNotNull(parentId);
+ List<FishingOperationLocation> result = getFishingOperationLocations(
+ enumeration.LOCATION_LEVEL_ID_SUB_STRATA,
+ Integer.valueOf(parentId),
+ parentLocationLevelId);
+ return result;
+ }
+
+ @Override
+ public List<FishingOperationLocation> getAllFishingOperationLocation(String zoneId,
+ String strataId,
+ String subStrataId) {
+
+ String parentId;
+ Integer parentLocationLevelId;
+
+ if (subStrataId != null) {
+
+ // use substrata as parent
+ parentId = subStrataId;
+ parentLocationLevelId = enumeration.LOCATION_LEVEL_ID_SUB_STRATA;
+
+ } else if (strataId != null) {
+
+ // use strata as parent
+ parentId = strataId;
+ parentLocationLevelId = enumeration.LOCATION_LEVEL_ID_STRATA;
+
+ } else {
+
+ // use zoneId as parent
+ parentId = zoneId;
+ parentLocationLevelId = enumeration.LOCATION_LEVEL_ID_PROGRAM;
+ }
+
+ Preconditions.checkNotNull(parentId);
+ List<FishingOperationLocation> result = getFishingOperationLocations(
+ enumeration.LOCATION_LEVEL_ID_LOCALITE,
+ Integer.valueOf(parentId),
+ parentLocationLevelId);
+ return result;
+ }
+
+ @Override
public List<Vessel> getAllScientificVessel() {
Iterator<Object[]> list = queryListWithStatus(
@@ -149,8 +225,53 @@
return result;
}
+// @Override
+ public List<Vessel> getAllFishingVessel2() {
+ Iterator<Object[]> list = queryListWithStatus(
+ "allSimpleVessels",
+
+ "vesselTypeId", IntegerType.INSTANCE, enumeration.VESSEL_TYPE_ID_FISHING);
+
+ Set<String> codes = Sets.newHashSet();
+ List<Vessel> result = Lists.newArrayList();
+ while (list.hasNext()) {
+ Object[] source = list.next();
+ String vesselCode = (String) source[0];
+ if (codes.add(vesselCode)) {
+
+ if (log.isInfoEnabled()) {
+ log.info("VesselCode: "+vesselCode);
+ }
+ Vessel target = new Vessel();
+ target.setId(vesselCode);
+ target.setName((String) source[1]);
+ setStatus((fr.ifremer.adagio.core.dao.referential.Status) source[2], target);
+ result.add(target);
+ }
+
+
+// Iterator<Object[]> source2 = queryList(
+// "vessel2",
+// "vesselCode", StringType.INSTANCE, vesselCode,
+// "refDate", DateType.INSTANCE, new Date()
+// );
+//
+// if (source2.hasNext()) {
+// Object[] next = source2.next();
+//
+// target.setRegistrationCode((String) next[0]);
+// target.setInternalRegistrationCode((String) next[1]);
+// }
+
+ }
+ return result;
+ }
+
@Override
public Vessel getVessel(String vesselCode) {
+ if (log.isInfoEnabled()) {
+ log.info("get vessel: " + vesselCode);
+ }
// Warning : return a list because more than one line could be found,
// but 'order by' assume that the first one in the good row
Iterator<Object[]> source = queryListWithStatus(
@@ -158,7 +279,11 @@
"vesselCode", StringType.INSTANCE, vesselCode,
"refDate", DateType.INSTANCE, new Date()
);
- Vessel result = loadVessel(source.next());
+ Vessel result;
+ if (source.hasNext())
+ result = loadVessel(source.next());
+ else
+ result = null;
return result;
}
@@ -255,30 +380,6 @@
}
@Override
- public List<Species> getAllBenthosSpecies() {
- TaxonRefTaxVO[] sources = taxonNameDao.getAllTaxonRefTax();
-
- List<Species> result = Lists.newArrayList();
- for (TaxonRefTaxVO source : sources) {
- Species target = loadSpecies(source);
- result.add(target);
- }
- return result;
- }
-
- @Override
- public List<Species> getAllPlanktonSpecies() {
- TaxonRefTaxVO[] sources = taxonNameDao.getAllTaxonRefTax();
-
- List<Species> result = Lists.newArrayList();
- for (TaxonRefTaxVO source : sources) {
- Species target = loadSpecies(source);
- result.add(target);
- }
- return result;
- }
-
- @Override
public List<Caracteristic> getAllSpeciesLengthStepCaracteristic() {
Iterator<Object[]> sources = queryListWithStatus(
"allLengthStepCaracteristics",
@@ -341,48 +442,6 @@
}
@Override
- public List<FishingOperationLocation> getAllFishingOperationStrata(String zoneId) {
- Iterator<Object[]> sources = queryListWithStatus(
- "allFishingOperationStratas",
- "locationLevelId", IntegerType.INSTANCE, enumeration.LOCATION_LEVEL_ID_STRATA);
- List<FishingOperationLocation> result = Lists.newArrayList();
- while (sources.hasNext()) {
- Object[] source = sources.next();
- FishingOperationLocation target = loadFishingOperationLocation(source);
- result.add(target);
- }
- return result;
- }
-
- @Override
- public List<FishingOperationLocation> getAllFishingOperationSubStrata(String locationId) {
- Iterator<Object[]> sources = queryListWithStatus(
- "allFishingOperationSubStratas",
- "locationLevelId", IntegerType.INSTANCE, enumeration.LOCATION_LEVEL_ID_SUB_STRATA);
- List<FishingOperationLocation> result = Lists.newArrayList();
- while (sources.hasNext()) {
- Object[] source = sources.next();
- FishingOperationLocation target = loadFishingOperationLocation(source);
- result.add(target);
- }
- return result;
- }
-
- @Override
- public List<FishingOperationLocation> getAllFishingOperationLocation(String locationId) {
- Iterator<Object[]> sources = queryListWithStatus(
- "allFishingOperationLocalites",
- "locationLevelId", IntegerType.INSTANCE, enumeration.LOCATION_LEVEL_ID_LOCALITE);
- List<FishingOperationLocation> result = Lists.newArrayList();
- while (sources.hasNext()) {
- Object[] source = sources.next();
- FishingOperationLocation target = loadFishingOperationLocation(source);
- result.add(target);
- }
- return result;
- }
-
- @Override
public Caracteristic getSizeCategoryCaracteristic() {
Integer pmfmId = enumeration.PMFM_ID_SIZE_CATEGORY;
Caracteristic result = getCaracteristic(pmfmId);
@@ -412,14 +471,14 @@
@Override
public Caracteristic getMacroWasteCategoryCaracteristic() {
- Integer pmfmId = enumeration.PMFM_ID_MACRO_WASTE_CATEGORY;
+ Integer pmfmId = enumeration.PMFM_ID_MARINE_LITTER_TYPE;
Caracteristic result = getCaracteristic(pmfmId);
return result;
}
@Override
public Caracteristic getMacroWasteSizeCategoryCaracteristic() {
- Integer pmfmId = enumeration.PMFM_ID_MACRO_WASTE_SIZE_CATEGORY;
+ Integer pmfmId = enumeration.PMFM_ID_MARINE_LITTER_SIZE_CATEGORY;
Caracteristic result = getCaracteristic(pmfmId);
return result;
}
@@ -437,7 +496,30 @@
//-- Internal methods --//
//------------------------------------------------------------------------//
+ protected List<FishingOperationLocation> getFishingOperationLocations(Integer locationLevelId, Integer parentId, Integer parentLocationLevelId) {
+ Iterator<Object[]> sources = queryListWithStatus(
+ "allFishingOperationLocation",
+ "parentId", IntegerType.INSTANCE, parentId,
+ "parentLocationLevelId", IntegerType.INSTANCE, parentLocationLevelId,
+ "locationClassificationId", IntegerType.INSTANCE, enumeration.LOCATION_CLASSIFICATION_ID_SECTOR,
+ "locationLevelId", IntegerType.INSTANCE, locationLevelId
+ );
+ List<FishingOperationLocation> result = Lists.newArrayList();
+ while (sources.hasNext()) {
+ Object[] source = sources.next();
+ FishingOperationLocation target = new FishingOperationLocation();
+ target.setId(String.valueOf(source[0]));
+ target.setLabel((String) source[1]);
+ target.setName((String) source[2]);
+// target.setDescription((String)source[3]);
+ target.setLocationLevel((Integer) source[3]);
+ setStatus((fr.ifremer.adagio.core.dao.referential.Status) source[4], target);
+ result.add(target);
+ }
+ return result;
+ }
+
protected Caracteristic loadCaracteristic(Object[] source) {
Integer pmfmId = (Integer) source[0];
@@ -479,18 +561,6 @@
return result;
}
- protected FishingOperationLocation loadFishingOperationLocation(Object[] source) {
- FishingOperationLocation target = new FishingOperationLocation();
- target.setId(String.valueOf(source[0]));
- target.setLabel((String) source[1]);
- target.setName((String) source[2]);
-// target.setDescription((String)source[3]);
- target.setLocationLevel((Integer) source[3]);
-
- setStatus((fr.ifremer.adagio.core.dao.referential.Status) source[4], target);
- return target;
- }
-
protected Species loadSpecies(TaxonRefTaxVO source) {
Species target = new Species();
target.setId(String.valueOf(source.getReferenceTaxonId()));
Modified: trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/service/TuttiEnumerationFile.java
===================================================================
--- trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/service/TuttiEnumerationFile.java 2013-01-28 18:29:58 UTC (rev 253)
+++ trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/service/TuttiEnumerationFile.java 2013-01-29 08:24:13 UTC (rev 254)
@@ -44,6 +44,9 @@
@Value("${GearClassificationId.FAO}")
public final Integer GEAR_CLASSIFICIATION_ID_FISHING = null;
+ @Value("${LocationClassificationId.SECTOR}")
+ public final Integer LOCATION_CLASSIFICATION_ID_SECTOR = null;
+
@Value("${LocationLevelId.PAYS_ISO3}")
public final Integer LOCATION_LEVEL_ID_COUNTRY = null;
@@ -51,12 +54,12 @@
public final Integer LOCATION_LEVEL_ID_LOCALITE = null;
@Value("${LocationLevelId.PROGRAM}")
- public final Integer LOCATION_LEVEL_ID_PROGRAMM = null;
+ public final Integer LOCATION_LEVEL_ID_PROGRAM = null;
@Value("${LocationLevelId.STRATA}")
public final Integer LOCATION_LEVEL_ID_STRATA = null;
- @Value("${LocationLevelId.SUBSTRATA}")
+ @Value("${LocationLevelId.SUB_STRATA}")
public final Integer LOCATION_LEVEL_ID_SUB_STRATA = null;
@Value("${MatrixId.GEAR}")
@@ -92,11 +95,11 @@
@Value("${PmfmId.MATURITY}")
public final Integer PMFM_ID_MATURITY = null;
- @Value("${PmfmId.MACRO_WASTE_CATEGORY}")
- public final Integer PMFM_ID_MACRO_WASTE_CATEGORY = null;
+ @Value("${PmfmId.MARINE_LITTER_TYPE}")
+ public final Integer PMFM_ID_MARINE_LITTER_TYPE = null;
- @Value("${PmfmId.MACRO_WASTE_SIZE_CATEGORY}")
- public final Integer PMFM_ID_MACRO_WASTE_SIZE_CATEGORY = null;
+ @Value("${PmfmId.MARINE_LITTER_SIZE_CATEGORY}")
+ public final Integer PMFM_ID_MARINE_LITTER_SIZE_CATEGORY = null;
@Value("${UnitId.NONE}")
public final Integer UNIT_ID_NONE = null;
@@ -118,10 +121,10 @@
@Value("${LocationLevelId.RECTANGLE_STATISTIQUE_MED}")
public final Integer RECTANGLE_STATISTIQUE_MED = null;
-
+
@Value("${LocationLevelId.RECTANGLE_STATISTIQUE}")
public final Integer RECTANGLE_STATISTIQUE = null;
-
+
@Value("${LocationLevelId.FAO_ZONE}")
public final Integer FAO_ZONE = null;
@@ -163,10 +166,10 @@
@Value("${QualitativeValueId.HAUL_VALID_NO}")
public final Integer QUALITATIVE_HAUL_VALID_NO = null;
-
+
@Value("${PmfmId.TRAWL_NET}")
public final Integer PMFM_ID_TRAWL_NET = null;
-
+
@Value("${PmfmId.TRAWL_NET_NUMBER}")
public final Integer PMFM_ID_TRAWL_NET_NUMBER = null;
Modified: trunk/tutti-persistence-adagio/src/main/resources/queries-override.hbm.xml
===================================================================
--- trunk/tutti-persistence-adagio/src/main/resources/queries-override.hbm.xml 2013-01-28 18:29:58 UTC (rev 253)
+++ trunk/tutti-persistence-adagio/src/main/resources/queries-override.hbm.xml 2013-01-29 08:24:13 UTC (rev 254)
@@ -356,9 +356,11 @@
FROM LocationImpl l
WHERE
l.locationLevel.id = :locationLevelId
+ AND l.locationClassification.id = :locationClassificationId
AND l.status.code IN (:statusValidCode, :statusTemporaryCode)
]]>
<query-param name="locationLevelId" type="java.lang.Integer"/>
+ <query-param name="locationClassificationId" type="java.lang.Integer"/>
<query-param name="statusValidCode" type="java.lang.String"/>
<query-param name="statusTemporaryCode" type="java.lang.String"/>
</query>
@@ -381,7 +383,35 @@
<query-param name="statusTemporaryCode" type="java.lang.String"/>
</query>
- <!-- [REF-03] et [REF-04] Get all vessel for a given vesselType -->
+ <!-- [REF-03] Get all fishing operation strata / substrata / localite -->
+ <query cacheable="true" name="allFishingOperationLocation">
+ <![CDATA[
+ SELECT
+ l.id as locationId,
+ l.label as locationLabel,
+ l.name as locationName,
+ l.locationLevel.id as locationLevelId,
+ l.status as status
+ FROM
+ LocationImpl l,
+ LocationHierarchyImpl lh
+ WHERE
+ l.status.code IN (:statusValidCode, :statusTemporaryCode)
+ AND l.locationLevel.id = :locationLevelId
+ AND l.locationClassification.id = :locationClassificationId
+ AND l.id = lh.locationHierarchyPk.location.id
+ AND lh.locationHierarchyPk.parent.id = :parentId
+ AND lh.locationHierarchyPk.parent.locationLevel.id = :parentLocationLevelId
+ ]]>
+ <query-param name="parentId" type="java.lang.Integer"/>
+ <query-param name="parentLocationLevelId" type="java.lang.Integer"/>
+ <query-param name="locationLevelId" type="java.lang.Integer"/>
+ <query-param name="locationClassificationId" type="java.lang.Integer"/>
+ <query-param name="statusValidCode" type="java.lang.String"/>
+ <query-param name="statusTemporaryCode" type="java.lang.String"/>
+ </query>
+
+ <!-- [REF-04] et [REF-05] Get all vessel for a given vesselType -->
<query cacheable="true" name="allVessels">
<![CDATA[
SELECT
@@ -420,6 +450,26 @@
<query-param name="statusTemporaryCode" type="java.lang.String"/>
</query>
+ <query cacheable="true" name="allSimpleVessels">
+ <![CDATA[
+ SELECT
+ v.code AS vesselCode,
+ vf.name AS vesselName,
+ v.status AS status,
+ vf.startDateTime
+ FROM
+ VesselImpl v
+ INNER JOIN v.vesselFeatures AS vf
+ WHERE
+ v.vesselType.id = :vesselTypeId
+ AND v.status.code IN (:statusValidCode, :statusTemporaryCode)
+ ORDER BY vf.startDateTime DESC
+ ]]>
+ <query-param name="vesselTypeId" type="java.lang.Integer"/>
+ <query-param name="statusValidCode" type="java.lang.String"/>
+ <query-param name="statusTemporaryCode" type="java.lang.String"/>
+ </query>
+
<!-- Get a vessel for a given vesselType -->
<query cacheable="true" name="vessel">
<![CDATA[
@@ -447,7 +497,26 @@
<query-param name="statusTemporaryCode" type="java.lang.String"/>
</query>
- <!-- [REF-04] [REF-05] Get all gears -->
+ <!-- Get a vessel for a given vesselType -->
+ <query cacheable="true" name="vessel2">
+ <![CDATA[
+ SELECT
+ vrp.registrationCode AS nationalRegistrationCode,
+ vrp.internationalRegistrationCode as internationalRegistrationCode
+ FROM
+ VesselImpl v
+ INNER JOIN v.vesselRegistrationPeriods AS vrp
+ WHERE
+ v.code = :vesselCode
+ AND NOT(coalesce(vrp.endDateTime, '2999-12-31 00:00:00') < coalesce(:refDate,sysdate)
+ OR vrp.vesselRegistrationPeriodPk.startDateTime > coalesce(:refDate,sysdate)
+ )
+ ]]>
+ <query-param name="vesselCode" type="java.lang.String"/>
+ <query-param name="refDate" type="java.util.Date"/>
+ </query>
+
+ <!-- [REF-06] [REF-07] Get all gears -->
<query cacheable="true" name="allGears">
<![CDATA[
SELECT
@@ -479,7 +548,7 @@
<query-param name="gearId" type="java.lang.Integer"/>
</query>
- <!-- [REF-07] Get all persons -->
+ <!-- [REF-08] Get all persons -->
<query cacheable="true" name="allPersons">
<![CDATA[
SELECT DISTINCT
@@ -507,7 +576,7 @@
<query-param name="statusTemporaryCode" type="java.lang.String"/>
</query>
- <!-- [REF-07-1] Get one person -->
+ <!-- [REF-08-1] Get one person -->
<query cacheable="true" name="person">
<![CDATA[
SELECT DISTINCT
@@ -522,7 +591,7 @@
<query-param name="personId" type="java.lang.Integer"/>
</query>
- <!-- [REF-09] Get all length step catacteristics -->
+ <!-- [REF-16] Get all length step catacteristics -->
<query cacheable="true" name="allLengthStepCaracteristics">
<![CDATA[
SELECT
@@ -556,66 +625,4 @@
<query-param name="statusTemporaryCode" type="java.lang.String"/>
</query>
- <!-- [REF-13] Get all fishing operation strates -->
- <query cacheable="true" name="allFishingOperationStratas">
- <![CDATA[
- SELECT
- l.id as locationId,
- l.label as locationLabel,
- l.name as locationName,
- l.locationLevel.id as locationLevelId,
- l.status as status
- FROM LocationImpl l
- WHERE
- l.status.code IN (:statusValidCode, :statusTemporaryCode)
- AND l.locationLevel.id = :locationLevelId
- ]]>
- <query-param name="locationLevelId" type="java.lang.Integer"/>
- <query-param name="statusValidCode" type="java.lang.String"/>
- <query-param name="statusTemporaryCode" type="java.lang.String"/>
- </query>
-
- <!-- [REF-14] Get all fishing operation substrates -->
- <query cacheable="true" name="allFishingOperationSubStratas">
- <![CDATA[
- SELECT
- l.id as locationId,
- l.label as locationLabel,
- l.name as locationName,
- l.locationLevel.id as locationLevelId,
- l.status as status
- FROM LocationImpl l
- WHERE
- l.status.code IN (:statusValidCode, :statusTemporaryCode)
- AND l.locationLevel.id = :locationLevelId
- ]]>
- <query-param name="locationLevelId" type="java.lang.Integer"/>
- <query-param name="statusValidCode" type="java.lang.String"/>
- <query-param name="statusTemporaryCode" type="java.lang.String"/>
- </query>
-
- <!-- [REF-15] Get all fishing operation localites -->
- <query cacheable="true" name="allFishingOperationLocalites">
- <![CDATA[
- SELECT
- l.id as locationId,
- l.label as locationLabel,
- l.name as locationName,
- l.locationLevel.id as locationLevelId,
- l.status as status
- FROM LocationImpl l
- WHERE
- l.status.code IN (:statusValidCode, :statusTemporaryCode)
- AND l.locationLevel.id = :locationLevelId
- ]]>
- <query-param name="locationLevelId" type="java.lang.Integer"/>
- <query-param name="statusValidCode" type="java.lang.String"/>
- <query-param name="statusTemporaryCode" type="java.lang.String"/>
- </query>
-
- <!-- TODO [REF-16] Get all Length - Weight conversions -->
- <!--query cacheable="true" name="allLengthWeightConvertions">
- <![CDATA[]]>
- </query-->
-
</hibernate-mapping>
Modified: trunk/tutti-persistence-adagio/src/main/resources/tutti-db-enumerations.properties
===================================================================
--- trunk/tutti-persistence-adagio/src/main/resources/tutti-db-enumerations.properties 2013-01-28 18:29:58 UTC (rev 253)
+++ trunk/tutti-persistence-adagio/src/main/resources/tutti-db-enumerations.properties 2013-01-29 08:24:13 UTC (rev 254)
@@ -300,14 +300,22 @@
# 10/01/2012 BLA Need to retrieve a Location from a given position (Lat/Long)
LocationLevelId.RECTANGLE_STATISTIQUE_MED=145
-# Ajout pour Tutti
-LocationLevelId.LOCALITE=22
-LocationLevelId.STRATA=23
-#TODO Creer la bonne valeur
-LocationLevelId.SUBSTRATA=113
-#TODO Mettre la bonne valeur
-LocationLevelId.PROGRAM=101
+################################################################################
+### Ajout pour Tutti ###########################################################
+################################################################################
+# zone d'étude
+LocationLevelId.PROGRAM=230
+# strate
+LocationLevelId.STRATA=231
+# sous strate
+LocationLevelId.SUB_STRATA=232
+# localité
+LocationLevelId.LOCALITE=233
+# radiale
+LocationLevelId.RADIALE=233
+
+
MethodId.DECLARATION=1
MatrixId.BATCH=1
@@ -320,12 +328,16 @@
PmfmId.SEX=196
PmfmId.SIZE_CATEGORY=198
PmfmId.SORTED_UNSORTED=200
-# TODO A confirmer
-PmfmId.MATURITY=1181
-#TODO A créér
-PmfmId.MACRO_WASTE_CATEGORY=1181
-#TODO A créér
-PmfmId.MACRO_WASTE_SIZE_CATEGORY=1181
+
+# Catégorie maturité
+PmfmId.MATURITY=174
+
+# Catégorie macro-déchet
+PmfmId.MARINE_LITTER_TYPE=1421
+
+# Classe de taille macro-déchet
+PmfmId.MARINE_LITTER_SIZE_CATEGORY=1422
+
# TODO A creer (dans les enumerations Allegro)
PmfmId.STATION_NUMBER=1243
# TODO A creer (dans les enumerations Allegro)
Modified: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/DatabaseFixtures.java
===================================================================
--- trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/DatabaseFixtures.java 2013-01-28 18:29:58 UTC (rev 253)
+++ trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/DatabaseFixtures.java 2013-01-29 08:24:13 UTC (rev 254)
@@ -39,21 +39,28 @@
public String cruiseId() {
return "100000";
}
-
+
public String fishingVesselCode() {
return "851751";
}
-
+
+ public String zoneId() {
+ //TODO TC : use an existing value
+ return "-1";
+ }
+
public String strataId() {
- return "20990"; /*= Strate 24E4*/
+ //TODO TC : use an existing value
+ return "-1";
}
-
+
public String subStrataId() {
- // TODO TC : change ID into a real substrata !
- return "6080"; /*= Rectangle 24E4 */
- }
-
+ //TODO TC : use an existing value
+ return "-1";
+ }
+
public String localite() {
- return "21525"; /*= Localité 4F1 */
- }
+ //TODO TC : use an existing value
+ return "-1";
+ }
}
Modified: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceServiceTest.java
===================================================================
--- trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceServiceTest.java 2013-01-28 18:29:58 UTC (rev 253)
+++ trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceServiceTest.java 2013-01-29 08:24:13 UTC (rev 254)
@@ -120,7 +120,7 @@
public void getAllProgramZone() {
List<Zone> result = service.getAllProgramZone();
Assert.assertNotNull(result);
- Assert.assertEquals(240, result.size());
+ Assert.assertEquals(0, result.size());
persistList(Zone.class, result);
assertSize(result, storage.getAllProgramZone());
@@ -131,11 +131,66 @@
List<Country> result = service.getAllCountry();
Assert.assertNotNull(result);
Assert.assertEquals(240, result.size());
+
persistList(Country.class, result);
assertSize(result, storage.getAllCountry());
}
@Test
+ public void getAllFishingOperationStrata(/*String zoneId*/) {
+ String zoneId = dbResource.getFixtures().zoneId();
+ List<FishingOperationLocation> result =
+ service.getAllFishingOperationStrata(zoneId);
+ Assert.assertNotNull(result);
+ Assert.assertEquals(0, result.size());
+
+ persistList(FishingOperationLocation.class, "Strata", result);
+ assertSize(result, storage.getAllFishingOperationStrata(zoneId));
+ }
+
+ @Test
+ public void getAllFishingOperationSubStrata(/*String zoneId, String strataId*/) {
+ String zoneId = dbResource.getFixtures().zoneId();
+ List<FishingOperationLocation> result =
+ service.getAllFishingOperationSubStrata(zoneId, null);
+ Assert.assertNotNull(result);
+ Assert.assertEquals(0, result.size());
+
+ persistList(FishingOperationLocation.class, "SubStrata", result);
+ assertSize(result, storage.getAllFishingOperationSubStrata(zoneId, null));
+
+ // try with a strataId
+ String strataId = dbResource.getFixtures().strataId();
+ result = service.getAllFishingOperationLocation(zoneId, strataId, null);
+ Assert.assertNotNull(result);
+ Assert.assertEquals(0, result.size());
+ }
+
+ @Test
+ public void getAllFishingOperationLocation(/*String zoneId, String strataId, String subStrataId*/) {
+ String zoneId = dbResource.getFixtures().zoneId();
+ List<FishingOperationLocation> result =
+ service.getAllFishingOperationLocation(zoneId, null, null);
+ Assert.assertNotNull(result);
+ Assert.assertEquals(0, result.size());
+
+ persistList(FishingOperationLocation.class, "Localite", result);
+ assertSize(result, storage.getAllFishingOperationLocation(zoneId, null, null));
+
+ // try with a strataId
+ String strataId = dbResource.getFixtures().strataId();
+ result = service.getAllFishingOperationLocation(zoneId, strataId, null);
+ Assert.assertNotNull(result);
+ Assert.assertEquals(0, result.size());
+
+ // try with a subStrataId
+ String subStrataId = dbResource.getFixtures().subStrataId();
+ result = service.getAllFishingOperationLocation(zoneId, strataId, subStrataId);
+ Assert.assertNotNull(result);
+ Assert.assertEquals(0, result.size());
+ }
+
+ @Test
public void getAllScientificVessel() {
List<Vessel> result = service.getAllScientificVessel();
Assert.assertNotNull(result);
@@ -146,11 +201,11 @@
//FIXME : requete trop longue (index manquant, trop de jointures?)
@Test
- @Ignore
+// @Ignore
public void getAllFishingVessel() {
List<Vessel> result = service.getAllFishingVessel();
Assert.assertNotNull(result);
- Assert.assertEquals(187, result.size());
+ Assert.assertEquals(31620, result.size());
persistList(Vessel.class, "Fishing", result);
assertSize(result, storage.getAllFishingVessel());
}
@@ -192,58 +247,10 @@
}
@Test
- public void getAllBenthosSpecies() {
- List<Species> result = service.getAllBenthosSpecies();
- Assert.assertNotNull(result);
- Assert.assertEquals(8435, result.size());
- persistList(Species.class, "Benthos", result);
- assertSize(result, storage.getAllBenthosSpecies());
- }
-
- @Test
- public void getAllPlanktonSpecies() {
- List<Species> result = service.getAllPlanktonSpecies();
- Assert.assertNotNull(result);
- Assert.assertEquals(8435, result.size());
- persistList(Species.class, "Plankton", result);
- assertSize(result, storage.getAllPlanktonSpecies());
- }
-
- @Test
public void getSpecies(/*String speciesId*/) {
}
@Test
- public void getAllFishingOperationStrata(/*String zoneId*/) {
- List<FishingOperationLocation> result =
- service.getAllFishingOperationStrata(null);
- Assert.assertNotNull(result);
- Assert.assertEquals(596, result.size());
- persistList(FishingOperationLocation.class, "Strata", result);
- assertSize(result, storage.getAllFishingOperationStrata(null));
- }
-
- @Test
- public void getAllFishingOperationSubStrata(/*String locationId*/) {
- List<FishingOperationLocation> result =
- service.getAllFishingOperationSubStrata(null);
- Assert.assertNotNull(result);
- Assert.assertEquals(0, result.size());
- persistList(FishingOperationLocation.class, "SubStrata", result);
- assertSize(result, storage.getAllFishingOperationSubStrata(null));
- }
-
- @Test
- public void getAllFishingOperationLocation(/*String locationId*/) {
- List<FishingOperationLocation> result =
- service.getAllFishingOperationLocation(null);
- Assert.assertNotNull(result);
- Assert.assertEquals(322, result.size());
- persistList(FishingOperationLocation.class, "Localite", result);
- assertSize(result, storage.getAllFishingOperationLocation(null));
- }
-
- @Test
public void getAllFishingOperationEnvironmentCaracteristic() {
List<Caracteristic> result = service.getAllFishingOperationEnvironmentCaracteristic();
Assert.assertNotNull(result);
@@ -308,11 +315,13 @@
@Test
public void getMaturityCaracteristic() {
Caracteristic result = service.getMaturityCaracteristic();
- assertCaracteristicQualitative(result, 10);
+ assertCaracteristicQualitative(result, 6);
persist(Caracteristic.class, ReferentialPersistenceServiceDevImpl.CaracteristicEnum.MaturityCategory.name(), result);
assertCaracteristicSize(result, storage.getMaturityCaracteristic());
}
+ //TODO Use this with new database
+ @Ignore
@Test
public void getMacroWasteCategoryCaracteristic() {
Caracteristic result = service.getMacroWasteCategoryCaracteristic();
@@ -321,6 +330,8 @@
assertCaracteristicSize(result, storage.getMacroWasteCategoryCaracteristic());
}
+ //TODO Use this with new database
+ @Ignore
@Test
public void getMacroWasteSizeCategoryCaracteristic() {
Caracteristic result = service.getMacroWasteSizeCategoryCaracteristic();
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 2013-01-28 18:29:58 UTC (rev 253)
+++ trunk/tutti-persistence-dev/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceDevImpl.java 2013-01-29 08:24:13 UTC (rev 254)
@@ -111,8 +111,6 @@
"fr.ifremer.tutti.persistence.entities.referential.Gear#Fishing",
"fr.ifremer.tutti.persistence.entities.referential.Person",
"fr.ifremer.tutti.persistence.entities.referential.Species",
- "fr.ifremer.tutti.persistence.entities.referential.Species#Benthos",
- "fr.ifremer.tutti.persistence.entities.referential.Species#Plankton",
"fr.ifremer.tutti.persistence.entities.referential.Vessel#Scientific",
"fr.ifremer.tutti.persistence.entities.referential.Vessel#Fishing",
"fr.ifremer.tutti.persistence.entities.referential.Zone"
@@ -244,6 +242,26 @@
}
@Override
+ public List<FishingOperationLocation> getAllFishingOperationStrata(String zoneId) {
+ return referentialPersistenceService.getAllFishingOperationStrata(zoneId);
+ }
+
+ @Override
+ public List<FishingOperationLocation> getAllFishingOperationSubStrata(String zoneId,
+ String strataId) {
+ return referentialPersistenceService.getAllFishingOperationSubStrata(
+ zoneId, strataId);
+ }
+
+ @Override
+ public List<FishingOperationLocation> getAllFishingOperationLocation(String zoneId,
+ String strataId,
+ String subStrataId) {
+ return referentialPersistenceService.getAllFishingOperationLocation(
+ zoneId, strataId, subStrataId);
+ }
+
+ @Override
public List<Vessel> getAllFishingVessel() {
return referentialPersistenceService.getAllFishingVessel();
}
@@ -263,36 +281,11 @@
}
@Override
- public List<Species> getAllBenthosSpecies() {
- return referentialPersistenceService.getAllBenthosSpecies();
- }
-
- @Override
- public List<Species> getAllPlanktonSpecies() {
- return referentialPersistenceService.getAllPlanktonSpecies();
- }
-
- @Override
public Species getSpecies(String speciesId) {
return referentialPersistenceService.getSpecies(speciesId);
}
@Override
- public List<FishingOperationLocation> getAllFishingOperationStrata(String zoneId) {
- return referentialPersistenceService.getAllFishingOperationStrata(zoneId);
- }
-
- @Override
- public List<FishingOperationLocation> getAllFishingOperationSubStrata(String locationId) {
- return referentialPersistenceService.getAllFishingOperationSubStrata(locationId);
- }
-
- @Override
- public List<FishingOperationLocation> getAllFishingOperationLocation(String locationId) {
- return referentialPersistenceService.getAllFishingOperationLocation(locationId);
- }
-
- @Override
public List<Caracteristic> getAllFishingOperationEnvironmentCaracteristic() {
return referentialPersistenceService.getAllFishingOperationEnvironmentCaracteristic();
}
Modified: trunk/tutti-persistence-dev/src/main/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceServiceDevImpl.java
===================================================================
--- trunk/tutti-persistence-dev/src/main/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceServiceDevImpl.java 2013-01-28 18:29:58 UTC (rev 253)
+++ trunk/tutti-persistence-dev/src/main/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceServiceDevImpl.java 2013-01-29 08:24:13 UTC (rev 254)
@@ -40,8 +40,6 @@
import java.util.List;
-import javax.naming.OperationNotSupportedException;
-
import static fr.ifremer.tutti.persistence.TuttiPersistenceDevImpl.getKey;
/**
@@ -81,36 +79,42 @@
}
@Override
- public List<Species> getAllBenthosSpecies() {
- List<Species> result = getDataInNewList(getKey(Species.class, "Benthos"));
+ public Species getSpecies(String id) {
+ Species result = getBean(Species.class.getName(), id);
return result;
}
@Override
- public List<Species> getAllPlanktonSpecies() {
- List<Species> result = getDataInNewList(getKey(Species.class, "Plankton"));
+ public List<Zone> getAllProgramZone() {
+ List<Zone> result = getDataInNewList(Zone.class.getName());
return result;
}
@Override
- public Species getSpecies(String id) {
- Species result = getBean(Species.class.getName(), id);
+ public List<Country> getAllCountry() {
+ List<Country> result = getDataInNewList(Country.class.getName());
return result;
}
@Override
- public List<Zone> getAllProgramZone() {
- List<Zone> result = getDataInNewList(Zone.class.getName());
+ public List<FishingOperationLocation> getAllFishingOperationStrata(String zoneId) {
+ List<FishingOperationLocation> result = getDataInNewList(getKey(FishingOperationLocation.class, "Strata"));
return result;
}
@Override
- public List<Country> getAllCountry() {
- List<Country> result = getDataInNewList(Country.class.getName());
+ public List<FishingOperationLocation> getAllFishingOperationSubStrata(String zoneId, String strataId) {
+ List<FishingOperationLocation> result = getDataInNewList(getKey(FishingOperationLocation.class, "SubStrata"));
return result;
}
@Override
+ public List<FishingOperationLocation> getAllFishingOperationLocation(String zoneId, String strataId, String subStrataId) {
+ List<FishingOperationLocation> result = getDataInNewList(getKey(FishingOperationLocation.class, "Localite"));
+ return result;
+ }
+
+ @Override
public List<Vessel> getAllScientificVessel() {
List<Vessel> result = getDataInNewList(getKey(Vessel.class, "Scientific"));
return result;
@@ -141,24 +145,6 @@
}
@Override
- public List<FishingOperationLocation> getAllFishingOperationStrata(final String zoneId) {
- List<FishingOperationLocation> result = getDataInNewList(getKey(FishingOperationLocation.class, "Strata"));
- return result;
- }
-
- @Override
- public List<FishingOperationLocation> getAllFishingOperationSubStrata(final String locationId) {
- List<FishingOperationLocation> result = getDataInNewList(getKey(FishingOperationLocation.class, "SubStrata"));
- return result;
- }
-
- @Override
- public List<FishingOperationLocation> getAllFishingOperationLocation(final String locationId) {
- List<FishingOperationLocation> result = getDataInNewList(getKey(FishingOperationLocation.class, "Localite"));
- return result;
- }
-
- @Override
public List<Caracteristic> getAllFishingOperationEnvironmentCaracteristic() {
return getAllCaracteristic(CaracteristicEnum.Environment);
}
@@ -229,12 +215,12 @@
@Override
public boolean isSortedQualitativeValue(CaracteristicQualitativeValue value) {
- return value !=null && value.getId().equals("311");
+ return value != null && value.getId().equals("311");
}
-
+
@Override
public Caracteristic getCaracteristic(Integer pmfmId) {
- throw new RuntimeException("getCaracteristic() not supports is only support in tutti-persistence-adagio");
+ throw new RuntimeException("getCaracteristic() not supports is only support in tutti-persistence-adagio");
}
protected <B extends IdAware> List<B> getData(String entityType) {
@@ -263,6 +249,6 @@
Caracteristic result = data.get(0);
return result;
}
-
+
}
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 2013-01-28 18:29:58 UTC (rev 253)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java 2013-01-29 08:24:13 UTC (rev 254)
@@ -174,16 +174,6 @@
}
@Override
- public List<Species> getAllBenthosSpecies() {
- return devDriver.getAllBenthosSpecies();
- }
-
- @Override
- public List<Species> getAllPlanktonSpecies() {
- return devDriver.getAllPlanktonSpecies();
- }
-
- @Override
public Species getSpecies(String speciesId) {
return devDriver.getSpecies(speciesId);
}
@@ -219,13 +209,13 @@
}
@Override
- public List<FishingOperationLocation> getAllFishingOperationSubStrata(String locationId) {
- return devDriver.getAllFishingOperationSubStrata(locationId);
+ public List<FishingOperationLocation> getAllFishingOperationSubStrata(String zoneId, String strataId) {
+ return devDriver.getAllFishingOperationSubStrata(zoneId, strataId);
}
@Override
- public List<FishingOperationLocation> getAllFishingOperationLocation(String locationId) {
- return devDriver.getAllFishingOperationLocation(locationId);
+ public List<FishingOperationLocation> getAllFishingOperationLocation(String zoneId, String strataId, String subStrataId) {
+ return devDriver.getAllFishingOperationLocation(zoneId, strataId, subStrataId);
}
@Override
Modified: trunk/tutti-ui-swing/pom.xml
===================================================================
--- trunk/tutti-ui-swing/pom.xml 2013-01-28 18:29:58 UTC (rev 253)
+++ trunk/tutti-ui-swing/pom.xml 2013-01-29 08:24:13 UTC (rev 254)
@@ -75,8 +75,6 @@
target/${project.build.finalName}-full-linux-x64.zip
</redmine.releaseFiles>
- <jreVersion>1.7.10</jreVersion>
-
</properties>
<build>
@@ -403,6 +401,7 @@
<groupId>com.oracle</groupId>
<artifactId>jre</artifactId>
<version>${jreVersion}</version>
+ <type>zip</type>
<classifier>linux-i586</classifier>
</artifactItem>
</artifactItems>
@@ -423,6 +422,7 @@
<groupId>com.oracle</groupId>
<artifactId>jre</artifactId>
<version>${jreVersion}</version>
+ <type>zip</type>
<classifier>linux-x64</classifier>
</artifactItem>
</artifactItems>
@@ -443,6 +443,7 @@
<groupId>com.oracle</groupId>
<artifactId>jre</artifactId>
<version>${jreVersion}</version>
+ <type>zip</type>
<classifier>windows-i586</classifier>
</artifactItem>
</artifactItems>
@@ -463,6 +464,7 @@
<groupId>com.oracle</groupId>
<artifactId>jre</artifactId>
<version>${jreVersion}</version>
+ <type>zip</type>
<classifier>windows-x64</classifier>
</artifactItem>
</artifactItems>
Modified: trunk/tutti-ui-swing/src/main/assembly/full/tutti.sh
===================================================================
--- trunk/tutti-ui-swing/src/main/assembly/full/tutti.sh 2013-01-28 18:29:58 UTC (rev 253)
+++ trunk/tutti-ui-swing/src/main/assembly/full/tutti.sh 2013-01-29 08:24:13 UTC (rev 254)
@@ -13,7 +13,7 @@
cp tutti-app/update.sh .
./update.sh
- ./tutti-app/launch.sh --option tutti.mode=full
+ ./tutti-app/launch.sh --option tutti.launch.mode=full
exitcode=$?
echo "exitCode: $exitcode"
Deleted: trunk/tutti-ui-swing/src/main/assembly/min/update-application.properties
===================================================================
--- trunk/tutti-ui-swing/src/main/assembly/min/update-application.properties 2013-01-28 18:29:58 UTC (rev 253)
+++ trunk/tutti-ui-swing/src/main/assembly/min/update-application.properties 2013-01-29 08:24:13 UTC (rev 254)
@@ -1,34 +0,0 @@
-###
-# #%L
-# Tutti :: UI
-# $Id$
-# $HeadURL$
-# %%
-# Copyright (C) 2012 - 2013 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%
-###
-tutti.version=1.1
-tutti.url=zip:file:/tmp/tutti-1.1-standalone.zip
-jre.version=1.7.10
-#linux.amd64.jre.version=1.7.10
-linux.amd64.jre.url=zip:file:~/.m2/repository/com/oracle/jre/1.7.10/jre-1.7.10-linux-x64.jar
-#linux.i386.jre.version=1.7.10
-linux.i386.jre.url=zip:file:~/.m2/repository/com/oracle/jre/1.7.10/jre-1.7.10-linux-i586.jar
-#windows.amd64.jre.version=1.7.10
-windows.amd64.jre.url=zip:file:~/.m2/repository/com/oracle/jre/1.7.10/jre-1.7.10-windows-x64.jar
-#windows.i386.jre.version=1.7.10
-windows.i386.jre.url=zip:file:~/.m2/repository/com/oracle/jre/1.7.10/jre-1.7.10-windows-i586.jar
Modified: trunk/tutti-ui-swing/src/main/assembly/min/update-database.properties
===================================================================
--- trunk/tutti-ui-swing/src/main/assembly/min/update-database.properties 2013-01-28 18:29:58 UTC (rev 253)
+++ trunk/tutti-ui-swing/src/main/assembly/min/update-database.properties 2013-01-29 08:24:13 UTC (rev 254)
@@ -21,5 +21,5 @@
# <http://www.gnu.org/licenses/gpl-3.0.html>.
# #L%
###
-adagiodb.version=1.0
-adagiodb.url=zip:file:/tmp/tutti-1.1-standalone.zip
+db.version=2013.01.28
+db.url=zip:file:/tmp/adagio-2013.01.28.zip
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/RunTutti.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/RunTutti.java 2013-01-28 18:29:58 UTC (rev 253)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/RunTutti.java 2013-01-29 08:24:13 UTC (rev 254)
@@ -59,14 +59,19 @@
// prepare context (mainly init configs, i18n)
context.init();
- //TODO tutti.mode=full alors mise a jour
+ String launchMode = config.getTuttiLaunchMode();
- // try to update jre
- updateTuttiJre(context);
+ if ("full".equals(launchMode)) {
- // try to update application
- updateTuttiApplication(context);
+ if (log.isInfoEnabled()) {
+ log.info("Full launch mode, try to update jre / application.");
+ }
+ // do the application and jre updates
+ // try to update jre or/and application
+ updateTuttiJreOrApplication(context);
+ }
+
// try to update database
updateTuttiDatabase(context);
@@ -110,48 +115,21 @@
}
}
- public static void updateTuttiJre(TuttiUIContext context) {
-
+ public static void updateTuttiJreOrApplication(TuttiUIContext context) {
TuttiConfig config = context.getConfig();
- File current = config.getJreDirectory();
+ File current = config.getTuttiBasedir();
if (current == null || !current.exists()) {
- // can not update jre
- if (log.isWarnEnabled()) {
- log.warn("No jre directory defined, skip jre update.");
- }
- } else {
-
- String url = config.getApplicationUpdateUrl();
- if (log.isInfoEnabled()) {
- log.info(String.format("Try to update jre (current jre location: %s), using update url: %s", current, url));
- }
- ApplicationUpdater up = new ApplicationUpdater();
- File dest = config.getTuttiBasedir();
- up.update(url,
- current,
- dest,
- false,
- new TuttiJreUpdaterCallBack(context));
- }
- }
-
- public static void updateTuttiApplication(TuttiUIContext context) {
- TuttiConfig config = context.getConfig();
-
- File current = config.getApplicationDirectory();
- if (current == null || !current.exists()) {
-
// can not update application
if (log.isWarnEnabled()) {
- log.warn("No application directory defined, skip application update.");
+ log.warn("No application directory defined, skip jre or application update.");
}
} else {
String url = config.getApplicationUpdateUrl();
if (log.isInfoEnabled()) {
- log.info(String.format("Try to update application (current application location: %s), using update url: %s", current, url));
+ log.info(String.format("Try to update jre or application (current application location: %s), using update url: %s", current, url));
}
ApplicationUpdater up = new ApplicationUpdater();
@@ -160,9 +138,8 @@
current,
dest,
false,
- new TuttiApplicationUpdaterCallBack(context));
+ new TuttiApplicationUpdaterCallBack());
}
-
}
public static void updateTuttiDatabase(TuttiUIContext context) {
@@ -176,9 +153,9 @@
log.info(String.format("Try to update database (current database location: %s), using update url: %s", current, url));
}
up.update(url,
- current,
+ current.getParentFile(),
dest,
false,
- new TuttiDatabaseUpdaterCallBack(context));
+ new TuttiDatabaseUpdaterCallBack());
}
}
\ No newline at end of file
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiApplicationUpdaterCallBack.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiApplicationUpdaterCallBack.java 2013-01-28 18:29:58 UTC (rev 253)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiApplicationUpdaterCallBack.java 2013-01-29 08:24:13 UTC (rev 254)
@@ -24,46 +24,107 @@
* #L%
*/
+import com.google.common.collect.Maps;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuiton.util.ApplicationUpdater;
+import java.util.Map;
+
/**
- * CallBack to update jre. TODO EMrger
+ * CallBack to update jre and/or tutti-app.
*
* @author tchemit <chemit(a)codelutin.com>
* @since 1.0
*/
-public class TuttiApplicationUpdaterCallBack extends TuttiUpdaterCallBack {
+public class TuttiApplicationUpdaterCallBack implements ApplicationUpdater.ApplicationUpdaterCallback {
/** Logger. */
private static final Log log =
LogFactory.getLog(TuttiApplicationUpdaterCallBack.class);
- public static final String APP_KEY = "tutti";
+ public static final String TUTTI_APP = "tutti-app";
- public TuttiApplicationUpdaterCallBack(TuttiUIContext context) {
- super(context, APP_KEY);
+ public static final String JRE = "jre";
+
+ @Override
+ public Map<String, ApplicationUpdater.ApplicationInfo> updateToDo(Map<String, ApplicationUpdater.ApplicationInfo> appToUpdate) {
+ Map<String, ApplicationUpdater.ApplicationInfo> result = Maps.newHashMap();
+
+ ApplicationUpdater.ApplicationInfo applicationInfo;
+ applicationInfo = getJreApplicationInfo(appToUpdate);
+ if (applicationInfo != null) {
+ result.put(JRE, applicationInfo);
+ }
+ applicationInfo = getTuttiAppApplicationInfo(appToUpdate);
+ if (applicationInfo != null) {
+ result.put(TUTTI_APP, applicationInfo);
+ }
+ return result;
}
@Override
- protected void updateDone(ApplicationUpdater.ApplicationInfo applicationInfo,
- Exception error) {
+ public void updateDone(Map<String, ApplicationUpdater.ApplicationInfo> appToUpdate,
+ Map<String, Exception> appUpdateError) {
- if (error != null) {
+ boolean doRestart = false;
+ if (appUpdateError.containsKey(JRE)) {
- //error when update database
- if (log.isWarnEnabled()) {
- log.warn("Could not update tutti application", error);
+ // something bad while updating jre
+ if (log.isErrorEnabled()) {
+ log.error("Could not update jre",
+ appUpdateError.get(JRE));
}
} else {
+ ApplicationUpdater.ApplicationInfo info = getJreApplicationInfo(appToUpdate);
+ if (info != null) {
- // launch a referential synchronize operation
- if (log.isInfoEnabled()) {
- log.info(String.format("A tutti application update was downloaded (oldVersion: %s, newVersion: %s), will restart application to use it", applicationInfo.oldVersion, applicationInfo.newVersion));
+ if (log.isInfoEnabled()) {
+ log.info(String.format(
+ "A jre update was downloaded (oldVersion: %s, newVersion: %s), will restart application to use it",
+ info.oldVersion, info.newVersion));
+ }
}
+ doRestart = true;
+ }
+ if (appUpdateError.containsKey(TUTTI_APP)) {
+
+ // something bad while updating application
+ if (log.isErrorEnabled()) {
+ log.error("Could not update tutti-app",
+ appUpdateError.get(TUTTI_APP));
+ }
+ } else {
+ ApplicationUpdater.ApplicationInfo info = getTuttiAppApplicationInfo(appToUpdate);
+ if (info != null) {
+
+ if (log.isInfoEnabled()) {
+ log.info(String.format(
+ "A tutti-app update was downloaded (oldVersion: %s, newVersion: %s), will restart application to use it",
+ info.oldVersion, info.newVersion));
+ }
+ }
+ doRestart = true;
+ }
+
+ if (doRestart) {
System.exit(RunTutti.UPATE_EXIT_CODE);
}
}
+
+ @Override
+ public void aborted(String propertiesURL, Exception eee) {
+ if (log.isErrorEnabled()) {
+ log.error("Could not update from " + propertiesURL, eee);
+ }
+ }
+
+ protected ApplicationUpdater.ApplicationInfo getJreApplicationInfo(Map<String, ApplicationUpdater.ApplicationInfo> appToUpdate) {
+ return appToUpdate.get(JRE);
+ }
+
+ protected ApplicationUpdater.ApplicationInfo getTuttiAppApplicationInfo(Map<String, ApplicationUpdater.ApplicationInfo> appToUpdate) {
+ return appToUpdate.get(TUTTI_APP);
+ }
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiDatabaseUpdaterCallBack.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiDatabaseUpdaterCallBack.java 2013-01-28 18:29:58 UTC (rev 253)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiDatabaseUpdaterCallBack.java 2013-01-29 08:24:13 UTC (rev 254)
@@ -24,53 +24,91 @@
* #L%
*/
+import com.google.common.collect.Maps;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuiton.util.ApplicationUpdater;
import org.nuiton.util.Version;
+import java.util.Map;
+
/**
* CallBack to update tutti.
*
* @author tchemit <chemit(a)codelutin.com>
* @since 1.0
*/
-public class TuttiDatabaseUpdaterCallBack extends TuttiUpdaterCallBack {
+public class TuttiDatabaseUpdaterCallBack implements ApplicationUpdater.ApplicationUpdaterCallback {
/** Logger. */
private static final Log log =
LogFactory.getLog(TuttiDatabaseUpdaterCallBack.class);
- public static final String APP_KEY = "adagiodb";
+ public static final String APP_KEY = "db";
- public TuttiDatabaseUpdaterCallBack(TuttiUIContext context) {
- super(context, APP_KEY);
+
+ @Override
+ public Map<String, ApplicationUpdater.ApplicationInfo> updateToDo(Map<String, ApplicationUpdater.ApplicationInfo> appToUpdate) {
+ Map<String, ApplicationUpdater.ApplicationInfo> result = Maps.newHashMap();
+
+ ApplicationUpdater.ApplicationInfo applicationInfo;
+ applicationInfo = appToUpdate.get(APP_KEY);
+ if (applicationInfo != null) {
+ result.put(APP_KEY, applicationInfo);
+ }
+ return result;
}
@Override
- protected void updateDone(ApplicationUpdater.ApplicationInfo applicationInfo,
- Exception error) {
+ public void updateDone(Map<String, ApplicationUpdater.ApplicationInfo> appToUpdate,
+ Map<String, Exception> appUpdateError) {
- if (error != null) {
+ boolean doRestart = false;
+ if (appUpdateError.containsKey(APP_KEY)) {
- //error when update database
- if (log.isWarnEnabled()) {
- log.warn("Could not update database", error);
+ // something bad while updating jre
+ if (log.isErrorEnabled()) {
+ log.error("Could not update database",
+ appUpdateError.get(APP_KEY));
}
- } else if (Version.VZERO.toString().equals(applicationInfo.oldVersion)) {
-
- // first database, just copy it to correct directory
- if (log.isInfoEnabled()) {
- log.info("First time database was downloaded at version: " + applicationInfo.newVersion);
- }
- //TODO copie base au bon endroit pour utilisation directe
} else {
+ ApplicationUpdater.ApplicationInfo info = appToUpdate.get(APP_KEY);
+ if (info != null) {
- // launch a referential synchronize operation
- if (log.isInfoEnabled()) {
- log.info(String.format("A database update was downloaded (oldVersion: %s, newVersion: %s), will launch a referential synchronize operation ", applicationInfo.oldVersion, applicationInfo.newVersion));
+
+ if (Version.VZERO.toString().equals(info.oldVersion)) {
+
+ // first database, just copy it to correct directory
+
+ prepareFirstDatabase(info);
+ } else {
+
+ // launch a referential synchronize operation
+ synchronizetDatabase(info);
+ }
}
- //TODO synchro referentiel
}
}
+
+ @Override
+ public void aborted(String propertiesURL, Exception eee) {
+ if (log.isErrorEnabled()) {
+ log.error("Could not update from " + propertiesURL, eee);
+ }
+ }
+
+ protected void prepareFirstDatabase(ApplicationUpdater.ApplicationInfo info) {
+ //TODO copie base au bon endroit pour utilisation directe
+ if (log.isInfoEnabled()) {
+ log.info("First time database was downloaded at version: " + info.newVersion);
+ }
+ }
+
+ protected void synchronizetDatabase(ApplicationUpdater.ApplicationInfo info) {
+ //TODO synchro referential
+ if (log.isInfoEnabled()) {
+ log.info(String.format("A database update was downloaded (oldVersion: %s, newVersion: %s), will launch a referential synchronize operation ", info.oldVersion, info.newVersion));
+ }
+ }
+
}
Deleted: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiJreUpdaterCallBack.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiJreUpdaterCallBack.java 2013-01-28 18:29:58 UTC (rev 253)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiJreUpdaterCallBack.java 2013-01-29 08:24:13 UTC (rev 254)
@@ -1,69 +0,0 @@
-package fr.ifremer.tutti.ui.swing;
-
-/*
- * #%L
- * Tutti :: UI
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2012 - 2013 Ifremer
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.nuiton.util.ApplicationUpdater;
-
-/**
- * CallBack to update jre.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 1.0
- */
-public class TuttiJreUpdaterCallBack extends TuttiUpdaterCallBack {
-
- /** Logger. */
- private static final Log log =
- LogFactory.getLog(TuttiJreUpdaterCallBack.class);
-
- public static final String APP_KEY = "jre";
-
- public TuttiJreUpdaterCallBack(TuttiUIContext context) {
- super(context, APP_KEY);
- }
-
- @Override
- protected void updateDone(ApplicationUpdater.ApplicationInfo applicationInfo,
- Exception error) {
-
- if (error != null) {
-
- //error when update database
- if (log.isWarnEnabled()) {
- log.warn("Could not update database", error);
- }
- } else {
-
- // launch a referential synchronize operation
- if (log.isInfoEnabled()) {
- log.info(String.format("A jre update was downloaded (oldVersion: %s, newVersion: %s), will restart applicationto use it", applicationInfo.oldVersion, applicationInfo.newVersion));
- }
-
- System.exit(RunTutti.UPATE_EXIT_CODE);
- }
- }
-}
Deleted: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiUpdaterCallBack.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiUpdaterCallBack.java 2013-01-28 18:29:58 UTC (rev 253)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiUpdaterCallBack.java 2013-01-29 08:24:13 UTC (rev 254)
@@ -1,102 +0,0 @@
-package fr.ifremer.tutti.ui.swing;
-
-/*
- * #%L
- * Tutti :: UI
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2012 - 2013 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.Maps;
-import org.nuiton.util.ApplicationUpdater;
-
-import java.util.Map;
-
-/**
- * CallBack to update tutti.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 1.0
- */
-public abstract class TuttiUpdaterCallBack implements ApplicationUpdater.ApplicationUpdaterCallback {
-
- protected final TuttiUIContext context;
-
- protected final String app;
-
- protected ApplicationUpdater.ApplicationInfo applicationInfo;
-
- protected Exception error;
-
- public TuttiUpdaterCallBack(TuttiUIContext context, String app) {
- this.context = context;
- this.app = app;
- }
-
- public boolean isSuccess() {
- return error == null;
- }
-
- public boolean isUpdateDone() {
- return applicationInfo != null;
- }
-
- public ApplicationUpdater.ApplicationInfo getApplicationInfo() {
- return applicationInfo;
- }
-
- public Exception getError() {
- return error;
- }
-
- @Override
- public final Map<String, ApplicationUpdater.ApplicationInfo> updateToDo(Map<String, ApplicationUpdater.ApplicationInfo> appToUpdate) {
- ApplicationUpdater.ApplicationInfo applicationInfo = appToUpdate.get(app);
- if (applicationInfo != null) {
- appToUpdate = Maps.newHashMap();
- appToUpdate.put(app, applicationInfo);
- }
- return appToUpdate;
- }
-
- @Override
- public final void updateDone(Map<String, ApplicationUpdater.ApplicationInfo> appToUpdate,
- Map<String, Exception> appUpdateError) {
-
- ApplicationUpdater.ApplicationInfo applicationInfo = appToUpdate.get(app);
- Exception exception = appUpdateError.get(app);
- if (applicationInfo != null) {
-
- this.error = exception;
- if (exception == null) {
- this.applicationInfo = applicationInfo;
- }
- updateDone(applicationInfo, exception);
- }
- }
-
- @Override
- public void aborted(String propertiesURL, Exception eee) {
- this.error = eee;
- }
-
- protected abstract void updateDone(ApplicationUpdater.ApplicationInfo applicationInfo,
- Exception error);
-}
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 2013-01-28 18:29:58 UTC (rev 253)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/config/TuttiConfig.java 2013-01-29 08:24:13 UTC (rev 254)
@@ -146,6 +146,10 @@
return ReflectionToStringBuilder.toString(this);
}
+ public String getTuttiLaunchMode() {
+ return applicationConfig.getOption(TuttiConfigOption.TUTTI_LAUNCH_MODE.getKey());
+ }
+
/** @return {@link TuttiConfigOption#UI_CONFIG_FILE} value */
public File getUIConfigFile() {
return applicationConfig.getOptionAsFile(TuttiConfigOption.UI_CONFIG_FILE.getKey());
@@ -265,12 +269,4 @@
public String getDatabaseUpdateUrl() {
return applicationConfig.getOption(TuttiConfigOption.TUTTI_UPDATE_DATABASE_URL.getKey());
}
-
- public File getJreDirectory() {
- return applicationConfig.getOptionAsFile(TuttiConfigOption.TUTTI_JRE_DIRECTORY.getKey());
- }
-
- public File getApplicationDirectory() {
- return applicationConfig.getOptionAsFile(TuttiConfigOption.TUTTI_APPLICATION_DIRECTORY.getKey());
- }
}
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 2013-01-28 18:29:58 UTC (rev 253)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/config/TuttiConfigOption.java 2013-01-29 08:24:13 UTC (rev 254)
@@ -41,11 +41,15 @@
*/
public enum TuttiConfigOption implements ApplicationConfig.OptionDef {
- //TODO Utiliser une option full-mode pour trouver facilement le basedir
+ TUTTI_LAUNCH_MODE(
+ "tutti.launch.mode",
+ n_("tutti.launch.mode.description"),
+ null,
+ String.class,
+ true,
+ true
+ ),
-// TUTTI_MODE(
-//
-// ),
TUTTI_APPLICATION_BASEDIR(
"tutti.application.basedir",
n_("tutti.application.basedir.description"),
@@ -55,24 +59,6 @@
true
),
- TUTTI_JRE_DIRECTORY(
- "tutti.jre.directory",
- n_("tutti.jre.directory.description"),
- "${tutti.application.basedir}/jre",
- File.class,
- true,
- true
- ),
-
- TUTTI_APPLICATION_DIRECTORY(
- "tutti.application.directory",
- n_("tutti.application.directory.description"),
- "${tutti.application.basedir}/tutti-app",
- File.class,
- true,
- true
- ),
-
TUTTI_UPDATE_APPLICATION_URL(
"tutti.update.application.url",
n_("tutti.update.application.url.description"),
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/AddSpeciesAction.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/AddSpeciesAction.java 2013-01-28 18:29:58 UTC (rev 253)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/AddSpeciesAction.java 2013-01-29 08:24:13 UTC (rev 254)
@@ -1,6 +1,30 @@
package fr.ifremer.tutti.ui.swing.content.operation.catches.species.split;
+/*
+ * #%L
+ * Tutti :: UI
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 - 2013 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
import com.google.common.collect.Lists;
import fr.ifremer.tutti.persistence.TuttiPersistence;
import fr.ifremer.tutti.persistence.entities.referential.Species;
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/AddSpeciesAction.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/catches/species/split/AddSpeciesUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/AddSpeciesUI.css 2013-01-28 18:29:58 UTC (rev 253)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/AddSpeciesUI.css 2013-01-29 08:24:13 UTC (rev 254)
@@ -1,3 +1,26 @@
+/*
+ * #%L
+ * Tutti :: UI
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 - 2013 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%
+ */
#speciesCombo {
showReset: true;
i18nPrefix: "tutti.property.";
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/AddSpeciesUI.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/catches/species/split/AddSpeciesUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/AddSpeciesUI.jaxx 2013-01-28 18:29:58 UTC (rev 253)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/AddSpeciesUI.jaxx 2013-01-29 08:24:13 UTC (rev 254)
@@ -1,3 +1,26 @@
+<!--
+ #%L
+ Tutti :: UI
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2012 - 2013 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 layout='{new BorderLayout()}' id='addSpeciesPopup'
implements='fr.ifremer.tutti.ui.swing.TuttiUI<AddSpeciesUIModel, AddSpeciesUIHandler>'>
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/AddSpeciesUI.jaxx
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/AddSpeciesUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/AddSpeciesUIHandler.java 2013-01-28 18:29:58 UTC (rev 253)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/AddSpeciesUIHandler.java 2013-01-29 08:24:13 UTC (rev 254)
@@ -1,6 +1,30 @@
package fr.ifremer.tutti.ui.swing.content.operation.catches.species.split;
+/*
+ * #%L
+ * Tutti :: UI
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 - 2013 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
import com.google.common.collect.Lists;
import fr.ifremer.tutti.persistence.TuttiPersistence;
import fr.ifremer.tutti.persistence.entities.referential.Caracteristic;
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/AddSpeciesUIHandler.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/catches/species/split/AddSpeciesUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/AddSpeciesUIModel.java 2013-01-28 18:29:58 UTC (rev 253)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/AddSpeciesUIModel.java 2013-01-29 08:24:13 UTC (rev 254)
@@ -1,6 +1,30 @@
package fr.ifremer.tutti.ui.swing.content.operation.catches.species.split;
+/*
+ * #%L
+ * Tutti :: UI
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 - 2013 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
import com.google.common.collect.Lists;
import fr.ifremer.tutti.persistence.entities.referential.Species;
import fr.ifremer.tutti.ui.swing.AbstractTuttiBeanUIModel;
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/AddSpeciesUIModel.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/CaracteristicRowModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/CaracteristicRowModel.java 2013-01-28 18:29:58 UTC (rev 253)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/CaracteristicRowModel.java 2013-01-29 08:24:13 UTC (rev 254)
@@ -1,6 +1,30 @@
package fr.ifremer.tutti.ui.swing.content.operation.fishing;
+/*
+ * #%L
+ * Tutti :: UI
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 - 2013 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
import fr.ifremer.tutti.persistence.entities.referential.Caracteristic;
import fr.ifremer.tutti.ui.swing.AbstractTuttiBeanUIModel;
import java.io.Serializable;
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/CaracteristicRowModel.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/CaracteristicTabUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/CaracteristicTabUIHandler.java 2013-01-28 18:29:58 UTC (rev 253)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/CaracteristicTabUIHandler.java 2013-01-29 08:24:13 UTC (rev 254)
@@ -1,6 +1,30 @@
package fr.ifremer.tutti.ui.swing.content.operation.fishing;
+/*
+ * #%L
+ * Tutti :: UI
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 - 2013 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.base.Preconditions;
import com.google.common.collect.Lists;
import fr.ifremer.tutti.persistence.entities.CaracteristicMap;
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/CaracteristicTabUIHandler.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/CaracteristicTabUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/CaracteristicTabUIModel.java 2013-01-28 18:29:58 UTC (rev 253)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/CaracteristicTabUIModel.java 2013-01-29 08:24:13 UTC (rev 254)
@@ -1,6 +1,30 @@
package fr.ifremer.tutti.ui.swing.content.operation.fishing;
+/*
+ * #%L
+ * Tutti :: UI
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 - 2013 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.CaracteristicMap;
import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
import fr.ifremer.tutti.persistence.entities.referential.Caracteristic;
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/CaracteristicTabUIModel.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/environment/EnvironmentRowModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/environment/EnvironmentRowModel.java 2013-01-28 18:29:58 UTC (rev 253)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/environment/EnvironmentRowModel.java 2013-01-29 08:24:13 UTC (rev 254)
@@ -1,6 +1,30 @@
package fr.ifremer.tutti.ui.swing.content.operation.fishing.environment;
+/*
+ * #%L
+ * Tutti :: UI
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 - 2013 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.content.operation.fishing.CaracteristicRowModel;
/**
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/gearshooting/GearShootingRowModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/gearshooting/GearShootingRowModel.java 2013-01-28 18:29:58 UTC (rev 253)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/gearshooting/GearShootingRowModel.java 2013-01-29 08:24:13 UTC (rev 254)
@@ -1,6 +1,30 @@
package fr.ifremer.tutti.ui.swing.content.operation.fishing.gearshooting;
+/*
+ * #%L
+ * Tutti :: UI
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 - 2013 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.content.operation.fishing.CaracteristicRowModel;
/**
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/CoordinateEditorType.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/CoordinateEditorType.java 2013-01-28 18:29:58 UTC (rev 253)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/CoordinateEditorType.java 2013-01-29 08:24:13 UTC (rev 254)
@@ -1,6 +1,30 @@
package fr.ifremer.tutti.ui.swing.util.editor;
+/*
+ * #%L
+ * Tutti :: UI
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 - 2013 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
/**
*
* @author kmorin <kmorin(a)codelutin.com>
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/CoordinateEditorType.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 2013-01-28 18:29:58 UTC (rev 253)
+++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2013-01-29 08:24:13 UTC (rev 254)
@@ -222,6 +222,7 @@
tutti.label.tab.protocol.species=Espèces
tutti.label.tab.species=Espèces
tutti.label.traitReminder=Trait \: %s
+tutti.launch.mode.description=
tutti.legend.catch.benthos=Benthos
tutti.legend.catch.macroWaste=Macro déchets
tutti.legend.catch.species=Espèces
Property changes on: trunk/tutti-ui-swing/src/main/resources/icons/action-warning.png
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
1
0
r253 - in trunk/tutti-ui-swing/src/main: java/fr/ifremer/tutti/ui/swing/content/operation java/fr/ifremer/tutti/ui/swing/content/operation/catches java/fr/ifremer/tutti/ui/swing/content/operation/catches/species java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split resources/i18n
by kmorin@users.forge.codelutin.com 28 Jan '13
by kmorin@users.forge.codelutin.com 28 Jan '13
28 Jan '13
Author: kmorin
Date: 2013-01-28 19:29:58 +0100 (Mon, 28 Jan 2013)
New Revision: 253
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/253
Log:
debug + replace popups by cardlayouts
Modified:
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/catches/EditCatchesUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/AddSpeciesAction.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/CreateSpeciesBatchUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/CreateSpeciesBatchUIHandler.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.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.css 2013-01-28 17:50:07 UTC (rev 252)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.css 2013-01-28 18:29:58 UTC (rev 253)
@@ -52,6 +52,10 @@
bean: {model};
}
+/*#fishingOperationTabScrollPane {
+ horizontalScrollBarPolicy: {javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER};
+}*/
+
#stationNumberLabel {
text: "tutti.label.fishingOperation.stationNumber";
labelFor: {stationNumberField};
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 2013-01-28 17:50:07 UTC (rev 252)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.jaxx 2013-01-28 18:29:58 UTC (rev 253)
@@ -157,345 +157,347 @@
<JTabbedPane id='fishingOperationTabPane' constraints='BorderLayout.CENTER'>
<tab id='traitGeneralTab'>
- <Table fill='both' id='generalForm'>
+<!-- <JScrollPane id='fishingOperationTabScrollPane'>-->
+ <Table fill='both' id='generalForm'>
- <!-- Numero station / Numéro trait / Numéro de poche -->
- <row>
- <cell>
- <JLabel id='stationNumberLabel'/>
- </cell>
- <cell weightx='0.3'>
- <JTextField id='stationNumberField'
- onKeyReleased='handler.setText(event, "stationNumber")'/>
- </cell>
- <cell>
- <JLabel id='fishingOperationNumberLabel'/>
- </cell>
- <cell weightx='0.3'>
- <NumberEditor id='fishingOperationNumberField'
- constructorParams='this'/>
- </cell>
- <cell>
- <JLabel id='trawlNetNumberLabel'/>
- </cell>
- <cell weightx='0.3'>
- <NumberEditor id='trawlNetNumberField' constructorParams='this'/>
- </cell>
- </row>
+ <!-- Numero station / Numéro trait / Numéro de poche -->
+ <row>
+ <cell>
+ <JLabel id='stationNumberLabel'/>
+ </cell>
+ <cell weightx='0.3'>
+ <JTextField id='stationNumberField'
+ onKeyReleased='handler.setText(event, "stationNumber")'/>
+ </cell>
+ <cell>
+ <JLabel id='fishingOperationNumberLabel'/>
+ </cell>
+ <cell weightx='0.3'>
+ <NumberEditor id='fishingOperationNumberField'
+ constructorParams='this'/>
+ </cell>
+ <cell>
+ <JLabel id='trawlNetNumberLabel'/>
+ </cell>
+ <cell weightx='0.3'>
+ <NumberEditor id='trawlNetNumberField' constructorParams='this'/>
+ </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='locationLabel'/>
- </cell>
- <cell weightx='0.3'>
- <BeanComboBox id='locationComboBox' constructorParams='this'
- genericType='FishingOperationLocation'/>
- </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='locationLabel'/>
+ </cell>
+ <cell weightx='0.3'>
+ <BeanComboBox id='locationComboBox' 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>
- <JPanel/>
- </cell>
- <cell>
- <JLabel id='gearLatitudeLabel'/>
- </cell>
- <cell>
- <JLabel id='gearLongitudeLabel'/>
- </cell>
- <cell>
- <JLabel id='gearDateLabel'/>
- </cell>
- <cell>
- <JLabel id='gearTimeLabel'/>
- </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>
+ <JPanel/>
+ </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 weightx='1'>
- <JPanel id='gearShootingStartLatitudePanel'>
- <NumberEditor id='gearShootingStartLatitudeDDField'
- constraints='"DD"'
- constructorParams='this'/>
- <JPanel layout="{new GridLayout(1,0)}"
- constraints='"DMS"'>
- <NumberEditor
- id='gearShootingStartLatitudeDMSDegreeField'
- constructorParams='this' styleClass='degree'/>
+ <row>
+ <cell>
+ <JLabel id='gearShootingStartLabel'/>
+ </cell>
+ <cell weightx='1'>
+ <JPanel id='gearShootingStartLatitudePanel'>
+ <NumberEditor id='gearShootingStartLatitudeDDField'
+ constraints='"DD"'
+ constructorParams='this'/>
+ <JPanel layout="{new GridLayout(1,0)}"
+ constraints='"DMS"'>
+ <NumberEditor
+ id='gearShootingStartLatitudeDMSDegreeField'
+ constructorParams='this' styleClass='degree'/>
- <NumberEditor
- id='gearShootingStartLatitudeDMSMinuteField'
- constructorParams='this' styleClass='minute'/>
+ <NumberEditor
+ id='gearShootingStartLatitudeDMSMinuteField'
+ constructorParams='this' styleClass='minute'/>
- <NumberEditor
- id='gearShootingStartLatitudeDMSSecondField'
- constructorParams='this' styleClass='second'/>
- </JPanel>
- <JPanel layout="{new GridLayout(1,0)}"
- constraints='"DMD"'>
- <NumberEditor
- id='gearShootingStartLatitudeDMDDegreeField'
- constructorParams='this' styleClass='degree'/>
+ <NumberEditor
+ id='gearShootingStartLatitudeDMSSecondField'
+ constructorParams='this' styleClass='second'/>
+ </JPanel>
+ <JPanel layout="{new GridLayout(1,0)}"
+ constraints='"DMD"'>
+ <NumberEditor
+ id='gearShootingStartLatitudeDMDDegreeField'
+ constructorParams='this' styleClass='degree'/>
- <NumberEditor
- id='gearShootingStartLatitudeDMDMinuteField'
- constructorParams='this' styleClass='decimalMinute'/>
+ <NumberEditor
+ id='gearShootingStartLatitudeDMDMinuteField'
+ constructorParams='this' styleClass='decimalMinute'/>
+ </JPanel>
</JPanel>
- </JPanel>
- </cell>
- <cell weightx='1'>
- <JPanel id='gearShootingStartLongitudePanel'>
- <NumberEditor id='gearShootingStartLongitudeDDField'
- constraints='"DD"'
- constructorParams='this'/>
- <JPanel layout="{new GridLayout(1,0)}"
- constraints='"DMS"'>
- <NumberEditor
- id='gearShootingStartLongitudeDMSDegreeField'
- constructorParams='this' styleClass='degree'/>
+ </cell>
+ <cell weightx='1'>
+ <JPanel id='gearShootingStartLongitudePanel'>
+ <NumberEditor id='gearShootingStartLongitudeDDField'
+ constraints='"DD"'
+ constructorParams='this'/>
+ <JPanel layout="{new GridLayout(1,0)}"
+ constraints='"DMS"'>
+ <NumberEditor
+ id='gearShootingStartLongitudeDMSDegreeField'
+ constructorParams='this' styleClass='degree'/>
- <NumberEditor
- id='gearShootingStartLongitudeDMSMinuteField'
- constructorParams='this' styleClass='minute'/>
+ <NumberEditor
+ id='gearShootingStartLongitudeDMSMinuteField'
+ constructorParams='this' styleClass='minute'/>
- <NumberEditor
- id='gearShootingStartLongitudeDMSSecondField'
- constructorParams='this' styleClass='second'/>
- </JPanel>
- <JPanel layout="{new GridLayout(1,0)}"
- constraints='"DMD"'>
- <NumberEditor
- id='gearShootingStartLongitudeDMDDegreeField'
- constructorParams='this' styleClass='degree'/>
+ <NumberEditor
+ id='gearShootingStartLongitudeDMSSecondField'
+ constructorParams='this' styleClass='second'/>
+ </JPanel>
+ <JPanel layout="{new GridLayout(1,0)}"
+ constraints='"DMD"'>
+ <NumberEditor
+ id='gearShootingStartLongitudeDMDDegreeField'
+ constructorParams='this' styleClass='degree'/>
- <NumberEditor
- id='gearShootingStartLongitudeDMDMinuteField'
- constructorParams='this' styleClass='decimalMinute'/>
+ <NumberEditor
+ id='gearShootingStartLongitudeDMDMinuteField'
+ constructorParams='this' styleClass='decimalMinute'/>
+ </JPanel>
</JPanel>
- </JPanel>
- </cell>
- <cell>
- <JXDatePicker id='gearShootingStartDateField'
- onActionPerformed='handler.setDate(event, "gearShootingStartDate")'/>
- </cell>
- <cell>
- <SimpleTimeEditor id='gearShootingStartTimeField'
+ </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 weightx='1'>
+ <JPanel id='gearShootingEndLatitudePanel'>
+ <NumberEditor id='gearShootingEndLatitudeDDField'
+ constraints='"DD"'
constructorParams='this'/>
- </cell>
- </row>
- <row>
- <cell>
- <JLabel id='gearShootingEndLabel'/>
- </cell>
- <cell weightx='1'>
- <JPanel id='gearShootingEndLatitudePanel'>
- <NumberEditor id='gearShootingEndLatitudeDDField'
- constraints='"DD"'
- constructorParams='this'/>
- <JPanel layout="{new GridLayout(1,0)}"
- constraints='"DMS"'>
- <NumberEditor
- id='gearShootingEndLatitudeDMSDegreeField'
- constructorParams='this' styleClass='degree'/>
+ <JPanel layout="{new GridLayout(1,0)}"
+ constraints='"DMS"'>
+ <NumberEditor
+ id='gearShootingEndLatitudeDMSDegreeField'
+ constructorParams='this' styleClass='degree'/>
- <NumberEditor
- id='gearShootingEndLatitudeDMSMinuteField'
- constructorParams='this' styleClass='minute'/>
+ <NumberEditor
+ id='gearShootingEndLatitudeDMSMinuteField'
+ constructorParams='this' styleClass='minute'/>
- <NumberEditor
- id='gearShootingEndLatitudeDMSSecondField'
- constructorParams='this' styleClass='second'/>
- </JPanel>
- <JPanel layout="{new GridLayout(1,0)}"
- constraints='"DMD"'>
- <NumberEditor
- id='gearShootingEndLatitudeDMDDegreeField'
- constructorParams='this' styleClass='degree'/>
+ <NumberEditor
+ id='gearShootingEndLatitudeDMSSecondField'
+ constructorParams='this' styleClass='second'/>
+ </JPanel>
+ <JPanel layout="{new GridLayout(1,0)}"
+ constraints='"DMD"'>
+ <NumberEditor
+ id='gearShootingEndLatitudeDMDDegreeField'
+ constructorParams='this' styleClass='degree'/>
- <NumberEditor
- id='gearShootingEndLatitudeDMDMinuteField'
- constructorParams='this' styleClass='decimalMinute'/>
+ <NumberEditor
+ id='gearShootingEndLatitudeDMDMinuteField'
+ constructorParams='this' styleClass='decimalMinute'/>
+ </JPanel>
</JPanel>
- </JPanel>
- </cell>
- <cell weightx='1'>
- <JPanel id='gearShootingEndLongitudePanel'>
- <NumberEditor id='gearShootingEndLongitudeDDField'
- constraints='"DD"'
- constructorParams='this'/>
- <JPanel layout="{new GridLayout(1,0)}"
- constraints='"DMS"'>
- <NumberEditor
- id='gearShootingEndLongitudeDMSDegreeField'
- constructorParams='this' styleClass='degree'/>
+ </cell>
+ <cell weightx='1'>
+ <JPanel id='gearShootingEndLongitudePanel'>
+ <NumberEditor id='gearShootingEndLongitudeDDField'
+ constraints='"DD"'
+ constructorParams='this'/>
+ <JPanel layout="{new GridLayout(1,0)}"
+ constraints='"DMS"'>
+ <NumberEditor
+ id='gearShootingEndLongitudeDMSDegreeField'
+ constructorParams='this' styleClass='degree'/>
- <NumberEditor
- id='gearShootingEndLongitudeDMSMinuteField'
- constructorParams='this' styleClass='minute'/>
+ <NumberEditor
+ id='gearShootingEndLongitudeDMSMinuteField'
+ constructorParams='this' styleClass='minute'/>
- <NumberEditor
- id='gearShootingEndLongitudeDMSSecondField'
- constructorParams='this' styleClass='second'/>
+ <NumberEditor
+ id='gearShootingEndLongitudeDMSSecondField'
+ constructorParams='this' styleClass='second'/>
+ </JPanel>
+ <JPanel layout="{new GridLayout(1,0)}"
+ constraints='"DMD"'>
+ <NumberEditor
+ id='gearShootingEndLongitudeDMDDegreeField'
+ constructorParams='this' styleClass='degree'/>
+
+ <NumberEditor
+ id='gearShootingEndLongitudeDMDMinuteField'
+ constructorParams='this' styleClass='decimalMinute'/>
+ </JPanel>
</JPanel>
- <JPanel layout="{new GridLayout(1,0)}"
- constraints='"DMD"'>
- <NumberEditor
- id='gearShootingEndLongitudeDMDDegreeField'
- constructorParams='this' styleClass='degree'/>
+ </cell>
+ <cell>
+ <JXDatePicker id='gearShootingEndDateField'
+ onActionPerformed='handler.setDate(event, "gearShootingEndDate")'/>
+ </cell>
+ <cell>
+ <SimpleTimeEditor id='gearShootingEndTimeField'
+ constructorParams='this'/>
+ </cell>
+ </row>
- <NumberEditor
- id='gearShootingEndLongitudeDMDMinuteField'
- constructorParams='this' styleClass='decimalMinute'/>
+ <!-- FishingOperation rectiligne / distance chalutee / durée -->
+ <row>
+ <cell>
+ <JLabel/>
+ </cell>
+ <cell>
+ <JCheckBox id='fishingOperationRectiligneCheckBox'
+ onItemStateChanged='handler.setBoolean(event, "fishingOperationRectiligne")'/>
+ </cell>
+ <cell>
+ <JPanel layout="{new BorderLayout()}">
+ <JLabel id='trawlDistanceLabel'
+ constraints='BorderLayout.WEST'/>
+ <NumberEditor id='trawlDistanceField'
+ constraints='BorderLayout.CENTER'
+ constructorParams='this'/>
</JPanel>
- </JPanel>
- </cell>
- <cell>
- <JXDatePicker id='gearShootingEndDateField'
- onActionPerformed='handler.setDate(event, "gearShootingEndDate")'/>
- </cell>
- <cell>
- <SimpleTimeEditor id='gearShootingEndTimeField'
- constructorParams='this'/>
- </cell>
- </row>
+ </cell>
+ <cell>
+ <JLabel/>
+ </cell>
+ <cell>
+ <JPanel layout="{new BorderLayout()}">
+ <JLabel id='durationLabel'
+ constraints='BorderLayout.WEST'/>
+ <JTextField id='durationField'
+ constraints='BorderLayout.CENTER'/>
+ </JPanel>
+ </cell>
+ </row>
- <!-- FishingOperation rectiligne / distance chalutee / durée -->
- <row>
- <cell>
- <JLabel/>
- </cell>
- <cell>
- <JCheckBox id='fishingOperationRectiligneCheckBox'
- onItemStateChanged='handler.setBoolean(event, "fishingOperationRectiligne")'/>
- </cell>
- <cell>
- <JPanel layout="{new BorderLayout()}">
- <JLabel id='trawlDistanceLabel'
- constraints='BorderLayout.WEST'/>
- <NumberEditor id='trawlDistanceField'
- constraints='BorderLayout.CENTER'
- constructorParams='this'/>
- </JPanel>
- </cell>
- <cell>
- <JLabel/>
- </cell>
- <cell>
- <JPanel layout="{new BorderLayout()}">
- <JLabel id='durationLabel'
- constraints='BorderLayout.WEST'/>
- <JTextField id='durationField'
- constraints='BorderLayout.CENTER'/>
- </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>
+ </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>
- </Table>
- </JPanel>
- </cell>
- </row>
+ <!-- Actions d'import -->
+ <row>
+ <cell columns='6'>
+ <JPanel layout='{new GridLayout(1,0)}'>
+ <JButton id='importCasinoButton'
+ onActionPerformed='handler.importCasino()'/>
+ </JPanel>
+ </cell>
+ </row>
- <!-- Actions d'import -->
- <row>
- <cell columns='6'>
- <JPanel layout='{new GridLayout(1,0)}'>
- <JButton id='importCasinoButton'
- onActionPerformed='handler.importCasino()'/>
- </JPanel>
- </cell>
- </row>
+ <!-- Saisisseur -->
+ <row weighty='0.2'>
+ <cell columns='6'>
+ <JPanel layout='{new GridLayout(1,0)}'>
+ <BeanDoubleList id='saisisseurList' genericType='Person'/>
+ <Table fill="both" weightx='1' id='traitVesselPanel'>
+ <row>
+ <cell anchor='west'>
+ <JLabel id='vesselLabel'/>
+ </cell>
+ <cell weightx="1.0" fill="both">
+ <BeanComboBox id='vesselComboBox'
+ constructorParams='this'
+ genericType='Vessel'/>
+ </cell>
+ </row>
+ <row>
+ <cell anchor='west'>
+ <JLabel id='gearLabel'/>
+ </cell>
+ <cell>
+ <BeanComboBox id='gearComboBox'
+ constructorParams='this'
+ genericType='Gear'/>
+ </cell>
+ </row>
+ </Table>
+ </JPanel>
+ </cell>
+ </row>
- <!-- Saisisseur -->
- <row weighty='0.2'>
- <cell columns='6'>
- <JPanel layout='{new GridLayout(1,0)}'>
- <BeanDoubleList id='saisisseurList' genericType='Person'/>
- <Table fill="both" weightx='1' id='traitVesselPanel'>
- <row>
- <cell anchor='west'>
- <JLabel id='vesselLabel'/>
- </cell>
- <cell weightx="1.0" fill="both">
- <BeanComboBox id='vesselComboBox'
- constructorParams='this'
- genericType='Vessel'/>
- </cell>
- </row>
- <row>
- <cell anchor='west'>
- <JLabel id='gearLabel'/>
- </cell>
- <cell>
- <BeanComboBox id='gearComboBox'
- constructorParams='this'
- genericType='Gear'/>
- </cell>
- </row>
- </Table>
- </JPanel>
- </cell>
- </row>
-
- <!-- Commentaire -->
- <row weighty='0.8'>
- <cell columns='6'>
- <JScrollPane id='commentPane'
- onFocusGained='commentField.requestFocus()'>
- <JTextArea id='commentField'
- onKeyReleased='handler.setText(event, "comment")'/>
- </JScrollPane>
- </cell>
- </row>
- </Table>
+ <!-- Commentaire -->
+ <row weighty='0.8'>
+ <cell columns='6'>
+ <JScrollPane id='commentPane'
+ onFocusGained='commentField.requestFocus()'>
+ <JTextArea id='commentField'
+ onKeyReleased='handler.setText(event, "comment")'/>
+ </JScrollPane>
+ </cell>
+ </row>
+ </Table>
+ <!--</JScrollPane>-->
</tab>
<tab id='traitGearShootingTab'>
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.css 2013-01-28 17:50:07 UTC (rev 252)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.css 2013-01-28 18:29:58 UTC (rev 253)
@@ -102,6 +102,14 @@
text: "tutti.label.catches.catchThalassa";
}
+#speciesTabPanel {
+ layout:{speciesTabPanelLayout};
+}
+
+#speciesTabCreateBatchReminderLabel {
+ title: {_("tutti.title.createBatch")};
+}
+
#speciesTable {
border: {BorderFactory.createTitledBorder(_("tutti.legend.catch.species"))};
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.jaxx 2013-01-28 17:50:07 UTC (rev 252)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.jaxx 2013-01-28 18:29:58 UTC (rev 253)
@@ -31,12 +31,14 @@
fr.ifremer.tutti.ui.swing.content.operation.catches.macrowaste.MacroWasteBatchUI
fr.ifremer.tutti.ui.swing.content.operation.catches.plankton.PlanktonBatchUI
fr.ifremer.tutti.ui.swing.content.operation.catches.species.SpeciesBatchUI
+ fr.ifremer.tutti.ui.swing.content.operation.catches.species.split.CreateSpeciesBatchUI
fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUI
org.jdesktop.swingx.JXTitledPanel
-
+
+ jaxx.runtime.swing.CardLayout2Ext
jaxx.runtime.swing.editor.NumberEditor
-
+
jaxx.runtime.validator.swing.SwingValidatorUtil
jaxx.runtime.validator.swing.SwingValidatorMessageTableModel
@@ -92,6 +94,9 @@
component='macroWasteTotalWeightField'/>
</BeanValidator>
+ <CardLayout2Ext id='speciesTabPanelLayout'
+ constructorParams='this, "speciesTabPanel"'/>
+
<JTabbedPane id='tabPane' constraints='BorderLayout.CENTER'>
<tab id='catchesCaracteristicsTab'>
<JXTitledPanel id='catchesCaracteristicsTabPane'>
@@ -288,9 +293,14 @@
</JXTitledPanel>
</tab>
<tab id='speciesTab' title='tutti.label.tab.species'>
- <JXTitledPanel id='speciesTabFishingOperationReminderLabel'>
- <SpeciesBatchUI id='speciesTabContent' constructorParams='this'/>
- </JXTitledPanel>
+ <JPanel id='speciesTabPanel'>
+ <JXTitledPanel id='speciesTabFishingOperationReminderLabel' constraints='"main"'>
+ <SpeciesBatchUI id='speciesTabContent' constructorParams='this'/>
+ </JXTitledPanel>
+ <JXTitledPanel id='speciesTabCreateBatchReminderLabel' constraints='"createBatch"'>
+ <CreateSpeciesBatchUI id='speciesTabCreateBatch' constructorParams='this'/>
+ </JXTitledPanel>
+ </JPanel>
</tab>
<tab id='benthosTab' title='tutti.label.tab.benthos'>
<JXTitledPanel id='benthosTabFishingOperationReminderLabel'>
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java 2013-01-28 17:50:07 UTC (rev 252)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java 2013-01-28 18:29:58 UTC (rev 253)
@@ -43,6 +43,7 @@
import fr.ifremer.tutti.service.PersistenceService;
import fr.ifremer.tutti.ui.swing.TuttiUI;
import fr.ifremer.tutti.ui.swing.content.operation.AbstractTuttiBatchTableUIHandler;
+import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUI;
import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUIModel;
import fr.ifremer.tutti.ui.swing.content.operation.catches.species.frequency.FrequencyCellComponent;
import fr.ifremer.tutti.ui.swing.content.operation.catches.species.frequency.SpeciesFrequencyRowModel;
@@ -58,8 +59,6 @@
import fr.ifremer.tutti.ui.swing.util.editor.LongTextCellComponent;
import fr.ifremer.tutti.ui.swing.util.table.AbstractSelectTableAction;
import fr.ifremer.tutti.ui.swing.util.table.ColumnIdentifier;
-import java.awt.Color;
-import java.awt.Component;
import jaxx.runtime.JAXXUtil;
import jaxx.runtime.context.JAXXContextEntryDef;
import jaxx.runtime.swing.ErrorDialogUI;
@@ -79,9 +78,8 @@
import java.util.EnumMap;
import java.util.List;
import java.util.Set;
-import org.jdesktop.swingx.decorator.ComponentAdapter;
-import org.jdesktop.swingx.decorator.HighlightPredicate;
-import org.jdesktop.swingx.decorator.Highlighter;
+import jaxx.runtime.SwingUtil;
+import jaxx.runtime.swing.CardLayout2Ext;
import static org.nuiton.i18n.I18n._;
import static org.nuiton.i18n.I18n.n_;
@@ -658,18 +656,16 @@
public void createSpeciesBatch() {
- CreateSpeciesBatchUI createBatchEditor =
- getCreateSpeciesBatchEditor();
+ EditCatchesUI parent = SwingUtil.getParentContainer(ui, EditCatchesUI.class);
+ CreateSpeciesBatchUI createBatchEditor = parent.getSpeciesTabCreateBatch();
createBatchEditor.getHandler().openUI(getModel());
-
- openDialog(ui,
- createBatchEditor,
- _("tutti.title.createBatch"),
- ui.getPreferredSize());
-
- CreateSpeciesBatchUIModel createModel = createBatchEditor.getModel();
-
+
+ CardLayout2Ext card = (CardLayout2Ext) parent.getSpeciesTabPanel().getLayout();
+ card.setSelected("createBatch");
+ }
+
+ public void addSpeciesBatch(CreateSpeciesBatchUIModel createModel) {
if (createModel.isValid()) {
SpeciesBatchTableModel tableModel = getTableModel();
@@ -694,9 +690,6 @@
addToSpeciesUsed(newRow);
}
- // reset create ui
- createBatchEditor.getHandler().openUI(null);
-
recomputeBatchActionEnable();
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIHandler.java 2013-01-28 17:50:07 UTC (rev 252)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIHandler.java 2013-01-28 18:29:58 UTC (rev 253)
@@ -26,6 +26,7 @@
import com.ezware.oxbow.swingbits.util.Preconditions;
import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
import fr.ifremer.tutti.persistence.entities.TuttiEntities;
import fr.ifremer.tutti.persistence.entities.protocol.SpeciesProtocol;
import fr.ifremer.tutti.persistence.entities.protocol.TuttiProtocol;
@@ -176,7 +177,13 @@
Preconditions.checkNotNull(protocol,
"Could not find protocol in ui context");
- speciesProtocol = TuttiEntities.splitById(protocol.getSpecies());
+ // FIXME 20130128 kmorin: the species have no technical id
+ speciesProtocol = Maps.newHashMap();
+ for (SpeciesProtocol sp : protocol.getSpecies()) {
+ speciesProtocol.put(sp.getSpeciesId(), sp);
+ }
+// speciesProtocol = TuttiEntities.splitById(protocol.getSpecies());
+
}
//TODO Use protocol to have lengthStepCaracteristic to use (if any protocol)
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/AddSpeciesAction.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/AddSpeciesAction.java 2013-01-28 17:50:07 UTC (rev 252)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/AddSpeciesAction.java 2013-01-28 18:29:58 UTC (rev 253)
@@ -69,7 +69,7 @@
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
- getHandler().openDialog(popup, _("tutti.title.createBatch"));
+// getHandler().openDialog(popup, _("tutti.title.createBatch"));
Species species = popup.getModel().getSelectedSpecies();
if (species != null) {
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/CreateSpeciesBatchUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/CreateSpeciesBatchUI.jaxx 2013-01-28 17:50:07 UTC (rev 252)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/CreateSpeciesBatchUI.jaxx 2013-01-28 18:29:58 UTC (rev 253)
@@ -29,7 +29,7 @@
fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue
fr.ifremer.tutti.ui.swing.content.operation.catches.species.SampleCategoryType
- fr.ifremer.tutti.ui.swing.content.operation.catches.species.SpeciesBatchUI
+ fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUI
fr.ifremer.tutti.ui.swing.TuttiUI
fr.ifremer.tutti.ui.swing.TuttiUIContext
@@ -52,7 +52,7 @@
<script><![CDATA[
-public CreateSpeciesBatchUI(SpeciesBatchUI parentUI) {
+public CreateSpeciesBatchUI(EditCatchesUI parentUI) {
JAXXUtil.initContext(this, parentUI);
CreateSpeciesBatchUIHandler handler = new CreateSpeciesBatchUIHandler(parentUI, this);
setContextValue(handler);
@@ -80,63 +80,50 @@
<field name='batchWeight' component='batchWeightField'/>
</BeanValidator>
- <JSplitPane id='splitPane' constraints='BorderLayout.NORTH'>
+ <Table id='configurationPanel' constraints='BorderLayout.CENTER' fill='both'>
- <Table id='configurationPanel' fill='both'>
+ <!-- Species -->
+ <row>
+ <cell anchor='west'>
+ <JLabel id='speciesLabel'/>
+ </cell>
+ <cell weightx='1.0'>
+ <BeanComboBox id='speciesComboBox' constructorParams='this'
+ genericType='Species'/>
+ </cell>
+ <cell>
+ <JButton id='addSpeciesButton'/>
+ </cell>
+ </row>
- <!-- Species -->
- <row>
- <cell anchor='west'>
- <JLabel id='speciesLabel'/>
- </cell>
- <cell weightx='1.0'>
- <BeanComboBox id='speciesComboBox' constructorParams='this'
- genericType='Species'/>
- </cell>
- <cell>
- <JButton id='addSpeciesButton'/>
- </cell>
- </row>
+ <!-- Sorted / Unsorted Category -->
+ <row>
+ <cell anchor='west'>
+ <JLabel id='sortedUnsortedCategoryLabel'/>
+ </cell>
+ <cell weightx='1.0' columns='2'>
+ <BeanComboBox id='sortedUnsortedCategoryComboBox'
+ constructorParams='this'
+ genericType='CaracteristicQualitativeValue'/>
+ </cell>
+ </row>
- <!-- Sorted / Unsorted Category -->
- <row>
- <cell anchor='west'>
- <JLabel id='sortedUnsortedCategoryLabel'/>
- </cell>
- <cell weightx='1.0' columns='2'>
- <BeanComboBox id='sortedUnsortedCategoryComboBox'
- constructorParams='this'
- genericType='CaracteristicQualitativeValue'/>
- </cell>
- </row>
+ <!-- Species batch weight -->
+ <row>
+ <cell anchor='west'>
+ <JLabel id='batchWeightLabel'/>
+ </cell>
+ <cell weightx='1.0' columns='2'>
+ <NumberEditor id='batchWeightField' constructorParams='this'/>
+ </cell>
+ </row>
- <!-- Species batch weight -->
- <row>
- <cell anchor='west'>
- <JLabel id='batchWeightLabel'/>
- </cell>
- <cell weightx='1.0' columns='2'>
- <NumberEditor id='batchWeightField' constructorParams='this'/>
- </cell>
- </row>
-
- <!-- Form Actions -->
- <row>
- <cell columns='3'>
- <JPanel layout='{new GridLayout(1, 0)}'>
- <JButton id='cancelButton' onActionPerformed='handler.cancel()'/>
- <JButton id='saveButton' onActionPerformed='handler.save()'/>
- </JPanel>
- </cell>
- </row>
- </Table>
-
- <!-- Messages report -->
- <JPanel id='messagePanel' layout='{new GridLayout()}'>
- <JScrollPane columnHeaderView='{errorTable.getTableHeader()}'>
- <JTable id='errorTable'/>
- </JScrollPane>
- </JPanel>
- </JSplitPane>
-
+
+ </Table>
+
+ <!-- Form Actions -->
+ <JPanel layout='{new GridLayout(1, 0)}' constraints='BorderLayout.SOUTH'>
+ <JButton id='cancelButton' onActionPerformed='handler.cancel()'/>
+ <JButton id='saveButton' onActionPerformed='handler.save()'/>
+ </JPanel>
</JPanel>
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/CreateSpeciesBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/CreateSpeciesBatchUIHandler.java 2013-01-28 17:50:07 UTC (rev 252)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/CreateSpeciesBatchUIHandler.java 2013-01-28 18:29:58 UTC (rev 253)
@@ -33,6 +33,7 @@
import fr.ifremer.tutti.service.PersistenceService;
import fr.ifremer.tutti.ui.swing.AbstractTuttiUIHandler;
import fr.ifremer.tutti.ui.swing.TuttiUI;
+import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUI;
import fr.ifremer.tutti.ui.swing.content.operation.catches.species.SpeciesBatchUI;
import fr.ifremer.tutti.ui.swing.content.operation.catches.species.SpeciesBatchUIModel;
import fr.ifremer.tutti.ui.swing.util.Cancelable;
@@ -45,6 +46,8 @@
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.util.List;
+import jaxx.runtime.SwingUtil;
+import jaxx.runtime.swing.CardLayout2Ext;
/**
* Handler of {@link CreateSpeciesBatchUI}.
@@ -69,7 +72,7 @@
private final CaracteristicQualitativeValue sortedValue;
- public CreateSpeciesBatchUIHandler(SpeciesBatchUI parentUi,
+ public CreateSpeciesBatchUIHandler(TuttiUI parentUi,
CreateSpeciesBatchUI ui) {
super(parentUi.getHandler().getContext());
this.ui = ui;
@@ -155,8 +158,8 @@
}
});
- SwingValidatorUtil.installUI(ui.getErrorTable(),
- new SwingValidatorMessageTableRenderer());
+// SwingValidatorUtil.installUI(ui.getErrorTable(),
+// new SwingValidatorMessageTableRenderer());
listenValidatorValid(ui.getValidator(), getModel());
}
@@ -168,6 +171,17 @@
log.info("closing: " + ui);
}
+ // evict model from validator
+ ui.getValidator().setBean(null);
+
+ // when canceling always invalid model
+ getModel().setValid(false);
+
+ EditCatchesUI parent = SwingUtil.getParentContainer(ui, EditCatchesUI.class);
+
+ CardLayout2Ext card = (CardLayout2Ext) parent.getSpeciesTabPanel().getLayout();
+ card.setSelected("main");
+
}
@Override
@@ -181,25 +195,12 @@
@Override
public void cancel() {
-
if (log.isInfoEnabled()) {
log.info("Cancel UI " + ui);
}
-
- // evict model from validator
- ui.getValidator().setBean(null);
-
- // when canceling always invalid model
- getModel().setValid(false);
-
- // close dialog
- closeDialog(ui);
+ closeUI(ui);
}
- public void openDialog(TuttiUI dialogContent, String title) {
- openDialog(ui, dialogContent, title, ui.getPreferredSize());
- }
-
//------------------------------------------------------------------------//
//-- Public methods --//
//------------------------------------------------------------------------//
@@ -241,8 +242,11 @@
log.info("Save UI " + ui);
}
+ EditCatchesUI parent = SwingUtil.getParentContainer(ui, EditCatchesUI.class);
+ parent.getSpeciesTabContent().getHandler().addSpeciesBatch(getModel());
+
// close dialog
- closeDialog(ui);
+ closeUI(ui);
}
public CreateSpeciesBatchUI getUi() {
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 2013-01-28 17:50:07 UTC (rev 252)
+++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2013-01-28 18:29:58 UTC (rev 253)
@@ -91,6 +91,7 @@
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.color.cellWithValue=
tutti.config.ui.color.rowInvalid=Ligne invalide
tutti.config.ui.color.rowReadOnly=Cellule non éditable
tutti.config.ui.config=Chemin du fichier de configuration des interfaces graphiques
1
0
r252 - in trunk/tutti-ui-swing/src/main: assembly/full assembly/min java/fr/ifremer/tutti/ui/swing java/fr/ifremer/tutti/ui/swing/config
by tchemit@users.forge.codelutin.com 28 Jan '13
by tchemit@users.forge.codelutin.com 28 Jan '13
28 Jan '13
Author: tchemit
Date: 2013-01-28 18:50:07 +0100 (Mon, 28 Jan 2013)
New Revision: 252
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/252
Log:
refs #1893: [TECH] - Mise ?\195?\160 jour automatique de l'outil (am?\195?\169lioration des scripts + ajout de TODO ?\195?\160 finir)
Modified:
trunk/tutti-ui-swing/src/main/assembly/full/tutti.sh
trunk/tutti-ui-swing/src/main/assembly/min/launch.sh
trunk/tutti-ui-swing/src/main/assembly/min/update.sh
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/RunTutti.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiApplicationUpdaterCallBack.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiDatabaseUpdaterCallBack.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiJreUpdaterCallBack.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/config/TuttiConfigOption.java
Modified: trunk/tutti-ui-swing/src/main/assembly/full/tutti.sh
===================================================================
--- trunk/tutti-ui-swing/src/main/assembly/full/tutti.sh 2013-01-28 13:58:33 UTC (rev 251)
+++ trunk/tutti-ui-swing/src/main/assembly/full/tutti.sh 2013-01-28 17:50:07 UTC (rev 252)
@@ -1,12 +1,19 @@
#!/bin/bash
-export JAVA_COMMAND=`pwd`/jre/bin/java
+REP=$(dirname $0)
+export JAVA_HOME=$REP/jre
+export JAVA_COMMAND=$JAVA_HOME/bin/java
+cd $REP
+
+echo "$REP"
+echo "$JAVA_HOME"
+
while true; do
cp tutti-app/update.sh .
./update.sh
- (cd tutti-app ; ./launch.sh)
+ ./tutti-app/launch.sh --option tutti.mode=full
exitcode=$?
echo "exitCode: $exitcode"
Modified: trunk/tutti-ui-swing/src/main/assembly/min/launch.sh
===================================================================
--- trunk/tutti-ui-swing/src/main/assembly/min/launch.sh 2013-01-28 13:58:33 UTC (rev 251)
+++ trunk/tutti-ui-swing/src/main/assembly/min/launch.sh 2013-01-28 17:50:07 UTC (rev 252)
@@ -1,10 +1,15 @@
#!/bin/bash
MEMORY="-Xmx1024M"
+TUTTI_JVM_OPTS="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8000"
+REP=$(dirname $0)
+
+cd $REP
+
echo "java command: $JAVA_COMMAND"
-$JAVA_COMMAND $MEMORY -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8000 -jar ${project.build.finalName}.${project.packaging} $*
+$JAVA_COMMAND $MEMORY $TUTTI_JVM_OPTS -jar ${project.build.finalName}.${project.packaging} $*
exitcode=$?
echo "Stop Tutti with exitcode: $exitcode"
exit $exitcode
Modified: trunk/tutti-ui-swing/src/main/assembly/min/update.sh
===================================================================
--- trunk/tutti-ui-swing/src/main/assembly/min/update.sh 2013-01-28 13:58:33 UTC (rev 251)
+++ trunk/tutti-ui-swing/src/main/assembly/min/update.sh 2013-01-28 17:50:07 UTC (rev 252)
@@ -1,25 +1,24 @@
#!/bin/bash
-if [ -d NEW/tutti-app ]; then
- oldVersion=`cat tutti-app/version.appup`
- newVersion=`cat NEW/tutti-app/version.appup`
- echo "Update tutti version $oldVersion to $newVersion"
- mkdir OLD
- backupDate=`date -d %Y-%j`
- backupdir=OLD/tutti-app-$oldVersion-$backupDate
- echo "Backup tutti old version to $backupDir"
- #mv tutti-app $backupDir
- #mv NEW/tutti-app .
-fi
-
+BACKUP_DATE=$(date -d %Y-%j)
if [ -d NEW/jre ]; then
oldVersion=`cat jre/version.appup`
newVersion=`cat NEW/jre/version.appup`
echo "Update jre version $oldVersion to $newVersion"
mkdir OLD
- backupDate=`date -d %Y-%j`
- backupdir=OLD/jre-$oldVersion-$backupDate
+ backupdir=OLD/jre-$oldVersion-$BACKUP_DATE
echo "Backup jre old version to $backupDir"
#mv jre $backupDir
#mv NEW/jre .
fi
+
+if [ -d NEW/tutti-app ]; then
+ oldVersion=`cat tutti-app/version.appup`
+ newVersion=`cat NEW/tutti-app/version.appup`
+ echo "Update tutti version $oldVersion to $newVersion"
+ mkdir OLD
+ backupdir=OLD/tutti-app-$oldVersion-$BACKUP_DATE
+ echo "Backup tutti old version to $backupDir"
+ #mv tutti-app $backupDir
+ #mv NEW/tutti-app .
+fi
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/RunTutti.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/RunTutti.java 2013-01-28 13:58:33 UTC (rev 251)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/RunTutti.java 2013-01-28 17:50:07 UTC (rev 252)
@@ -59,6 +59,8 @@
// prepare context (mainly init configs, i18n)
context.init();
+ //TODO tutti.mode=full alors mise a jour
+
// try to update jre
updateTuttiJre(context);
@@ -126,7 +128,7 @@
log.info(String.format("Try to update jre (current jre location: %s), using update url: %s", current, url));
}
ApplicationUpdater up = new ApplicationUpdater();
- File dest = config.getNewTmpDirectory("NEW-jre");
+ File dest = config.getTuttiBasedir();
up.update(url,
current,
dest,
@@ -153,7 +155,7 @@
}
ApplicationUpdater up = new ApplicationUpdater();
- File dest = config.getNewTmpDirectory("NEW-tutti");
+ File dest = config.getTuttiBasedir();
up.update(url,
current,
dest,
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiApplicationUpdaterCallBack.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiApplicationUpdaterCallBack.java 2013-01-28 13:58:33 UTC (rev 251)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiApplicationUpdaterCallBack.java 2013-01-28 17:50:07 UTC (rev 252)
@@ -29,7 +29,7 @@
import org.nuiton.util.ApplicationUpdater;
/**
- * CallBack to update jre.
+ * CallBack to update jre. TODO EMrger
*
* @author tchemit <chemit(a)codelutin.com>
* @since 1.0
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiDatabaseUpdaterCallBack.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiDatabaseUpdaterCallBack.java 2013-01-28 13:58:33 UTC (rev 251)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiDatabaseUpdaterCallBack.java 2013-01-28 17:50:07 UTC (rev 252)
@@ -63,12 +63,14 @@
if (log.isInfoEnabled()) {
log.info("First time database was downloaded at version: " + applicationInfo.newVersion);
}
+ //TODO copie base au bon endroit pour utilisation directe
} else {
// launch a referential synchronize operation
if (log.isInfoEnabled()) {
log.info(String.format("A database update was downloaded (oldVersion: %s, newVersion: %s), will launch a referential synchronize operation ", applicationInfo.oldVersion, applicationInfo.newVersion));
}
+ //TODO synchro referentiel
}
}
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiJreUpdaterCallBack.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiJreUpdaterCallBack.java 2013-01-28 13:58:33 UTC (rev 251)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiJreUpdaterCallBack.java 2013-01-28 17:50:07 UTC (rev 252)
@@ -40,8 +40,6 @@
private static final Log log =
LogFactory.getLog(TuttiJreUpdaterCallBack.class);
-
-
public static final String APP_KEY = "jre";
public TuttiJreUpdaterCallBack(TuttiUIContext context) {
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 2013-01-28 13:58:33 UTC (rev 251)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/config/TuttiConfigOption.java 2013-01-28 17:50:07 UTC (rev 252)
@@ -41,6 +41,11 @@
*/
public enum TuttiConfigOption implements ApplicationConfig.OptionDef {
+ //TODO Utiliser une option full-mode pour trouver facilement le basedir
+
+// TUTTI_MODE(
+//
+// ),
TUTTI_APPLICATION_BASEDIR(
"tutti.application.basedir",
n_("tutti.application.basedir.description"),
1
0
r251 - trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/config
by tchemit@users.forge.codelutin.com 28 Jan '13
by tchemit@users.forge.codelutin.com 28 Jan '13
28 Jan '13
Author: tchemit
Date: 2013-01-28 14:58:33 +0100 (Mon, 28 Jan 2013)
New Revision: 251
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/251
Log:
use last nuiton-utils api
Modified:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/config/TuttiConfig.java
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 2013-01-28 12:04:12 UTC (rev 250)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/config/TuttiConfig.java 2013-01-28 13:58:33 UTC (rev 251)
@@ -27,11 +27,6 @@
import fr.ifremer.tutti.service.TuttiServiceTechnicalException;
import fr.ifremer.tutti.service.config.TuttiServiceConfig;
import fr.ifremer.tutti.ui.swing.util.editor.CoordinateEditorType;
-import java.awt.Color;
-import java.io.File;
-import java.io.IOException;
-import java.net.URL;
-import javax.swing.KeyStroke;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
import org.apache.commons.logging.Log;
@@ -79,14 +74,18 @@
applicationConfig = new ApplicationConfig();
- // load all config default options
+ // get all config providers
Set<ApplicationConfigProvider> providers =
- ApplicationConfigHelper.loadAllDefaultOption(applicationConfig,
- null,
- null,
- null,
- true);
+ ApplicationConfigHelper.getProviders(null,
+ null,
+ null,
+ true);
+ // load all default options
+ ApplicationConfigHelper.loadAllDefaultOption(applicationConfig,
+ providers);
+
+ // get all transient and final option keys
Set<String> optionToSkip =
ApplicationConfigHelper.getTransientOrFinalOptionKey(providers);
@@ -205,7 +204,7 @@
public String getDateFormat() {
return applicationConfig.getOption(TuttiConfigOption.DATE_FORMAT.getKey());
}
-
+
public Version getVersion() {
return serviceConfig.getVersion();
}
1
0
r250 - in trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing: config content/operation/catches/species content/operation/catches/species/frequency util/editor util/table
by kmorin@users.forge.codelutin.com 28 Jan '13
by kmorin@users.forge.codelutin.com 28 Jan '13
28 Jan '13
Author: kmorin
Date: 2013-01-28 13:04:12 +0100 (Mon, 28 Jan 2013)
New Revision: 250
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/250
Log:
closes #1853 [ERGO] - Gestion des champs commentaires
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/TuttiConfigOption.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/config/TuttiConfigUI.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/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/LongTextCellComponent.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/table/AbstractTuttiTableUIHandler.java
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 2013-01-28 11:26:25 UTC (rev 249)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/config/TuttiConfig.java 2013-01-28 12:04:12 UTC (rev 250)
@@ -187,6 +187,10 @@
public Color getColorRowReadOnly() {
return applicationConfig.getOptionAsColor(TuttiConfigOption.COLOR_ROW_READ_ONLY.getKey());
}
+
+ public Color getColorCellWithValue() {
+ return applicationConfig.getOptionAsColor(TuttiConfigOption.COLOR_CELL_WITH_VALUE.getKey());
+ }
public KeyStroke getShortcutClosePopup() {
return applicationConfig.getOptionAsKeyStroke(TuttiConfigOption.SHORTCUT_CLOSE_POPUP.getKey());
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 2013-01-28 11:26:25 UTC (rev 249)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/config/TuttiConfigOption.java 2013-01-28 12:04:12 UTC (rev 250)
@@ -141,6 +141,13 @@
new Color(255, 128, 128).toString(),
Color.class
),
+
+ COLOR_CELL_WITH_VALUE(
+ "tutti.ui.color.cellWithValue",
+ n_("tutti.config.ui.color.cellWithValue"),
+ new Color(128, 255, 128).toString(),
+ Color.class
+ ),
SHORTCUT_CLOSE_POPUP(
"tutti.ui.shortcut.closePopup",
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/config/TuttiConfigUI.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/config/TuttiConfigUI.java 2013-01-28 11:26:25 UTC (rev 249)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/config/TuttiConfigUI.java 2013-01-28 12:04:12 UTC (rev 250)
@@ -108,6 +108,7 @@
CALLBACK_UI)
.addOption(TuttiConfigOption.COLOR_ROW_INVALID)
.addOption(TuttiConfigOption.COLOR_ROW_READ_ONLY)
+ .addOption(TuttiConfigOption.COLOR_CELL_WITH_VALUE)
.addOption(TuttiConfigOption.DATE_FORMAT)
.addOption(TuttiConfigOption.COORDINATE_EDITOR_TYPE);
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java 2013-01-28 11:26:25 UTC (rev 249)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java 2013-01-28 12:04:12 UTC (rev 250)
@@ -58,6 +58,8 @@
import fr.ifremer.tutti.ui.swing.util.editor.LongTextCellComponent;
import fr.ifremer.tutti.ui.swing.util.table.AbstractSelectTableAction;
import fr.ifremer.tutti.ui.swing.util.table.ColumnIdentifier;
+import java.awt.Color;
+import java.awt.Component;
import jaxx.runtime.JAXXUtil;
import jaxx.runtime.context.JAXXContextEntryDef;
import jaxx.runtime.swing.ErrorDialogUI;
@@ -77,6 +79,9 @@
import java.util.EnumMap;
import java.util.List;
import java.util.Set;
+import org.jdesktop.swingx.decorator.ComponentAdapter;
+import org.jdesktop.swingx.decorator.HighlightPredicate;
+import org.jdesktop.swingx.decorator.Highlighter;
import static org.nuiton.i18n.I18n._;
import static org.nuiton.i18n.I18n.n_;
@@ -621,6 +626,7 @@
getTable().setRowFilter(filter);
}
});
+
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/FrequencyCellComponent.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/FrequencyCellComponent.java 2013-01-28 11:26:25 UTC (rev 249)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/FrequencyCellComponent.java 2013-01-28 12:04:12 UTC (rev 250)
@@ -37,7 +37,6 @@
import org.apache.commons.logging.LogFactory;
import javax.swing.AbstractCellEditor;
-import javax.swing.JButton;
import javax.swing.JTable;
import javax.swing.border.LineBorder;
import javax.swing.table.TableCellEditor;
@@ -49,6 +48,7 @@
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.List;
+import javax.swing.table.DefaultTableCellRenderer;
import static org.nuiton.i18n.I18n._;
@@ -58,7 +58,7 @@
* @author tchemit <chemit(a)codelutin.com>
* @since 0.2
*/
-public class FrequencyCellComponent extends JButton {
+public class FrequencyCellComponent extends DefaultTableCellRenderer {
private static final long serialVersionUID = 1L;
@@ -69,8 +69,7 @@
LogFactory.getLog(FrequencyCellComponent.class);
public FrequencyCellComponent() {
- setContentAreaFilled(false);
- setOpaque(false);
+ setHorizontalAlignment(CENTER);
setIcon(SwingUtil.createActionIcon("show-frequency"));
}
@@ -271,16 +270,22 @@
int row,
int column) {
- String text;
- if (value == null) {
- text = " - ";
- } else {
- text = String.valueOf(value);
+ FrequencyCellComponent result =
+ (FrequencyCellComponent) component.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
+
+ if (table != null) {
+ String text;
+ if (value == null) {
+ text = " - ";
+ } else {
+ text = String.valueOf(value);
+ }
+ boolean editable = table.isCellEditable(row, column);
+ result.setEnabled(editable);
+ result.setText(text);
}
- boolean editable = table.isCellEditable(row, column);
- component.setEnabled(editable);
- component.setText(text);
- return component;
+
+ return result;
}
}
}
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 2013-01-28 11:26:25 UTC (rev 249)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/AttachmentCellComponent.java 2013-01-28 12:04:12 UTC (rev 250)
@@ -41,7 +41,6 @@
import javax.swing.AbstractCellEditor;
import javax.swing.BorderFactory;
-import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JTable;
import javax.swing.border.LineBorder;
@@ -57,6 +56,7 @@
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.util.Collection;
+import javax.swing.table.DefaultTableCellRenderer;
import static org.nuiton.i18n.I18n._;
@@ -66,7 +66,7 @@
* @author kmorin
* @since 0.2
*/
-public class AttachmentCellComponent extends JButton {
+public class AttachmentCellComponent extends DefaultTableCellRenderer {
/** Logger. */
private static final Log log = LogFactory.getLog(AttachmentCellComponent.class);
@@ -74,11 +74,15 @@
private static final long serialVersionUID = 1L;
public AttachmentCellComponent() {
- setContentAreaFilled(false);
- setOpaque(false);
+ setHorizontalAlignment(CENTER);
setIcon(SwingUtil.createActionIcon("edit-attachment"));
}
+ @Override
+ protected void setValue(Object value) {
+ // do nothing
+ }
+
public static TableCellRenderer newRender(Decorator<Attachment> decorator, String noneText) {
return new AttachmentCellRenderer(decorator, noneText);
}
@@ -87,7 +91,6 @@
return new AttachmentCellEditor(ui);
}
-
public static class AttachmentCellEditor extends AbstractCellEditor implements TableCellEditor {
private static final long serialVersionUID = 1L;
@@ -276,33 +279,38 @@
boolean hasFocus,
int row,
int column) {
+ AttachmentCellComponent result =
+ (AttachmentCellComponent) component.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
+
+ if (table != null) {
+
+ String textValue;
+ if (value == null) {
+ if (propertyName == null) {
+ AbstractTuttiTableModel tableModel =
+ (AbstractTuttiTableModel) table.getModel();
+ ColumnIdentifier columnIdentifier = tableModel.getPropertyName(column);
+ propertyName = columnIdentifier.getPropertyName();
+ }
+ // use HTML to show the tooltip in italic
+ textValue = "<i>" + _(noneText) + "</i>";
- String textValue;
-
- if (value == null) {
- if (propertyName == null) {
- AbstractTuttiTableModel tableModel =
- (AbstractTuttiTableModel) table.getModel();
- ColumnIdentifier columnIdentifier = tableModel.getPropertyName(column);
- propertyName = columnIdentifier.getPropertyName();
+ } else {
+ Collection<Attachment> attachments = (Collection<Attachment>) value;
+ StringBuilder sb = new StringBuilder();
+ for (Attachment attachment : attachments) {
+ sb.append("<br/>").append(decorator.toString(attachment));
+ }
+ // use html to display the tooltip on several lines
+ textValue = sb.substring(5);
}
- // use HTML to show the tooltip in italic
- textValue = "<i>" + _(noneText) + "</i>";
-
- } else {
- Collection<Attachment> attachments = (Collection<Attachment>) value;
- StringBuilder sb = new StringBuilder();
- for (Attachment attachment : attachments) {
- sb.append("<br/>").append(decorator.toString(attachment));
- }
- // use html to display the tooltip on several lines
- textValue = sb.substring(5);
+ String text = String.format(TEXT_PATTERN, textValue);
+ boolean editable = table.isCellEditable(row, column);
+ result.setEnabled(editable);
+ result.setToolTipText(text);
}
- String text = String.format(TEXT_PATTERN, textValue);
- boolean editable = table.isCellEditable(row, column);
- component.setEnabled(editable);
- component.setToolTipText(text);
- return component;
+
+ return result;
}
}
}
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 2013-01-28 11:26:25 UTC (rev 249)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/LongTextCellComponent.java 2013-01-28 12:04:12 UTC (rev 250)
@@ -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.Color;
import jaxx.runtime.JAXXUtil;
import jaxx.runtime.SwingUtil;
import org.apache.commons.lang3.StringUtils;
@@ -40,13 +41,11 @@
import javax.swing.AbstractCellEditor;
import javax.swing.BorderFactory;
-import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JTable;
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.KeyAdapter;
@@ -55,6 +54,7 @@
import java.awt.event.MouseEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
+import javax.swing.table.DefaultTableCellRenderer;
import static org.nuiton.i18n.I18n._;
@@ -64,7 +64,7 @@
* @author kmorin
* @since 0.2
*/
-public class LongTextCellComponent extends JButton {
+public class LongTextCellComponent extends DefaultTableCellRenderer {
/** Logger. */
private static final Log log = LogFactory.getLog(LongTextCellComponent.class);
@@ -72,11 +72,15 @@
private static final long serialVersionUID = 1L;
public LongTextCellComponent() {
- setContentAreaFilled(false);
- setOpaque(false);
+ setHorizontalAlignment(CENTER);
setIcon(SwingUtil.createActionIcon("edit-comment"));
}
+ @Override
+ protected void setValue(Object value) {
+ // do nothing
+ }
+
public static TableCellRenderer newRender(String noneText) {
return new LongTextCellRenderer(noneText);
}
@@ -274,30 +278,35 @@
int row,
int column) {
-// String text;
- String textValue;
- if (StringUtils.isBlank((String) value)) {
- if (propertyName == null) {
- AbstractTuttiTableModel tableModel =
- (AbstractTuttiTableModel) table.getModel();
- ColumnIdentifier columnIdentifier =
- tableModel.getPropertyName(column);
- propertyName = columnIdentifier.getPropertyName();
+ LongTextCellComponent result =
+ (LongTextCellComponent) component.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
+
+ if (table != null) {
+ String textValue;
+ if (StringUtils.isBlank((String) value)) {
+ if (propertyName == null) {
+ AbstractTuttiTableModel tableModel =
+ (AbstractTuttiTableModel) table.getModel();
+ ColumnIdentifier columnIdentifier =
+ tableModel.getPropertyName(column);
+ propertyName = columnIdentifier.getPropertyName();
+ }
+ // use HTML to show the tooltip in italic
+ textValue = "<i>" + _(noneText) + "</i>";
+
+ } else {
+ // use html to display the tooltip on several lines
+ textValue = String.valueOf(value).replace("\n", "<br/>");
}
- // use HTML to show the tooltip in italic
- textValue = "<i>" + _(noneText) + "</i>";
- } else {
- // use html to display the tooltip on several lines
- textValue = String.valueOf(value).replace("\n", "<br/>");
+ String text = String.format(TEXT_PATTERN, textValue);
+
+ boolean editable = table.isCellEditable(row, column);
+ result.setEnabled(editable);
+ result.setToolTipText(text);
}
-
- String text = String.format(TEXT_PATTERN, textValue);
-
- boolean editable = table.isCellEditable(row, column);
- component.setEnabled(editable);
- component.setToolTipText(text);
- return component;
+
+ return result;
}
}
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/table/AbstractTuttiTableUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/table/AbstractTuttiTableUIHandler.java 2013-01-28 11:26:25 UTC (rev 249)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/table/AbstractTuttiTableUIHandler.java 2013-01-28 12:04:12 UTC (rev 250)
@@ -31,6 +31,7 @@
import fr.ifremer.tutti.ui.swing.AbstractTuttiBeanUIModel;
import fr.ifremer.tutti.ui.swing.AbstractTuttiUIHandler;
import fr.ifremer.tutti.ui.swing.TuttiUIContext;
+import fr.ifremer.tutti.ui.swing.content.operation.catches.species.SpeciesBatchTableModel;
import fr.ifremer.tutti.ui.swing.util.TuttiBeanMonitor;
import fr.ifremer.tutti.ui.swing.util.TuttiUIUtil;
import jaxx.runtime.SwingUtil;
@@ -292,6 +293,31 @@
Highlighter readOnlyHighlighter = TuttiUIUtil.newBackgroundColorHighlighter(
HighlightPredicate.READ_ONLY, getConfig().getColorRowReadOnly());
table.addHighlighter(readOnlyHighlighter);
+
+ Color cellWithValueColor = getConfig().getColorCellWithValue();
+ Highlighter commentHighlighter = TuttiUIUtil.newBackgroundColorHighlighter(
+ new HighlightPredicate.AndHighlightPredicate(
+ new HighlightPredicate.IdentifierHighlightPredicate(SpeciesBatchTableModel.COMMENT),
+ new HighlightPredicate() {
+ @Override
+ public boolean isHighlighted(Component renderer, ComponentAdapter adapter) {
+ boolean result = adapter.getValue() != null;
+ return result;
+ }
+ }), cellWithValueColor);
+ table.addHighlighter(commentHighlighter);
+
+ Highlighter attachmentHighlighter = TuttiUIUtil.newBackgroundColorHighlighter(
+ new HighlightPredicate.AndHighlightPredicate(
+ new HighlightPredicate.IdentifierHighlightPredicate(SpeciesBatchTableModel.ATTACHMENTS),
+ new HighlightPredicate() {
+ @Override
+ public boolean isHighlighted(Component renderer, ComponentAdapter adapter) {
+ boolean result = adapter.getValue() != null;
+ return result;
+ }
+ }), cellWithValueColor);
+ table.addHighlighter(attachmentHighlighter);
// paint in a special color inValid rows
Highlighter validHighlighter = TuttiUIUtil.newBackgroundColorHighlighter(
1
0