Author: tchemit Date: 2013-01-29 13:29:44 +0100 (Tue, 29 Jan 2013) New Revision: 255 Url: http://forge.codelutin.com/projects/tutti/repository/revisions/255 Log: - fix dependencies + third parties - refs #1912: [Ecran Trait] Filtrage des strates - sous-strates - localit?\195?\169s Modified: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/service/synchro/ReferentialSynchronizeHelperTest.java trunk/tutti-persistence/pom.xml trunk/tutti-persistence/src/license/THIRD-PARTY.properties trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java Modified: trunk/tutti-persistence/pom.xml =================================================================== --- trunk/tutti-persistence/pom.xml 2013-01-29 08:24:13 UTC (rev 254) +++ trunk/tutti-persistence/pom.xml 2013-01-29 12:29:44 UTC (rev 255) @@ -21,7 +21,9 @@ #L% --> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> @@ -59,6 +61,11 @@ </dependency> <dependency> + <groupId>commons-collections</groupId> + <artifactId>commons-collections</artifactId> + </dependency> + + <dependency> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> </dependency> @@ -95,8 +102,10 @@ <execution> <phase>generate-sources</phase> <configuration> - <defaultPackage>fr.ifremer.tutti.persistence.entities</defaultPackage> - <fullPackagePath>fr.ifremer.tutti.persistence.entities</fullPackagePath> + <defaultPackage>fr.ifremer.tutti.persistence.entities + </defaultPackage> + <fullPackagePath>fr.ifremer.tutti.persistence.entities + </fullPackagePath> <inputs>zargo</inputs> </configuration> <goals> Modified: trunk/tutti-persistence/src/license/THIRD-PARTY.properties =================================================================== --- trunk/tutti-persistence/src/license/THIRD-PARTY.properties 2013-01-29 08:24:13 UTC (rev 254) +++ trunk/tutti-persistence/src/license/THIRD-PARTY.properties 2013-01-29 12:29:44 UTC (rev 255) @@ -15,5 +15,8 @@ # # #Sat Jan 19 08:25:52 CET 2013 +antlr--antlr--2.7.6=BSD License commons-primitives--commons-primitives--1.0=The Apache Software License, Version 2.0 -regexp--regexp--1.3=The Apache Software License, Version 2.0 +dom4j--dom4j--1.6.1=BSD License +javax.transaction--jta--1.1=COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 +regexp--regexp--1.3=The Apache Software License, Version 2.0 \ No newline at end of file Modified: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/service/synchro/ReferentialSynchronizeHelperTest.java =================================================================== --- trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/service/synchro/ReferentialSynchronizeHelperTest.java 2013-01-29 08:24:13 UTC (rev 254) +++ trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/service/synchro/ReferentialSynchronizeHelperTest.java 2013-01-29 12:29:44 UTC (rev 255) @@ -28,7 +28,7 @@ import fr.ifremer.tutti.persistence.DatabaseResource; import fr.ifremer.tutti.persistence.entities.TuttiEntities; import fr.ifremer.tutti.persistence.service.TuttiPersistenceServiceLocator; -import org.apache.commons.lang.ObjectUtils; +import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.time.DateUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java 2013-01-29 08:24:13 UTC (rev 254) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java 2013-01-29 12:29:44 UTC (rev 255) @@ -49,17 +49,18 @@ import fr.ifremer.tutti.ui.swing.util.TabHandler; import fr.ifremer.tutti.ui.swing.util.TuttiBeanMonitor; import fr.ifremer.tutti.ui.swing.util.TuttiUIUtil; +import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import javax.swing.JLabel; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JTabbedPane; import java.awt.BorderLayout; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.util.List; -import javax.swing.JLabel; -import javax.swing.JOptionPane; -import javax.swing.JPanel; -import javax.swing.JTabbedPane; -import org.apache.commons.collections.CollectionUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; /** * Handler for UI {@link EditFishingOperationUI}. @@ -68,7 +69,7 @@ * @since 0.1 */ public class EditFishingOperationUIHandler extends AbstractTuttiTabContainerUIHandler<EditFishingOperationUIModel> - implements TabHandler { + implements TabHandler { /** Logger. */ private static final Log log = @@ -208,29 +209,16 @@ FishingOperationLocation location = model.getLocation(); + String zoneId = zone.getId(); List<FishingOperationLocation> stratas = - persistenceService.getAllFishingOperationStrata(zone.getId()); + persistenceService.getAllFishingOperationStrata(zoneId); - List<FishingOperationLocation> subStratas; + List<FishingOperationLocation> subStratas = + persistenceService.getAllFishingOperationSubStrata(zoneId, strataId); - if (strataId == null) { - subStratas = Lists.newArrayList(); - } else { + List<FishingOperationLocation> locations = + persistenceService.getAllFishingOperationLocation(zoneId, strataId, substrataId); - // load substratas - subStratas = persistenceService.getAllFishingOperationSubStrata(strataId); - } - - List<FishingOperationLocation> locations; - - if (substrataId == null) { - locations = Lists.newArrayList(); - } else { - - // load localites - locations = persistenceService.getAllFishingOperationLocation(substrataId); - } - initBeanComboBox(ui.getStrataComboBox(), stratas, strata); initBeanComboBox(ui.getSubStrataComboBox(), subStratas, subStrata); @@ -275,7 +263,7 @@ environmentModel.addPropertyChangeListener(AbstractTuttiBeanUIModel.PROPERTY_VALID, pcl); hydrologyModel.addPropertyChangeListener(AbstractTuttiBeanUIModel.PROPERTY_VALID, pcl); model.addPropertyChangeListener(AbstractTuttiBeanUIModel.PROPERTY_VALID, pcl); - + } else { model.addPropertyChangeListener(AbstractTuttiBeanUIModel.PROPERTY_VALID, new PropertyChangeListener() { @@ -288,8 +276,8 @@ } }); } - - + + MainUI main = ui.getContextValue(MainUI.class, MainUI.class.getName()); main.clearValidators(); main.registerValidator(ui.getValidator()); @@ -320,11 +308,11 @@ case JOptionPane.OK_OPTION: ui.getSaveFishingOperationAction().actionPerformed(null); break; - + case JOptionPane.NO_OPTION: parentUi.getHandler().reloadFishingOperation(); break; - + case JOptionPane.CANCEL_OPTION: result = false; } @@ -335,7 +323,7 @@ @Override public void onShowTab() { } - + @Override protected JTabbedPane getTabPanel() { return ui.getFishingOperationTabPane(); @@ -351,13 +339,13 @@ //------------------------------------------------------------------------// public CaracteristicTabUIModel[] getSubModels() { - return new CaracteristicTabUIModel[] { - ui.getGearShootingTabContent().getModel(), - ui.getEnvironmentTabContent().getModel(), - ui.getHydrologyTabContent().getModel() + return new CaracteristicTabUIModel[]{ + ui.getGearShootingTabContent().getModel(), + ui.getEnvironmentTabContent().getModel(), + ui.getHydrologyTabContent().getModel() }; } - + public void clearFishingOperation() { EditFishingOperationUIModel model = getModel(); model.fromBean(new FishingOperation()); @@ -444,7 +432,7 @@ } // cancel to create a new fishingOperation parentUi.getHandler().closeCurrentFishingOperation(); - + } else { parentUi.getHandler().reloadFishingOperation(); } @@ -461,7 +449,7 @@ public TuttiBeanMonitor<EditFishingOperationUIModel> getFishingOperationMonitor() { return fishingOperationMonitor; } - + //------------------------------------------------------------------------// //-- Protected methods --// //------------------------------------------------------------------------// @@ -475,6 +463,22 @@ // reset sub strata combo ui.getSubStrataComboBox().setData(null); + Zone zone = + model.getFishingOperation().getCruise().getProgram().getZone(); + + String zoneId = zone.getId(); + String strataId = newStrata == null ? null : newStrata.getId(); + + List<FishingOperationLocation> subStrata = + persistenceService.getAllFishingOperationSubStrata(zoneId, strataId); + + List<FishingOperationLocation> location = + persistenceService.getAllFishingOperationLocation(zoneId, strataId, null); + + ui.getSubStrataComboBox().setData(subStrata); + + ui.getLocationComboBox().setData(location); + if (newStrata == null) { // reset strata, keep focus on it @@ -484,20 +488,12 @@ // try to load substrata - List<FishingOperationLocation> subStrata = - persistenceService.getAllFishingOperationSubStrata(newStrata.getId()); - ui.getSubStrataComboBox().setData(subStrata); - if (CollectionUtils.isEmpty(subStrata)) { // try to load localite - List<FishingOperationLocation> location = - persistenceService.getAllFishingOperationLocation(newStrata.getId()); - ui.getLocationComboBox().setData(location); - ui.getLocationComboBox().grabFocus(); } } @@ -511,21 +507,27 @@ // reset localite combo ui.getLocationComboBox().setData(null); + Zone zone = + getModel().getFishingOperation().getCruise().getProgram().getZone(); + String zoneId = zone.getId(); + + FishingOperationLocation strata = model.getStrata(); + String subStrataId = newSubStrata == null ? null : newSubStrata.getId(); + + String strataId = strata == null ? null : strata.getId(); + + List<FishingOperationLocation> location = + persistenceService.getAllFishingOperationLocation(zoneId, strataId, subStrataId); + + ui.getLocationComboBox().setData(location); + if (newSubStrata == null) { // reset substrata, keep focus on it ui.getSubStrataComboBox().grabFocus(); - } else { - - // try to load localite - - List<FishingOperationLocation> location = - persistenceService.getAllFishingOperationLocation(newSubStrata.getId()); - - ui.getLocationComboBox().setData(location); } } - + protected boolean areAllModelsValid() { boolean result = getModel().isValid(); CaracteristicTabUIModel[] subModels = getSubModels(); @@ -534,7 +536,7 @@ } return result; } - + protected boolean isAModelModified() { boolean result = getModel().isModify(); CaracteristicTabUIModel[] subModels = getSubModels(); @@ -543,5 +545,5 @@ } return result; } - + }