Author: tchemit Date: 2013-03-01 21:59:12 +0100 (Fri, 01 Mar 2013) New Revision: 513 Url: http://forge.codelutin.com/projects/tutti/repository/revisions/513 Log: - fix dependencies - fix build (but not tests :() - reformat codes Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/BatchPersistenceServiceImpl.java trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/CruisePersistenceServiceImpl.java trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/ProgramPersistenceService.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/batch/ScientificCruiseCatchBatchValidator.java trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceServiceReadTest.java trunk/tutti-service/pom.xml trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiApplicationUpdaterCallBack.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiDataContext.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/UpdateApplicationAction.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/CreateMelagAction.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/EnterMelagWeightDialog.css trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/EnterMelagWeightDialog.jaxx trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUI.css trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIModel.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUI.css trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIHandler.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIModel.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/action/AbstractTuttiAction.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/action/TuttiUIAction.java trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/table/AbstractTuttiTableUIHandler.java Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/BatchPersistenceServiceImpl.java =================================================================== --- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/BatchPersistenceServiceImpl.java 2013-03-01 20:37:07 UTC (rev 512) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/BatchPersistenceServiceImpl.java 2013-03-01 20:59:12 UTC (rev 513) @@ -10,15 +10,15 @@ * %% * 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 + * 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 + * + * 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% @@ -30,8 +30,6 @@ 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.SortingBatchDao; -import fr.ifremer.adagio.core.dao.data.batch.SortingBatchImpl; import fr.ifremer.adagio.core.dao.data.batch.validator.CatchBatchValidationException; import fr.ifremer.adagio.core.dao.data.batch.validator.CatchBatchValidator; import fr.ifremer.adagio.core.dao.data.measure.Measurement; @@ -57,7 +55,6 @@ import org.apache.commons.logging.LogFactory; import org.hibernate.FlushMode; import org.hibernate.type.IntegerType; -import org.springframework.cache.annotation.CacheEvict; import org.springframework.dao.DataIntegrityViolationException; import org.springframework.dao.DataRetrievalFailureException; import org.springframework.stereotype.Service; @@ -156,8 +153,8 @@ SortingBatch benthosBatch = catchBatchDao.getSortingBatch(vracBatch.getChildBatchs(), "pmfmId", enumeration.PMFM_ID_SORTING_TYPE, enumeration.QUALITATIVE_ID_SORTING_TYPE_BENTHOS); if (benthosBatch != null) { - result.setBenthosTotalSampleSortedWeight(benthosBatch.getWeight()); - result.setBenthosTotalSortedWeight(benthosBatch.getWeightBeforeSampling()); + result.setBenthosTotalSampleSortedWeight(benthosBatch.getWeight()); + result.setBenthosTotalSortedWeight(benthosBatch.getWeightBeforeSampling()); } // TODO : Plancton... @@ -173,13 +170,13 @@ SortingBatch speciesBatch = catchBatchDao.getSortingBatch(horsVracBatch.getChildBatchs(), "pmfmId", enumeration.PMFM_ID_SORTING_TYPE, enumeration.QUALITATIVE_ID_SORTING_TYPE_SPECIES); if (speciesBatch != null) { - result.setSpeciesTotalUnsortedWeight(speciesBatch.getWeight()); + result.setSpeciesTotalUnsortedWeight(speciesBatch.getWeight()); } SortingBatch benthosBatch = catchBatchDao.getSortingBatch(horsVracBatch.getChildBatchs(), "pmfmId", enumeration.PMFM_ID_SORTING_TYPE, enumeration.QUALITATIVE_ID_SORTING_TYPE_BENTHOS); if (benthosBatch != null) { - result.setBenthosTotalUnsortedWeight(benthosBatch.getWeight()); + result.setBenthosTotalUnsortedWeight(benthosBatch.getWeight()); } @@ -505,7 +502,7 @@ // If some batchs need to be update, do it if (batchsToUpdate.size() > 0) { - catchBatchDao.updateSortingBatch(batchsToUpdate, catchBatch); + catchBatchDao.updateSortingBatch(batchsToUpdate, catchBatch); } if (notUpdatedChildIds.size() > 0) { @@ -1293,16 +1290,16 @@ // Sorted Vrac > Benthos // ----------------------------------------------------------------------------- { - SortingBatch benthosBatch = batchChilds.get(enumeration.QUALITATIVE_ID_SORTING_TYPE_BENTHOS); - if (benthosBatch == null) { - benthosBatch = SortingBatch.Factory.newInstance(); - batch.getChildBatchs().add(benthosBatch); - } - beanToEntitySortingBatch(target, batch, benthosBatch, recorderDepartmentId, - enumeration.PMFM_ID_SORTING_TYPE, enumeration.QUALITATIVE_ID_SORTING_TYPE_BENTHOS, - source.getBenthosTotalSampleSortedWeight(), source.getBenthosTotalSortedWeight(), - copyIfNull); - benthosBatch.setRankOrder((short) 2); + SortingBatch benthosBatch = batchChilds.get(enumeration.QUALITATIVE_ID_SORTING_TYPE_BENTHOS); + if (benthosBatch == null) { + benthosBatch = SortingBatch.Factory.newInstance(); + batch.getChildBatchs().add(benthosBatch); + } + beanToEntitySortingBatch(target, batch, benthosBatch, recorderDepartmentId, + enumeration.PMFM_ID_SORTING_TYPE, enumeration.QUALITATIVE_ID_SORTING_TYPE_BENTHOS, + source.getBenthosTotalSampleSortedWeight(), source.getBenthosTotalSortedWeight(), + copyIfNull); + benthosBatch.setRankOrder((short) 2); } // TODO plancton, macro déchet... @@ -1332,36 +1329,36 @@ // Hors Vrac > Species : // ----------------------------------------------------------------------------- { - SortingBatch speciesBatch = batchChilds.get(enumeration.QUALITATIVE_ID_SORTING_TYPE_SPECIES); - if (speciesBatch == null) { - speciesBatch = SortingBatch.Factory.newInstance(); - if (batch.getChildBatchs() == null) { - batch.setChildBatchs(Lists.newArrayList((Batch) speciesBatch)); - } else { - batch.getChildBatchs().add(speciesBatch); - } - } - beanToEntitySortingBatch(target, batch, speciesBatch, recorderDepartmentId, - enumeration.PMFM_ID_SORTING_TYPE, enumeration.QUALITATIVE_ID_SORTING_TYPE_SPECIES, - source.getSpeciesTotalUnsortedWeight(), null, - copyIfNull); - speciesBatch.setRankOrder((short) 1); + SortingBatch speciesBatch = batchChilds.get(enumeration.QUALITATIVE_ID_SORTING_TYPE_SPECIES); + if (speciesBatch == null) { + speciesBatch = SortingBatch.Factory.newInstance(); + if (batch.getChildBatchs() == null) { + batch.setChildBatchs(Lists.newArrayList((Batch) speciesBatch)); + } else { + batch.getChildBatchs().add(speciesBatch); + } + } + beanToEntitySortingBatch(target, batch, speciesBatch, recorderDepartmentId, + enumeration.PMFM_ID_SORTING_TYPE, enumeration.QUALITATIVE_ID_SORTING_TYPE_SPECIES, + source.getSpeciesTotalUnsortedWeight(), null, + copyIfNull); + speciesBatch.setRankOrder((short) 1); } // ----------------------------------------------------------------------------- // Hors Vrac > Benthos : // ----------------------------------------------------------------------------- { - SortingBatch benthosBatch = batchChilds.get(enumeration.QUALITATIVE_ID_SORTING_TYPE_SPECIES); - if (benthosBatch == null) { - benthosBatch = SortingBatch.Factory.newInstance(); - batch.getChildBatchs().add(benthosBatch); - } - beanToEntitySortingBatch(target, batch, benthosBatch, recorderDepartmentId, - enumeration.PMFM_ID_SORTING_TYPE, enumeration.QUALITATIVE_ID_SORTING_TYPE_BENTHOS, - source.getBenthosTotalUnsortedWeight(), null, - copyIfNull); - benthosBatch.setRankOrder((short) 2); + SortingBatch benthosBatch = batchChilds.get(enumeration.QUALITATIVE_ID_SORTING_TYPE_SPECIES); + if (benthosBatch == null) { + benthosBatch = SortingBatch.Factory.newInstance(); + batch.getChildBatchs().add(benthosBatch); + } + beanToEntitySortingBatch(target, batch, benthosBatch, recorderDepartmentId, + enumeration.PMFM_ID_SORTING_TYPE, enumeration.QUALITATIVE_ID_SORTING_TYPE_BENTHOS, + source.getBenthosTotalUnsortedWeight(), null, + copyIfNull); + benthosBatch.setRankOrder((short) 2); } // TODO : plancton, macro déchet... @@ -1642,4 +1639,4 @@ return pmfmId; } -} \ No newline at end of file +} Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/CruisePersistenceServiceImpl.java =================================================================== --- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/CruisePersistenceServiceImpl.java 2013-03-01 20:37:07 UTC (rev 512) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/CruisePersistenceServiceImpl.java 2013-03-01 20:59:12 UTC (rev 513) @@ -259,7 +259,7 @@ } // load surverPart - result.setSurveyPart((String)source[12]); + result.setSurveyPart((String) source[12]); // get secondary gears from fishingOperation (first load from Allegro DB only) if (result.getGear() == null) { Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/ProgramPersistenceService.java =================================================================== --- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/ProgramPersistenceService.java 2013-03-01 20:37:07 UTC (rev 512) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/ProgramPersistenceService.java 2013-03-01 20:59:12 UTC (rev 513) @@ -26,7 +26,6 @@ import fr.ifremer.tutti.persistence.TuttiPersistenceServiceImplementor; import fr.ifremer.tutti.persistence.entities.data.Program; - import org.springframework.cache.annotation.CacheEvict; import org.springframework.cache.annotation.Cacheable; import org.springframework.transaction.annotation.Transactional; @@ -49,7 +48,7 @@ * * @return the list of programs found in db. */ - @Cacheable(value = "programs") + @Cacheable(value = "programs") List<Program> getAllProgram(); /** @@ -63,10 +62,10 @@ Program getProgram(String id); @Transactional(readOnly = false) - @CacheEvict(value = {"programs", "programZones"}, allEntries = true) + @CacheEvict(value = {"programs", "programZones"}, allEntries = true) Program createProgram(Program bean); @Transactional(readOnly = false) - @CacheEvict(value = {"programs", "programZones"}, allEntries = true) + @CacheEvict(value = {"programs", "programZones"}, allEntries = true) Program saveProgram(Program bean); } 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-01 20:37:07 UTC (rev 512) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceService.java 2013-03-01 20:59:12 UTC (rev 513) @@ -37,7 +37,6 @@ import fr.ifremer.tutti.persistence.entities.referential.Species; import fr.ifremer.tutti.persistence.entities.referential.Vessel; import fr.ifremer.tutti.persistence.entities.referential.Zone; - import org.springframework.cache.annotation.CacheEvict; import org.springframework.cache.annotation.Cacheable; import org.springframework.transaction.annotation.Transactional; @@ -63,7 +62,7 @@ * @see Program#setZone(Zone) * @since 0.3 */ - @Cacheable(value = "programZones") + @Cacheable(value = "programZones") List<Zone> getAllProgramZone(); /** @@ -138,7 +137,7 @@ * @return the vessel * @since 0.3 */ - @Cacheable(value = "vesselByCode", key="#vesselCode") + @Cacheable(value = "vesselByCode", key = "#vesselCode") Vessel getVessel(String vesselCode); /** 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-01 20:37:07 UTC (rev 512) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceServiceImpl.java 2013-03-01 20:59:12 UTC (rev 513) @@ -48,8 +48,6 @@ import fr.ifremer.tutti.persistence.entities.referential.Status; import fr.ifremer.tutti.persistence.entities.referential.Vessel; import fr.ifremer.tutti.persistence.entities.referential.Zone; -import net.sf.ehcache.Element; - import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.hibernate.Query; @@ -57,10 +55,6 @@ import org.hibernate.type.IntegerType; import org.hibernate.type.StringType; import org.springframework.cache.Cache; -import org.springframework.cache.annotation.CacheEvict; -import org.springframework.cache.annotation.CachePut; -import org.springframework.cache.annotation.Cacheable; -import org.springframework.cache.support.SimpleValueWrapper; import org.springframework.dao.DataIntegrityViolationException; import org.springframework.dao.DataRetrievalFailureException; import org.springframework.stereotype.Service; @@ -105,6 +99,7 @@ @Resource(name = "cacheService") protected CacheService cacheService; + //TODO-TC We should prefer AOP thant Proxy stuff to avoid this. @Resource(name = "referentialPersistenceService") protected ReferentialPersistenceService thisService; @@ -257,10 +252,10 @@ while (list.hasNext()) { Object[] source = list.next(); - Vessel target = loadVessel(source, true); - result.add(target); - // Add to cache - vesselByCodeCache.put(target.getId(), target); + Vessel target = loadVessel(source, true); + result.add(target); + // Add to cache + vesselByCodeCache.put(target.getId(), target); } return result; } @@ -275,15 +270,15 @@ List<Vessel> result = Lists.newArrayList(); Cache vesselByCodeCache = cacheService.getCache("vesselByCode"); - + while (list.hasNext()) { Object[] source = list.next(); - Vessel target = loadVessel(source, true); + Vessel target = loadVessel(source, true); target.setScientificVessel(false); - result.add(target); - - // Add to cache - vesselByCodeCache.put(target.getId(), target); + result.add(target); + + // Add to cache + vesselByCodeCache.put(target.getId(), target); } return result; } @@ -393,8 +388,8 @@ if (target.isReferenceTaxon()) { // Add to cache : - referentSpeciesByIdCache.put(target.getReferenceTaxonId(), target); - + referentSpeciesByIdCache.put(target.getReferenceTaxonId(), target); + referenceTaxonsOnly.add(target); } result.add(target); @@ -452,7 +447,7 @@ Integer pmfmId = (Integer) source[0]; Caracteristic target = loadCaracteristic(source); // Skip some protected PSFM - if (!isProtectedCaracteristic(pmfmId)) { + if (!isProtectedCaracteristic(pmfmId)) { result.add(target); } pmfmByIdCache.put(pmfmId, target); 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-01 20:37:07 UTC (rev 512) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/batch/ScientificCruiseCatchBatchValidator.java 2013-03-01 20:59:12 UTC (rev 513) @@ -25,24 +25,9 @@ */ -import static org.nuiton.i18n.I18n._; -import static org.nuiton.i18n.I18n.n_; - -import java.util.Collection; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.dao.DataIntegrityViolationException; -import org.springframework.stereotype.Component; - import com.google.common.base.Preconditions; import com.google.common.collect.Lists; import com.google.common.collect.Sets; - import fr.ifremer.adagio.core.dao.data.batch.Batch; import fr.ifremer.adagio.core.dao.data.batch.CatchBatch; import fr.ifremer.adagio.core.dao.data.batch.CatchBatchExtendDao; @@ -54,112 +39,124 @@ import fr.ifremer.tutti.persistence.service.BatchPersistenceService; import fr.ifremer.tutti.persistence.service.ReferentialPersistenceService; import fr.ifremer.tutti.persistence.service.TuttiEnumerationFile; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.dao.DataIntegrityViolationException; +import org.springframework.stereotype.Component; +import java.util.Collection; +import java.util.HashSet; +import java.util.List; + +import static org.nuiton.i18n.I18n._; +import static org.nuiton.i18n.I18n.n_; + @Component(value = "scientificCruiseCatchBatchValidator") public class ScientificCruiseCatchBatchValidator implements CatchBatchValidator { - /** Logger. */ - private static final Log log = - LogFactory.getLog(ScientificCruiseCatchBatchValidator.class); + /** Logger. */ + private static final Log log = + LogFactory.getLog(ScientificCruiseCatchBatchValidator.class); - @Autowired - protected BatchPersistenceService batchService; + @Autowired + protected BatchPersistenceService batchService; - @Autowired - protected ReferentialPersistenceService referentialService; + @Autowired + protected ReferentialPersistenceService referentialService; - @Autowired - protected CatchBatchExtendDao catchBatchDao; + @Autowired + protected CatchBatchExtendDao catchBatchDao; - @Autowired - protected TuttiEnumerationFile enumeration; + @Autowired + protected TuttiEnumerationFile enumeration; - public ScientificCruiseCatchBatchValidator() { - } + public ScientificCruiseCatchBatchValidator() { + } - @Override - public boolean isEnable(fr.ifremer.adagio.core.dao.data.batch.CatchBatch catchBatch) { - // Apply validation only on catch batch for fishingOperation - return (catchBatch.getFishingOperation() != null); - } + @Override + public boolean isEnable(fr.ifremer.adagio.core.dao.data.batch.CatchBatch catchBatch) { + // Apply validation only on catch batch for fishingOperation + return (catchBatch.getFishingOperation() != null); + } - @Override - public List<CatchBatchValidationError> validate(fr.ifremer.adagio.core.dao.data.batch.CatchBatch catchBatch) { - List<CatchBatchValidationError> errors = Lists.newArrayList(); - validate(catchBatch.getChildBatchs(), errors, 1); - return errors; - } + @Override + public List<CatchBatchValidationError> validate(fr.ifremer.adagio.core.dao.data.batch.CatchBatch catchBatch) { + List<CatchBatchValidationError> errors = Lists.newArrayList(); + validate(catchBatch.getChildBatchs(), errors, 1); + return errors; + } - // ------------------------------------------------------------------------// - // -- Internal methods --// - // ------------------------------------------------------------------------// + // ------------------------------------------------------------------------// + // -- Internal methods --// + // ------------------------------------------------------------------------// - protected void validate(Collection<Batch> batchs, List<CatchBatchValidationError> errors, int treeLevel) { + protected void validate(Collection<Batch> batchs, List<CatchBatchValidationError> errors, int treeLevel) { //TODO finishi i18n - // Vrac - SortingBatch vracBatch = catchBatchDao.getSortingBatch(batchs, - "pmfmId", enumeration.PMFM_ID_SORTED_UNSORTED, enumeration.QUALITATIVE_VRAC_ID); - if (vracBatch == null) { - addError(errors, n_("tutti.persistence.batch.validation.vracNotFound"), null); - } 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); - } else { - // Vrac > Species > Inert - SortingBatch inertBatch = catchBatchDao.getSortingBatch(speciesBatch.getChildBatchs(), - "referenceTaxonId", enumeration.REFERENCE_TAXON_ID_INERT); - if (inertBatch == null) { - addWarning(errors, n_("tutti.persistence.batch.validation.vracSpeciesInertNotFound")); - } + // Vrac + SortingBatch vracBatch = catchBatchDao.getSortingBatch(batchs, + "pmfmId", enumeration.PMFM_ID_SORTED_UNSORTED, enumeration.QUALITATIVE_VRAC_ID); + if (vracBatch == null) { + addError(errors, n_("tutti.persistence.batch.validation.vracNotFound"), null); + } 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); + } else { + // Vrac > Species > Inert + SortingBatch inertBatch = catchBatchDao.getSortingBatch(speciesBatch.getChildBatchs(), + "referenceTaxonId", enumeration.REFERENCE_TAXON_ID_INERT); + if (inertBatch == null) { + addWarning(errors, n_("tutti.persistence.batch.validation.vracSpeciesInertNotFound")); + } - // Vrac > Species > Alive no itemized - SortingBatch livingNotItemizedBatch = catchBatchDao.getSortingBatch(speciesBatch.getChildBatchs(), - "referenceTaxonId", enumeration.REFERENCE_TAXON_ID_LIFE); - if (livingNotItemizedBatch == null) { - addWarning(errors, n_("tutti.persistence.batch.validation.vracSpeciesLifeNotFound")); - } - } + // Vrac > Species > Alive no itemized + SortingBatch livingNotItemizedBatch = catchBatchDao.getSortingBatch(speciesBatch.getChildBatchs(), + "referenceTaxonId", enumeration.REFERENCE_TAXON_ID_LIFE); + if (livingNotItemizedBatch == null) { + addWarning(errors, n_("tutti.persistence.batch.validation.vracSpeciesLifeNotFound")); + } + } - // TODO : Benthos, Plancton... - } + // TODO : Benthos, Plancton... + } - // Hors Vrac - SortingBatch horsVracBatch = catchBatchDao.getSortingBatch(batchs, - "pmfmId", enumeration.PMFM_ID_SORTED_UNSORTED, - enumeration.QUALITATIVE_HORS_VRAC_ID); - if (horsVracBatch == null) { - addWarning(errors, n_("tutti.persistence.batch.validation.horsVracSpeciesNotFound")); - } else { - // Hors Vrac > Species - SortingBatch speciesBatch = catchBatchDao.getSortingBatch(horsVracBatch.getChildBatchs(), - "pmfmId", enumeration.PMFM_ID_SORTING_TYPE, - enumeration.QUALITATIVE_ID_SORTING_TYPE_SPECIES); - if (speciesBatch == null) { - addWarning(errors, n_("tutti.persistence.batch.validation.horsVracSpeciesNotFound")); - } + // Hors Vrac + SortingBatch horsVracBatch = catchBatchDao.getSortingBatch(batchs, + "pmfmId", enumeration.PMFM_ID_SORTED_UNSORTED, + enumeration.QUALITATIVE_HORS_VRAC_ID); + if (horsVracBatch == null) { + addWarning(errors, n_("tutti.persistence.batch.validation.horsVracSpeciesNotFound")); + } else { + // Hors Vrac > Species + SortingBatch speciesBatch = catchBatchDao.getSortingBatch(horsVracBatch.getChildBatchs(), + "pmfmId", enumeration.PMFM_ID_SORTING_TYPE, + enumeration.QUALITATIVE_ID_SORTING_TYPE_SPECIES); + if (speciesBatch == null) { + addWarning(errors, n_("tutti.persistence.batch.validation.horsVracSpeciesNotFound")); + } - // TODO : Benthos, Plancton... - } + // TODO : Benthos, Plancton... + } - // Unsorted - SortingBatch unsortedBatch = catchBatchDao.getSortingBatch(batchs, - "pmfmId", enumeration.PMFM_ID_SORTED_UNSORTED, - enumeration.QUALITATIVE_UNSORTED_ID); - if (unsortedBatch == null) { - addWarning(errors,n_( "tutti.persistence.batch.validation.unsortedNotFound")); - } + // Unsorted + SortingBatch unsortedBatch = catchBatchDao.getSortingBatch(batchs, + "pmfmId", enumeration.PMFM_ID_SORTED_UNSORTED, + enumeration.QUALITATIVE_UNSORTED_ID); + 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; + // 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 (allBatchHasSpecies && batch.getReferenceTaxon() == null) { @@ -181,52 +178,52 @@ } } } - if (allBatchHasSpecies && !someBatchHasSortingMeasurement) { - errors.clear(); - addError(errors,n_( "tutti.persistence.batch.validation.onlySpeciesBatchStructure"), new CatchBatchQuickFix() { - @Override - public CatchBatch repair(CatchBatch catchBatch) { - return ScientificCruiseCatchBatchValidator.this.repairHistoricalData(catchBatch, false); - } - }); - } - else if (allBatchHasSpecies && someBatchHasSortingMeasurement && allBatchHasVrac) { - errors.clear(); - addError(errors, n_("tutti.persistence.batch.validation.onlySpeciesBatchStructure"), new CatchBatchQuickFix() { - @Override - public CatchBatch repair(CatchBatch catchBatch) { - return ScientificCruiseCatchBatchValidator.this.repairHistoricalData(catchBatch, true); - } - }); - } - } - } + if (allBatchHasSpecies && !someBatchHasSortingMeasurement) { + errors.clear(); + addError(errors, n_("tutti.persistence.batch.validation.onlySpeciesBatchStructure"), new CatchBatchQuickFix() { + @Override + public CatchBatch repair(CatchBatch catchBatch) { + return ScientificCruiseCatchBatchValidator.this.repairHistoricalData(catchBatch, false); + } + }); + } else if (allBatchHasSpecies && someBatchHasSortingMeasurement && allBatchHasVrac) { + errors.clear(); + addError(errors, n_("tutti.persistence.batch.validation.onlySpeciesBatchStructure"), new CatchBatchQuickFix() { + @Override + public CatchBatch repair(CatchBatch catchBatch) { + return ScientificCruiseCatchBatchValidator.this.repairHistoricalData(catchBatch, true); + } + }); + } + } + } - /** - * 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()); + /** + * 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>()); + // Copy catch batch children + Collection<Batch> speciesBatchChilds = Sets.newHashSet(); + speciesBatchChilds.addAll(catchBatch.getChildBatchs()); + catchBatch.setChildBatchs(new HashSet<Batch>()); - // Clean catch 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); + "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."); + 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 @@ -258,24 +255,24 @@ // Save mofidifications : catchBatchDao.update(catchBatch); - return catchBatch; - } + return catchBatch; + } - protected void addError(List<CatchBatchValidationError> errors, String messageKey, CatchBatchQuickFix quickFix) { - CatchBatchValidationError error = new CatchBatchValidationError( - messageKey, - _(messageKey), - CatchBatchValidationError.GRAVITY_ERROR); - error.setQuickFixes(Lists.newArrayList(quickFix)); - errors.add(error); - } + protected void addError(List<CatchBatchValidationError> errors, String messageKey, CatchBatchQuickFix quickFix) { + CatchBatchValidationError error = new CatchBatchValidationError( + messageKey, + _(messageKey), + CatchBatchValidationError.GRAVITY_ERROR); + error.setQuickFixes(Lists.newArrayList(quickFix)); + errors.add(error); + } - protected void addWarning(List<CatchBatchValidationError> errors, String messageKey) { - CatchBatchValidationError error = new CatchBatchValidationError( - messageKey, - _(messageKey), - CatchBatchValidationError.GRAVITY_WARNING); - errors.add(error); - } + protected void addWarning(List<CatchBatchValidationError> errors, String messageKey) { + CatchBatchValidationError error = new CatchBatchValidationError( + messageKey, + _(messageKey), + CatchBatchValidationError.GRAVITY_WARNING); + errors.add(error); + } } 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-01 20:37:07 UTC (rev 512) +++ trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceServiceReadTest.java 2013-03-01 20:59:12 UTC (rev 513) @@ -39,7 +39,6 @@ import fr.ifremer.tutti.persistence.entities.referential.Zone; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.hibernate.NonUniqueResultException; import org.junit.Assert; import org.junit.Before; import org.junit.BeforeClass; Modified: trunk/tutti-service/pom.xml =================================================================== --- trunk/tutti-service/pom.xml 2013-03-01 20:37:07 UTC (rev 512) +++ trunk/tutti-service/pom.xml 2013-03-01 20:59:12 UTC (rev 513) @@ -49,6 +49,12 @@ </dependency> <dependency> + <groupId>fr.ifremer.adagio</groupId> + <artifactId>adagio-core</artifactId> + <classifier>allegro</classifier> + </dependency> + + <dependency> <groupId>org.nuiton</groupId> <artifactId>nuiton-utils</artifactId> </dependency> Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiApplicationUpdaterCallBack.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiApplicationUpdaterCallBack.java 2013-03-01 20:37:07 UTC (rev 512) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiApplicationUpdaterCallBack.java 2013-03-01 20:59:12 UTC (rev 513) @@ -28,6 +28,7 @@ import com.google.common.collect.Lists; import com.google.common.collect.Maps; import fr.ifremer.tutti.persistence.ProgressionModel; +import fr.ifremer.tutti.persistence.config.TuttiPersistenceConfig; import fr.ifremer.tutti.persistence.service.synchro.ReferentialSynchronizeResult; import fr.ifremer.tutti.service.PersistenceService; import fr.ifremer.tutti.service.TuttiTechnicalException; @@ -138,12 +139,32 @@ boolean doRestart = updateDoneJre(appToUpdate, appUpdateError); - doRestart |= updateDoneTutti(appToUpdate, appUpdateError); + boolean updateTutti = updateDoneTutti(appToUpdate, appUpdateError); + doRestart |= updateTutti; + doRestart |= updateDoneI18n(appToUpdate, appUpdateError); updateDoneDb(appToUpdate, appUpdateError); if (doRestart) { + + if (updateTutti) { + + TuttiPersistenceConfig persistenceConfig = context.getConfig().getServiceConfig().getPersistenceConfig(); + + // must remove the enumeration file at exit + persistenceConfig.getDbEnumerationPath().deleteOnExit(); + + // must also remove i18n directory + File i18nDirectory = context.getConfig().getI18nDirectory(); + try { + FileUtils.forceDeleteOnExit(i18nDirectory); + } catch (IOException e) { + throw new TuttiTechnicalException( + "could not delete i18n directory " + i18nDirectory, e); + } + + } System.exit(RunTutti.UPATE_EXIT_CODE); } } Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiDataContext.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiDataContext.java 2013-03-01 20:37:07 UTC (rev 512) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiDataContext.java 2013-03-01 20:59:12 UTC (rev 513) @@ -1,5 +1,29 @@ package fr.ifremer.tutti.ui.swing; +/* + * #%L + * Tutti :: UI + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2012 - 2013 Ifremer + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + import com.google.common.base.Preconditions; import fr.ifremer.tutti.persistence.entities.data.Cruise; import fr.ifremer.tutti.persistence.entities.data.Program; Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiDataContext.java ___________________________________________________________________ Modified: svn:keywords - Author Date Id Revision + Author Date Id Revision HeadURL Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/UpdateApplicationAction.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/UpdateApplicationAction.java 2013-03-01 20:37:07 UTC (rev 512) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/UpdateApplicationAction.java 2013-03-01 20:59:12 UTC (rev 513) @@ -92,7 +92,7 @@ dest, false, callback); - getContext().getActionUI().getModel().clear(); +// getContext().getActionUI().getModel().clear(); } } } \ No newline at end of file Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/CreateMelagAction.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/CreateMelagAction.java 2013-03-01 20:37:07 UTC (rev 512) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/CreateMelagAction.java 2013-03-01 20:59:12 UTC (rev 513) @@ -1,22 +1,43 @@ package fr.ifremer.tutti.ui.swing.content.operation.catches.species; +/* + * #%L + * Tutti :: UI + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2012 - 2013 Ifremer + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + import com.google.common.collect.Maps; -import fr.ifremer.tutti.ui.swing.AbstractTuttiAction; import fr.ifremer.tutti.ui.swing.content.operation.catches.species.frequency.SpeciesFrequencyRowModel; -import java.awt.Frame; -import java.awt.event.ActionEvent; -import java.util.Map; -import javax.swing.JOptionPane; -import jaxx.runtime.JAXXUtil; +import fr.ifremer.tutti.ui.swing.util.action.AbstractTuttiAction; import jaxx.runtime.SwingUtil; import org.apache.commons.lang3.StringUtils; -import org.nuiton.util.StringUtil; +import javax.swing.JOptionPane; +import java.awt.Frame; +import java.util.Map; + import static org.nuiton.i18n.I18n._; /** - * * @author kmorin <kmorin@codelutin.com> * @since 1.0.2 */ @@ -34,7 +55,6 @@ public CreateMelagAction(SpeciesBatchUIHandler handler) { super(handler, - "createMelag", "batch-rename", _("tutti.action.createMelag"), _("tutti.action.createMelag.tip"), @@ -43,10 +63,9 @@ } @Override - protected boolean prepareAction(ActionEvent event) { - boolean result = super.prepareAction(event); + protected boolean prepareAction() { + boolean result = super.prepareAction(); - SpeciesBatchUIHandler handler = getHandler(); int[] selectedRowIndexes = handler.getTable().getSelectedRows(); SpeciesBatchTableModel tableModel = handler.getTableModel(); @@ -57,7 +76,7 @@ for (int selectedRowIndex : selectedRowIndexes) { SpeciesBatchRowModel selectedRow = - tableModel.getEntry(selectedRowIndex); + tableModel.getEntry(selectedRowIndex); Float sampleWeight = null; if (selectedRow.getFinestCategory().getCategoryWeight() != null) { @@ -119,7 +138,7 @@ Frame frame = SwingUtil.getParentContainer(getUI(), Frame.class); final EnterMelagWeightDialog dialog = new EnterMelagWeightDialog(frame, - getConfig().getShortcutClosePopup()); + getConfig().getShortcutClosePopup()); SwingUtil.center(frame, dialog); dialog.pack(); dialog.setVisible(true); @@ -132,7 +151,7 @@ } @Override - protected void doAction(ActionEvent event) throws Exception { + protected void doAction() throws Exception { for (SpeciesBatchRowModel batch : selectedRows.keySet()) { Float sampleWeight = selectedRows.get(batch); if (sampleWeight != null) { @@ -153,8 +172,9 @@ } @Override - protected void releaseAction(ActionEvent event) { - super.releaseAction(event); + protected void releaseAction() { + super.releaseAction(); + //TODO-TC No release action is not design to refresh ui... getHandler().getTable().repaint(); selectedRows.clear(); melagWeight = null; Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/CreateMelagAction.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/EnterMelagWeightDialog.css =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/EnterMelagWeightDialog.css 2013-03-01 20:37:07 UTC (rev 512) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/EnterMelagWeightDialog.css 2013-03-01 20:59:12 UTC (rev 513) @@ -1,3 +1,26 @@ +/* + * #%L + * Tutti :: UI + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2012 - 2013 Ifremer + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ #dialog { title: "tutti.dialog.createMelag.title"; } Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/EnterMelagWeightDialog.css ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/EnterMelagWeightDialog.jaxx =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/EnterMelagWeightDialog.jaxx 2013-03-01 20:37:07 UTC (rev 512) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/EnterMelagWeightDialog.jaxx 2013-03-01 20:59:12 UTC (rev 513) @@ -1,3 +1,26 @@ +<!-- + #%L + Tutti :: UI + $Id$ + $HeadURL$ + %% + Copyright (C) 2012 - 2013 Ifremer + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public + License along with this program. If not, see + <http://www.gnu.org/licenses/gpl-3.0.html>. + #L% + --> <JDialog id='dialog' layout='{new BorderLayout()}'> <import> java.awt.Component; @@ -43,7 +66,8 @@ </row> </Table> <JPanel layout='{new GridLayout(1,0)}' constraints='BorderLayout.SOUTH'> - <JButton id='cancelButton' onActionPerformed='editor.setModel(null); dispose();'/> + <JButton id='cancelButton' + onActionPerformed='editor.setModel(null); dispose();'/> <JButton id='validateButton' onActionPerformed='dispose();'/> </JPanel> </JDialog> \ No newline at end of file Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/EnterMelagWeightDialog.jaxx ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUI.css =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUI.css 2013-03-01 20:37:07 UTC (rev 512) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUI.css 2013-03-01 20:59:12 UTC (rev 513) @@ -8,15 +8,15 @@ * %% * 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 + * 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 + * + * 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% 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-01 20:37:07 UTC (rev 512) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java 2013-03-01 20:59:12 UTC (rev 513) @@ -10,15 +10,15 @@ * %% * 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 + * 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 + * + * 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% @@ -75,6 +75,7 @@ import javax.swing.JOptionPane; import javax.swing.RowFilter; +import javax.swing.UIManager; import javax.swing.table.TableCellRenderer; import javax.swing.table.TableColumnModel; import java.awt.Color; @@ -88,7 +89,6 @@ import java.util.List; import java.util.Map; import java.util.Set; -import javax.swing.UIManager; import static org.nuiton.i18n.I18n._; import static org.nuiton.i18n.I18n.n_; @@ -648,8 +648,8 @@ // highlight only the species column if the row is selected Highlighter selectedHighlighter = TuttiUIUtil.newBackgroundColorHighlighter( new HighlightPredicate.AndHighlightPredicate( - HighlightPredicate.IS_SELECTED, - new HighlightPredicate.IdentifierHighlightPredicate(SpeciesBatchTableModel.SPECIES)), + HighlightPredicate.IS_SELECTED, + new HighlightPredicate.IdentifierHighlightPredicate(SpeciesBatchTableModel.SPECIES)), UIManager.getColor("Table[Enabled+Selected].textBackground")); table.addHighlighter(selectedHighlighter); Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIModel.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIModel.java 2013-03-01 20:37:07 UTC (rev 512) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIModel.java 2013-03-01 20:59:12 UTC (rev 513) @@ -10,15 +10,15 @@ * %% * 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 + * 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 + * + * 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% Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUI.css =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUI.css 2013-03-01 20:37:07 UTC (rev 512) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUI.css 2013-03-01 20:59:12 UTC (rev 513) @@ -8,15 +8,15 @@ * %% * 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 + * 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 + * + * 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% Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIHandler.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIHandler.java 2013-03-01 20:37:07 UTC (rev 512) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIHandler.java 2013-03-01 20:59:12 UTC (rev 513) @@ -10,15 +10,15 @@ * %% * 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 + * 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 + * + * 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% @@ -514,4 +514,4 @@ //-- Internal methods --// //------------------------------------------------------------------------// -} \ No newline at end of file +} Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIModel.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIModel.java 2013-03-01 20:37:07 UTC (rev 512) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIModel.java 2013-03-01 20:59:12 UTC (rev 513) @@ -10,15 +10,15 @@ * %% * 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 + * 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 + * + * 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% @@ -234,4 +234,4 @@ } return result; } -} \ No newline at end of file +} Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/action/AbstractTuttiAction.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/action/AbstractTuttiAction.java 2013-03-01 20:37:07 UTC (rev 512) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/action/AbstractTuttiAction.java 2013-03-01 20:59:12 UTC (rev 513) @@ -25,30 +25,15 @@ */ import com.google.common.base.Preconditions; -import com.google.common.collect.Sets; -import fr.ifremer.tutti.service.DecoratorService; -import fr.ifremer.tutti.ui.swing.MainUI; import fr.ifremer.tutti.ui.swing.TuttiDataContext; import fr.ifremer.tutti.ui.swing.TuttiUIContext; import fr.ifremer.tutti.ui.swing.config.TuttiApplicationConfig; import fr.ifremer.tutti.ui.swing.util.AbstractTuttiUIHandler; import fr.ifremer.tutti.ui.swing.util.TuttiExceptionHandler; import fr.ifremer.tutti.ui.swing.util.TuttiUI; -import jaxx.runtime.SwingUtil; -import org.apache.commons.lang3.ObjectUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.jdesktop.beans.AbstractBean; import org.nuiton.util.decorator.Decorator; -import javax.swing.AbstractAction; -import java.awt.event.ActionEvent; -import java.util.Set; -import java.util.Timer; -import java.util.TimerTask; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; - /** * TODO * @@ -72,10 +57,10 @@ protected abstract void doAction() throws Exception; protected AbstractTuttiAction(H handler, - String actionIcon, - String actionName, - String actionDescription, - boolean hideBody) { + String actionIcon, + String actionName, + String actionDescription, + boolean hideBody) { this.handler = handler; this.actionName = actionName; this.actionDescription = actionDescription; Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/action/TuttiUIAction.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/action/TuttiUIAction.java 2013-03-01 20:37:07 UTC (rev 512) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/action/TuttiUIAction.java 2013-03-01 20:59:12 UTC (rev 513) @@ -1,5 +1,29 @@ package fr.ifremer.tutti.ui.swing.util.action; +/* + * #%L + * Tutti :: UI + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2012 - 2013 Ifremer + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + import fr.ifremer.tutti.ui.swing.MainUI; import fr.ifremer.tutti.ui.swing.util.TuttiExceptionHandler; import jaxx.runtime.SwingUtil; @@ -9,7 +33,6 @@ import javax.swing.AbstractAction; import javax.swing.ImageIcon; -import javax.swing.JRootPane; import javax.swing.SwingUtilities; import javax.swing.SwingWorker; import java.awt.Cursor; Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/action/TuttiUIAction.java ___________________________________________________________________ Modified: svn:keywords - Author Date Id Revision + Author Date Id Revision HeadURL Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/table/AbstractTuttiTableUIHandler.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/table/AbstractTuttiTableUIHandler.java 2013-03-01 20:37:07 UTC (rev 512) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/table/AbstractTuttiTableUIHandler.java 2013-03-01 20:59:12 UTC (rev 513) @@ -10,15 +10,15 @@ * %% * 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 + * 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 + * + * 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% @@ -73,7 +73,6 @@ import java.awt.event.MouseEvent; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; -import java.util.Arrays; import java.util.Enumeration; import java.util.List; import java.util.Set;