Author: kmorin Date: 2013-04-03 11:21:33 +0200 (Wed, 03 Apr 2013) New Revision: 719 Url: http://forge.codelutin.com/projects/tutti/repository/revisions/719 Log: add computed weights Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchRowModel.java Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchRowModel.java =================================================================== --- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchRowModel.java 2013-04-03 09:11:00 UTC (rev 718) +++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchRowModel.java 2013-04-03 09:21:33 UTC (rev 719) @@ -66,9 +66,9 @@ public static final String PROPERTY_SORTED_UNSORTED_CATEGORY_VALUE = "sortedUnsortedCategoryValue"; - public static final String PROPERTY_SORTED_UNSORTED_CATEGORY_WEIGHT = "sortedUnsortedCategoryWeight"; + public static final String PROPERTY_SORTED_UNSORTED_CATEGORY_WEIGHT = "sortedUnsortedCategoryComputedWeight"; - public static final String PROPERTY_SORTED_UNSORTED_COMPUTED_WEIGHT = "sortedUnsortedComputedWeight"; + public static final String PROPERTY_SORTED_UNSORTED_CATEGORY_COMPUTED_WEIGHT = "sortedUnsortedCategoryComputedWeight"; public static final String PROPERTY_SIZE_CATEGORY = "sizeCategory"; @@ -76,22 +76,30 @@ public static final String PROPERTY_SIZE_CATEGORY_WEIGHT = "sizeCategoryWeight"; + public static final String PROPERTY_SIZE_CATEGORY_COMPUTED_WEIGHT = "sexCategoryComputedWeight"; + public static final String PROPERTY_SEX_CATEGORY = "sexCategory"; public static final String PROPERTY_SEX_CATEGORY_VALUE = "sexCategoryValue"; public static final String PROPERTY_SEX_CATEGORY_WEIGHT = "sexCategoryWeight"; + public static final String PROPERTY_SEX_CATEGORY_COMPUTED_WEIGHT = "sexCategoryComputedWeight"; + public static final String PROPERTY_MATURITY_CATEGORY = "maturityCategory"; public static final String PROPERTY_MATURITY_CATEGORY_VALUE = "maturityCategoryValue"; + public static final String PROPERTY_MATURITY_CATEGORY_COMPUTED_WEIGHT = "maturityCategoryComputedWeight"; + public static final String PROPERTY_MATURITY_CATEGORY_WEIGHT = "maturityCategoryWeight"; public static final String PROPERTY_AGE_CATEGORY = "ageCategory"; public static final String PROPERTY_AGE_CATEGORY_VALUE = "ageCategoryValue"; + public static final String PROPERTY_AGE_CATEGORY_COMPUTED_WEIGHT = "ageCategoryComputedWeight"; + public static final String PROPERTY_AGE_CATEGORY_WEIGHT = "ageCategoryWeight"; public static final String PROPERTY_WEIGHT = "weight"; @@ -342,10 +350,12 @@ Object oldCategory = getSortedUnsortedCategory(); Object oldValue = getSortedUnsortedCategoryValue(); Object oldWeight = getSortedUnsortedCategoryWeight(); + Object oldComputedWeight = getSortedUnsortedCategoryComputedWeight(); this.sortedUnsortedCategory = sortedUnsortedCategory; firePropertyChange(PROPERTY_SORTED_UNSORTED_CATEGORY, oldCategory, sortedUnsortedCategory); firePropertyChange(PROPERTY_SORTED_UNSORTED_CATEGORY_VALUE, oldValue, getSortedUnsortedCategoryValue()); firePropertyChange(PROPERTY_SORTED_UNSORTED_CATEGORY_WEIGHT, oldWeight, getSortedUnsortedCategoryWeight()); + firePropertyChange(PROPERTY_SORTED_UNSORTED_CATEGORY_COMPUTED_WEIGHT, oldComputedWeight, getSortedUnsortedCategoryComputedWeight()); } public CaracteristicQualitativeValue getSortedUnsortedCategoryValue() { @@ -362,6 +372,16 @@ firePropertyChange(PROPERTY_SORTED_UNSORTED_CATEGORY_WEIGHT, oldValue, sortedUnsortedCategoryWeight); } + public Float getSortedUnsortedCategoryComputedWeight() { + return sortedUnsortedCategory.getComputedWeight(); + } + + public void setSortedUnsortedCategoryComputedWeight(Float sortedUnsortedCategoryComputedWeight) { + Object oldValue = getSortedUnsortedCategoryComputedWeight(); + sortedUnsortedCategory.setComputedWeight(sortedUnsortedCategoryComputedWeight); + firePropertyChange(PROPERTY_SORTED_UNSORTED_CATEGORY_COMPUTED_WEIGHT, oldValue, sortedUnsortedCategoryComputedWeight); + } + //------------------------------------------------------------------------// //-- Size category --// //------------------------------------------------------------------------// @@ -374,10 +394,12 @@ Object oldCategory = getSizeCategory(); Object oldValue = getSizeCategoryValue(); Object oldWeight = getSizeCategoryWeight(); + Object oldComputedWeight = getSizeCategoryComputedWeight(); this.sizeCategory = sizeCategory; firePropertyChange(PROPERTY_SIZE_CATEGORY, oldCategory, sizeCategory); firePropertyChange(PROPERTY_SIZE_CATEGORY_VALUE, oldValue, getSizeCategoryValue()); firePropertyChange(PROPERTY_SIZE_CATEGORY_WEIGHT, oldWeight, getSizeCategoryWeight()); + firePropertyChange(PROPERTY_SIZE_CATEGORY_COMPUTED_WEIGHT, oldComputedWeight, getSizeCategoryComputedWeight()); } public CaracteristicQualitativeValue getSizeCategoryValue() { @@ -394,6 +416,16 @@ firePropertyChange(PROPERTY_SIZE_CATEGORY_WEIGHT, oldValue, sizeCategoryWeight); } + public Float getSizeCategoryComputedWeight() { + return sizeCategory.getComputedWeight(); + } + + public void setSizeCategoryComputedWeight(Float sizeCategoryComputedWeight) { + Object oldValue = getSizeCategoryComputedWeight(); + this.sizeCategory.setComputedWeight(sizeCategoryComputedWeight); + firePropertyChange(PROPERTY_SIZE_CATEGORY_COMPUTED_WEIGHT, oldValue, sizeCategoryComputedWeight); + } + //------------------------------------------------------------------------// //-- Sex category --// //------------------------------------------------------------------------// @@ -406,10 +438,12 @@ Object oldCategory = getSexCategory(); Object oldValue = getSexCategoryValue(); Object oldWeight = getSexCategoryWeight(); + Object oldComputedWeight = getSexCategoryComputedWeight(); this.sexCategory = sexCategory; firePropertyChange(PROPERTY_SEX_CATEGORY, oldCategory, sexCategory); firePropertyChange(PROPERTY_SEX_CATEGORY_VALUE, oldValue, getSexCategoryValue()); firePropertyChange(PROPERTY_SEX_CATEGORY_WEIGHT, oldWeight, getSexCategoryWeight()); + firePropertyChange(PROPERTY_SEX_CATEGORY_COMPUTED_WEIGHT, oldComputedWeight, getSexCategoryComputedWeight()); } public CaracteristicQualitativeValue getSexCategoryValue() { @@ -426,6 +460,16 @@ firePropertyChange(PROPERTY_SEX_CATEGORY_WEIGHT, oldValue, sexCategoryWeight); } + public Float getSexCategoryComputedWeight() { + return sexCategory.getComputedWeight(); + } + + public void setSexCategoryComputedWeight(Float sexCategoryComputedWeight) { + Object oldValue = getSexCategoryComputedWeight(); + this.sexCategory.setComputedWeight(sexCategoryComputedWeight); + firePropertyChange(PROPERTY_SEX_CATEGORY_COMPUTED_WEIGHT, oldValue, sexCategoryComputedWeight); + } + //------------------------------------------------------------------------// //-- Maturity category --// //------------------------------------------------------------------------// @@ -438,10 +482,12 @@ Object oldCategory = getMaturityCategory(); Object oldValue = getMaturityCategoryValue(); Object oldWeight = getMaturityCategoryWeight(); + Object oldComputedWeight = getMaturityCategoryComputedWeight(); this.maturityCategory = maturityCategory; firePropertyChange(PROPERTY_MATURITY_CATEGORY, oldCategory, maturityCategory); firePropertyChange(PROPERTY_MATURITY_CATEGORY_VALUE, oldValue, getMaturityCategoryValue()); firePropertyChange(PROPERTY_MATURITY_CATEGORY_WEIGHT, oldWeight, getMaturityCategoryWeight()); + firePropertyChange(PROPERTY_MATURITY_CATEGORY_COMPUTED_WEIGHT, oldComputedWeight, getMaturityCategoryComputedWeight()); } public CaracteristicQualitativeValue getMaturityCategoryValue() { @@ -458,6 +504,16 @@ firePropertyChange(PROPERTY_MATURITY_CATEGORY_WEIGHT, oldValue, maturityCategoryWeight); } + public Float getMaturityCategoryComputedWeight() { + return maturityCategory.getComputedWeight(); + } + + public void setMaturityCategoryComputedWeight(Float maturityCategoryComputedWeight) { + Object oldValue = getMaturityCategoryComputedWeight(); + this.maturityCategory.setComputedWeight(maturityCategoryComputedWeight); + firePropertyChange(PROPERTY_MATURITY_CATEGORY_COMPUTED_WEIGHT, oldValue, maturityCategoryComputedWeight); + } + //------------------------------------------------------------------------// //-- Age category --// //------------------------------------------------------------------------// @@ -470,11 +526,12 @@ Object oldCategory = getAgeCategory(); Object oldValue = getAgeCategoryValue(); Object oldWeight = getAgeCategoryWeight(); + Object oldComputedWeight = getAgeCategoryComputedWeight(); this.ageCategory = ageCategory; - firePropertyChange(PROPERTY_AGE_CATEGORY, oldCategory, ageCategory); firePropertyChange(PROPERTY_AGE_CATEGORY_VALUE, oldValue, getAgeCategoryValue()); firePropertyChange(PROPERTY_AGE_CATEGORY_WEIGHT, oldWeight, getAgeCategoryWeight()); + firePropertyChange(PROPERTY_AGE_CATEGORY_COMPUTED_WEIGHT, oldComputedWeight, getAgeCategoryComputedWeight()); } public Float getAgeCategoryValue() { @@ -491,6 +548,16 @@ firePropertyChange(PROPERTY_AGE_CATEGORY_WEIGHT, oldValue, ageCategoryWeight); } + public Float getAgeCategoryComputedWeight() { + return ageCategory.getComputedWeight(); + } + + public void setAgeCategoryComputedWeight(Float ageCategoryComputedWeight) { + Object oldValue = getAgeCategoryComputedWeight(); + ageCategory.setComputedWeight(ageCategoryComputedWeight); + firePropertyChange(PROPERTY_AGE_CATEGORY_COMPUTED_WEIGHT, oldValue, ageCategoryComputedWeight); + } + //------------------------------------------------------------------------// //-- Navigation properties --// //------------------------------------------------------------------------// @@ -664,6 +731,15 @@ } @Override + public Float getSampleCategoryComputedWeight() { + return null; + } + + @Override + public void setSampleCategoryComputedWeight(Float sampleCategoryComputedWeight) { + } + + @Override public SpeciesBatch getChildBatchs(int index) { return null; }