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
March 2013
- 5 participants
- 242 discussions
r714 - trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation
by kmorin@users.forge.codelutin.com 29 Mar '13
by kmorin@users.forge.codelutin.com 29 Mar '13
29 Mar '13
Author: kmorin
Date: 2013-03-29 17:53:13 +0100 (Fri, 29 Mar 2013)
New Revision: 714
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/714
Log:
- debug npe
- fix isEmpty method of the editfishingoperation handler
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/EditFishingOperationUIModel.java
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-03-29 16:30:41 UTC (rev 713)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java 2013-03-29 16:53:13 UTC (rev 714)
@@ -97,7 +97,7 @@
//check if the user changed the date and not only the time)
Date oldDate = (Date) evt.getOldValue();
Date newDate = (Date) evt.getNewValue();
- if (getModel().getGearShootingEndDate() == null &&
+ if (newDate != null && getModel().getGearShootingEndDate() == null &&
(oldDate == null || !DateUtils.isSameDay(oldDate, newDate))) {
getModel().setGearShootingEndDate(newDate);
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel.java 2013-03-29 16:30:41 UTC (rev 713)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel.java 2013-03-29 16:53:13 UTC (rev 714)
@@ -237,12 +237,14 @@
&& gearShootingEndLatitudeAsSexagecimal.isNull()
&& gearShootingEndLongitudeAsSexagecimal.isNull()
&& gearShootingEndDate == null
- && recorderPerson == null
+ && !fishingOperationRectiligne
+ && trawlDistance == null
+ && fishingOperationValid == null
+ && CollectionUtils.isEmpty(recorderPerson)
&& gear == null
&& StringUtils.isEmpty(comment)
&& CollectionUtils.isEmpty(getAttachment());
- // TODO add the otehr ones
}
public FishingOperation getFishingOperation() {
1
0
r713 - in trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing: content/cruise content/operation util
by kmorin@users.forge.codelutin.com 29 Mar '13
by kmorin@users.forge.codelutin.com 29 Mar '13
29 Mar '13
Author: kmorin
Date: 2013-03-29 17:30:41 +0100 (Fri, 29 Mar 2013)
New Revision: 713
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/713
Log:
use a scrollpane when the ui can be too high
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.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/EditFishingOperationUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/AbstractTuttiUIHandler.java
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-03-29 15:01:19 UTC (rev 712)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUI.css 2013-03-29 16:30:41 UTC (rev 713)
@@ -54,6 +54,10 @@
_help: {"tutti.editCruise.help"};
}
+#cruiseScrollPane {
+ _onlyVerticalScrollable: true;
+}
+
#nameLabel {
text: "tutti.editCruise.field.name";
labelFor: {nameField};
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-03-29 15:01:19 UTC (rev 712)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUI.jaxx 2013-03-29 16:30:41 UTC (rev 713)
@@ -92,157 +92,156 @@
constructorParams='getHandler().getContext(), getModel()'/>
</JToolBar>
- <Table fill='both' constraints='BorderLayout.CENTER'>
+ <JScrollPane id='cruiseScrollPane' constraints='BorderLayout.CENTER'>
+ <Table fill='both'>
- <!-- cruise program / survey part -->
- <row>
- <cell anchor='west'>
- <JLabel id='programLabel'/>
- </cell>
- <cell weightx='0.3'>
- <BeanFilterableComboBox id='programComboBox' constructorParams='this'
- genericType='Program'/>
- </cell>
- <cell>
- <JLabel id='surveyPartLabel'/>
- </cell>
- <cell weightx='0.3'>
- <JTextField id='surveyPartField'
- onKeyReleased='handler.setText(event, "surveyPart")'/>
- </cell>
- </row>
+ <!-- cruise program / survey part -->
+ <row>
+ <cell anchor='west'>
+ <JLabel id='programLabel'/>
+ </cell>
+ <cell weightx='0.3'>
+ <BeanFilterableComboBox id='programComboBox' constructorParams='this'
+ genericType='Program'/>
+ </cell>
+ <cell>
+ <JLabel id='surveyPartLabel'/>
+ </cell>
+ <cell weightx='0.3'>
+ <JTextField id='surveyPartField'
+ onKeyReleased='handler.setText(event, "surveyPart")'/>
+ </cell>
+ </row>
- <!-- departure harbour / begin date -->
- <row>
- <cell anchor='west'>
- <JLabel id='departureLocationLabel'/>
- </cell>
- <cell>
- <BeanFilterableComboBox id='departureLocationComboBox'
- constructorParams='this'
- genericType='TuttiLocation'/>
- </cell>
- <cell>
- <JLabel id='beginDateLabel'/>
- </cell>
- <cell>
- <JXDatePicker id='beginDateField'
- onActionPerformed='handler.setDate(event, "beginDate")'/>
- </cell>
- </row>
+ <!-- departure harbour / begin date -->
+ <row>
+ <cell anchor='west'>
+ <JLabel id='departureLocationLabel'/>
+ </cell>
+ <cell>
+ <BeanFilterableComboBox id='departureLocationComboBox'
+ constructorParams='this'
+ genericType='TuttiLocation'/>
+ </cell>
+ <cell>
+ <JLabel id='beginDateLabel'/>
+ </cell>
+ <cell>
+ <JXDatePicker id='beginDateField'
+ onActionPerformed='handler.setDate(event, "beginDate")'/>
+ </cell>
+ </row>
- <!-- landing harbour / end date -->
- <row>
- <cell anchor='west'>
- <JLabel id='returnLocationLabel'/>
- </cell>
- <cell>
- <BeanFilterableComboBox id='returnLocationComboBox'
- constructorParams='this'
- genericType='TuttiLocation'/>
- </cell>
- <cell>
- <JLabel id='endDateLabel'/>
- </cell>
- <cell>
- <JXDatePicker id='endDateField'
- onActionPerformed='handler.setDate(event, "endDate")'/>
- </cell>
- </row>
+ <!-- landing harbour / end date -->
+ <row>
+ <cell anchor='west'>
+ <JLabel id='returnLocationLabel'/>
+ </cell>
+ <cell>
+ <BeanFilterableComboBox id='returnLocationComboBox'
+ constructorParams='this'
+ genericType='TuttiLocation'/>
+ </cell>
+ <cell>
+ <JLabel id='endDateLabel'/>
+ </cell>
+ <cell>
+ <JXDatePicker id='endDateField'
+ onActionPerformed='handler.setDate(event, "endDate")'/>
+ </cell>
+ </row>
- <!-- cruise name / multirigNumber -->
- <row>
- <cell>
- <JLabel id='nameLabel'/>
- </cell>
- <cell>
- <JTextField id='nameField'
- onKeyReleased='handler.setText(event, "name")'/>
- </cell>
- <cell columns='2'>
- <JButton id='generateNameButton'
- onActionPerformed='handler.generateCampaignName()'/>
- </cell>
- </row>
+ <!-- cruise name / multirigNumber -->
+ <row>
+ <cell>
+ <JLabel id='nameLabel'/>
+ </cell>
+ <cell>
+ <JTextField id='nameField'
+ onKeyReleased='handler.setText(event, "name")'/>
+ </cell>
+ <cell columns='2'>
+ <JButton id='generateNameButton'
+ onActionPerformed='handler.generateCampaignName()'/>
+ </cell>
+ </row>
- <!-- cruise name / multirigNumber -->
- <row>
- <cell>
- <JLabel id='multirigNumberLabel'/>
- </cell>
- <cell>
- <NumberEditor id='multirigNumberField' constructorParams='this'/>
- </cell>
- <cell columns="2">
- <JLabel/>
- </cell>
- </row>
+ <!-- cruise name / multirigNumber -->
+ <row>
+ <cell>
+ <JLabel id='multirigNumberLabel'/>
+ </cell>
+ <cell>
+ <NumberEditor id='multirigNumberField' constructorParams='this'/>
+ </cell>
+ <cell columns="2">
+ <JLabel/>
+ </cell>
+ </row>
- <!-- cruise vessel / gear -->
- <row>
- <cell columns='4'>
- <JSeparator constructorParams='SwingConstants.HORIZONTAL'/>
- </cell>
- </row>
- <row>
- <cell columns='4'>
- <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>
- <cell>
- <JLabel id='vesselLabel'/>
- </cell>
- <cell columns="3">
- <BeanFilterableComboBox id='vesselComboBox' constructorParams='this'
- genericType='Vessel'/>
+ <!-- cruise vessel / gear -->
+ <row>
+ <cell columns='4'>
+ <JSeparator constructorParams='SwingConstants.HORIZONTAL'/>
+ </cell>
+ </row>
+ <row>
+ <cell columns='4'>
+ <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>
+ <cell>
+ <JLabel id='vesselLabel'/>
+ </cell>
+ <cell columns="3">
+ <BeanFilterableComboBox id='vesselComboBox' constructorParams='this'
+ genericType='Vessel'/>
- </cell>
- </row>
- <row weighty='0.3'>
- <cell columns="4">
- <BeanDoubleList id='gearList' genericType='Gear'/>
- </cell>
- </row>
+ </cell>
+ </row>
+ <row weighty='0.3'>
+ <cell columns="4">
+ <BeanDoubleList id='gearList' genericType='Gear'/>
+ </cell>
+ </row>
- <!-- cruise headOfMission / headOfSortRoom -->
- <row weighty='0.3'>
- <cell columns='4'>
- <JPanel layout='{new GridLayout(1, 0)}'>
- <BeanDoubleList id='headOfMissionList' genericType='Person'/>
- <BeanDoubleList id='headOfSortRoomList' genericType='Person'/>
- </JPanel>
- </cell>
- </row>
+ <!-- cruise headOfMission / headOfSortRoom -->
+ <row weighty='0.3'>
+ <cell columns='4'>
+ <JPanel layout='{new GridLayout(1, 0)}'>
+ <BeanDoubleList id='headOfMissionList' genericType='Person'/>
+ <BeanDoubleList id='headOfSortRoomList' genericType='Person'/>
+ </JPanel>
+ </cell>
+ </row>
- <!-- cruise comment -->
- <row weighty='0.3'>
- <cell columns='4'>
- <JScrollPane id='commentPane'
- onFocusGained='commentField.requestFocus()'>
- <JTextArea id='commentField'
- onKeyReleased='handler.setText(event, "comment")'/>
- </JScrollPane>
- </cell>
- </row>
+ <!-- cruise comment -->
+ <row weighty='0.3'>
+ <cell columns='4'>
+ <JScrollPane id='commentPane'
+ onFocusGained='commentField.requestFocus()'>
+ <JTextArea id='commentField'
+ onKeyReleased='handler.setText(event, "comment")'/>
+ </JScrollPane>
+ </cell>
+ </row>
- <!-- Form Actions -->
- <row>
- <cell columns='4'>
- <JPanel layout='{new GridLayout(1, 0)}'>
- <JButton id='closeButton'/>
- <JButton id='saveButton'/>
- </JPanel>
- </cell>
- </row>
- </Table>
+ </Table>
+ </JScrollPane>
+ <!-- Form Actions -->
+ <JPanel layout='{new GridLayout(1, 0)}' constraints='BorderLayout.SOUTH'>
+ <JButton id='closeButton'/>
+ <JButton id='saveButton'/>
+ </JPanel>
+
</JPanel>
\ No newline at end of file
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-03-29 15:01:19 UTC (rev 712)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.css 2013-03-29 16:30:41 UTC (rev 713)
@@ -70,6 +70,10 @@
borderPainted: false;
}
+#fishingOperationTabScrollPane {
+ _onlyVerticalScrollable: true;
+}
+
#fishingOperationAttachmentsButton {
enabled: {model.getId() != null};
toolTipText: "tutti.editFishingOperation.action.attachments.tip";
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-03-29 15:01:19 UTC (rev 712)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.jaxx 2013-03-29 16:30:41 UTC (rev 713)
@@ -158,344 +158,344 @@
<JTabbedPane id='fishingOperationTabPane' constraints='BorderLayout.CENTER'>
<tab id='traitGeneralTab'>
<JXTitledPanel id='traitGeneralTabPane'>
- <!-- <JScrollPane id='fishingOperationTabScrollPane'>-->
- <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='multirigAggregationLabel'/>
- </cell>
- <cell weightx='0.3'>
- <JTextField id='multirigAggregationField'
- onKeyReleased='handler.setText(event, "multirigAggregation")'/>
- </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='multirigAggregationLabel'/>
+ </cell>
+ <cell weightx='0.3'>
+ <JTextField id='multirigAggregationField'
+ onKeyReleased='handler.setText(event, "multirigAggregation")'/>
+ </cell>
+ </row>
- <!-- Strate d'association / Sous Strate / Localité -->
- <row>
- <cell>
- <JLabel id='strataLabel'/>
- </cell>
- <cell weightx='0.3'>
- <BeanFilterableComboBox id='strataComboBox'
- constructorParams='this'
- genericType='TuttiLocation'/>
- </cell>
- <cell>
- <JLabel id='subStrataLabel'/>
- </cell>
- <cell weightx='0.3'>
- <BeanFilterableComboBox id='subStrataComboBox'
- constructorParams='this'
- genericType='TuttiLocation'/>
- </cell>
- <cell>
- <JLabel id='locationLabel'/>
- </cell>
- <cell weightx='0.3'>
- <BeanFilterableComboBox id='locationComboBox'
- constructorParams='this'
- genericType='TuttiLocation'/>
- </cell>
- </row>
+ <!-- Strate d'association / Sous Strate / Localité -->
+ <row>
+ <cell>
+ <JLabel id='strataLabel'/>
+ </cell>
+ <cell weightx='0.3'>
+ <BeanFilterableComboBox id='strataComboBox'
+ constructorParams='this'
+ genericType='TuttiLocation'/>
+ </cell>
+ <cell>
+ <JLabel id='subStrataLabel'/>
+ </cell>
+ <cell weightx='0.3'>
+ <BeanFilterableComboBox id='subStrataComboBox'
+ constructorParams='this'
+ genericType='TuttiLocation'/>
+ </cell>
+ <cell>
+ <JLabel id='locationLabel'/>
+ </cell>
+ <cell weightx='0.3'>
+ <BeanFilterableComboBox id='locationComboBox'
+ constructorParams='this'
+ genericType='TuttiLocation'/>
+ </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>
+ <!-- RecorderPerson / Vessel / Gear -->
+ <row weighty='0.2'>
+ <cell columns='6'>
+ <JPanel layout='{new GridLayout(1,0)}'>
+ <BeanDoubleList id='recorderPersonList' genericType='Person'/>
+ <Table fill="both" weightx='1' id='traitVesselPanel'>
+ <row>
+ <cell anchor='west'>
+ <JLabel id='vesselLabel'/>
+ </cell>
+ <cell weightx="1.0" fill="both">
+ <JLabel id='vesselField'/>
+ </cell>
+ </row>
+ <row>
+ <cell anchor='west'>
+ <JLabel id='gearLabel'/>
+ </cell>
+ <cell>
+ <BeanFilterableComboBox id='gearComboBox'
+ constructorParams='this'
+ genericType='Gear'/>
+ </cell>
+ </row>
+ </Table>
+ </JPanel>
+ </cell>
+ </row>
- <!-- RecorderPerson / Vessel / Gear -->
- <row weighty='0.2'>
- <cell columns='6'>
- <JPanel layout='{new GridLayout(1,0)}'>
- <BeanDoubleList id='recorderPersonList' genericType='Person'/>
- <Table fill="both" weightx='1' id='traitVesselPanel'>
- <row>
- <cell anchor='west'>
- <JLabel id='vesselLabel'/>
- </cell>
- <cell weightx="1.0" fill="both">
- <JLabel id='vesselField'/>
- </cell>
- </row>
- <row>
- <cell anchor='west'>
- <JLabel id='gearLabel'/>
- </cell>
- <cell>
- <BeanFilterableComboBox 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>
</JXTitledPanel>
- <!--</JScrollPane>-->
</tab>
<tab id='gearUseFeatureTab'>
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/AbstractTuttiUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/AbstractTuttiUIHandler.java 2013-03-29 15:01:19 UTC (rev 712)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/AbstractTuttiUIHandler.java 2013-03-29 16:30:41 UTC (rev 713)
@@ -63,29 +63,9 @@
import org.nuiton.util.decorator.JXPathDecorator;
import org.nuiton.validator.bean.simple.SimpleBeanValidator;
-import javax.swing.AbstractAction;
-import javax.swing.AbstractButton;
-import javax.swing.Action;
-import javax.swing.DefaultComboBoxModel;
-import javax.swing.JComboBox;
-import javax.swing.JComponent;
-import javax.swing.JDialog;
-import javax.swing.JLabel;
-import javax.swing.JList;
-import javax.swing.JOptionPane;
-import javax.swing.JPopupMenu;
-import javax.swing.JRootPane;
-import javax.swing.JSpinner;
-import javax.swing.JTable;
-import javax.swing.JTextField;
-import javax.swing.KeyStroke;
-import javax.swing.ListCellRenderer;
-import javax.swing.ListSelectionModel;
-import javax.swing.SwingUtilities;
+import javax.swing.*;
import javax.swing.border.LineBorder;
-import javax.swing.event.ListSelectionEvent;
-import javax.swing.event.TableModelEvent;
-import javax.swing.event.TableModelListener;
+import javax.swing.event.*;
import javax.swing.table.TableCellEditor;
import javax.swing.table.TableCellRenderer;
import javax.swing.table.TableColumnModel;
@@ -405,6 +385,9 @@
} else if (component instanceof AbstractButton) {
initButton((AbstractButton) component);
+ } else if (component instanceof JScrollPane) {
+
+ initScrollPane((JScrollPane) component);
}
}
}
@@ -594,6 +577,24 @@
}
}
+ protected void initScrollPane(JScrollPane scrollPane) {
+ Boolean onlyVerticalScrollable = (Boolean) scrollPane.getClientProperty("onlyVerticalScrollable");
+ if (onlyVerticalScrollable != null && onlyVerticalScrollable) {
+ scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
+ scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
+
+ final JViewport viewport = scrollPane.getViewport();
+ viewport.addChangeListener(new ChangeListener() {
+ @Override
+ public void stateChanged(ChangeEvent e) {
+ Dimension newDimension = new Dimension(viewport.getExtentSize().width,
+ viewport.getViewSize().height);
+ viewport.setViewSize(newDimension);
+ }
+ });
+ }
+ }
+
protected boolean isAutoSelectOnFocus(JComponent comp) {
Object selectOnFocus = comp.getClientProperty("selectOnFocus");
return selectOnFocus != null && Boolean.valueOf(selectOnFocus.toString());
@@ -955,4 +956,5 @@
}
}
}
+
}
1
0
r712 - in trunk: . tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation
by kmorin@users.forge.codelutin.com 29 Mar '13
by kmorin@users.forge.codelutin.com 29 Mar '13
29 Mar '13
Author: kmorin
Date: 2013-03-29 16:01:19 +0100 (Fri, 29 Mar 2013)
New Revision: 712
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/712
Log:
- use last jaxx snapshot
- separate fatal and error in fishing operation (to be able to save a fishing operation even if there are errors in validation mode)
Added:
trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-edit-fatal-validation.xml
trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-validate-fatal-validation.xml
Modified:
trunk/pom.xml
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/util/AbstractTuttiUIHandler.java
trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-edit-error-validation.xml
trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-validate-error-validation.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2013-03-29 10:51:23 UTC (rev 711)
+++ trunk/pom.xml 2013-03-29 15:01:19 UTC (rev 712)
@@ -135,7 +135,7 @@
<postgresqlVersion>9.1-901-1.jdbc4</postgresqlVersion>
<licensePluginVersion>1.4</licensePluginVersion>
- <jaxxVersion>2.5.15</jaxxVersion>
+ <jaxxVersion>2.5.16-SNAPSHOT</jaxxVersion>
<swingXVersion>1.6.4</swingXVersion>
<xworkVersion>2.3.7</xworkVersion>
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-03-29 10:51:23 UTC (rev 711)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java 2013-03-29 15:01:19 UTC (rev 712)
@@ -289,7 +289,7 @@
initBeanFilterableComboBox(ui.getLocationComboBox(), locations, location);
changeValidatorContext(model.getValidationContext(), ui.getValidator());
- listenValidatorValid(ui.getValidator(), model);
+ listenValidationTableHasNoFatalError(ui.getValidator(), model);
setCustomTab(0, model);
listModelIsModify(model);
@@ -307,32 +307,17 @@
vesselUseFeatureModel.setAvailableCaracteristics(getDataContext().getCaracteristics());
setCustomTab(2, vesselUseFeatureModel);
- if (TuttiUIContext.VALIDATION_CONTEXT_VALIDATE.equals(model.getValidationContext())) {
- PropertyChangeListener pcl = new PropertyChangeListener() {
+ model.addPropertyChangeListener(AbstractTuttiBeanUIModel.PROPERTY_VALID, new PropertyChangeListener() {
- @Override
- public void propertyChange(PropertyChangeEvent evt) {
- boolean allModelsValid = areAllModelsValid();
- ui.getSaveButton().setEnabled(allModelsValid);
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ Boolean valid = (Boolean) evt.getNewValue();
+ if (valid != null) {
+ ui.getSaveButton().setEnabled(valid);
}
- };
- gearUseFeatureModel.addPropertyChangeListener(AbstractTuttiBeanUIModel.PROPERTY_VALID, pcl);
- vesselUseFeatureModel.addPropertyChangeListener(AbstractTuttiBeanUIModel.PROPERTY_VALID, pcl);
- model.addPropertyChangeListener(AbstractTuttiBeanUIModel.PROPERTY_VALID, pcl);
+ }
+ });
- } else {
- model.addPropertyChangeListener(AbstractTuttiBeanUIModel.PROPERTY_VALID, new PropertyChangeListener() {
-
- @Override
- public void propertyChange(PropertyChangeEvent evt) {
- Boolean valid = (Boolean) evt.getNewValue();
- if (valid != null) {
- ui.getSaveButton().setEnabled(valid);
- }
- }
- });
- }
-
// listen when id becones empty or not toupdate cancel action and button
getModel().addPropertyChangeListener(
EditFishingOperationUIModel.PROPERTY_ID,
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/AbstractTuttiUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/AbstractTuttiUIHandler.java 2013-03-29 10:51:23 UTC (rev 711)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/AbstractTuttiUIHandler.java 2013-03-29 15:01:19 UTC (rev 712)
@@ -84,6 +84,8 @@
import javax.swing.SwingUtilities;
import javax.swing.border.LineBorder;
import javax.swing.event.ListSelectionEvent;
+import javax.swing.event.TableModelEvent;
+import javax.swing.event.TableModelListener;
import javax.swing.table.TableCellEditor;
import javax.swing.table.TableCellRenderer;
import javax.swing.table.TableColumnModel;
@@ -742,6 +744,21 @@
});
}
+ protected void listenValidationTableHasNoFatalError(final SimpleBeanValidator validator,
+ final AbstractTuttiBeanUIModel model) {
+ getContext().getMainUI().getValidatorMessageWidget().addTableModelListener(new TableModelListener() {
+ @Override
+ public void tableChanged(TableModelEvent e) {
+ boolean valid = !validator.hasFatalErrors();
+ if (log.isDebugEnabled()) {
+ log.debug("Model [" + model +
+ "] pass to valid state [" + valid + "]");
+ }
+ model.setValid(valid);
+ }
+ });
+ }
+
protected void listModelIsModify(AbstractTuttiBeanUIModel model) {
model.addPropertyChangeListener(new PropertyChangeListener() {
Modified: trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-edit-error-validation.xml
===================================================================
--- trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-edit-error-validation.xml 2013-03-29 10:51:23 UTC (rev 711)
+++ trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-edit-error-validation.xml 2013-03-29 15:01:19 UTC (rev 712)
@@ -27,73 +27,8 @@
"http://struts.apache.org/dtds/xwork-validator-1.0.3.dtd">
<validators>
- <field name="stationNumber">
-
- <field-validator type="requiredstring" short-circuit="true">
- <message>
- tutti.validator.error.fishingOperation.stationNumber.required
- </message>
- </field-validator>
-
- <field-validator type="stringlength" short-circuit="true">
- <param name="maxLength">40</param>
- <message>
- tutti.validator.error.fishingOperation.stationNumber.too.long##${maxLength}
- </message>
- </field-validator>
-
- <field-validator type="collectionUniqueKey" short-circuit="true">
- <param name="collectionFieldName">existingOperations</param>
- <param name="keys">stationNumber, fishingOperationNumber, gearShootingStartDate</param>
- <param name="againstMe">true</param>
- <param name="nullValueSkipped">true</param>
- <message>tutti.validator.error.fishingOperation.existingKey</message>
- </field-validator>
-
- </field>
-
- <field name="fishingOperationNumber">
-
- <field-validator type="required" short-circuit="true">
- <message>
- tutti.validator.error.fishingOperation.fishingOperationNumber.required
- </message>
- </field-validator>
-
- <field-validator type="collectionUniqueKey" short-circuit="true">
- <param name="collectionFieldName">existingOperations</param>
- <param name="keys">stationNumber, fishingOperationNumber, gearShootingStartDate</param>
- <param name="againstMe">true</param>
- <param name="nullValueSkipped">true</param>
- <message>tutti.validator.error.fishingOperation.existingKey</message>
- </field-validator>
-
- </field>
-
- <field name="multirigAggregation">
-
- <field-validator type="required" short-circuit="true">
- <message>
- tutti.validator.error.fishingOperation.trawlNetNumber.required
- </message>
- </field-validator>
-
- </field>
-
<field name="gearShootingStartDate">
- <field-validator type="required" short-circuit="true">
- <message>tutti.validator.error.fishingOperation.date.start.required</message>
- </field-validator>
-
- <field-validator type="collectionUniqueKey" short-circuit="true">
- <param name="collectionFieldName">existingOperations</param>
- <param name="keys">stationNumber, fishingOperationNumber, gearShootingStartDate</param>
- <param name="againstMe">true</param>
- <param name="nullValueSkipped">true</param>
- <message>tutti.validator.error.fishingOperation.existingKey</message>
- </field-validator>
-
<field-validator type="fieldexpression" short-circuit="true">
<param name="expression">
<![CDATA[ gearShootingEndDate == null || !gearShootingStartDate.after(gearShootingEndDate) ]]>
Copied: trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-edit-fatal-validation.xml (from rev 711, trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-edit-error-validation.xml)
===================================================================
--- trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-edit-fatal-validation.xml (rev 0)
+++ trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-edit-fatal-validation.xml 2013-03-29 15:01:19 UTC (rev 712)
@@ -0,0 +1,98 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%L
+ Tutti :: UI
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2012 Ifremer
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public
+ License along with this program. If not, see
+ <http://www.gnu.org/licenses/gpl-3.0.html>.
+ #L%
+ -->
+<!DOCTYPE validators PUBLIC
+ "-//Apache Struts//XWork Validator 1.0.3//EN"
+ "http://struts.apache.org/dtds/xwork-validator-1.0.3.dtd">
+<validators>
+
+ <field name="stationNumber">
+
+ <field-validator type="requiredstring" short-circuit="true">
+ <message>
+ tutti.validator.error.fishingOperation.stationNumber.required
+ </message>
+ </field-validator>
+
+ <field-validator type="stringlength" short-circuit="true">
+ <param name="maxLength">40</param>
+ <message>
+ tutti.validator.error.fishingOperation.stationNumber.too.long##${maxLength}
+ </message>
+ </field-validator>
+
+ <field-validator type="collectionUniqueKey" short-circuit="true">
+ <param name="collectionFieldName">existingOperations</param>
+ <param name="keys">stationNumber, fishingOperationNumber, gearShootingStartDate</param>
+ <param name="againstMe">true</param>
+ <param name="nullValueSkipped">true</param>
+ <message>tutti.validator.error.fishingOperation.existingKey</message>
+ </field-validator>
+
+ </field>
+
+ <field name="fishingOperationNumber">
+
+ <field-validator type="required" short-circuit="true">
+ <message>
+ tutti.validator.error.fishingOperation.fishingOperationNumber.required
+ </message>
+ </field-validator>
+
+ <field-validator type="collectionUniqueKey" short-circuit="true">
+ <param name="collectionFieldName">existingOperations</param>
+ <param name="keys">stationNumber, fishingOperationNumber, gearShootingStartDate</param>
+ <param name="againstMe">true</param>
+ <param name="nullValueSkipped">true</param>
+ <message>tutti.validator.error.fishingOperation.existingKey</message>
+ </field-validator>
+
+ </field>
+
+ <field name="multirigAggregation">
+
+ <field-validator type="required" short-circuit="true">
+ <message>
+ tutti.validator.error.fishingOperation.trawlNetNumber.required
+ </message>
+ </field-validator>
+
+ </field>
+
+ <field name="gearShootingStartDate">
+
+ <field-validator type="required" short-circuit="true">
+ <message>tutti.validator.error.fishingOperation.date.start.required</message>
+ </field-validator>
+
+ <field-validator type="collectionUniqueKey" short-circuit="true">
+ <param name="collectionFieldName">existingOperations</param>
+ <param name="keys">stationNumber, fishingOperationNumber, gearShootingStartDate</param>
+ <param name="againstMe">true</param>
+ <param name="nullValueSkipped">true</param>
+ <message>tutti.validator.error.fishingOperation.existingKey</message>
+ </field-validator>
+
+ </field>
+</validators>
Property changes on: trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-edit-fatal-validation.xml
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-validate-error-validation.xml
===================================================================
--- trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-validate-error-validation.xml 2013-03-29 10:51:23 UTC (rev 711)
+++ trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-validate-error-validation.xml 2013-03-29 15:01:19 UTC (rev 712)
@@ -27,59 +27,6 @@
"http://struts.apache.org/dtds/xwork-validator-1.0.3.dtd">
<validators>
- <field name="stationNumber">
-
- <field-validator type="requiredstring" short-circuit="true">
- <message>
- tutti.validator.error.fishingOperation.stationNumber.required
- </message>
- </field-validator>
-
- <field-validator type="stringlength" short-circuit="true">
- <param name="maxLength">40</param>
- <message>
- tutti.validator.error.fishingOperation.stationNumber.too.long##${maxLength}
- </message>
- </field-validator>
-
- <field-validator type="collectionUniqueKey" short-circuit="true">
- <param name="collectionFieldName">existingOperations</param>
- <param name="keys">stationNumber, fishingOperationNumber, gearShootingStartDate</param>
- <param name="againstMe">true</param>
- <param name="nullValueSkipped">true</param>
- <message>tutti.validator.error.fishingOperation.existingKey</message>
- </field-validator>
-
- </field>
-
- <field name="fishingOperationNumber">
-
- <field-validator type="required" short-circuit="true">
- <message>
- tutti.validator.error.fishingOperation.fishingOperationNumber.required
- </message>
- </field-validator>
-
- <field-validator type="collectionUniqueKey" short-circuit="true">
- <param name="collectionFieldName">existingOperations</param>
- <param name="keys">stationNumber, fishingOperationNumber, gearShootingStartDate</param>
- <param name="againstMe">true</param>
- <param name="nullValueSkipped">true</param>
- <message>tutti.validator.error.fishingOperation.existingKey</message>
- </field-validator>
-
- </field>
-
- <field name="multirigAggregation">
-
- <field-validator type="required" short-circuit="true">
- <message>
- tutti.validator.error.fishingOperation.trawlNetNumber.required
- </message>
- </field-validator>
-
- </field>
-
<field name='strata'>
<field-validator type="fieldexpression" short-circuit="true">
<param name="expression">
@@ -109,18 +56,6 @@
<field name="gearShootingStartDate">
- <field-validator type="required" short-circuit="true">
- <message>tutti.validator.error.fishingOperation.date.start.required</message>
- </field-validator>
-
- <field-validator type="collectionUniqueKey" short-circuit="true">
- <param name="collectionFieldName">existingOperations</param>
- <param name="keys">stationNumber, fishingOperationNumber, gearShootingStartDate</param>
- <param name="againstMe">true</param>
- <param name="nullValueSkipped">true</param>
- <message>tutti.validator.error.fishingOperation.existingKey</message>
- </field-validator>
-
<field-validator type="fieldexpression" short-circuit="true">
<param name="expression">
<![CDATA[ gearShootingEndDate == null || gearShootingStartDate.before(gearShootingEndDate) ]]>
Added: trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-validate-fatal-validation.xml
===================================================================
--- trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-validate-fatal-validation.xml (rev 0)
+++ trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-validate-fatal-validation.xml 2013-03-29 15:01:19 UTC (rev 712)
@@ -0,0 +1,98 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%L
+ Tutti :: UI
+ $Id: EditFishingOperationUIModel-edit-error-validation.xml 553 2013-03-06 17:22:48Z kmorin $
+ $HeadURL: http://svn.forge.codelutin.com/svn/tutti/trunk/tutti-ui-swing/src/main/reso… $
+ %%
+ Copyright (C) 2012 Ifremer
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public
+ License along with this program. If not, see
+ <http://www.gnu.org/licenses/gpl-3.0.html>.
+ #L%
+ -->
+<!DOCTYPE validators PUBLIC
+ "-//Apache Struts//XWork Validator 1.0.3//EN"
+ "http://struts.apache.org/dtds/xwork-validator-1.0.3.dtd">
+<validators>
+
+ <field name="stationNumber">
+
+ <field-validator type="requiredstring" short-circuit="true">
+ <message>
+ tutti.validator.error.fishingOperation.stationNumber.required
+ </message>
+ </field-validator>
+
+ <field-validator type="stringlength" short-circuit="true">
+ <param name="maxLength">40</param>
+ <message>
+ tutti.validator.error.fishingOperation.stationNumber.too.long##${maxLength}
+ </message>
+ </field-validator>
+
+ <field-validator type="collectionUniqueKey" short-circuit="true">
+ <param name="collectionFieldName">existingOperations</param>
+ <param name="keys">stationNumber, fishingOperationNumber, gearShootingStartDate</param>
+ <param name="againstMe">true</param>
+ <param name="nullValueSkipped">true</param>
+ <message>tutti.validator.error.fishingOperation.existingKey</message>
+ </field-validator>
+
+ </field>
+
+ <field name="fishingOperationNumber">
+
+ <field-validator type="required" short-circuit="true">
+ <message>
+ tutti.validator.error.fishingOperation.fishingOperationNumber.required
+ </message>
+ </field-validator>
+
+ <field-validator type="collectionUniqueKey" short-circuit="true">
+ <param name="collectionFieldName">existingOperations</param>
+ <param name="keys">stationNumber, fishingOperationNumber, gearShootingStartDate</param>
+ <param name="againstMe">true</param>
+ <param name="nullValueSkipped">true</param>
+ <message>tutti.validator.error.fishingOperation.existingKey</message>
+ </field-validator>
+
+ </field>
+
+ <field name="multirigAggregation">
+
+ <field-validator type="required" short-circuit="true">
+ <message>
+ tutti.validator.error.fishingOperation.trawlNetNumber.required
+ </message>
+ </field-validator>
+
+ </field>
+
+ <field name="gearShootingStartDate">
+
+ <field-validator type="required" short-circuit="true">
+ <message>tutti.validator.error.fishingOperation.date.start.required</message>
+ </field-validator>
+
+ <field-validator type="collectionUniqueKey" short-circuit="true">
+ <param name="collectionFieldName">existingOperations</param>
+ <param name="keys">stationNumber, fishingOperationNumber, gearShootingStartDate</param>
+ <param name="againstMe">true</param>
+ <param name="nullValueSkipped">true</param>
+ <message>tutti.validator.error.fishingOperation.existingKey</message>
+ </field-validator>
+
+ </field>
+</validators>
1
0
r711 - in trunk/tutti-ui-swing/src/main: filtered-resources java/fr/ifremer/tutti/ui/swing/content/operation java/fr/ifremer/tutti/ui/swing/content/operation/catches/species java/fr/ifremer/tutti/ui/swing/util
by kmorin@users.forge.codelutin.com 29 Mar '13
by kmorin@users.forge.codelutin.com 29 Mar '13
29 Mar '13
Author: kmorin
Date: 2013-03-29 11:51:23 +0100 (Fri, 29 Mar 2013)
New Revision: 711
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/711
Log:
refs #1987 [PROTOCOLE] - Gestion dex contr?\195?\180les/infos obligatoires en validation
use the font style for JLabels instead of html text for performance reason
Modified:
trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-en.properties
trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-fr.properties
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/catches/species/SpeciesBatchUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/AbstractTuttiUIHandler.java
Modified: trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-en.properties
===================================================================
--- trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-en.properties 2013-03-29 00:30:05 UTC (rev 710)
+++ trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-en.properties 2013-03-29 10:51:23 UTC (rev 711)
@@ -1,5 +1,5 @@
#Generated by org.nuiton.jaxx.plugin.GenerateHelpIdsMojo
-#Tue Mar 26 18:46:47 CET 2013
+#Fri Mar 29 10:09:57 CET 2013
tutti.createBenthosBatch.action.addSpecies.help=createBenthosBatch.html\#actions
tutti.createBenthosBatch.action.cancel.help=createBenthosBatch.html\#actions
tutti.createBenthosBatch.action.save.help=createBenthosBatch.html\#actions
@@ -61,6 +61,7 @@
tutti.editCatchBatch.field.catchTotalSortedWeight.help=editCatchBatch.html\#fields
tutti.editCatchBatch.field.catchTotalUnsortedWeight.help=editCatchBatch.html\#fields
tutti.editCatchBatch.field.catchTotalWeight.help=editCatchBatch.html\#fields
+tutti.editCatchBatch.field.macroWasteTotalWeight.help=
tutti.editCatchBatch.field.marineLitterTotalWeight.help=editCatchBatch.html\#fields
tutti.editCatchBatch.field.speciesTotalSampleSortedWeight.help=editCatchBatch.html\#fields
tutti.editCatchBatch.field.speciesTotalSortedWeight.help=editCatchBatch.html\#fields
@@ -239,5 +240,6 @@
tutti.splitSpeciesBatch.help=splitSpeciesBatch.html
tuttihelp.config.help=config.help
tuttihelp.editAccidentalBatch.help=editAccidentalBatch.html
+tuttihelp.editMacroWasteBatch.help=
tuttihelp.editMarineLitterBatch.help=editMarineLitterBatch.html
tuttihelp.editPlanktonBatch.help=editPlanktonBatch.html
Modified: trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-fr.properties
===================================================================
--- trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-fr.properties 2013-03-29 00:30:05 UTC (rev 710)
+++ trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-fr.properties 2013-03-29 10:51:23 UTC (rev 711)
@@ -1,5 +1,5 @@
#Generated by org.nuiton.jaxx.plugin.GenerateHelpIdsMojo
-#Tue Mar 26 18:46:47 CET 2013
+#Fri Mar 29 10:09:57 CET 2013
tutti.createBenthosBatch.action.addSpecies.help=createBenthosBatch.html\#actions
tutti.createBenthosBatch.action.cancel.help=createBenthosBatch.html\#actions
tutti.createBenthosBatch.action.save.help=createBenthosBatch.html\#actions
@@ -70,6 +70,7 @@
tutti.editCatchBatch.field.catchTotalSortedWeight.help=editCatchBatch.html\#fields
tutti.editCatchBatch.field.catchTotalUnsortedWeight.help=editCatchBatch.html\#fields
tutti.editCatchBatch.field.catchTotalWeight.help=editCatchBatch.html\#fields
+tutti.editCatchBatch.field.macroWasteTotalWeight.help=
tutti.editCatchBatch.field.marineLitterTotalWeight.help=editCatchBatch.html\#fields
tutti.editCatchBatch.field.speciesTotalSampleSortedWeight.help=editCatchBatch.html\#fields
tutti.editCatchBatch.field.speciesTotalSortedWeight.help=editCatchBatch.html\#fields
@@ -248,5 +249,6 @@
tutti.splitSpeciesBatch.help=splitSpeciesBatch.html
tuttihelp.config.help=config.help
tuttihelp.editAccidentalBatch.help=editAccidentalBatch.html
+tuttihelp.editMacroWasteBatch.help=
tuttihelp.editMarineLitterBatch.help=editMarineLitterBatch.html
tuttihelp.editPlanktonBatch.help=editPlanktonBatch.html
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-03-29 00:30:05 UTC (rev 710)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.css 2013-03-29 10:51:23 UTC (rev 711)
@@ -205,6 +205,7 @@
#vesselField {
text: {handler.decorateVessel(model.getVessel())};
+ _strongStyle: true;
}
#gearLabel {
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-03-29 00:30:05 UTC (rev 710)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java 2013-03-29 10:51:23 UTC (rev 711)
@@ -643,13 +643,6 @@
}
public String decorateVessel(Vessel vessel) {
- String result;
- if (vessel == null) {
- result = "";
- } else {
- result = "<html><strong>" + decorate(vessel) +
- "</strong></html>";
- }
- return result;
+ return decorate(vessel);
}
}
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-03-29 00:30:05 UTC (rev 710)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java 2013-03-29 10:51:23 UTC (rev 711)
@@ -34,9 +34,12 @@
import fr.ifremer.tutti.persistence.entities.data.SampleCategoryEnum;
import fr.ifremer.tutti.persistence.entities.data.SpeciesBatch;
import fr.ifremer.tutti.persistence.entities.data.SpeciesBatchFrequency;
+import fr.ifremer.tutti.persistence.entities.protocol.SpeciesProtocol;
+import fr.ifremer.tutti.persistence.entities.protocol.TuttiProtocol;
import fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue;
import fr.ifremer.tutti.persistence.entities.referential.Species;
import fr.ifremer.tutti.service.DecoratorService;
+import fr.ifremer.tutti.ui.swing.TuttiUIContext;
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.EditCatchesUIHandler;
@@ -262,7 +265,30 @@
// a row is valid if species category is not empty and valid
// then if any of none empty category is valid
- boolean result = row.getSpecies() != null;
+ Species species = row.getSpecies();
+ boolean result = species != null;
+ if (result) {
+ if (TuttiUIContext.VALIDATION_CONTEXT_VALIDATE.equals(getContext().getValidationContext())) {
+ TuttiProtocol protocol = getDataContext().getProtocol();
+ if (protocol != null) {
+ List<SpeciesProtocol> speciesProtocols = protocol.getSpecies();
+ for (SpeciesProtocol speciesProtocol : speciesProtocols) {
+ if (species.getReferenceTaxonId().equals(
+ speciesProtocol.getSpeciesReferenceTaxonId())) {
+
+ // TODO kmorin 20130329 check with Vincent what are exactly the countIfNoFrequencyEnabled
+ // and weight properties
+ result = (!speciesProtocol.isSizeEnabled() || row.getSizeCategoryValue() != null)
+ && (!speciesProtocol.isSexEnabled() || row.getSexCategoryValue() != null)
+ && (!speciesProtocol.isMaturityEnabled() || row.getMaturityCategoryValue() != null)
+ && (!speciesProtocol.isAgeEnabled() || row.getAgeCategoryValue() != null)
+ && (!speciesProtocol.isCountIfNoFrequencyEnabled() || !CollectionUtils.isEmpty(row.getFrequency()));
+ }
+ }
+ }
+ }
+ }
+
return result;
}
@@ -859,7 +885,7 @@
SpeciesBatchRowModel row = tableModel.getEntry(rowIndex);
int selectedRowCount = getTable().getSelectedRowCount();
- if (row.isValid()) {
+ if (row.getSpecies() != null) {
// must have at least species filled in row
// otherwise nothing can be done
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/AbstractTuttiUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/AbstractTuttiUIHandler.java 2013-03-29 00:30:05 UTC (rev 710)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/AbstractTuttiUIHandler.java 2013-03-29 10:51:23 UTC (rev 711)
@@ -424,17 +424,15 @@
protected void initLabel(JLabel jLabel) {
Boolean strongStyle = (Boolean) jLabel.getClientProperty("strongStyle");
Boolean italicStyle = (Boolean) jLabel.getClientProperty("italicStyle");
- boolean addHtml = strongStyle != null && strongStyle || italicStyle != null && italicStyle;
- if (addHtml) {
- String text = jLabel.getText();
- if (strongStyle != null && strongStyle) {
- text = "<strong>" + text + "</strong>";
- }
- if (italicStyle != null && italicStyle) {
- text = "<em>" + text + "</em>";
- }
- jLabel.setText("<html>" + text + "</html>");
+ Font font = jLabel.getFont();
+ int style = font.getStyle();
+ if (strongStyle != null && strongStyle) {
+ style |= Font.BOLD;
}
+ if (italicStyle != null && italicStyle) {
+ style |= Font.ITALIC;
+ }
+ jLabel.setFont(font.deriveFont(style));
}
protected void initButtonAttachment(ButtonAttachment component) {
1
0
29 Mar '13
Author: tchemit
Date: 2013-03-29 01:30:05 +0100 (Fri, 29 Mar 2013)
New Revision: 710
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/710
Log:
refs #1865: [MACRODECHET] - Gestion de la saisie des Macrod?\195?\169chets
Added:
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/MarineLitterBatchPersistenceService.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/MarineLitterBatchPersistenceServiceImpl.java
trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/MarineLitterBatchPersistenceServiceReadTest.java
trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/MarineLitterBatchPersistenceServiceWriteTest.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchRowModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchTableModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUIModel.java
Removed:
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/MacroWasteBatchPersistenceService.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/MacroWasteBatchPersistenceServiceImpl.java
trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/MacroWasteBatchPersistenceServiceReadTest.java
trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/MacroWasteBatchPersistenceServiceWriteTest.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/macrowaste/MacroWasteBatchRowModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/macrowaste/MacroWasteBatchTableModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/macrowaste/MacroWasteBatchUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/macrowaste/MacroWasteBatchUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/macrowaste/MacroWasteBatchUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/macrowaste/MacroWasteBatchUIModel.java
Modified:
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistence.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceImpl.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceNoDbImpl.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TuttiEntities.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceService.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceServiceImpl.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/TuttiEnumerationFile.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/TuttiPersistenceServiceLocator.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/batch/ScientificCruiseCatchBatchValidator.java
trunk/tutti-persistence/src/main/resources/tutti-db-enumerations.properties
trunk/tutti-persistence/src/main/xmi/tutti-persistence.properties
trunk/tutti-persistence/src/main/xmi/tutti-persistence.zargo
trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceServiceReadTest.java
trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/synchro/ReferentialSynchronizeHelperTest.java
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/DecoratorService.java
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java
trunk/tutti-service/src/main/resources/i18n/tutti-service_en_GB.properties
trunk/tutti-service/src/main/resources/i18n/tutti-service_fr_FR.properties
trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-en.properties
trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-fr.properties
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationAction.java
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/EditCatchesUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/AbstractTuttiBeanUIModel.java
trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.properties
trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistence.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistence.java 2013-03-28 15:34:45 UTC (rev 709)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistence.java 2013-03-29 00:30:05 UTC (rev 710)
@@ -30,7 +30,7 @@
import fr.ifremer.tutti.persistence.entities.data.CatchBatch;
import fr.ifremer.tutti.persistence.entities.data.Cruise;
import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
-import fr.ifremer.tutti.persistence.entities.data.MacroWasteBatch;
+import fr.ifremer.tutti.persistence.entities.data.MarineLitterBatch;
import fr.ifremer.tutti.persistence.entities.data.PlanktonBatch;
import fr.ifremer.tutti.persistence.entities.data.Program;
import fr.ifremer.tutti.persistence.entities.data.SpeciesBatch;
@@ -83,9 +83,7 @@
List<TuttiLocation> getAllProgramZone();
/**
- * @return all countries (used by a {@link Cruise}).
- * @see {@link Cruise#getCountry()}
- * @see {@link Cruise#setCountry(TuttiLocation)}
+ * @return all countries.
* @since 0.1
*/
List<TuttiLocation> getAllCountry();
@@ -210,9 +208,9 @@
Caracteristic getAgeCaracteristic();
- Caracteristic getMacroWasteCategoryCaracteristic();
+ Caracteristic getMarineLitterCategoryCaracteristic();
- Caracteristic getMacroWasteSizeCategoryCaracteristic();
+ Caracteristic getMarineLitterSizeCategoryCaracteristic();
List<Gear> getAllScientificGear();
@@ -550,21 +548,29 @@
void deletePlanktonBatch(String id);
//------------------------------------------------------------------------//
- //-- Macrodechet Batch methods --//
+ //-- MarineLitter Batch methods --//
//------------------------------------------------------------------------//
- List<MacroWasteBatch> getAllMacroWasteBatch(String fishingOperationId);
+ /**
+ * Get the batch parent of all root {@link MarineLitterBatch} for the given
+ * fishing operation.
+ * <p/>
+ * <strong>Note:</strong> All childs of the batch should be loaded here.
+ *
+ * @param fishingOperationId if of the fishing operation to seek
+ * @return the list of root {@link MarineLitterBatch}
+ * @since 1.3
+ */
+ BatchContainer<MarineLitterBatch> getRootMarineLitterBatch(String fishingOperationId);
- MacroWasteBatch getMacroWasteBatch(String id);
-
@Transactional(readOnly = false)
- MacroWasteBatch createMacroWasteBatch(MacroWasteBatch bean);
+ MarineLitterBatch createMarineLitterBatch(MarineLitterBatch bean);
@Transactional(readOnly = false)
- MacroWasteBatch saveMacroWasteBatch(MacroWasteBatch bean);
+ MarineLitterBatch saveMarineLitterBatch(MarineLitterBatch bean);
@Transactional(readOnly = false)
- void deleteMacroWasteBatch(String id);
+ void deleteMarineLitterBatch(String id);
//------------------------------------------------------------------------//
//-- Accidentel Batch methods --//
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceImpl.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceImpl.java 2013-03-28 15:34:45 UTC (rev 709)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceImpl.java 2013-03-29 00:30:05 UTC (rev 710)
@@ -33,7 +33,7 @@
import fr.ifremer.tutti.persistence.entities.data.CatchBatch;
import fr.ifremer.tutti.persistence.entities.data.Cruise;
import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
-import fr.ifremer.tutti.persistence.entities.data.MacroWasteBatch;
+import fr.ifremer.tutti.persistence.entities.data.MarineLitterBatch;
import fr.ifremer.tutti.persistence.entities.data.PlanktonBatch;
import fr.ifremer.tutti.persistence.entities.data.Program;
import fr.ifremer.tutti.persistence.entities.data.SpeciesBatch;
@@ -53,7 +53,7 @@
import fr.ifremer.tutti.persistence.service.CatchBatchPersistenceService;
import fr.ifremer.tutti.persistence.service.CruisePersistenceService;
import fr.ifremer.tutti.persistence.service.FishingOperationPersistenceService;
-import fr.ifremer.tutti.persistence.service.MacroWasteBatchPersistenceService;
+import fr.ifremer.tutti.persistence.service.MarineLitterBatchPersistenceService;
import fr.ifremer.tutti.persistence.service.PlanktonBatchPersistenceService;
import fr.ifremer.tutti.persistence.service.ProgramPersistenceService;
import fr.ifremer.tutti.persistence.service.ProtocolPersistenceService;
@@ -105,7 +105,7 @@
protected PlanktonBatchPersistenceService planktonBatchService;
@Autowired
- protected MacroWasteBatchPersistenceService macroWasteBatchService;
+ protected MarineLitterBatchPersistenceService marineLitterBatchService;
@Autowired
protected AccidentalBatchPersistenceService accidentalBatchService;
@@ -142,7 +142,7 @@
speciesBatchService.init();
benthosBatchService.init();
planktonBatchService.init();
- macroWasteBatchService.init();
+ marineLitterBatchService.init();
accidentalBatchService.init();
protocolService.init();
attachmentService.init();
@@ -162,7 +162,7 @@
speciesBatchService.close();
benthosBatchService.close();
planktonBatchService.close();
- macroWasteBatchService.close();
+ marineLitterBatchService.close();
accidentalBatchService.close();
protocolService.close();
attachmentService.close();
@@ -305,13 +305,13 @@
}
@Override
- public Caracteristic getMacroWasteCategoryCaracteristic() {
- return referentialService.getMacroWasteCategoryCaracteristic();
+ public Caracteristic getMarineLitterCategoryCaracteristic() {
+ return referentialService.getMarineLitterCategoryCaracteristic();
}
@Override
- public Caracteristic getMacroWasteSizeCategoryCaracteristic() {
- return referentialService.getMacroWasteSizeCategoryCaracteristic();
+ public Caracteristic getMarineLitterSizeCategoryCaracteristic() {
+ return referentialService.getMarineLitterSizeCategoryCaracteristic();
}
@Override
@@ -654,34 +654,29 @@
}
//------------------------------------------------------------------------//
- //-- Macrodechet Batch methods --//
+ //-- MarineLitter Batch methods --//
//------------------------------------------------------------------------//
@Override
- public List<MacroWasteBatch> getAllMacroWasteBatch(String fishingOperationId) {
- return macroWasteBatchService.getAllMacroWasteBatch(fishingOperationId);
+ public BatchContainer<MarineLitterBatch> getRootMarineLitterBatch(String fishingOperationId) {
+ return marineLitterBatchService.getRootMarineLitterBatch(fishingOperationId);
}
@Override
- public MacroWasteBatch getMacroWasteBatch(String id) {
- return macroWasteBatchService.getMacroWasteBatch(id);
+ public MarineLitterBatch createMarineLitterBatch(MarineLitterBatch bean) {
+ return marineLitterBatchService.createMarineLitterBatch(bean);
}
@Override
- public MacroWasteBatch createMacroWasteBatch(MacroWasteBatch bean) {
- return macroWasteBatchService.createMacroWasteBatch(bean);
+ public MarineLitterBatch saveMarineLitterBatch(MarineLitterBatch bean) {
+ return marineLitterBatchService.saveMarineLitterBatch(bean);
}
@Override
- public MacroWasteBatch saveMacroWasteBatch(MacroWasteBatch bean) {
- return macroWasteBatchService.saveMacroWasteBatch(bean);
+ public void deleteMarineLitterBatch(String id) {
+ marineLitterBatchService.deleteMarineLitterBatch(id);
}
- @Override
- public void deleteMacroWasteBatch(String id) {
- macroWasteBatchService.deleteMacroWasteBatch(id);
- }
-
//------------------------------------------------------------------------//
//-- Accidental Batch methods --//
//------------------------------------------------------------------------//
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceNoDbImpl.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceNoDbImpl.java 2013-03-28 15:34:45 UTC (rev 709)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceNoDbImpl.java 2013-03-29 00:30:05 UTC (rev 710)
@@ -30,7 +30,7 @@
import fr.ifremer.tutti.persistence.entities.data.CatchBatch;
import fr.ifremer.tutti.persistence.entities.data.Cruise;
import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
-import fr.ifremer.tutti.persistence.entities.data.MacroWasteBatch;
+import fr.ifremer.tutti.persistence.entities.data.MarineLitterBatch;
import fr.ifremer.tutti.persistence.entities.data.PlanktonBatch;
import fr.ifremer.tutti.persistence.entities.data.Program;
import fr.ifremer.tutti.persistence.entities.data.SpeciesBatch;
@@ -162,12 +162,12 @@
}
@Override
- public Caracteristic getMacroWasteCategoryCaracteristic() {
+ public Caracteristic getMarineLitterCategoryCaracteristic() {
throw new RuntimeException("method not implemented");
}
@Override
- public Caracteristic getMacroWasteSizeCategoryCaracteristic() {
+ public Caracteristic getMarineLitterSizeCategoryCaracteristic() {
throw new RuntimeException("method not implemented");
}
@@ -447,31 +447,26 @@
}
@Override
- public List<MacroWasteBatch> getAllMacroWasteBatch(String fishingOperationId) {
+ public BatchContainer<MarineLitterBatch> getRootMarineLitterBatch(String fishingOperationId) {
throw new RuntimeException("method not implemented");
}
@Override
- public MacroWasteBatch getMacroWasteBatch(String id) {
+ public MarineLitterBatch createMarineLitterBatch(MarineLitterBatch bean) {
throw new RuntimeException("method not implemented");
}
@Override
- public MacroWasteBatch createMacroWasteBatch(MacroWasteBatch bean) {
+ public MarineLitterBatch saveMarineLitterBatch(MarineLitterBatch bean) {
throw new RuntimeException("method not implemented");
}
@Override
- public MacroWasteBatch saveMacroWasteBatch(MacroWasteBatch bean) {
+ public void deleteMarineLitterBatch(String id) {
throw new RuntimeException("method not implemented");
}
@Override
- public void deleteMacroWasteBatch(String id) {
- throw new RuntimeException("method not implemented");
- }
-
- @Override
public List<AccidentalBatch> getAllAccidentalBatch(String fishingOperationId) {
throw new RuntimeException("method not implemented");
}
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TuttiEntities.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TuttiEntities.java 2013-03-28 15:34:45 UTC (rev 709)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TuttiEntities.java 2013-03-29 00:30:05 UTC (rev 710)
@@ -118,6 +118,10 @@
return Maps.uniqueIndex(list, GET_ID);
}
+ public static <B extends IdAware> Map<Integer, B> splitByIdAsInt(Iterable<B> list) {
+ return Maps.uniqueIndex(list, GET_ID_AS_INT);
+ }
+
public static Map<String, Species> splitByTaxonId(Iterable<Species> list) {
return Maps.uniqueIndex(list, GET_TAXON_ID);
}
@@ -140,6 +144,13 @@
}
};
+ public static final Function<IdAware, Integer > GET_ID_AS_INT = new Function<IdAware, Integer >() {
+ @Override
+ public Integer apply(IdAware input) {
+ return input.getIdAsInt();
+ }
+ };
+
public static <B extends IdAware> boolean isNew(B bean) {
return bean.getId() == null;
}
Deleted: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/MacroWasteBatchPersistenceService.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/MacroWasteBatchPersistenceService.java 2013-03-28 15:34:45 UTC (rev 709)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/MacroWasteBatchPersistenceService.java 2013-03-29 00:30:05 UTC (rev 710)
@@ -1,54 +0,0 @@
-package fr.ifremer.tutti.persistence.service;
-
-/*
- * #%L
- * Tutti :: Persistence API
- * $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.TuttiPersistenceServiceImplementor;
-import fr.ifremer.tutti.persistence.entities.data.MacroWasteBatch;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.util.List;
-
-/**
- * CRUD of {@link MacroWasteBatch} entity.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.3
- */
-@Transactional(readOnly = true)
-public interface MacroWasteBatchPersistenceService extends TuttiPersistenceServiceImplementor {
-
- List<MacroWasteBatch> getAllMacroWasteBatch(String fishingOperationId);
-
- MacroWasteBatch getMacroWasteBatch(String id);
-
- @Transactional(readOnly = false)
- MacroWasteBatch createMacroWasteBatch(MacroWasteBatch bean);
-
- @Transactional(readOnly = false)
- MacroWasteBatch saveMacroWasteBatch(MacroWasteBatch bean);
-
- @Transactional(readOnly = false)
- void deleteMacroWasteBatch(String id);
-}
Deleted: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/MacroWasteBatchPersistenceServiceImpl.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/MacroWasteBatchPersistenceServiceImpl.java 2013-03-28 15:34:45 UTC (rev 709)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/MacroWasteBatchPersistenceServiceImpl.java 2013-03-29 00:30:05 UTC (rev 710)
@@ -1,73 +0,0 @@
-package fr.ifremer.tutti.persistence.service;
-
-/*
- * #%L
- * Tutti :: Persistence API
- * $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.data.MacroWasteBatch;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.springframework.stereotype.Service;
-
-import java.util.List;
-
-/**
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.3
- */
-@Service("macroWasteBatchPersistenceService")
-public class MacroWasteBatchPersistenceServiceImpl extends AbstractPersistenceService implements MacroWasteBatchPersistenceService {
-
- /** Logger. */
- private static final Log log =
- LogFactory.getLog(MacroWasteBatchPersistenceServiceImpl.class);
-
- @Override
- public List<MacroWasteBatch> getAllMacroWasteBatch(String fishingOperationId) {
- List<MacroWasteBatch> result = Lists.newArrayList();
-
- // TODO BL
-
- return result;
- }
-
- @Override
- public MacroWasteBatch getMacroWasteBatch(String id) {
- return null;
- }
-
- @Override
- public MacroWasteBatch createMacroWasteBatch(MacroWasteBatch bean) {
- return null;
- }
-
- @Override
- public MacroWasteBatch saveMacroWasteBatch(MacroWasteBatch bean) {
- return null;
- }
-
- @Override
- public void deleteMacroWasteBatch(String id) {
- }
-}
Copied: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/MarineLitterBatchPersistenceService.java (from rev 709, trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/MacroWasteBatchPersistenceService.java)
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/MarineLitterBatchPersistenceService.java (rev 0)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/MarineLitterBatchPersistenceService.java 2013-03-29 00:30:05 UTC (rev 710)
@@ -0,0 +1,61 @@
+package fr.ifremer.tutti.persistence.service;
+
+/*
+ * #%L
+ * Tutti :: Persistence API
+ * $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.TuttiPersistenceServiceImplementor;
+import fr.ifremer.tutti.persistence.entities.data.BatchContainer;
+import fr.ifremer.tutti.persistence.entities.data.MarineLitterBatch;
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+ * CRUD of {@link MarineLitterBatch} entity.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+@Transactional(readOnly = true)
+public interface MarineLitterBatchPersistenceService extends TuttiPersistenceServiceImplementor {
+
+ /**
+ * Get the batch parent of all root {@link MarineLitterBatch} for the given
+ * fishing operation.
+ * <p/>
+ * <strong>Note:</strong> All childs of the batch should be loaded here.
+ *
+ * @param fishingOperationId if of the fishing operation to seek
+ * @return the list of root {@link MarineLitterBatch}
+ * @since 1.3
+ */
+ BatchContainer<MarineLitterBatch> getRootMarineLitterBatch(String fishingOperationId);
+
+ @Transactional(readOnly = false)
+ MarineLitterBatch createMarineLitterBatch(MarineLitterBatch bean);
+
+ @Transactional(readOnly = false)
+ MarineLitterBatch saveMarineLitterBatch(MarineLitterBatch bean);
+
+ @Transactional(readOnly = false)
+ void deleteMarineLitterBatch(String id);
+}
Copied: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/MarineLitterBatchPersistenceServiceImpl.java (from rev 709, trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/MacroWasteBatchPersistenceServiceImpl.java)
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/MarineLitterBatchPersistenceServiceImpl.java (rev 0)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/MarineLitterBatchPersistenceServiceImpl.java 2013-03-29 00:30:05 UTC (rev 710)
@@ -0,0 +1,176 @@
+package fr.ifremer.tutti.persistence.service;
+
+/*
+ * #%L
+ * Tutti :: Persistence API
+ * $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 fr.ifremer.adagio.core.dao.data.batch.Batch;
+import fr.ifremer.adagio.core.dao.data.batch.CatchBatchExtendDao;
+import fr.ifremer.adagio.core.dao.data.batch.SortingBatch;
+import fr.ifremer.adagio.core.dao.data.measure.QuantificationMeasurement;
+import fr.ifremer.adagio.core.dao.referential.pmfm.QualitativeValue;
+import fr.ifremer.tutti.persistence.entities.TuttiEntities;
+import fr.ifremer.tutti.persistence.entities.data.BatchContainer;
+import fr.ifremer.tutti.persistence.entities.data.MarineLitterBatch;
+import fr.ifremer.tutti.persistence.entities.referential.Caracteristic;
+import fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue;
+import fr.ifremer.tutti.persistence.service.batch.BatchPersistenceHelper;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.Collection;
+import java.util.Map;
+
+/**
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+@Service("marineLitterBatchPersistenceService")
+public class MarineLitterBatchPersistenceServiceImpl extends AbstractPersistenceService implements MarineLitterBatchPersistenceService {
+
+ /** Logger. */
+ private static final Log log =
+ LogFactory.getLog(MarineLitterBatchPersistenceServiceImpl.class);
+
+ @Resource(name = "referentialPersistenceService")
+ protected ReferentialPersistenceService referentialService;
+
+ @Resource(name = "catchBatchDao")
+ protected CatchBatchExtendDao catchBatchDao;
+
+ @Resource(name = "batchPersistenceHelper")
+ protected BatchPersistenceHelper batchHelper;
+
+ Integer marineLitterType;
+
+ Integer marineLitterSizeCategory;
+
+ Map<Integer, CaracteristicQualitativeValue> marineLitterCategoryCaracteristicValues;
+
+ Map<Integer, CaracteristicQualitativeValue> marineLitterSizeCategoryCaracteristicValues;
+
+ @Override
+ public void init() {
+ super.init();
+
+ Caracteristic marineLitterCategoryCaracteristic = referentialService.getMarineLitterCategoryCaracteristic();
+ marineLitterType = marineLitterCategoryCaracteristic.getIdAsInt();
+ marineLitterCategoryCaracteristicValues = TuttiEntities.splitByIdAsInt(marineLitterCategoryCaracteristic.getQualitativeValue());
+
+ Caracteristic marineLitterSizeCategoryCaracteristic = referentialService.getMarineLitterSizeCategoryCaracteristic();
+ marineLitterSizeCategory = marineLitterSizeCategoryCaracteristic.getIdAsInt();
+ marineLitterSizeCategoryCaracteristicValues = TuttiEntities.splitByIdAsInt(marineLitterSizeCategoryCaracteristic.getQualitativeValue());
+ }
+
+ @Override
+ public BatchContainer<MarineLitterBatch> getRootMarineLitterBatch(String fishingOperationId) {
+ Preconditions.checkNotNull(fishingOperationId);
+
+ // Load batch tree
+ Integer catchBatchId = catchBatchDao.getIdByFishingOperationId(Integer.valueOf(fishingOperationId));
+ Preconditions.checkNotNull(catchBatchId);
+
+ fr.ifremer.adagio.core.dao.data.batch.CatchBatch catchBatch = catchBatchDao.loadFullTree(catchBatchId);
+ Preconditions.checkNotNull(catchBatch);
+
+ Collection<Batch> catchBatchChilds = catchBatch.getChildBatchs();
+
+ // Vrac / Marine Litter
+ SortingBatch vracMarineLitterBatch = catchBatchDao.getSortingBatch(
+ catchBatchChilds,
+ "pmfmId", enumeration.PMFM_ID_SORTED_UNSORTED, enumeration.QUALITATIVE_VRAC_ID,
+ "pmfmId", enumeration.PMFM_ID_SORTING_TYPE, enumeration.QUALITATIVE_ID_SORTING_TYPE_MARINE_LITTER);
+
+ // container of speciesBatch is arbitraty put on vrac type (there is
+ // no common ancestor for all species batch).
+ BatchContainer<MarineLitterBatch> result = new BatchContainer<>();
+ result.setId(vracMarineLitterBatch.getId());
+
+ for (Batch batch1 : vracMarineLitterBatch.getChildBatchs()) {
+ SortingBatch source = (SortingBatch) batch1;
+
+ MarineLitterBatch target = new MarineLitterBatch();
+ entityToMacroWasteBatch(source, target);
+ result.addChildren(target);
+
+ if (log.isInfoEnabled()) {
+ log.info("Loaded CatchBatch MarineLetter > " +
+ target.getMarineLitterCategory().getName() + " / " +
+ target.getMarineLitterSizeCategory().getName() + " : " +
+ target.getId());
+ }
+ }
+
+ return result;
+ }
+
+ @Override
+ public MarineLitterBatch createMarineLitterBatch(MarineLitterBatch bean) {
+ return null;
+ }
+
+ @Override
+ public MarineLitterBatch saveMarineLitterBatch(MarineLitterBatch bean) {
+ return null;
+ }
+
+ @Override
+ public void deleteMarineLitterBatch(String id) {
+ }
+
+ public MarineLitterBatch entityToMacroWasteBatch(SortingBatch source,
+ MarineLitterBatch target) {
+
+ target.setId(source.getId().toString());
+
+ // Individual count
+ target.setNumber(source.getIndividualCount());
+
+ // Weight
+ target.setWeight(source.getWeight());
+
+ // Comments
+ target.setComment(source.getComments());
+
+ // Should have 2 quantification measurements
+
+ for (QuantificationMeasurement measurement : source.getQuantificationMeasurements()) {
+ Integer pmfmId = measurement.getPmfm().getId();
+ if (marineLitterType.equals(pmfmId)) {
+ QualitativeValue qualitativeValue = measurement.getQualitativeValue();
+ Integer id = qualitativeValue.getId();
+ CaracteristicQualitativeValue value = marineLitterCategoryCaracteristicValues.get(id);
+ target.setMarineLitterCategory(value);
+ } else if (marineLitterSizeCategory.equals(pmfmId)) {
+ QualitativeValue qualitativeValue = measurement.getQualitativeValue();
+ Integer id = qualitativeValue.getId();
+ CaracteristicQualitativeValue value = marineLitterSizeCategoryCaracteristicValues.get(id);
+ target.setMarineLitterSizeCategory(value);
+ }
+ }
+ return target;
+ }
+}
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-03-28 15:34:45 UTC (rev 709)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceService.java 2013-03-29 00:30:05 UTC (rev 710)
@@ -64,8 +64,6 @@
/**
* @return all countries (used by a {@link Cruise}).
- * @see {@link Cruise#getCountry()}
- * @see {@link Cruise#setCountry(TuttiLocation)}
* @since 0.1
*/
@Cacheable(value = "countries")
@@ -204,9 +202,9 @@
Caracteristic getAgeCaracteristic();
- Caracteristic getMacroWasteCategoryCaracteristic();
+ Caracteristic getMarineLitterCategoryCaracteristic();
- Caracteristic getMacroWasteSizeCategoryCaracteristic();
+ Caracteristic getMarineLitterSizeCategoryCaracteristic();
List<Gear> getAllScientificGear();
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceServiceImpl.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceServiceImpl.java 2013-03-28 15:34:45 UTC (rev 709)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceServiceImpl.java 2013-03-29 00:30:05 UTC (rev 710)
@@ -532,14 +532,14 @@
}
@Override
- public Caracteristic getMacroWasteCategoryCaracteristic() {
+ public Caracteristic getMarineLitterCategoryCaracteristic() {
Integer pmfmId = enumeration.PMFM_ID_MARINE_LITTER_TYPE;
Caracteristic result = thisService.getCaracteristic(pmfmId);
return result;
}
@Override
- public Caracteristic getMacroWasteSizeCategoryCaracteristic() {
+ public Caracteristic getMarineLitterSizeCategoryCaracteristic() {
Integer pmfmId = enumeration.PMFM_ID_MARINE_LITTER_SIZE_CATEGORY;
Caracteristic result = thisService.getCaracteristic(pmfmId);
return result;
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/TuttiEnumerationFile.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/TuttiEnumerationFile.java 2013-03-28 15:34:45 UTC (rev 709)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/TuttiEnumerationFile.java 2013-03-29 00:30:05 UTC (rev 710)
@@ -161,6 +161,9 @@
@Value("${QualitativeValueId.SORTING_TYPE_BENTHOS}")
public final Integer QUALITATIVE_ID_SORTING_TYPE_BENTHOS = null;
+ @Value("${QualitativeValueId.SORTING_TYPE_MARINE_LITTER}")
+ public final Integer QUALITATIVE_ID_SORTING_TYPE_MARINE_LITTER= null;
+
@Value("${StatusCode.ENABLE}")
public final String STATUS_VALID_CODE = null;
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/TuttiPersistenceServiceLocator.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/TuttiPersistenceServiceLocator.java 2013-03-28 15:34:45 UTC (rev 709)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/TuttiPersistenceServiceLocator.java 2013-03-29 00:30:05 UTC (rev 710)
@@ -100,9 +100,9 @@
PlanktonBatchPersistenceService.class);
}
- public static MacroWasteBatchPersistenceService getMacroWasteBatchPersistenceService() {
- return getPersistenceService("macroWasteBatchPersistenceService",
- MacroWasteBatchPersistenceService.class);
+ public static MarineLitterBatchPersistenceService getMarineLitterBatchPersistenceService() {
+ return getPersistenceService("marineLitterBatchPersistenceService",
+ MarineLitterBatchPersistenceService.class);
}
public static AccidentalBatchPersistenceService getAccidentalBatchPersistenceService() {
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/batch/ScientificCruiseCatchBatchValidator.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/batch/ScientificCruiseCatchBatchValidator.java 2013-03-28 15:34:45 UTC (rev 709)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/batch/ScientificCruiseCatchBatchValidator.java 2013-03-29 00:30:05 UTC (rev 710)
@@ -24,15 +24,12 @@
* #L%
*/
-
import com.google.common.collect.Lists;
import fr.ifremer.adagio.core.dao.data.batch.Batch;
import fr.ifremer.adagio.core.dao.data.batch.CatchBatchExtendDao;
import fr.ifremer.adagio.core.dao.data.batch.SortingBatch;
-import fr.ifremer.adagio.core.dao.data.batch.validator.CatchBatchQuickFix;
import fr.ifremer.adagio.core.dao.data.batch.validator.CatchBatchValidationError;
import fr.ifremer.adagio.core.dao.data.batch.validator.CatchBatchValidator;
-import fr.ifremer.adagio.core.dao.data.measure.SortingMeasurement;
import fr.ifremer.tutti.persistence.service.CatchBatchPersistenceService;
import fr.ifremer.tutti.persistence.service.TuttiEnumerationFile;
import org.apache.commons.logging.Log;
@@ -71,7 +68,7 @@
@Override
public List<CatchBatchValidationError> validate(fr.ifremer.adagio.core.dao.data.batch.CatchBatch catchBatch) {
List<CatchBatchValidationError> errors = Lists.newArrayList();
- validate(catchBatch.getChildBatchs(), errors, 1);
+ validate(catchBatch.getChildBatchs(), errors);
return errors;
}
@@ -80,8 +77,7 @@
// ------------------------------------------------------------------------//
protected void validate(Collection<Batch> batchs,
- List<CatchBatchValidationError> errors,
- int treeLevel) {
+ List<CatchBatchValidationError> errors) {
// Vrac
SortingBatch vracBatch = catchBatchDao.getSortingBatch(batchs,
@@ -92,14 +88,14 @@
}
if (vracBatch == null) {
- addError(errors, n_("tutti.persistence.batch.validation.vracNotFound"), null);
+ addError(errors, n_("tutti.persistence.batch.validation.vracNotFound"));
} else {
// Vrac > Species
SortingBatch speciesBatch = catchBatchDao.getSortingBatch(vracBatch.getChildBatchs(),
"pmfmId", enumeration.PMFM_ID_SORTING_TYPE,
enumeration.QUALITATIVE_ID_SORTING_TYPE_SPECIES);
if (speciesBatch == null) {
- addError(errors, n_("tutti.persistence.batch.validation.vracSpeciesNotFound"), null);
+ addError(errors, n_("tutti.persistence.batch.validation.vracSpeciesNotFound"));
} else {
// Vrac > Species > Inert
SortingBatch inertBatch = catchBatchDao.getSortingBatch(speciesBatch.getChildBatchs(),
@@ -122,7 +118,7 @@
"pmfmId", enumeration.PMFM_ID_SORTING_TYPE,
enumeration.QUALITATIVE_ID_SORTING_TYPE_BENTHOS);
if (benthosBatch == null) {
- addWarning(errors, n_("tutti.persistence.batch.validation.vracBenthosNotFound"));
+ addError(errors, n_("tutti.persistence.batch.validation.vracBenthosNotFound"));
} else {
// Vrac > Benthos > Inert
SortingBatch inertBatch = catchBatchDao.getSortingBatch(benthosBatch.getChildBatchs(),
@@ -156,6 +152,7 @@
addWarning(errors, n_("tutti.persistence.batch.validation.horsVracSpeciesNotFound"));
}
+ // Hors Vrac > Benthos
SortingBatch benthosBatch = catchBatchDao.getSortingBatch(horsVracBatch.getChildBatchs(),
"pmfmId", enumeration.PMFM_ID_SORTING_TYPE,
enumeration.QUALITATIVE_ID_SORTING_TYPE_BENTHOS);
@@ -172,118 +169,14 @@
if (unsortedBatch == null) {
addWarning(errors, n_("tutti.persistence.batch.validation.unsortedNotFound"));
}
-
- // May be, the tree is an old structure
- if (vracBatch == null && horsVracBatch == null && unsortedBatch == null) {
- boolean allBatchHasSpecies = true;
- boolean allBatchHasVrac = true;
- boolean someBatchHasSortingMeasurement = false;
- for (Batch batch1 : batchs) {
- SortingBatch batch = (SortingBatch) batch1;
- if (batch.getReferenceTaxon() == null) {
- allBatchHasSpecies = false;
- break;
- }
- if (allBatchHasVrac && batch.getSortingMeasurements() != null) {
- if (batch.getSortingMeasurements().size() > 1) {
- allBatchHasVrac = false;
- someBatchHasSortingMeasurement = true;
- } else if (batch.getSortingMeasurements().size() == 1) {
- someBatchHasSortingMeasurement = true;
- SortingMeasurement sm = batch.getSortingMeasurements().iterator().next();
- if (!enumeration.PMFM_ID_SORTED_UNSORTED.equals(sm.getPmfm().getId())
- || sm.getQualitativeValue() == null
- || !enumeration.QUALITATIVE_VRAC_ID.equals(sm.getQualitativeValue().getId())) {
- allBatchHasVrac = false;
- }
- }
- }
- }
- if (allBatchHasSpecies && !someBatchHasSortingMeasurement) {
- errors.clear();
- addError(errors,
- n_("tutti.persistence.batch.validation.onlySpeciesBatchStructure"),
- null);
-
- } else if (allBatchHasSpecies && allBatchHasVrac) {
- errors.clear();
- addError(errors,
- n_("tutti.persistence.batch.validation.onlySpeciesBatchStructure"),
- null);
- }
- }
}
-// /**
-// * Repair tree batch, when only species have been found under the cacth batch.
-// * This append typically with CGFS cruise.
-// *
-// * @param catchBatch
-// * @return
-// */
-// protected CatchBatch repairHistoricalData(CatchBatch catchBatch,
-// boolean batchHasVracSortingMeasurement) {
-// Preconditions.checkNotNull(catchBatch);
-// Preconditions.checkNotNull(catchBatch.getId());
-// Preconditions.checkNotNull(catchBatch.getFishingOperation());
-// Preconditions.checkNotNull(catchBatch.getFishingOperation().getId());
-//
-// // Copy catch batch children
-// Collection<Batch> speciesBatchChilds = Sets.newHashSet();
-// speciesBatchChilds.addAll(catchBatch.getChildBatchs());
-// catchBatch.setChildBatchs(new HashSet<Batch>());
-//
-// // Clean catch batch
-// batchService.cleanEntity(catchBatch, true);
-//
-// SortingBatch speciesBatch = catchBatchDao.getSortingBatch(catchBatch.getChildBatchs(),
-// "pmfmId", enumeration.PMFM_ID_SORTED_UNSORTED, enumeration.QUALITATIVE_VRAC_ID,
-// "pmfmId", enumeration.PMFM_ID_SORTING_TYPE, enumeration.QUALITATIVE_ID_SORTING_TYPE_SPECIES);
-// if (speciesBatch == null) {
-// throw new DataIntegrityViolationException("Invalid batch tree format. Could not retrieve 'Vrac>Species' batch.");
-// }
-//
-// // For all species batch : set the batch 'Vrac>Species' as new parent
-// for (Batch speciesBatchChild : speciesBatchChilds) {
-// SortingBatch batch = (SortingBatch) speciesBatchChild;
-// batch.setParentBatch(speciesBatch);
-//
-// if (batchHasVracSortingMeasurement) {
-// // Remove redundant 'Vrac' sorting measurement
-// SortingMeasurement sm = catchBatchDao.getSortingMeasurement(batch, enumeration.PMFM_ID_SORTED_UNSORTED, null, false);
-// batch.getSortingMeasurements().remove(sm);
-// }
-//
-// batch.setExhaustiveInventory(Boolean.TRUE);
-//
-// // Add an offset into the rank order, because of special batchs 'Biota' (=live) and 'Inert'
-// short rankOrder = (short) (batch.getRankOrder() + 2);
-// batch.setRankOrder(rankOrder);
-//
-// //FIXME-TC We should do nothing with this: this is not our problem...
-// //TODO What to do with weird comments! categorie_individu
-// // Reset comments if set to "taxon"
-// if (batch.getComments() != null && "taxon".equals(batch.getComments())) {
-// batch.setComments(null);
-// }
-//
-// speciesBatch.getChildBatchs().add(batch);
-// }
-//
-// // Save mofidifications :
-// catchBatchDao.update(catchBatch);
-//
-// return catchBatch;
-// }
-
protected void addError(List<CatchBatchValidationError> errors,
- String messageKey,
- CatchBatchQuickFix quickFix) {
+ String messageKey) {
CatchBatchValidationError error = new CatchBatchValidationError(
messageKey,
_(messageKey),
CatchBatchValidationError.GRAVITY_ERROR);
- error.setQuickFixes(Lists.newArrayList(quickFix));
errors.add(error);
}
Modified: trunk/tutti-persistence/src/main/resources/tutti-db-enumerations.properties
===================================================================
--- trunk/tutti-persistence/src/main/resources/tutti-db-enumerations.properties 2013-03-28 15:34:45 UTC (rev 709)
+++ trunk/tutti-persistence/src/main/resources/tutti-db-enumerations.properties 2013-03-29 00:30:05 UTC (rev 710)
@@ -379,7 +379,7 @@
QualitativeValueId.SORTING_TYPE_SPECIES=2147
QualitativeValueId.SORTING_TYPE_BENTHOS=2148
QualitativeValueId.SORTING_TYPE_PLANCTON=2149
-QualitativeValueId.SORTING_TYPE_MACRO_WASTE=2150
+QualitativeValueId.SORTING_TYPE_MARINE_LITTER=2150
QualitativeValueId.SORTING_TYPE_ACCIDENTAL_CATCH=2151
Modified: trunk/tutti-persistence/src/main/xmi/tutti-persistence.properties
===================================================================
--- trunk/tutti-persistence/src/main/xmi/tutti-persistence.properties 2013-03-28 15:34:45 UTC (rev 709)
+++ trunk/tutti-persistence/src/main/xmi/tutti-persistence.properties 2013-03-29 00:30:05 UTC (rev 710)
@@ -33,7 +33,7 @@
fr.ifremer.tutti.persistence.entities.data.Cruise.attribute.headOfSortRoom.stereotype=ordered
fr.ifremer.tutti.persistence.entities.data.FishingOperation.attribute.recorderPerson.stereotype=ordered
-fr.ifremer.tutti.persistence.entities.data.MacroWasteBatch.attribute.macroWasteCategory.stereotype=ordered
+fr.ifremer.tutti.persistence.entities.data.MarineLitterBatch.attribute.marineLitterCategory.stereotype=ordered
fr.ifremer.tutti.persistence.entities.data.SpeciesBatch.attribute.childBatchs.stereotype=ordered
fr.ifremer.tutti.persistence.entities.protocol.TuttiProtocol.attribute.gearUseFeaturePmfmId.stereotype=ordered
Modified: trunk/tutti-persistence/src/main/xmi/tutti-persistence.zargo
===================================================================
(Binary files differ)
Deleted: trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/MacroWasteBatchPersistenceServiceReadTest.java
===================================================================
--- trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/MacroWasteBatchPersistenceServiceReadTest.java 2013-03-28 15:34:45 UTC (rev 709)
+++ trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/MacroWasteBatchPersistenceServiceReadTest.java 2013-03-29 00:30:05 UTC (rev 710)
@@ -1,62 +0,0 @@
-package fr.ifremer.tutti.persistence.service;
-
-/*
- * #%L
- * Tutti :: Persistence API
- * $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.DatabaseResource;
-import org.junit.Before;
-import org.junit.ClassRule;
-import org.junit.Ignore;
-import org.junit.Test;
-
-/**
- * To test {@link MacroWasteBatchPersistenceService} for read operation.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.3
- */
-@Ignore
-public class MacroWasteBatchPersistenceServiceReadTest {
-
- @ClassRule
- public static final DatabaseResource dbResource = DatabaseResource.readDb();
-
- protected MacroWasteBatchPersistenceService service;
-
- @Before
- public void setUp() throws Exception {
- service = TuttiPersistenceServiceLocator.getMacroWasteBatchPersistenceService();
- }
-
- @Test
- public void getAllMacroWasteBatch(/*String fishingOperationId*/) {
-
- }
-
- @Test
- public void getMacroWasteBatch(/*String id*/) {
-
- }
-
-}
Deleted: trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/MacroWasteBatchPersistenceServiceWriteTest.java
===================================================================
--- trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/MacroWasteBatchPersistenceServiceWriteTest.java 2013-03-28 15:34:45 UTC (rev 709)
+++ trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/MacroWasteBatchPersistenceServiceWriteTest.java 2013-03-29 00:30:05 UTC (rev 710)
@@ -1,65 +0,0 @@
-package fr.ifremer.tutti.persistence.service;
-
-/*
- * #%L
- * Tutti :: Persistence API
- * $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.DatabaseResource;
-import org.junit.Before;
-import org.junit.ClassRule;
-import org.junit.Ignore;
-import org.junit.Test;
-
-/**
- * To test {@link MacroWasteBatchPersistenceService} for write operation.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.3
- */
-@Ignore
-public class MacroWasteBatchPersistenceServiceWriteTest {
-
- @ClassRule
- public static final DatabaseResource dbResource = DatabaseResource.writeDb();
-
- protected MacroWasteBatchPersistenceService service;
-
- @Before
- public void setUp() throws Exception {
- service = TuttiPersistenceServiceLocator.getMacroWasteBatchPersistenceService();
- }
-
- @Test
- public void createMacroWasteBatch(/*MacroWasteBatch bean*/) {
-
- }
-
- @Test
- public void saveMacroWasteBatch(/*MacroWasteBatch bean*/) {
-
- }
-
- @Test
- public void deleteMacroWasteBatch(/*String id*/) {
- }
-}
Copied: trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/MarineLitterBatchPersistenceServiceReadTest.java (from rev 709, trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/MacroWasteBatchPersistenceServiceReadTest.java)
===================================================================
--- trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/MarineLitterBatchPersistenceServiceReadTest.java (rev 0)
+++ trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/MarineLitterBatchPersistenceServiceReadTest.java 2013-03-29 00:30:05 UTC (rev 710)
@@ -0,0 +1,56 @@
+package fr.ifremer.tutti.persistence.service;
+
+/*
+ * #%L
+ * Tutti :: Persistence API
+ * $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.DatabaseResource;
+import org.junit.Before;
+import org.junit.ClassRule;
+import org.junit.Ignore;
+import org.junit.Test;
+
+/**
+ * To test {@link MarineLitterBatchPersistenceService} for read operation.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+@Ignore
+public class MarineLitterBatchPersistenceServiceReadTest {
+
+ @ClassRule
+ public static final DatabaseResource dbResource = DatabaseResource.readDb();
+
+ protected MarineLitterBatchPersistenceService service;
+
+ @Before
+ public void setUp() throws Exception {
+ service = TuttiPersistenceServiceLocator.getMarineLitterBatchPersistenceService();
+ }
+
+ @Test
+ public void getAllRootMarineLitterBatch(/*String fishingOperationId*/) {
+
+ }
+}
Copied: trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/MarineLitterBatchPersistenceServiceWriteTest.java (from rev 709, trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/MacroWasteBatchPersistenceServiceWriteTest.java)
===================================================================
--- trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/MarineLitterBatchPersistenceServiceWriteTest.java (rev 0)
+++ trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/MarineLitterBatchPersistenceServiceWriteTest.java 2013-03-29 00:30:05 UTC (rev 710)
@@ -0,0 +1,65 @@
+package fr.ifremer.tutti.persistence.service;
+
+/*
+ * #%L
+ * Tutti :: Persistence API
+ * $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.DatabaseResource;
+import org.junit.Before;
+import org.junit.ClassRule;
+import org.junit.Ignore;
+import org.junit.Test;
+
+/**
+ * To test {@link MarineLitterBatchPersistenceService} for write operation.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+@Ignore
+public class MarineLitterBatchPersistenceServiceWriteTest {
+
+ @ClassRule
+ public static final DatabaseResource dbResource = DatabaseResource.writeDb();
+
+ protected MarineLitterBatchPersistenceService service;
+
+ @Before
+ public void setUp() throws Exception {
+ service = TuttiPersistenceServiceLocator.getMarineLitterBatchPersistenceService();
+ }
+
+ @Test
+ public void createMarineLitterBatch(/*MarineLitterBatch bean*/) {
+
+ }
+
+ @Test
+ public void saveMarineLitterBatch(/*MarineLitterBatch bean*/) {
+
+ }
+
+ @Test
+ public void deleteMarineLitterBatch(/*String id*/) {
+ }
+}
Modified: trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceServiceReadTest.java
===================================================================
--- trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceServiceReadTest.java 2013-03-28 15:34:45 UTC (rev 709)
+++ trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceServiceReadTest.java 2013-03-29 00:30:05 UTC (rev 710)
@@ -273,13 +273,13 @@
@Test
public void getMacroWasteCategoryCaracteristic() {
- Caracteristic result = service.getMacroWasteCategoryCaracteristic();
+ Caracteristic result = service.getMarineLitterCategoryCaracteristic();
assertCaracteristicQualitative(result, 21);
}
@Test
public void getMacroWasteSizeCategoryCaracteristic() {
- Caracteristic result = service.getMacroWasteSizeCategoryCaracteristic();
+ Caracteristic result = service.getMarineLitterSizeCategoryCaracteristic();
assertCaracteristicQualitative(result, 6);
}
Modified: trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/synchro/ReferentialSynchronizeHelperTest.java
===================================================================
--- trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/synchro/ReferentialSynchronizeHelperTest.java 2013-03-28 15:34:45 UTC (rev 709)
+++ trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/synchro/ReferentialSynchronizeHelperTest.java 2013-03-29 00:30:05 UTC (rev 710)
@@ -188,10 +188,10 @@
getLastUpdateDate(TuttiTable.GEAR, internalDb, getSqlDate(2012, 12, 18));
getLastUpdateDate(TuttiTable.LOCATION_CLASSIFICATION, internalDb, getSqlDate(2010, 10, 26));
getLastUpdateDate(TuttiTable.LOCATION_LEVEL, internalDb, getSqlDate(2013, 1, 28));
- getLastUpdateDate(TuttiTable.LOCATION, internalDb, getSqlDate(2013, 2, 27));
+ getLastUpdateDate(TuttiTable.LOCATION, internalDb, getSqlDate(2013, 3, 29));
getLastUpdateDate(TuttiTable.TAXONOMIC_LEVEL, internalDb, getSqlDate(2012, 4, 18));
getLastUpdateDate(TuttiTable.REFERENCE_TAXON, internalDb, getSqlDate(2013, 1, 21));
- getLastUpdateDate(TuttiTable.TAXON_NAME, internalDb, getSqlDate(2013, 2, 26));
+ getLastUpdateDate(TuttiTable.TAXON_NAME, internalDb, getSqlDate(2013, 3, 29));
getLastUpdateDate(TuttiTable.TAXON_GROUP_TYPE, internalDb, getSqlDate(2012, 5, 24));
getLastUpdateDate(TuttiTable.TAXON_GROUP, internalDb, getSqlDate(2013, 1, 16));
getLastUpdateDate(TuttiTable.ROUND_WEIGHT_CONVERSION, internalDb, getSqlDate(2012, 10, 4));
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-03-28 15:34:45 UTC (rev 709)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/DecoratorService.java 2013-03-29 00:30:05 UTC (rev 710)
@@ -158,7 +158,7 @@
n_("tutti.property.species");
n_("tutti.property.genusSpecies");
n_("tutti.property.sortedUnsortedCategory");
- n_("tutti.property.macroWasteCategory");
+ n_("tutti.property.marineLitterCategory");
n_("tutti.property.attachment");
n_("tutti.property.multirigAggregation");
n_("tutti.property.caracteristic");
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-03-28 15:34:45 UTC (rev 709)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java 2013-03-29 00:30:05 UTC (rev 710)
@@ -37,7 +37,7 @@
import fr.ifremer.tutti.persistence.entities.data.CatchBatch;
import fr.ifremer.tutti.persistence.entities.data.Cruise;
import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
-import fr.ifremer.tutti.persistence.entities.data.MacroWasteBatch;
+import fr.ifremer.tutti.persistence.entities.data.MarineLitterBatch;
import fr.ifremer.tutti.persistence.entities.data.PlanktonBatch;
import fr.ifremer.tutti.persistence.entities.data.Program;
import fr.ifremer.tutti.persistence.entities.data.SpeciesBatch;
@@ -403,13 +403,13 @@
}
@Override
- public Caracteristic getMacroWasteCategoryCaracteristic() {
- return driver.getMacroWasteCategoryCaracteristic();
+ public Caracteristic getMarineLitterCategoryCaracteristic() {
+ return driver.getMarineLitterCategoryCaracteristic();
}
@Override
- public Caracteristic getMacroWasteSizeCategoryCaracteristic() {
- return driver.getMacroWasteSizeCategoryCaracteristic();
+ public Caracteristic getMarineLitterSizeCategoryCaracteristic() {
+ return driver.getMarineLitterSizeCategoryCaracteristic();
}
@Override
@@ -752,29 +752,25 @@
//-- Macrodechet Batch methods --//
//------------------------------------------------------------------------//
- @Override
- public List<MacroWasteBatch> getAllMacroWasteBatch(String fishingOperationId) {
- return driver.getAllMacroWasteBatch(fishingOperationId);
- }
@Override
- public MacroWasteBatch getMacroWasteBatch(String id) {
- return driver.getMacroWasteBatch(id);
+ public BatchContainer<MarineLitterBatch> getRootMarineLitterBatch(String fishingOperationId) {
+ return driver.getRootMarineLitterBatch(fishingOperationId);
}
@Override
- public MacroWasteBatch createMacroWasteBatch(MacroWasteBatch bean) {
- return driver.createMacroWasteBatch(bean);
+ public MarineLitterBatch createMarineLitterBatch(MarineLitterBatch bean) {
+ return driver.createMarineLitterBatch(bean);
}
@Override
- public MacroWasteBatch saveMacroWasteBatch(MacroWasteBatch bean) {
- return driver.saveMacroWasteBatch(bean);
+ public MarineLitterBatch saveMarineLitterBatch(MarineLitterBatch bean) {
+ return driver.saveMarineLitterBatch(bean);
}
@Override
- public void deleteMacroWasteBatch(String id) {
- driver.deleteMacroWasteBatch(id);
+ public void deleteMarineLitterBatch(String id) {
+ driver.deleteMarineLitterBatch(id);
}
//------------------------------------------------------------------------//
Modified: trunk/tutti-service/src/main/resources/i18n/tutti-service_en_GB.properties
===================================================================
--- trunk/tutti-service/src/main/resources/i18n/tutti-service_en_GB.properties 2013-03-28 15:34:45 UTC (rev 709)
+++ trunk/tutti-service/src/main/resources/i18n/tutti-service_en_GB.properties 2013-03-29 00:30:05 UTC (rev 710)
@@ -22,7 +22,7 @@
tutti.property.internationalRegistrationCode=
tutti.property.label=
tutti.property.lastName=
-tutti.property.macroWasteCategory=
+tutti.property.marineLitterCategory=
tutti.property.matrixName=
tutti.property.methodName=
tutti.property.multirigAggregation=
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-03-28 15:34:45 UTC (rev 709)
+++ trunk/tutti-service/src/main/resources/i18n/tutti-service_fr_FR.properties 2013-03-29 00:30:05 UTC (rev 710)
@@ -22,7 +22,7 @@
tutti.property.internationalRegistrationCode=Immatriculation internationale (ou nationale si non trouvée)
tutti.property.label=Code
tutti.property.lastName=Nom de Famille
-tutti.property.macroWasteCategory=Type de macro déchet
+tutti.property.marineLitterCategory=Type de macro déchet
tutti.property.matrixName=Support
tutti.property.methodName=Méthode
tutti.property.multirigAggregation=Numéro de poche
Modified: trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-en.properties
===================================================================
--- trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-en.properties 2013-03-28 15:34:45 UTC (rev 709)
+++ trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-en.properties 2013-03-29 00:30:05 UTC (rev 710)
@@ -61,7 +61,7 @@
tutti.editCatchBatch.field.catchTotalSortedWeight.help=editCatchBatch.html\#fields
tutti.editCatchBatch.field.catchTotalUnsortedWeight.help=editCatchBatch.html\#fields
tutti.editCatchBatch.field.catchTotalWeight.help=editCatchBatch.html\#fields
-tutti.editCatchBatch.field.macroWasteTotalWeight.help=editCatchBatch.html\#fields
+tutti.editCatchBatch.field.marineLitterTotalWeight.help=editCatchBatch.html\#fields
tutti.editCatchBatch.field.speciesTotalSampleSortedWeight.help=editCatchBatch.html\#fields
tutti.editCatchBatch.field.speciesTotalSortedWeight.help=editCatchBatch.html\#fields
tutti.editCatchBatch.field.speciesTotalUnsortedWeight.help=editCatchBatch.html\#fields
@@ -239,5 +239,5 @@
tutti.splitSpeciesBatch.help=splitSpeciesBatch.html
tuttihelp.config.help=config.help
tuttihelp.editAccidentalBatch.help=editAccidentalBatch.html
-tuttihelp.editMacroWasteBatch.help=editMacroWasteBatch.html
+tuttihelp.editMarineLitterBatch.help=editMarineLitterBatch.html
tuttihelp.editPlanktonBatch.help=editPlanktonBatch.html
Modified: trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-fr.properties
===================================================================
--- trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-fr.properties 2013-03-28 15:34:45 UTC (rev 709)
+++ trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-fr.properties 2013-03-29 00:30:05 UTC (rev 710)
@@ -70,7 +70,7 @@
tutti.editCatchBatch.field.catchTotalSortedWeight.help=editCatchBatch.html\#fields
tutti.editCatchBatch.field.catchTotalUnsortedWeight.help=editCatchBatch.html\#fields
tutti.editCatchBatch.field.catchTotalWeight.help=editCatchBatch.html\#fields
-tutti.editCatchBatch.field.macroWasteTotalWeight.help=editCatchBatch.html\#fields
+tutti.editCatchBatch.field.marineLitterTotalWeight.help=editCatchBatch.html\#fields
tutti.editCatchBatch.field.speciesTotalSampleSortedWeight.help=editCatchBatch.html\#fields
tutti.editCatchBatch.field.speciesTotalSortedWeight.help=editCatchBatch.html\#fields
tutti.editCatchBatch.field.speciesTotalUnsortedWeight.help=editCatchBatch.html\#fields
@@ -248,5 +248,5 @@
tutti.splitSpeciesBatch.help=splitSpeciesBatch.html
tuttihelp.config.help=config.help
tuttihelp.editAccidentalBatch.help=editAccidentalBatch.html
-tuttihelp.editMacroWasteBatch.help=editMacroWasteBatch.html
+tuttihelp.editMarineLitterBatch.help=editMarineLitterBatch.html
tuttihelp.editPlanktonBatch.help=editPlanktonBatch.html
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationAction.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationAction.java 2013-03-28 15:34:45 UTC (rev 709)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationAction.java 2013-03-29 00:30:05 UTC (rev 710)
@@ -558,7 +558,7 @@
ui.getSpeciesTabFishingOperationReminderLabel().setTitle(fishingOperationText);
ui.getBenthosTabFishingOperationReminderLabel().setTitle(fishingOperationText);
// ui.getPlanktonTabFishingOperationReminderLabel().setTitle(fishingOperationText);
-// ui.getMacroWasteTabFishingOperationReminderLabel().setTitle(fishingOperationText);
+// ui.getMarineLitterTabFishingOperationReminderLabel().setTitle(fishingOperationText);
// ui.getAccidentalTabFishingOperationReminderLabel().setTitle(fishingOperationText);
if (loadOtherTabs) {
@@ -568,7 +568,7 @@
ui.getSpeciesTabContent().getHandler().selectFishingOperation(batch == null ? null : bean);
ui.getBenthosTabContent().getHandler().selectFishingOperation(batch == null ? null : bean);
// ui.getPlanktonTabContent().getHandler().selectFishingOperation(bean);
-// ui.getMacroWasteTabContent().getHandler().selectFishingOperation(bean);
+// ui.getMarineLitterTabContent().getHandler().selectFishingOperation(bean);
// ui.getAccidentalTabContent().getHandler().selectFishingOperation(bean);
}
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-03-28 15:34:45 UTC (rev 709)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.css 2013-03-29 00:30:05 UTC (rev 710)
@@ -264,19 +264,19 @@
}
-#macroWasteTable {
- border: {BorderFactory.createTitledBorder(_("tutti.editCatchBatch.legend.macroWaste"))};
+#marineLitterTable {
+ border: {BorderFactory.createTitledBorder(_("tutti.editCatchBatch.legend.marineLitter"))};
}
-#macroWasteTotalWeightLabel {
- text: "tutti.editCatchBatch.field.macroWasteTotalWeight";
- toolTipText: {"tutti.editCatchBatch.field.macroWasteTotalWeight.tip"};
- labelFor: {macroWasteTotalWeightField};
+#marineLitterTotalWeightLabel {
+ text: "tutti.editCatchBatch.field.marineLitterTotalWeight";
+ toolTipText: {"tutti.editCatchBatch.field.marineLitterTotalWeight.tip"};
+ labelFor: {marineLitterTotalWeightField};
_strongStyle: true;
- _help: {"tutti.editCatchBatch.field.macroWasteTotalWeight.help"};
+ _help: {"tutti.editCatchBatch.field.marineLitterTotalWeight.help"};
}
-#macroWasteTotalWeightField {
+#marineLitterTotalWeightField {
_computed: true;
}
@@ -284,7 +284,7 @@
enabled: {false};
}
-#macroWasteTab {
+#marineLitterTab {
enabled: {false};
}
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-03-28 15:34:45 UTC (rev 709)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.jaxx 2013-03-29 00:30:05 UTC (rev 710)
@@ -33,7 +33,7 @@
fr.ifremer.tutti.ui.swing.content.operation.catches.benthos.frequency.BenthosFrequencyUI
fr.ifremer.tutti.ui.swing.content.operation.catches.benthos.create.CreateBenthosBatchUI
fr.ifremer.tutti.ui.swing.content.operation.catches.benthos.split.SplitBenthosBatchUI
- fr.ifremer.tutti.ui.swing.content.operation.catches.macrowaste.MacroWasteBatchUI
+ fr.ifremer.tutti.ui.swing.content.operation.catches.marinelitter.MarineLitterBatchUI
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.frequency.SpeciesFrequencyUI
@@ -88,8 +88,8 @@
<field name='benthosTotalSortedWeight'
component='benthosTotalSortedWeightField'/>
- <field name='macroWasteTotalWeight'
- component='macroWasteTotalWeightField'/>
+ <field name='marineLitterTotalWeight'
+ component='marineLitterTotalWeightField'/>
</BeanValidator>
<CardLayout2Ext id='speciesTabPanelLayout'
@@ -280,15 +280,15 @@
</row>
<row>
<cell columns='2'>
- <Table id='macroWasteTable' fill='both'>
+ <Table id='marineLitterTable' fill='both'>
<!-- Poids total Macro dechet -->
<row>
<cell anchor='west'>
- <JLabel id='macroWasteTotalWeightLabel'/>
+ <JLabel id='marineLitterTotalWeightLabel'/>
</cell>
<cell weightx='1.0'>
- <JTextField id='macroWasteTotalWeightField'/>
+ <JTextField id='marineLitterTotalWeightField'/>
</cell>
</row>
@@ -352,9 +352,9 @@
<PlanktonBatchUI id='planktonTabContent' constructorParams='this'/>
</JXTitledPanel-->
</tab>
- <tab id='macroWasteTab' title='tutti.label.tab.macroDechet'>
- <!--JXTitledPanel id='macroWasteTabFishingOperationReminderLabel'>
- <MacroWasteBatchUI id='macroWasteTabContent' constructorParams='this'/>
+ <tab id='marineLitterTab' title='tutti.label.tab.marineLitter'>
+ <!--JXTitledPanel id='marineLitterTabFishingOperationReminderLabel'>
+ <MarineLitterBatchUI id='marineLitterTabContent' constructorParams='this'/>
</JXTitledPanel-->
</tab>
<tab id='accidentalTab' title='tutti.label.tab.accidentel'>
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-03-28 15:34:45 UTC (rev 709)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIHandler.java 2013-03-29 00:30:05 UTC (rev 710)
@@ -142,7 +142,7 @@
closeUI(ui.getSpeciesTabContent());
closeUI(ui.getBenthosTabContent());
// closeUI(ui.getPlanktonTabContent());
-// closeUI(ui.getMacroWasteTabContent());
+// closeUI(ui.getMarineLitterTabContent());
// closeUI(ui.getAccidentalTabContent());
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIModel.java 2013-03-28 15:34:45 UTC (rev 709)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIModel.java 2013-03-29 00:30:05 UTC (rev 710)
@@ -110,7 +110,7 @@
public static final String PROPERTY_PLANKTON_TOTAL_SAMPLE_WEIGHT = "planktonTotalSampleWeight";
- public static final String PROPERTY_MACRO_WASTE_TOTAL_WEIGHT = "macroWasteTotalWeight";
+ public static final String PROPERTY_MARINE_LITTER_TOTAL_WEIGHT = "marineLitterTotalWeight";
public static final String PROPERTY_FISHING_OPERATION = "fishingOperation";
@@ -148,7 +148,7 @@
protected Float planktonTotalSampleWeight;
- protected Float macroWasteTotalWeight;
+ protected Float marineLitterTotalWeight;
protected TuttiComputedOrNotData<Float> catchTotalComputedOrNotWeight
= new TuttiComputedOrNotData<Float>();
@@ -561,17 +561,17 @@
}
//------------------------------------------------------------------------//
- //-- Macro Waste --//
+ //-- Marine Litter --//
//------------------------------------------------------------------------//
- public Float getMacroWasteTotalWeight() {
- return macroWasteTotalWeight;
+ public Float getMarineLitterTotalWeight() {
+ return marineLitterTotalWeight;
}
- public void setMacroWasteTotalWeight(Float macroWasteTotalWeight) {
- Object oldValue = getMacroWasteTotalWeight();
- this.macroWasteTotalWeight = macroWasteTotalWeight;
- firePropertyChange(PROPERTY_MACRO_WASTE_TOTAL_WEIGHT, oldValue, macroWasteTotalWeight);
+ public void setMarineLitterTotalWeight(Float marineLitterTotalWeight) {
+ Object oldValue = getMarineLitterTotalWeight();
+ this.marineLitterTotalWeight = marineLitterTotalWeight;
+ firePropertyChange(PROPERTY_MARINE_LITTER_TOTAL_WEIGHT, oldValue, marineLitterTotalWeight);
}
//------------------------------------------------------------------------//
Deleted: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/macrowaste/MacroWasteBatchRowModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/macrowaste/MacroWasteBatchRowModel.java 2013-03-28 15:34:45 UTC (rev 709)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/macrowaste/MacroWasteBatchRowModel.java 2013-03-29 00:30:05 UTC (rev 710)
@@ -1,216 +0,0 @@
-package fr.ifremer.tutti.ui.swing.content.operation.catches.macrowaste;
-
-/*
- * #%L
- * Tutti :: UI
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2012 Ifremer
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-import com.google.common.collect.Lists;
-import fr.ifremer.tutti.persistence.entities.data.AttachementObjectTypeEnum;
-import fr.ifremer.tutti.persistence.entities.data.Attachment;
-import fr.ifremer.tutti.persistence.entities.data.MacroWasteBatch;
-import fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue;
-import fr.ifremer.tutti.ui.swing.util.AbstractTuttiBeanUIModel;
-import fr.ifremer.tutti.ui.swing.util.attachment.AttachmentModelAware;
-import fr.ifremer.tutti.ui.swing.util.comment.CommentModelAware;
-import org.nuiton.util.beans.Binder;
-import org.nuiton.util.beans.BinderFactory;
-
-import java.util.Collection;
-import java.util.List;
-
-/**
- * Define a benthos batch row.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.2
- */
-public class MacroWasteBatchRowModel extends AbstractTuttiBeanUIModel<MacroWasteBatch, MacroWasteBatchRowModel> implements AttachmentModelAware, CommentModelAware {
-
- private static final long serialVersionUID = 1L;
-
- public static final String PROPERTY_MACRO_WASTE_CATEGORY = "macroWasteCategory";
-
- public static final String PROPERTY_MACRO_WASTE_SIZE_CATEGORY = "macroWasteSizeCategory";
-
- public static final String PROPERTY_WEIGHT = "weight";
-
- public static final String PROPERTY_NUMBER = "number";
-
- /**
- * MacroWaste category.
- *
- * @since 0.2
- */
- protected CaracteristicQualitativeValue macroWasteCategory;
-
- /**
- * MacroWaste size category.
- *
- * @since 0.3
- */
- protected CaracteristicQualitativeValue macroWasteSizeCategory;
-
- /**
- * Observed weight.
- *
- * @since 0.2
- */
- protected Float weight;
-
- /**
- * Observed number.
- *
- * @since 0.3
- */
- protected Integer number;
-
- /**
- * Comment on this batch.
- *
- * @since 0.2
- */
- protected String comment;
-
- /**
- * Attachments (should never be null).
- *
- * @since 0.2
- */
- protected final List<Attachment> attachment = Lists.newArrayList();
-
- protected static final Binder<MacroWasteBatch, MacroWasteBatchRowModel> fromBeanBinder =
- BinderFactory.newBinder(MacroWasteBatch.class,
- MacroWasteBatchRowModel.class);
-
- protected static final Binder<MacroWasteBatchRowModel, MacroWasteBatch> toBeanBinder =
- BinderFactory.newBinder(MacroWasteBatchRowModel.class,
- MacroWasteBatch.class);
-
- public MacroWasteBatchRowModel() {
- super(MacroWasteBatch.class, fromBeanBinder, toBeanBinder);
- }
-
- public MacroWasteBatchRowModel(MacroWasteBatch aBatch) {
- this();
- fromBean(aBatch);
- }
-
- public CaracteristicQualitativeValue getMacroWasteCategory() {
- return macroWasteCategory;
- }
-
- public void setMacroWasteCategory(CaracteristicQualitativeValue macroWasteCategory) {
- Object oldValue = getMacroWasteCategory();
- this.macroWasteCategory = macroWasteCategory;
- firePropertyChange(PROPERTY_MACRO_WASTE_CATEGORY, oldValue, macroWasteCategory);
- }
-
- public CaracteristicQualitativeValue getMacroWasteSizeCategory() {
- return macroWasteSizeCategory;
- }
-
- public void setMacroWasteSizeCategory(CaracteristicQualitativeValue macroWasteSizeCategory) {
- Object oldValue = getMacroWasteSizeCategory();
- this.macroWasteSizeCategory = macroWasteSizeCategory;
- firePropertyChange(PROPERTY_MACRO_WASTE_SIZE_CATEGORY, oldValue, macroWasteSizeCategory);
- }
-
- public Float getWeight() {
- return weight;
- }
-
- public void setWeight(Float weight) {
- Object oldValue = getWeight();
- this.weight = weight;
- firePropertyChange(PROPERTY_WEIGHT, oldValue, weight);
- }
-
- public Integer getNumber() {
- return number;
- }
-
- public void setNumber(Integer number) {
- Object oldValue = getNumber();
- this.number = number;
- firePropertyChange(PROPERTY_NUMBER, oldValue, number);
- }
-
- //------------------------------------------------------------------------//
- //-- CommentModelAware --//
- //------------------------------------------------------------------------//
-
- @Override
- public String getComment() {
- return comment;
- }
-
- @Override
- public void setComment(String comment) {
- Object oldValue = getComment();
- this.comment = comment;
- firePropertyChange(PROPERTY_COMMENT, oldValue, comment);
- }
-
- //------------------------------------------------------------------------//
- //-- AttachmentModelAware --//
- //------------------------------------------------------------------------//
-
- @Override
- public AttachementObjectTypeEnum getObjectType() {
- return AttachementObjectTypeEnum.SAMPLE;
- }
-
- @Override
- public String getObjectId() {
- return getId();
- }
-
- @Override
- public List<Attachment> getAttachment() {
- return attachment;
- }
-
- @Override
- public void addAllAttachment(Collection<Attachment> attachments) {
- this.attachment.addAll(attachments);
- firePropertyChange(PROPERTY_ATTACHMENT, null, getAttachment());
- }
-
- @Override
- public void addAttachment(Attachment attachment) {
- this.attachment.add(attachment);
- firePropertyChange(PROPERTY_ATTACHMENT, null, getAttachment());
- }
-
- @Override
- public void removeAllAttachment(Collection<Attachment> attachments) {
- this.attachment.removeAll(attachments);
- firePropertyChange(PROPERTY_ATTACHMENT, null, getAttachment());
- }
-
- @Override
- public void removeAttachment(Attachment attachment) {
- this.attachment.remove(attachment);
- firePropertyChange(PROPERTY_ATTACHMENT, null, getAttachment());
- }
-}
Deleted: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/macrowaste/MacroWasteBatchTableModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/macrowaste/MacroWasteBatchTableModel.java 2013-03-28 15:34:45 UTC (rev 709)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/macrowaste/MacroWasteBatchTableModel.java 2013-03-29 00:30:05 UTC (rev 710)
@@ -1,86 +0,0 @@
-package fr.ifremer.tutti.ui.swing.content.operation.catches.macrowaste;
-
-/*
- * #%L
- * Tutti :: UI
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2012 Ifremer
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-import fr.ifremer.tutti.ui.swing.util.table.AbstractTuttiTableModel;
-import fr.ifremer.tutti.ui.swing.util.table.ColumnIdentifier;
-import org.jdesktop.swingx.table.TableColumnModelExt;
-
-import static org.nuiton.i18n.I18n.n_;
-
-/**
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.2
- */
-public class MacroWasteBatchTableModel extends AbstractTuttiTableModel<MacroWasteBatchRowModel> {
-
- private static final long serialVersionUID = 1L;
-
- public static final ColumnIdentifier<MacroWasteBatchRowModel> MACRO_WASTE_CATEGORY = ColumnIdentifier.newId(
- MacroWasteBatchRowModel.PROPERTY_MACRO_WASTE_CATEGORY,
- n_("tutti.editMacroWasteBatch.table.header.macroWasteCategory"),
- n_("tutti.editMacroWasteBatch.table.header.macroWasteCategory"));
-
- public static final ColumnIdentifier<MacroWasteBatchRowModel> MACRO_WASTE_SIZE_CATEGORY = ColumnIdentifier.newId(
- MacroWasteBatchRowModel.PROPERTY_MACRO_WASTE_SIZE_CATEGORY,
- n_("tutti.editMacroWasteBatch.table.header.macroWasteSizeCategory"),
- n_("tutti.editMacroWasteBatch.table.header.macroWasteSizeCategory"));
-
- public static final ColumnIdentifier<MacroWasteBatchRowModel> WEIGHT = ColumnIdentifier.newId(
- MacroWasteBatchRowModel.PROPERTY_WEIGHT,
- n_("tutti.editMacroWasteBatch.table.header.weight"),
- n_("tutti.editMacroWasteBatch.table.header.weight"));
-
- public static final ColumnIdentifier<MacroWasteBatchRowModel> NUMBER = ColumnIdentifier.newId(
- MacroWasteBatchRowModel.PROPERTY_NUMBER,
- n_("tutti.editMacroWasteBatch.table.header.number"),
- n_("tutti.editMacroWasteBatch.table.header.number"));
-
- public static final ColumnIdentifier<MacroWasteBatchRowModel> COMMENT = ColumnIdentifier.newId(
- MacroWasteBatchRowModel.PROPERTY_COMMENT,
- n_("tutti.editMacroWasteBatch.table.header.comment"),
- n_("tutti.editMacroWasteBatch.table.header.comment"));
-
- public static final ColumnIdentifier<MacroWasteBatchRowModel> ATTACHMENT = ColumnIdentifier.newId(
- MacroWasteBatchRowModel.PROPERTY_ATTACHMENT,
- n_("tutti.editMacroWasteBatch.table.header.file"),
- n_("tutti.editMacroWasteBatch.table.header.file"));
-
- public MacroWasteBatchTableModel(TableColumnModelExt columnModel) {
- super(columnModel, true, true);
-
- setNoneEditableCols();
- }
-
- @Override
- public MacroWasteBatchRowModel createNewRow() {
- MacroWasteBatchRowModel result = new MacroWasteBatchRowModel();
-
- // by default empty row is not valid
- result.setValid(false);
- return result;
- }
-
-}
\ No newline at end of file
Deleted: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/macrowaste/MacroWasteBatchUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/macrowaste/MacroWasteBatchUI.css 2013-03-28 15:34:45 UTC (rev 709)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/macrowaste/MacroWasteBatchUI.css 2013-03-29 00:30:05 UTC (rev 710)
@@ -1,53 +0,0 @@
-/*
- * #%L
- * Tutti :: UI
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2012 Ifremer
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-NumberEditor {
- autoPopup: {handler.getConfig().isAutoPopupNumberEditor()};
- showPopupButton: {handler.getConfig().isShowNumberEditorButton()};
- bean: {model};
- showReset: true;
-}
-
-#editMacroWasteBatchTopPanel {
- _help: {"tuttihelp.editMacroWasteBatch.help"};
-}
-
-#macroWasteTotalWeightLabel {
- text: "tutti.editCatchBatch.field.macroWasteTotalWeight";
- labelFor: {macroWasteTotalWeightField};
-}
-
-#macroWasteTotalWeightField {
- property: macroWasteTotalWeight;
- model: {model.getMacroWasteTotalWeight()};
- useFloat: false;
- numberPattern: {INT_6_DIGITS_PATTERN};
-}
-
-#table {
- selectionMode: {ListSelectionModel.SINGLE_SELECTION};
- selectionBackground: {null};
- selectionForeground: {Color.BLACK};
- sortable: false;
-}
Deleted: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/macrowaste/MacroWasteBatchUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/macrowaste/MacroWasteBatchUI.jaxx 2013-03-28 15:34:45 UTC (rev 709)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/macrowaste/MacroWasteBatchUI.jaxx 2013-03-29 00:30:05 UTC (rev 710)
@@ -1,88 +0,0 @@
-<!--
- #%L
- Tutti :: UI
- $Id$
- $HeadURL$
- %%
- Copyright (C) 2012 Ifremer
- %%
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as
- published by the Free Software Foundation, either version 3 of the
- License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public
- License along with this program. If not, see
- <http://www.gnu.org/licenses/gpl-3.0.html>.
- #L%
- -->
-<JPanel id='editMacroWasteBatchTopPanel' layout='{new BorderLayout()}'
- decorator='help'
- implements='fr.ifremer.tutti.ui.swing.util.TuttiUI<MacroWasteBatchUIModel, MacroWasteBatchUIHandler>'>
-
- <import>
- fr.ifremer.tutti.ui.swing.TuttiHelpBroker
- fr.ifremer.tutti.ui.swing.TuttiUIContext
- fr.ifremer.tutti.ui.swing.util.TuttiUI
-
- jaxx.runtime.swing.editor.NumberEditor
-
- org.jdesktop.swingx.JXTable
-
- javax.swing.ListSelectionModel
-
- java.awt.Color
-
- static org.nuiton.i18n.I18n._
- </import>
-
- <script><![CDATA[
-
-public MacroWasteBatchUI(TuttiUI<?,?> parentUI) {
- JAXXUtil.initContext(this, parentUI);
- MacroWasteBatchUIHandler handler = new MacroWasteBatchUIHandler(parentUI, this);
- setContextValue(handler);
- handler.beforeInitUI();
-}
-
-protected void $afterCompleteSetup() { handler.afterInitUI(); }
- ]]></script>
-
- <MacroWasteBatchUIHandler id='handler'
- initializer='getContextValue(MacroWasteBatchUIHandler.class)'/>
-
- <MacroWasteBatchUIModel id='model'
- initializer='getContextValue(MacroWasteBatchUIModel.class)'/>
-
- <BeanValidator id='validator' bean='model'
- uiClass='jaxx.runtime.validator.swing.ui.ImageValidationUI'>
- <field name='macroWasteTotalWeight' component='macroWasteTotalWeightField'/>
- </BeanValidator>
-
- <TuttiHelpBroker id='broker'
- constructorParams='"tuttihelp.editMacroWasteBatch.help"'/>
-
- <Table id='form' fill='both' constraints='BorderLayout.NORTH'>
-
- <!-- Poids total -->
- <row>
- <cell anchor='west'>
- <JLabel id='macroWasteTotalWeightLabel'/>
- </cell>
- <cell weightx='1.0'>
- <NumberEditor id='macroWasteTotalWeightField' constructorParams='this'/>
- </cell>
- </row>
- </Table>
-
- <JScrollPane id='tableScrollPane' constraints='BorderLayout.CENTER'>
- <JXTable id='table'
- onFocusLost='handler.saveSelectedRowIfRequired(event);'/>
- </JScrollPane>
-
-</JPanel>
\ No newline at end of file
Deleted: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/macrowaste/MacroWasteBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/macrowaste/MacroWasteBatchUIHandler.java 2013-03-28 15:34:45 UTC (rev 709)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/macrowaste/MacroWasteBatchUIHandler.java 2013-03-29 00:30:05 UTC (rev 710)
@@ -1,305 +0,0 @@
-package fr.ifremer.tutti.ui.swing.content.operation.catches.macrowaste;
-
-/*
- * #%L
- * Tutti :: UI
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2012 Ifremer
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-import com.google.common.collect.Lists;
-import fr.ifremer.tutti.persistence.entities.TuttiEntities;
-import fr.ifremer.tutti.persistence.entities.data.Attachment;
-import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
-import fr.ifremer.tutti.persistence.entities.data.MacroWasteBatch;
-import fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue;
-import fr.ifremer.tutti.ui.swing.content.operation.AbstractTuttiBatchTableUIHandler;
-import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUIModel;
-import fr.ifremer.tutti.ui.swing.util.TuttiBeanMonitor;
-import fr.ifremer.tutti.ui.swing.util.TuttiUI;
-import fr.ifremer.tutti.ui.swing.util.attachment.AttachmentCellEditor;
-import fr.ifremer.tutti.ui.swing.util.attachment.AttachmentCellRenderer;
-import fr.ifremer.tutti.ui.swing.util.comment.CommentCellEditor;
-import fr.ifremer.tutti.ui.swing.util.comment.CommentCellRenderer;
-import jaxx.runtime.validator.swing.SwingValidator;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.jdesktop.swingx.JXTable;
-import org.jdesktop.swingx.table.DefaultTableColumnModelExt;
-import org.nuiton.util.decorator.Decorator;
-
-import java.util.List;
-
-/**
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.2
- */
-public class MacroWasteBatchUIHandler extends AbstractTuttiBatchTableUIHandler<MacroWasteBatchRowModel, MacroWasteBatchUIModel, MacroWasteBatchUI> {
-
- /** Logger. */
- private static final Log log =
- LogFactory.getLog(MacroWasteBatchUIHandler.class);
-
- public MacroWasteBatchUIHandler(TuttiUI<?, ?> parentUi, MacroWasteBatchUI ui) {
- super(parentUi, ui,
- MacroWasteBatchRowModel.PROPERTY_MACRO_WASTE_CATEGORY,
- MacroWasteBatchRowModel.PROPERTY_MACRO_WASTE_SIZE_CATEGORY,
- MacroWasteBatchRowModel.PROPERTY_WEIGHT,
- MacroWasteBatchRowModel.PROPERTY_NUMBER,
- MacroWasteBatchRowModel.PROPERTY_COMMENT);
- }
-
- //------------------------------------------------------------------------//
- //-- AbstractTuttiBatchTableUIHandler methods --//
- //------------------------------------------------------------------------//
-
- @Override
- public void selectFishingOperation(FishingOperation bean) {
-
- boolean empty = bean == null;
-
- MacroWasteBatchUIModel model = getModel();
-
- List<MacroWasteBatchRowModel> rows;
-
- if (empty) {
- rows = null;
- } else {
-
- if (log.isInfoEnabled()) {
- log.info("Get macroWaste batch for fishingOperation: " +
- bean.getId());
- }
- rows = Lists.newArrayList();
-
- if (!TuttiEntities.isNew(bean)) {
- List<MacroWasteBatch> catches =
- persistenceService.getAllMacroWasteBatch(bean.getId());
- for (MacroWasteBatch aBatch : catches) {
- MacroWasteBatchRowModel entry =
- new MacroWasteBatchRowModel(aBatch);
- rows.add(entry);
- }
- }
- }
- model.setRows(rows);
- }
-
- //------------------------------------------------------------------------//
- //-- AbstractTuttiTableUIHandler methods --//
- //------------------------------------------------------------------------//
-
- @Override
- public MacroWasteBatchTableModel getTableModel() {
- return (MacroWasteBatchTableModel) getTable().getModel();
- }
-
- @Override
- public JXTable getTable() {
- return ui.getTable();
- }
-
- @Override
- protected boolean isRowValid(MacroWasteBatchRowModel row) {
- boolean result = row.getMacroWasteCategory() != null &&
- row.getMacroWasteSizeCategory() != null &&
- row.getWeight() != null;
- return result;
- }
-
- @Override
- protected void onRowModified(int rowIndex,
- MacroWasteBatchRowModel row,
- String propertyName,
- Object oldValue,
- Object newValue) {
- recomputeRowValidState(row);
- }
-
- @Override
- protected void saveSelectedRowIfRequired(TuttiBeanMonitor<MacroWasteBatchRowModel> rowMonitor,
- MacroWasteBatchRowModel row) {
-
- if (row != null) {
-
- if (row.isValid()) {
- // there is a valid bean attached to the monitor
-
- if (rowMonitor.wasModified()) {
-
- // monitored bean was modified, save it
- if (log.isInfoEnabled()) {
- log.info("Row " + row + " was modified, will save it");
- }
-
- saveRow(row);
-
- // clear modified flag on the monitor
- rowMonitor.clearModified();
- }
- } else {
-
- // row is not valid can not save it
-
- MacroWasteBatch catchBean = row.toBean();
-
- if (!TuttiEntities.isNew(catchBean)) {
-
- // remove this
- persistenceService.deleteMacroWasteBatch(catchBean.getId());
- }
- }
- }
- }
-
- //------------------------------------------------------------------------//
- //-- AbstractTuttiUIHandler methods --//
- //------------------------------------------------------------------------//
-
- @Override
- public SwingValidator<MacroWasteBatchUIModel> getValidator() {
- return ui.getValidator();
- }
-
- @Override
- public void beforeInitUI() {
-
- if (log.isInfoEnabled()) {
- log.info("beforeInit: " + ui);
- }
-
- EditCatchesUIModel catchesUIModel =
- ui.getContextValue(EditCatchesUIModel.class);
-
- MacroWasteBatchUIModel model = new MacroWasteBatchUIModel(catchesUIModel);
- ui.setContextValue(model);
- }
-
- @Override
- public void afterInitUI() {
-
- if (log.isInfoEnabled()) {
- log.info("afterInit: " + ui);
- }
-
- initUI(ui);
-
- JXTable table = getTable();
-
- // create table column model
- DefaultTableColumnModelExt columnModel =
- new DefaultTableColumnModelExt();
-
- {
- // MacroWaste Category column
-
- Decorator<CaracteristicQualitativeValue> decorator = getDecorator(
- CaracteristicQualitativeValue.class, null);
-
- addComboDataColumnToModel(columnModel,
- MacroWasteBatchTableModel.MACRO_WASTE_CATEGORY,
- decorator, persistenceService.getMacroWasteCategoryCaracteristic().getQualitativeValue());
- }
-
- {
- // MacroWaste Size Category column
-
- Decorator<CaracteristicQualitativeValue> decorator = getDecorator(
- CaracteristicQualitativeValue.class, null);
-
- addComboDataColumnToModel(columnModel,
- MacroWasteBatchTableModel.MACRO_WASTE_SIZE_CATEGORY,
- decorator, persistenceService.getMacroWasteSizeCategoryCaracteristic().getQualitativeValue());
- }
-
- { // Weight column
-
- addFloatColumnToModel(columnModel,
- MacroWasteBatchTableModel.WEIGHT,
- TuttiUI.DECIMAL3_PATTERN);
- }
-
- { // Number column
-
- addIntegerColumnToModel(columnModel,
- MacroWasteBatchTableModel.NUMBER,
- TuttiUI.INT_3_DIGITS_PATTERN);
- }
-
- { // Comment column
-
- addColumnToModel(columnModel,
- CommentCellEditor.newEditor(ui),
- CommentCellRenderer.newRender(),
- MacroWasteBatchTableModel.COMMENT);
- }
-
- { // File column
-
- addColumnToModel(columnModel,
- AttachmentCellEditor.newEditor(ui),
- AttachmentCellRenderer.newRender(getDecorator(Attachment.class, null)),
- MacroWasteBatchTableModel.ATTACHMENT);
- }
-
- // create table model
- MacroWasteBatchTableModel tableModel =
- new MacroWasteBatchTableModel(columnModel);
-
- table.setModel(tableModel);
- table.setColumnModel(columnModel);
-
- initBatchTable(table, columnModel, tableModel);
- }
-
- @Override
- public void onCloseUI() {
- if (log.isDebugEnabled()) {
- log.debug("closing: " + ui);
- }
- }
-
- //------------------------------------------------------------------------//
- //-- Public methods --//
- //------------------------------------------------------------------------//
-
- //------------------------------------------------------------------------//
- //-- Internal methods --//
- //------------------------------------------------------------------------//
-
- protected void saveRow(MacroWasteBatchRowModel row) {
-
- MacroWasteBatch catchBean = row.toBean();
-
- FishingOperation fishingOperation = getModel().getFishingOperation();
- catchBean.setFishingOperation(fishingOperation);
- if (log.isInfoEnabled()) {
- log.info("Selected fishingOperation: " + fishingOperation.getId());
- }
-
- if (TuttiEntities.isNew(catchBean)) {
-
- catchBean = persistenceService.createMacroWasteBatch(catchBean);
- row.setId(catchBean.getId());
- } else {
- persistenceService.saveMacroWasteBatch(catchBean);
- }
- }
-}
\ No newline at end of file
Deleted: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/macrowaste/MacroWasteBatchUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/macrowaste/MacroWasteBatchUIModel.java 2013-03-28 15:34:45 UTC (rev 709)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/macrowaste/MacroWasteBatchUIModel.java 2013-03-29 00:30:05 UTC (rev 710)
@@ -1,50 +0,0 @@
-package fr.ifremer.tutti.ui.swing.content.operation.catches.macrowaste;
-
-/*
- * #%L
- * Tutti :: UI
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2012 Ifremer
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-import fr.ifremer.tutti.ui.swing.content.operation.AbstractTuttiBatchUIModel;
-import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUIModel;
-
-/**
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.2
- */
-public class MacroWasteBatchUIModel extends AbstractTuttiBatchUIModel<MacroWasteBatchRowModel, MacroWasteBatchUIModel> {
-
- private static final long serialVersionUID = 1L;
-
- public MacroWasteBatchUIModel(EditCatchesUIModel catchesUIModel) {
- super(catchesUIModel,
- EditCatchesUIModel.PROPERTY_MACRO_WASTE_TOTAL_WEIGHT);
- }
-
- public Float getMacroWasteTotalWeight() {
- return catchesUIModel.getMacroWasteTotalWeight();
- }
-
- public void setMacroWasteTotalWeight(Float macroWasteTotalWeight) {
- catchesUIModel.setMacroWasteTotalWeight(macroWasteTotalWeight);
- }
-}
\ No newline at end of file
Copied: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchRowModel.java (from rev 709, trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/macrowaste/MacroWasteBatchRowModel.java)
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchRowModel.java (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchRowModel.java 2013-03-29 00:30:05 UTC (rev 710)
@@ -0,0 +1,216 @@
+package fr.ifremer.tutti.ui.swing.content.operation.catches.marinelitter;
+
+/*
+ * #%L
+ * Tutti :: UI
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import com.google.common.collect.Lists;
+import fr.ifremer.tutti.persistence.entities.data.AttachementObjectTypeEnum;
+import fr.ifremer.tutti.persistence.entities.data.Attachment;
+import fr.ifremer.tutti.persistence.entities.data.MarineLitterBatch;
+import fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue;
+import fr.ifremer.tutti.ui.swing.util.AbstractTuttiBeanUIModel;
+import fr.ifremer.tutti.ui.swing.util.attachment.AttachmentModelAware;
+import fr.ifremer.tutti.ui.swing.util.comment.CommentModelAware;
+import org.nuiton.util.beans.Binder;
+import org.nuiton.util.beans.BinderFactory;
+
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * Define a MarineLitter batch row.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.2
+ */
+public class MarineLitterBatchRowModel extends AbstractTuttiBeanUIModel<MarineLitterBatch, MarineLitterBatchRowModel> implements AttachmentModelAware, CommentModelAware {
+
+ private static final long serialVersionUID = 1L;
+
+ public static final String PROPERTY_MARINE_LITTER_CATEGORY = "marineLitterCategory";
+
+ public static final String PROPERTY_MARINE_LITTER_SIZE_CATEGORY = "marineLitterSizeCategory";
+
+ public static final String PROPERTY_WEIGHT = "weight";
+
+ public static final String PROPERTY_NUMBER = "number";
+
+ /**
+ * MarineLitter category.
+ *
+ * @since 0.2
+ */
+ protected CaracteristicQualitativeValue marineLitterCategory;
+
+ /**
+ * MarineLitter size category.
+ *
+ * @since 0.3
+ */
+ protected CaracteristicQualitativeValue marineLitterSizeCategory;
+
+ /**
+ * Observed weight.
+ *
+ * @since 0.2
+ */
+ protected Float weight;
+
+ /**
+ * Observed number.
+ *
+ * @since 0.3
+ */
+ protected Integer number;
+
+ /**
+ * Comment on this batch.
+ *
+ * @since 0.2
+ */
+ protected String comment;
+
+ /**
+ * Attachments (should never be null).
+ *
+ * @since 0.2
+ */
+ protected final List<Attachment> attachment = Lists.newArrayList();
+
+ protected static final Binder<MarineLitterBatch, MarineLitterBatchRowModel> fromBeanBinder =
+ BinderFactory.newBinder(MarineLitterBatch.class,
+ MarineLitterBatchRowModel.class);
+
+ protected static final Binder<MarineLitterBatchRowModel, MarineLitterBatch> toBeanBinder =
+ BinderFactory.newBinder(MarineLitterBatchRowModel.class,
+ MarineLitterBatch.class);
+
+ public MarineLitterBatchRowModel() {
+ super(MarineLitterBatch.class, fromBeanBinder, toBeanBinder);
+ }
+
+ public MarineLitterBatchRowModel(MarineLitterBatch aBatch) {
+ this();
+ fromBean(aBatch);
+ }
+
+ public CaracteristicQualitativeValue getMarineLitterCategory() {
+ return marineLitterCategory;
+ }
+
+ public void setMarineLitterCategory(CaracteristicQualitativeValue marineLitterCategory) {
+ Object oldValue = getMarineLitterCategory();
+ this.marineLitterCategory = marineLitterCategory;
+ firePropertyChange(PROPERTY_MARINE_LITTER_CATEGORY, oldValue, marineLitterCategory);
+ }
+
+ public CaracteristicQualitativeValue getMarineLitterSizeCategory() {
+ return marineLitterSizeCategory;
+ }
+
+ public void setMarineLitterSizeCategory(CaracteristicQualitativeValue marineLitterSizeCategory) {
+ Object oldValue = getMarineLitterSizeCategory();
+ this.marineLitterSizeCategory = marineLitterSizeCategory;
+ firePropertyChange(PROPERTY_MARINE_LITTER_SIZE_CATEGORY, oldValue, marineLitterSizeCategory);
+ }
+
+ public Float getWeight() {
+ return weight;
+ }
+
+ public void setWeight(Float weight) {
+ Object oldValue = getWeight();
+ this.weight = weight;
+ firePropertyChange(PROPERTY_WEIGHT, oldValue, weight);
+ }
+
+ public Integer getNumber() {
+ return number;
+ }
+
+ public void setNumber(Integer number) {
+ Object oldValue = getNumber();
+ this.number = number;
+ firePropertyChange(PROPERTY_NUMBER, oldValue, number);
+ }
+
+ //------------------------------------------------------------------------//
+ //-- CommentModelAware --//
+ //------------------------------------------------------------------------//
+
+ @Override
+ public String getComment() {
+ return comment;
+ }
+
+ @Override
+ public void setComment(String comment) {
+ Object oldValue = getComment();
+ this.comment = comment;
+ firePropertyChange(PROPERTY_COMMENT, oldValue, comment);
+ }
+
+ //------------------------------------------------------------------------//
+ //-- AttachmentModelAware --//
+ //------------------------------------------------------------------------//
+
+ @Override
+ public AttachementObjectTypeEnum getObjectType() {
+ return AttachementObjectTypeEnum.SAMPLE;
+ }
+
+ @Override
+ public String getObjectId() {
+ return getId();
+ }
+
+ @Override
+ public List<Attachment> getAttachment() {
+ return attachment;
+ }
+
+ @Override
+ public void addAllAttachment(Collection<Attachment> attachments) {
+ this.attachment.addAll(attachments);
+ firePropertyChange(PROPERTY_ATTACHMENT, null, getAttachment());
+ }
+
+ @Override
+ public void addAttachment(Attachment attachment) {
+ this.attachment.add(attachment);
+ firePropertyChange(PROPERTY_ATTACHMENT, null, getAttachment());
+ }
+
+ @Override
+ public void removeAllAttachment(Collection<Attachment> attachments) {
+ this.attachment.removeAll(attachments);
+ firePropertyChange(PROPERTY_ATTACHMENT, null, getAttachment());
+ }
+
+ @Override
+ public void removeAttachment(Attachment attachment) {
+ this.attachment.remove(attachment);
+ firePropertyChange(PROPERTY_ATTACHMENT, null, getAttachment());
+ }
+}
Copied: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchTableModel.java (from rev 709, trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/macrowaste/MacroWasteBatchTableModel.java)
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchTableModel.java (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchTableModel.java 2013-03-29 00:30:05 UTC (rev 710)
@@ -0,0 +1,86 @@
+package fr.ifremer.tutti.ui.swing.content.operation.catches.marinelitter;
+
+/*
+ * #%L
+ * Tutti :: UI
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import fr.ifremer.tutti.ui.swing.util.table.AbstractTuttiTableModel;
+import fr.ifremer.tutti.ui.swing.util.table.ColumnIdentifier;
+import org.jdesktop.swingx.table.TableColumnModelExt;
+
+import static org.nuiton.i18n.I18n.n_;
+
+/**
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.2
+ */
+public class MarineLitterBatchTableModel extends AbstractTuttiTableModel<MarineLitterBatchRowModel> {
+
+ private static final long serialVersionUID = 1L;
+
+ public static final ColumnIdentifier<MarineLitterBatchRowModel> MACRO_WASTE_CATEGORY = ColumnIdentifier.newId(
+ MarineLitterBatchRowModel.PROPERTY_MARINE_LITTER_CATEGORY,
+ n_("tutti.editMarineLitterBatch.table.header.marineLitterCategory"),
+ n_("tutti.editMarineLitterBatch.table.header.marineLitterCategory"));
+
+ public static final ColumnIdentifier<MarineLitterBatchRowModel> MACRO_WASTE_SIZE_CATEGORY = ColumnIdentifier.newId(
+ MarineLitterBatchRowModel.PROPERTY_MARINE_LITTER_SIZE_CATEGORY,
+ n_("tutti.editMarineLitterBatch.table.header.marineLitterSizeCategory"),
+ n_("tutti.editMarineLitterBatch.table.header.marineLitterSizeCategory"));
+
+ public static final ColumnIdentifier<MarineLitterBatchRowModel> WEIGHT = ColumnIdentifier.newId(
+ MarineLitterBatchRowModel.PROPERTY_WEIGHT,
+ n_("tutti.editMarineLitterBatch.table.header.weight"),
+ n_("tutti.editMarineLitterBatch.table.header.weight"));
+
+ public static final ColumnIdentifier<MarineLitterBatchRowModel> NUMBER = ColumnIdentifier.newId(
+ MarineLitterBatchRowModel.PROPERTY_NUMBER,
+ n_("tutti.editMarineLitterBatch.table.header.number"),
+ n_("tutti.editMarineLitterBatch.table.header.number"));
+
+ public static final ColumnIdentifier<MarineLitterBatchRowModel> COMMENT = ColumnIdentifier.newId(
+ MarineLitterBatchRowModel.PROPERTY_COMMENT,
+ n_("tutti.editMarineLitterBatch.table.header.comment"),
+ n_("tutti.editMarineLitterBatch.table.header.comment"));
+
+ public static final ColumnIdentifier<MarineLitterBatchRowModel> ATTACHMENT = ColumnIdentifier.newId(
+ MarineLitterBatchRowModel.PROPERTY_ATTACHMENT,
+ n_("tutti.editMarineLitterBatch.table.header.file"),
+ n_("tutti.editMarineLitterBatch.table.header.file"));
+
+ public MarineLitterBatchTableModel(TableColumnModelExt columnModel) {
+ super(columnModel, true, true);
+
+ setNoneEditableCols();
+ }
+
+ @Override
+ public MarineLitterBatchRowModel createNewRow() {
+ MarineLitterBatchRowModel result = new MarineLitterBatchRowModel();
+
+ // by default empty row is not valid
+ result.setValid(false);
+ return result;
+ }
+
+}
\ No newline at end of file
Copied: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUI.css (from rev 709, trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/macrowaste/MacroWasteBatchUI.css)
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUI.css (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUI.css 2013-03-29 00:30:05 UTC (rev 710)
@@ -0,0 +1,53 @@
+/*
+ * #%L
+ * Tutti :: UI
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+NumberEditor {
+ autoPopup: {handler.getConfig().isAutoPopupNumberEditor()};
+ showPopupButton: {handler.getConfig().isShowNumberEditorButton()};
+ bean: {model};
+ showReset: true;
+}
+
+#editMarineLitterBatchTopPanel {
+ _help: {"tuttihelp.editMarineLitterBatch.help"};
+}
+
+#marineLitterTotalWeightLabel {
+ text: "tutti.editCatchBatch.field.marineLitterTotalWeight";
+ labelFor: {marineLitterTotalWeightField};
+}
+
+#marineLitterTotalWeightField {
+ property: marineLitterTotalWeight;
+ model: {model.getMarineLitterTotalWeight()};
+ useFloat: false;
+ numberPattern: {INT_6_DIGITS_PATTERN};
+}
+
+#table {
+ selectionMode: {ListSelectionModel.SINGLE_SELECTION};
+ selectionBackground: {null};
+ selectionForeground: {Color.BLACK};
+ sortable: false;
+}
Copied: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUI.jaxx (from rev 709, trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/macrowaste/MacroWasteBatchUI.jaxx)
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUI.jaxx (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUI.jaxx 2013-03-29 00:30:05 UTC (rev 710)
@@ -0,0 +1,88 @@
+<!--
+ #%L
+ Tutti :: UI
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2012 Ifremer
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public
+ License along with this program. If not, see
+ <http://www.gnu.org/licenses/gpl-3.0.html>.
+ #L%
+ -->
+<JPanel id='editMarineLitterBatchTopPanel' layout='{new BorderLayout()}'
+ decorator='help'
+ implements='fr.ifremer.tutti.ui.swing.util.TuttiUI<MarineLitterBatchUIModel, MarineLitterBatchUIHandler>'>
+
+ <import>
+ fr.ifremer.tutti.ui.swing.TuttiHelpBroker
+ fr.ifremer.tutti.ui.swing.TuttiUIContext
+ fr.ifremer.tutti.ui.swing.util.TuttiUI
+
+ jaxx.runtime.swing.editor.NumberEditor
+
+ org.jdesktop.swingx.JXTable
+
+ javax.swing.ListSelectionModel
+
+ java.awt.Color
+
+ static org.nuiton.i18n.I18n._
+ </import>
+
+ <script><![CDATA[
+
+public MarineLitterBatchUI(TuttiUI<?,?> parentUI) {
+ JAXXUtil.initContext(this, parentUI);
+ MarineLitterBatchUIHandler handler = new MarineLitterBatchUIHandler(parentUI, this);
+ setContextValue(handler);
+ handler.beforeInitUI();
+}
+
+protected void $afterCompleteSetup() { handler.afterInitUI(); }
+ ]]></script>
+
+ <MarineLitterBatchUIHandler id='handler'
+ initializer='getContextValue(MarineLitterBatchUIHandler.class)'/>
+
+ <MarineLitterBatchUIModel id='model'
+ initializer='getContextValue(MarineLitterBatchUIModel.class)'/>
+
+ <BeanValidator id='validator' bean='model'
+ uiClass='jaxx.runtime.validator.swing.ui.ImageValidationUI'>
+ <field name='marineLitterTotalWeight' component='marineLitterTotalWeightField'/>
+ </BeanValidator>
+
+ <TuttiHelpBroker id='broker'
+ constructorParams='"tuttihelp.editMarineLitterBatch.help"'/>
+
+ <Table id='form' fill='both' constraints='BorderLayout.NORTH'>
+
+ <!-- Poids total -->
+ <row>
+ <cell anchor='west'>
+ <JLabel id='marineLitterTotalWeightLabel'/>
+ </cell>
+ <cell weightx='1.0'>
+ <NumberEditor id='marineLitterTotalWeightField' constructorParams='this'/>
+ </cell>
+ </row>
+ </Table>
+
+ <JScrollPane id='tableScrollPane' constraints='BorderLayout.CENTER'>
+ <JXTable id='table'
+ onFocusLost='handler.saveSelectedRowIfRequired(event);'/>
+ </JScrollPane>
+
+</JPanel>
\ No newline at end of file
Copied: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUIHandler.java (from rev 709, trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/macrowaste/MacroWasteBatchUIHandler.java)
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUIHandler.java (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUIHandler.java 2013-03-29 00:30:05 UTC (rev 710)
@@ -0,0 +1,307 @@
+package fr.ifremer.tutti.ui.swing.content.operation.catches.marinelitter;
+
+/*
+ * #%L
+ * Tutti :: UI
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import com.google.common.collect.Lists;
+import fr.ifremer.tutti.persistence.entities.TuttiEntities;
+import fr.ifremer.tutti.persistence.entities.data.Attachment;
+import fr.ifremer.tutti.persistence.entities.data.BatchContainer;
+import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
+import fr.ifremer.tutti.persistence.entities.data.MarineLitterBatch;
+import fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue;
+import fr.ifremer.tutti.ui.swing.content.operation.AbstractTuttiBatchTableUIHandler;
+import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUIModel;
+import fr.ifremer.tutti.ui.swing.util.TuttiBeanMonitor;
+import fr.ifremer.tutti.ui.swing.util.TuttiUI;
+import fr.ifremer.tutti.ui.swing.util.attachment.AttachmentCellEditor;
+import fr.ifremer.tutti.ui.swing.util.attachment.AttachmentCellRenderer;
+import fr.ifremer.tutti.ui.swing.util.comment.CommentCellEditor;
+import fr.ifremer.tutti.ui.swing.util.comment.CommentCellRenderer;
+import jaxx.runtime.validator.swing.SwingValidator;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jdesktop.swingx.JXTable;
+import org.jdesktop.swingx.table.DefaultTableColumnModelExt;
+import org.nuiton.util.decorator.Decorator;
+
+import java.util.List;
+
+/**
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.2
+ */
+public class MarineLitterBatchUIHandler extends AbstractTuttiBatchTableUIHandler<MarineLitterBatchRowModel, MarineLitterBatchUIModel, MarineLitterBatchUI> {
+
+ /** Logger. */
+ private static final Log log =
+ LogFactory.getLog(MarineLitterBatchUIHandler.class);
+
+ public MarineLitterBatchUIHandler(TuttiUI<?, ?> parentUi, MarineLitterBatchUI ui) {
+ super(parentUi, ui,
+ MarineLitterBatchRowModel.PROPERTY_MARINE_LITTER_CATEGORY,
+ MarineLitterBatchRowModel.PROPERTY_MARINE_LITTER_SIZE_CATEGORY,
+ MarineLitterBatchRowModel.PROPERTY_WEIGHT,
+ MarineLitterBatchRowModel.PROPERTY_NUMBER,
+ MarineLitterBatchRowModel.PROPERTY_COMMENT);
+ }
+
+ //------------------------------------------------------------------------//
+ //-- AbstractTuttiBatchTableUIHandler methods --//
+ //------------------------------------------------------------------------//
+
+ @Override
+ public void selectFishingOperation(FishingOperation bean) {
+
+ boolean empty = bean == null;
+
+ MarineLitterBatchUIModel model = getModel();
+
+ List<MarineLitterBatchRowModel> rows;
+
+ if (empty) {
+ rows = null;
+ } else {
+
+ if (log.isInfoEnabled()) {
+ log.info("Get marineLitter batch for fishingOperation: " +
+ bean.getId());
+ }
+ rows = Lists.newArrayList();
+
+ if (!TuttiEntities.isNew(bean)) {
+ BatchContainer<MarineLitterBatch> batchContainer =
+ persistenceService.getRootMarineLitterBatch(bean.getId());
+
+ for (MarineLitterBatch aBatch : batchContainer.getChildren()) {
+ MarineLitterBatchRowModel entry =
+ new MarineLitterBatchRowModel(aBatch);
+ rows.add(entry);
+ }
+ }
+ }
+ model.setRows(rows);
+ }
+
+ //------------------------------------------------------------------------//
+ //-- AbstractTuttiTableUIHandler methods --//
+ //------------------------------------------------------------------------//
+
+ @Override
+ public MarineLitterBatchTableModel getTableModel() {
+ return (MarineLitterBatchTableModel) getTable().getModel();
+ }
+
+ @Override
+ public JXTable getTable() {
+ return ui.getTable();
+ }
+
+ @Override
+ protected boolean isRowValid(MarineLitterBatchRowModel row) {
+ boolean result = row.getMarineLitterCategory() != null &&
+ row.getMarineLitterSizeCategory() != null &&
+ row.getWeight() != null;
+ return result;
+ }
+
+ @Override
+ protected void onRowModified(int rowIndex,
+ MarineLitterBatchRowModel row,
+ String propertyName,
+ Object oldValue,
+ Object newValue) {
+ recomputeRowValidState(row);
+ }
+
+ @Override
+ protected void saveSelectedRowIfRequired(TuttiBeanMonitor<MarineLitterBatchRowModel> rowMonitor,
+ MarineLitterBatchRowModel row) {
+
+ if (row != null) {
+
+ if (row.isValid()) {
+ // there is a valid bean attached to the monitor
+
+ if (rowMonitor.wasModified()) {
+
+ // monitored bean was modified, save it
+ if (log.isInfoEnabled()) {
+ log.info("Row " + row + " was modified, will save it");
+ }
+
+ saveRow(row);
+
+ // clear modified flag on the monitor
+ rowMonitor.clearModified();
+ }
+ } else {
+
+ // row is not valid can not save it
+
+ MarineLitterBatch catchBean = row.toBean();
+
+ if (!TuttiEntities.isNew(catchBean)) {
+
+ // remove this
+ persistenceService.deleteMarineLitterBatch(catchBean.getId());
+ }
+ }
+ }
+ }
+
+ //------------------------------------------------------------------------//
+ //-- AbstractTuttiUIHandler methods --//
+ //------------------------------------------------------------------------//
+
+ @Override
+ public SwingValidator<MarineLitterBatchUIModel> getValidator() {
+ return ui.getValidator();
+ }
+
+ @Override
+ public void beforeInitUI() {
+
+ if (log.isInfoEnabled()) {
+ log.info("beforeInit: " + ui);
+ }
+
+ EditCatchesUIModel catchesUIModel =
+ ui.getContextValue(EditCatchesUIModel.class);
+
+ MarineLitterBatchUIModel model = new MarineLitterBatchUIModel(catchesUIModel);
+ ui.setContextValue(model);
+ }
+
+ @Override
+ public void afterInitUI() {
+
+ if (log.isInfoEnabled()) {
+ log.info("afterInit: " + ui);
+ }
+
+ initUI(ui);
+
+ JXTable table = getTable();
+
+ // create table column model
+ DefaultTableColumnModelExt columnModel =
+ new DefaultTableColumnModelExt();
+
+ {
+ // MarineLitter Category column
+
+ Decorator<CaracteristicQualitativeValue> decorator = getDecorator(
+ CaracteristicQualitativeValue.class, null);
+
+ addComboDataColumnToModel(columnModel,
+ MarineLitterBatchTableModel.MACRO_WASTE_CATEGORY,
+ decorator, persistenceService.getMarineLitterCategoryCaracteristic().getQualitativeValue());
+ }
+
+ {
+ // MarineLitter Size Category column
+
+ Decorator<CaracteristicQualitativeValue> decorator = getDecorator(
+ CaracteristicQualitativeValue.class, null);
+
+ addComboDataColumnToModel(columnModel,
+ MarineLitterBatchTableModel.MACRO_WASTE_SIZE_CATEGORY,
+ decorator, persistenceService.getMarineLitterSizeCategoryCaracteristic().getQualitativeValue());
+ }
+
+ { // Weight column
+
+ addFloatColumnToModel(columnModel,
+ MarineLitterBatchTableModel.WEIGHT,
+ TuttiUI.DECIMAL3_PATTERN);
+ }
+
+ { // Number column
+
+ addIntegerColumnToModel(columnModel,
+ MarineLitterBatchTableModel.NUMBER,
+ TuttiUI.INT_3_DIGITS_PATTERN);
+ }
+
+ { // Comment column
+
+ addColumnToModel(columnModel,
+ CommentCellEditor.newEditor(ui),
+ CommentCellRenderer.newRender(),
+ MarineLitterBatchTableModel.COMMENT);
+ }
+
+ { // File column
+
+ addColumnToModel(columnModel,
+ AttachmentCellEditor.newEditor(ui),
+ AttachmentCellRenderer.newRender(getDecorator(Attachment.class, null)),
+ MarineLitterBatchTableModel.ATTACHMENT);
+ }
+
+ // create table model
+ MarineLitterBatchTableModel tableModel =
+ new MarineLitterBatchTableModel(columnModel);
+
+ table.setModel(tableModel);
+ table.setColumnModel(columnModel);
+
+ initBatchTable(table, columnModel, tableModel);
+ }
+
+ @Override
+ public void onCloseUI() {
+ if (log.isDebugEnabled()) {
+ log.debug("closing: " + ui);
+ }
+ }
+
+ //------------------------------------------------------------------------//
+ //-- Public methods --//
+ //------------------------------------------------------------------------//
+
+ //------------------------------------------------------------------------//
+ //-- Internal methods --//
+ //------------------------------------------------------------------------//
+
+ protected void saveRow(MarineLitterBatchRowModel row) {
+
+ MarineLitterBatch catchBean = row.toBean();
+
+ FishingOperation fishingOperation = getModel().getFishingOperation();
+ catchBean.setFishingOperation(fishingOperation);
+ if (log.isInfoEnabled()) {
+ log.info("Selected fishingOperation: " + fishingOperation.getId());
+ }
+
+ if (TuttiEntities.isNew(catchBean)) {
+
+ catchBean = persistenceService.createMarineLitterBatch(catchBean);
+ row.setId(catchBean.getId());
+ } else {
+ persistenceService.saveMarineLitterBatch(catchBean);
+ }
+ }
+}
\ No newline at end of file
Copied: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUIModel.java (from rev 709, trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/macrowaste/MacroWasteBatchUIModel.java)
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUIModel.java (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUIModel.java 2013-03-29 00:30:05 UTC (rev 710)
@@ -0,0 +1,50 @@
+package fr.ifremer.tutti.ui.swing.content.operation.catches.marinelitter;
+
+/*
+ * #%L
+ * Tutti :: UI
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import fr.ifremer.tutti.ui.swing.content.operation.AbstractTuttiBatchUIModel;
+import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUIModel;
+
+/**
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.2
+ */
+public class MarineLitterBatchUIModel extends AbstractTuttiBatchUIModel<MarineLitterBatchRowModel, MarineLitterBatchUIModel> {
+
+ private static final long serialVersionUID = 1L;
+
+ public MarineLitterBatchUIModel(EditCatchesUIModel catchesUIModel) {
+ super(catchesUIModel,
+ EditCatchesUIModel.PROPERTY_MARINE_LITTER_TOTAL_WEIGHT);
+ }
+
+ public Float getMarineLitterTotalWeight() {
+ return catchesUIModel.getMarineLitterTotalWeight();
+ }
+
+ public void setMarineLitterTotalWeight(Float marineLitterTotalWeight) {
+ catchesUIModel.setMarineLitterTotalWeight(marineLitterTotalWeight);
+ }
+}
\ No newline at end of file
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/AbstractTuttiBeanUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/AbstractTuttiBeanUIModel.java 2013-03-28 15:34:45 UTC (rev 709)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/AbstractTuttiBeanUIModel.java 2013-03-29 00:30:05 UTC (rev 710)
@@ -75,6 +75,20 @@
return result;
}
+ @Override
+ public Integer getIdAsInt() {
+ return id == null ? null : Integer.valueOf(id);
+ }
+
+ @Override
+ public void setId(Integer id) {
+ if (id == null) {
+ this.id = null;
+ } else {
+ this.id = id.toString();
+ }
+ }
+
protected E newEntity() {
try {
E result = entityType.newInstance();
Modified: trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.properties
===================================================================
--- trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.properties 2013-03-28 15:34:45 UTC (rev 709)
+++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.properties 2013-03-29 00:30:05 UTC (rev 710)
@@ -307,8 +307,8 @@
tutti.editCatchBatch.field.catchTotalUnsortedWeight.tip=
tutti.editCatchBatch.field.catchTotalWeight=
tutti.editCatchBatch.field.catchTotalWeight.tip=
-tutti.editCatchBatch.field.macroWasteTotalWeight=
-tutti.editCatchBatch.field.macroWasteTotalWeight.tip=
+tutti.editCatchBatch.field.marineLitterTotalWeight=
+tutti.editCatchBatch.field.marineLitterTotalWeight.tip=
tutti.editCatchBatch.field.speciesTotalSampleSortedWeight=
tutti.editCatchBatch.field.speciesTotalSampleSortedWeight.tip=
tutti.editCatchBatch.field.speciesTotalSortedWeight=
@@ -318,7 +318,7 @@
tutti.editCatchBatch.field.speciesTotalWeight=
tutti.editCatchBatch.field.speciesTotalWeight.tip=
tutti.editCatchBatch.legend.benthos=
-tutti.editCatchBatch.legend.macroWaste=
+tutti.editCatchBatch.legend.marineLitter=
tutti.editCatchBatch.legend.species=
tutti.editCatchBatch.legend.total=
tutti.editCruise.action.closeEditCruise=
@@ -461,12 +461,12 @@
tutti.editFishingOperation.label.traitReminder.inCreation=
tutti.editFishingOperation.pane.other=
tutti.editFishingOperation.tab.general=
-tutti.editMacroWasteBatch.table.header.comment=
-tutti.editMacroWasteBatch.table.header.file=
-tutti.editMacroWasteBatch.table.header.macroWasteCategory=
-tutti.editMacroWasteBatch.table.header.macroWasteSizeCategory=
-tutti.editMacroWasteBatch.table.header.number=
-tutti.editMacroWasteBatch.table.header.weight=
+tutti.editMarineLitterBatch.table.header.comment=
+tutti.editMarineLitterBatch.table.header.file=
+tutti.editMarineLitterBatch.table.header.marineLitterCategory=
+tutti.editMarineLitterBatch.table.header.marineLitterSizeCategory=
+tutti.editMarineLitterBatch.table.header.number=
+tutti.editMarineLitterBatch.table.header.weight=
tutti.editPlanktonBatch.table.header.comment=
tutti.editPlanktonBatch.table.header.file=
tutti.editPlanktonBatch.table.header.sampleWeight=
@@ -738,7 +738,7 @@
tutti.label.tab.catches=
tutti.label.tab.catchesCaracteristics=
tutti.label.tab.fishingOperation=
-tutti.label.tab.macroDechet=
+tutti.label.tab.marineLitter=
tutti.label.tab.observationIndividuel=
tutti.label.tab.plancton=
tutti.label.tab.species=
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-03-28 15:34:45 UTC (rev 709)
+++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2013-03-29 00:30:05 UTC (rev 710)
@@ -316,8 +316,8 @@
tutti.editCatchBatch.field.catchTotalUnsortedWeight.tip=
tutti.editCatchBatch.field.catchTotalWeight=Poids TOTAL (kg)
tutti.editCatchBatch.field.catchTotalWeight.tip=
-tutti.editCatchBatch.field.macroWasteTotalWeight=Poids TOTAL (kg)
-tutti.editCatchBatch.field.macroWasteTotalWeight.tip=
+tutti.editCatchBatch.field.marineLitterTotalWeight=Poids TOTAL (kg)
+tutti.editCatchBatch.field.marineLitterTotalWeight.tip=
tutti.editCatchBatch.field.speciesTotalInertWeight=Poids inerte trié (kg)
tutti.editCatchBatch.field.speciesTotalLivingNotItemizedWeight=Poids vivant non détaillé trié (kg)
tutti.editCatchBatch.field.speciesTotalSampleSortedWeight=Poids VRAC trié (kg)
@@ -329,7 +329,7 @@
tutti.editCatchBatch.field.speciesTotalWeight=Poids TOTAL (kg)
tutti.editCatchBatch.field.speciesTotalWeight.tip=
tutti.editCatchBatch.legend.benthos=Benthos
-tutti.editCatchBatch.legend.macroWaste=Macro déchets
+tutti.editCatchBatch.legend.marineLitter=Macro déchets
tutti.editCatchBatch.legend.species=Espèces
tutti.editCatchBatch.legend.total=Capture
tutti.editCruise.action.closeEditCruise=Fermer
@@ -468,12 +468,12 @@
tutti.editFishingOperation.label.traitReminder.inCreation=en cours de création
tutti.editFishingOperation.pane.other=Autres caractéristiques
tutti.editFishingOperation.tab.general=Trait
-tutti.editMacroWasteBatch.table.header.comment=Commentaire
-tutti.editMacroWasteBatch.table.header.file=Pièces jointes
-tutti.editMacroWasteBatch.table.header.macroWasteCategory=Catégorie
-tutti.editMacroWasteBatch.table.header.macroWasteSizeCategory=Catégorie de taille
-tutti.editMacroWasteBatch.table.header.number=Nombre
-tutti.editMacroWasteBatch.table.header.weight=Poids
+tutti.editMarineLitterBatch.table.header.comment=Commentaire
+tutti.editMarineLitterBatch.table.header.file=Pièces jointes
+tutti.editMarineLitterBatch.table.header.marineLitterCategory=Catégorie
+tutti.editMarineLitterBatch.table.header.marineLitterSizeCategory=Catégorie de taille
+tutti.editMarineLitterBatch.table.header.number=Nombre
+tutti.editMarineLitterBatch.table.header.weight=Poids
tutti.editPlanktonBatch.table.header.comment=Commentaire
tutti.editPlanktonBatch.table.header.file=Pièces jointes
tutti.editPlanktonBatch.table.header.sampleWeight=Poids échantillonné
@@ -743,7 +743,7 @@
tutti.label.tab.catches=Captures
tutti.label.tab.catchesCaracteristics=Résumé
tutti.label.tab.fishingOperation=Trait
-tutti.label.tab.macroDechet=Macro déchets
+tutti.label.tab.marineLitter=Macro déchets
tutti.label.tab.observationIndividuel=Observations individuelles
tutti.label.tab.plancton=Plancton
tutti.label.tab.species=Espèces
1
0
r709 - trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content
by tchemit@users.forge.codelutin.com 28 Mar '13
by tchemit@users.forge.codelutin.com 28 Mar '13
28 Mar '13
Author: tchemit
Date: 2013-03-28 16:34:45 +0100 (Thu, 28 Mar 2013)
New Revision: 709
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/709
Log:
fix import
Modified:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/ImportTemporaryReferentialAction.java
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/ImportTemporaryReferentialAction.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/ImportTemporaryReferentialAction.java 2013-03-28 15:33:26 UTC (rev 708)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/ImportTemporaryReferentialAction.java 2013-03-28 15:34:45 UTC (rev 709)
@@ -25,7 +25,7 @@
*/
import fr.ifremer.tutti.ui.swing.TuttiScreen;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
import org.nuiton.util.StringUtil;
import javax.swing.*;
1
0
r708 - tags/tutti-1.2/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content
by tchemit@users.forge.codelutin.com 28 Mar '13
by tchemit@users.forge.codelutin.com 28 Mar '13
28 Mar '13
Author: tchemit
Date: 2013-03-28 16:33:26 +0100 (Thu, 28 Mar 2013)
New Revision: 708
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/708
Log:
fix import
Modified:
tags/tutti-1.2/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/ImportTemporaryReferentialAction.java
Modified: tags/tutti-1.2/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/ImportTemporaryReferentialAction.java
===================================================================
--- tags/tutti-1.2/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/ImportTemporaryReferentialAction.java 2013-03-28 15:19:54 UTC (rev 707)
+++ tags/tutti-1.2/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/ImportTemporaryReferentialAction.java 2013-03-28 15:33:26 UTC (rev 708)
@@ -25,7 +25,7 @@
*/
import fr.ifremer.tutti.ui.swing.TuttiScreen;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
import org.nuiton.util.StringUtil;
import javax.swing.*;
1
0
r707 - in trunk: . tutti-persistence tutti-service tutti-ui-swing
by maven-release@users.forge.codelutin.com 28 Mar '13
by maven-release@users.forge.codelutin.com 28 Mar '13
28 Mar '13
Author: maven-release
Date: 2013-03-28 16:19:54 +0100 (Thu, 28 Mar 2013)
New Revision: 707
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/707
Log:
[maven-release-plugin] prepare for next development iteration
Modified:
trunk/pom.xml
trunk/tutti-persistence/pom.xml
trunk/tutti-service/pom.xml
trunk/tutti-ui-swing/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2013-03-28 15:19:46 UTC (rev 706)
+++ trunk/pom.xml 2013-03-28 15:19:54 UTC (rev 707)
@@ -33,7 +33,7 @@
<groupId>fr.ifremer</groupId>
<artifactId>tutti</artifactId>
- <version>1.2</version>
+ <version>1.3-SNAPSHOT</version>
<modules>
<module>tutti-persistence</module>
@@ -89,12 +89,12 @@
</developers>
<scm>
- <url>http://svn.forge.codelutin.com/svn/tutti/tags/tutti-1.2</url>
+ <url>http://svn.forge.codelutin.com/svn/tutti/trunk</url>
<connection>
- scm:svn:http://svn.forge.codelutin.com/svn/tutti/tags/tutti-1.2
+ scm:svn:http://svn.forge.codelutin.com/svn/tutti/trunk
</connection>
<developerConnection>
- scm:svn:http://svn.forge.codelutin.com/svn/tutti/tags/tutti-1.2
+ scm:svn:http://svn.forge.codelutin.com/svn/tutti/trunk
</developerConnection>
</scm>
Modified: trunk/tutti-persistence/pom.xml
===================================================================
--- trunk/tutti-persistence/pom.xml 2013-03-28 15:19:46 UTC (rev 706)
+++ trunk/tutti-persistence/pom.xml 2013-03-28 15:19:54 UTC (rev 707)
@@ -28,7 +28,7 @@
<parent>
<groupId>fr.ifremer</groupId>
<artifactId>tutti</artifactId>
- <version>1.2</version>
+ <version>1.3-SNAPSHOT</version>
</parent>
<groupId>fr.ifremer.tutti</groupId>
Modified: trunk/tutti-service/pom.xml
===================================================================
--- trunk/tutti-service/pom.xml 2013-03-28 15:19:46 UTC (rev 706)
+++ trunk/tutti-service/pom.xml 2013-03-28 15:19:54 UTC (rev 707)
@@ -28,7 +28,7 @@
<parent>
<groupId>fr.ifremer</groupId>
<artifactId>tutti</artifactId>
- <version>1.2</version>
+ <version>1.3-SNAPSHOT</version>
</parent>
<groupId>fr.ifremer.tutti</groupId>
Modified: trunk/tutti-ui-swing/pom.xml
===================================================================
--- trunk/tutti-ui-swing/pom.xml 2013-03-28 15:19:46 UTC (rev 706)
+++ trunk/tutti-ui-swing/pom.xml 2013-03-28 15:19:54 UTC (rev 707)
@@ -28,7 +28,7 @@
<parent>
<groupId>fr.ifremer</groupId>
<artifactId>tutti</artifactId>
- <version>1.2</version>
+ <version>1.3-SNAPSHOT</version>
</parent>
<groupId>fr.ifremer.tutti</groupId>
1
0
Author: maven-release
Date: 2013-03-28 16:19:46 +0100 (Thu, 28 Mar 2013)
New Revision: 706
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/706
Log:
[maven-release-plugin] copy for tag tutti-1.2
Added:
tags/tutti-1.2/
1
0
r705 - in trunk: . tutti-persistence tutti-service tutti-ui-swing
by maven-release@users.forge.codelutin.com 28 Mar '13
by maven-release@users.forge.codelutin.com 28 Mar '13
28 Mar '13
Author: maven-release
Date: 2013-03-28 16:19:38 +0100 (Thu, 28 Mar 2013)
New Revision: 705
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/705
Log:
[maven-release-plugin] prepare release tutti-1.2
Modified:
trunk/pom.xml
trunk/tutti-persistence/pom.xml
trunk/tutti-service/pom.xml
trunk/tutti-ui-swing/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2013-03-28 15:12:59 UTC (rev 704)
+++ trunk/pom.xml 2013-03-28 15:19:38 UTC (rev 705)
@@ -33,7 +33,7 @@
<groupId>fr.ifremer</groupId>
<artifactId>tutti</artifactId>
- <version>1.2-SNAPSHOT</version>
+ <version>1.2</version>
<modules>
<module>tutti-persistence</module>
@@ -89,12 +89,12 @@
</developers>
<scm>
- <url>http://svn.forge.codelutin.com/svn/tutti/trunk</url>
+ <url>http://svn.forge.codelutin.com/svn/tutti/tags/tutti-1.2</url>
<connection>
- scm:svn:http://svn.forge.codelutin.com/svn/tutti/trunk
+ scm:svn:http://svn.forge.codelutin.com/svn/tutti/tags/tutti-1.2
</connection>
<developerConnection>
- scm:svn:http://svn.forge.codelutin.com/svn/tutti/trunk
+ scm:svn:http://svn.forge.codelutin.com/svn/tutti/tags/tutti-1.2
</developerConnection>
</scm>
Modified: trunk/tutti-persistence/pom.xml
===================================================================
--- trunk/tutti-persistence/pom.xml 2013-03-28 15:12:59 UTC (rev 704)
+++ trunk/tutti-persistence/pom.xml 2013-03-28 15:19:38 UTC (rev 705)
@@ -28,7 +28,7 @@
<parent>
<groupId>fr.ifremer</groupId>
<artifactId>tutti</artifactId>
- <version>1.2-SNAPSHOT</version>
+ <version>1.2</version>
</parent>
<groupId>fr.ifremer.tutti</groupId>
Modified: trunk/tutti-service/pom.xml
===================================================================
--- trunk/tutti-service/pom.xml 2013-03-28 15:12:59 UTC (rev 704)
+++ trunk/tutti-service/pom.xml 2013-03-28 15:19:38 UTC (rev 705)
@@ -28,7 +28,7 @@
<parent>
<groupId>fr.ifremer</groupId>
<artifactId>tutti</artifactId>
- <version>1.2-SNAPSHOT</version>
+ <version>1.2</version>
</parent>
<groupId>fr.ifremer.tutti</groupId>
Modified: trunk/tutti-ui-swing/pom.xml
===================================================================
--- trunk/tutti-ui-swing/pom.xml 2013-03-28 15:12:59 UTC (rev 704)
+++ trunk/tutti-ui-swing/pom.xml 2013-03-28 15:19:38 UTC (rev 705)
@@ -28,7 +28,7 @@
<parent>
<groupId>fr.ifremer</groupId>
<artifactId>tutti</artifactId>
- <version>1.2-SNAPSHOT</version>
+ <version>1.2</version>
</parent>
<groupId>fr.ifremer.tutti</groupId>
1
0