Author: chatellier Date: 2010-11-25 10:40:51 +0000 (Thu, 25 Nov 2010) New Revision: 273 Log: Ajout des 4 commentaires correspondants aux 4 listes de selection Modified: trunk/coser-business/src/main/java/fr/ifremer/coser/bean/Selection.java trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/selection/SelectionListsView.jaxx trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/selection/SelectionView.jaxx Modified: trunk/coser-business/src/main/java/fr/ifremer/coser/bean/Selection.java =================================================================== --- trunk/coser-business/src/main/java/fr/ifremer/coser/bean/Selection.java 2010-11-25 09:27:45 UTC (rev 272) +++ trunk/coser-business/src/main/java/fr/ifremer/coser/bean/Selection.java 2010-11-25 10:40:51 UTC (rev 273) @@ -59,6 +59,8 @@ protected List<String> selectedStrata; + protected String comment; + /** L1 : liste des especes. */ protected List<String> selectedSpecies; @@ -70,9 +72,19 @@ /** L4 : */ protected List<String> selectedSpeciesMaturity; + + /** L1 : comment. */ + protected String selectedSpeciesComment; - protected String comment; + /** L2 : comment. */ + protected String selectedSpeciesOccDensComment; + /** L3 : comment. */ + protected String selectedSpeciesSizeAllYearComment; + + /** L4 : comment. */ + protected String selectedSpeciesMaturityComment; + protected boolean validated; protected List<RSufiResult> rsufiResults; @@ -92,7 +104,9 @@ } public void setDescription(String description) { + String oldValue = this.description; this.description = description; + getPropertyChangeSupport().firePropertyChange("description", oldValue, description); } public List<String> getAllYears() { @@ -119,6 +133,16 @@ this.selectedStrata = selectedStrata; } + public String getComment() { + return comment; + } + + public void setComment(String comment) { + String oldValue = this.comment; + this.comment = comment; + getPropertyChangeSupport().firePropertyChange("comment", oldValue, comment); + } + public List<String> getSelectedSpecies() { return selectedSpecies; } @@ -152,16 +176,49 @@ this.selectedSpeciesMaturity = selectedSpeciesMaturity; } - public String getComment() { - return comment; + public String getSelectedSpeciesComment() { + return selectedSpeciesComment; } - public void setComment(String comment) { - String oldValue = this.comment; - this.comment = comment; - getPropertyChangeSupport().firePropertyChange("comment", oldValue, comment); + public void setSelectedSpeciesComment(String selectedSpeciesComment) { + String oldValue = this.selectedSpeciesComment; + this.selectedSpeciesComment = selectedSpeciesComment; + getPropertyChangeSupport().firePropertyChange("selectedSpeciesComment", oldValue, selectedSpeciesComment); } + public String getSelectedSpeciesOccDensComment() { + return selectedSpeciesOccDensComment; + } + + public void setSelectedSpeciesOccDensComment( + String selectedSpeciesOccDensComment) { + String oldValue = this.selectedSpeciesOccDensComment; + this.selectedSpeciesOccDensComment = selectedSpeciesOccDensComment; + getPropertyChangeSupport().firePropertyChange("selectedSpeciesOccDensComment", oldValue, selectedSpeciesOccDensComment); + } + + public String getSelectedSpeciesSizeAllYearComment() { + return selectedSpeciesSizeAllYearComment; + } + + public void setSelectedSpeciesSizeAllYearComment( + String selectedSpeciesSizeAllYearComment) { + String oldValue = this.selectedSpeciesSizeAllYearComment; + this.selectedSpeciesSizeAllYearComment = selectedSpeciesSizeAllYearComment; + getPropertyChangeSupport().firePropertyChange("selectedSpeciesSizeAllYearComment", oldValue, selectedSpeciesSizeAllYearComment); + } + + public String getSelectedSpeciesMaturityComment() { + return selectedSpeciesMaturityComment; + } + + public void setSelectedSpeciesMaturityComment( + String selectedSpeciesMaturityComment) { + String oldValue = this.selectedSpeciesMaturityComment; + this.selectedSpeciesMaturityComment = selectedSpeciesMaturityComment; + getPropertyChangeSupport().firePropertyChange("selectedSpeciesMaturityComment", oldValue, selectedSpeciesMaturityComment); + } + public boolean isValidated() { return validated; } @@ -183,6 +240,9 @@ public Properties toProperties() { Properties props = new Properties(); + if (description != null) { + props.setProperty("selection.description", description); + } if (getAllYears() != null) { props.setProperty("selection.allYears", StringUtils.join(getAllYears(),',')); } @@ -192,6 +252,9 @@ if (getSelectedStrata() != null) { props.setProperty("selection.selectedStrata", StringUtils.join(getSelectedStrata(),',')); } + if (comment != null) { + props.setProperty("selection.comment", comment); + } if (getSelectedSpecies() != null) { props.setProperty("selection.selectedSpecies", StringUtils.join(getSelectedSpecies(),',')); } @@ -204,17 +267,27 @@ if (getSelectedSpeciesMaturity() != null) { props.setProperty("selection.selectedSpeciesMaturity", StringUtils.join(getSelectedSpeciesMaturity(),',')); } - if (description != null) { - props.setProperty("selection.description", description); + if (selectedSpeciesComment != null) { + props.setProperty("selection.selectedSpeciesComment", selectedSpeciesComment); } + if (selectedSpeciesOccDensComment != null) { + props.setProperty("selection.selectedSpeciesOccDensComment", selectedSpeciesOccDensComment); + } + if (selectedSpeciesSizeAllYearComment != null) { + props.setProperty("selection.selectedSpeciesSizeAllYearComment", selectedSpeciesSizeAllYearComment); + } + if (selectedSpeciesMaturityComment != null) { + props.setProperty("selection.selectedSpeciesMaturityComment", selectedSpeciesMaturityComment); + } props.setProperty("selection.validated", String.valueOf(isValidated())); - if (comment != null) { - props.setProperty("selection.comment", comment); - } + return props; } public void fromProperties(Properties props) { + if (props.containsKey("selection.description")) { + setDescription(props.getProperty("selection.description")); + } if (props.containsKey("selection.allYears")) { setAllYears(splitAsList(props.getProperty("selection.allYears"))); } @@ -224,6 +297,9 @@ if (props.containsKey("selection.selectedStrata")) { setSelectedStrata(splitAsList(props.getProperty("selection.selectedStrata"))); } + if (props.containsKey("selection.comment")) { + setComment(props.getProperty("selection.comment")); + } if (props.containsKey("selection.selectedSpecies")) { setSelectedSpecies(splitAsList(props.getProperty("selection.selectedSpecies"))); } @@ -236,12 +312,18 @@ if (props.containsKey("selection.selectedSpeciesMaturity")) { setSelectedSpeciesMaturity(splitAsList(props.getProperty("selection.selectedSpeciesMaturity"))); } - if (props.containsKey("selection.description")) { - setDescription(props.getProperty("selection.description")); + if (props.containsKey("selection.selectedSpeciesComment")) { + setSelectedSpeciesComment(props.getProperty("selection.selectedSpeciesComment")); } - if (props.containsKey("selection.comment")) { - setComment(props.getProperty("selection.comment")); + if (props.containsKey("selection.selectedSpeciesOccDensComment")) { + setSelectedSpeciesOccDensComment(props.getProperty("selection.selectedSpeciesOccDensComment")); } + if (props.containsKey("selection.selectedSpeciesSizeAllYearComment")) { + setSelectedSpeciesSizeAllYearComment(props.getProperty("selection.selectedSpeciesSizeAllYearComment")); + } + if (props.containsKey("selection.selectedSpeciesMaturityComment")) { + setSelectedSpeciesMaturityComment(props.getProperty("selection.selectedSpeciesMaturityComment")); + } if (props.containsKey("selection.validated")) { setValidated(Boolean.parseBoolean(props.getProperty("selection.validated"))); } Modified: trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/selection/SelectionListsView.jaxx =================================================================== --- trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/selection/SelectionListsView.jaxx 2010-11-25 09:27:45 UTC (rev 272) +++ trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/selection/SelectionListsView.jaxx 2010-11-25 10:40:51 UTC (rev 273) @@ -24,6 +24,7 @@ --> <Table> <SelectionHandler id="handler" javaBean="null" /> + <fr.ifremer.coser.bean.Selection id="selection" javaBean="null" /> <script><![CDATA[ import fr.ifremer.coser.ui.selection.model.*; @@ -172,22 +173,34 @@ <row> <cell fill="horizontal" columns="2"> <JScrollPane> - <JTextArea id="allSpeciesCommentField" rows="3" /> + <JTextArea id="allSpeciesCommentField" rows="3" text="{getSelection().getSelectedSpeciesComment()}"/> + <javax.swing.text.Document javaBean="allSpeciesCommentField.getDocument()" + onInsertUpdate='getSelection().setSelectedSpeciesComment(allSpeciesCommentField.getText())' + onRemoveUpdate='getSelection().setSelectedSpeciesComment(allSpeciesCommentField.getText())' /> </JScrollPane> </cell> <cell fill="horizontal" columns="2"> <JScrollPane> - <JTextArea id="occurrenceDensityCommentField" rows="3" /> + <JTextArea id="occurrenceDensityCommentField" rows="3" text="{getSelection().getSelectedSpeciesOccDensComment()}"/> + <javax.swing.text.Document javaBean="occurrenceDensityCommentField.getDocument()" + onInsertUpdate='getSelection().setSelectedSpeciesOccDensComment(occurrenceDensityCommentField.getText())' + onRemoveUpdate='getSelection().setSelectedSpeciesOccDensComment(occurrenceDensityCommentField.getText())' /> </JScrollPane> </cell> <cell fill="horizontal" columns="2"> <JScrollPane> - <JTextArea id="sizeAllYearCommentField" rows="3" /> + <JTextArea id="sizeAllYearCommentField" rows="3" text="{getSelection().getSelectedSpeciesSizeAllYearComment()}"/> + <javax.swing.text.Document javaBean="sizeAllYearCommentField.getDocument()" + onInsertUpdate='getSelection().setSelectedSpeciesSizeAllYearComment(sizeAllYearCommentField.getText())' + onRemoveUpdate='getSelection().setSelectedSpeciesSizeAllYearComment(sizeAllYearCommentField.getText())' /> </JScrollPane> </cell> <cell fill="horizontal" columns="2"> <JScrollPane> - <JTextArea id="maturityCommentField" rows="3" /> + <JTextArea id="maturityCommentField" rows="3" text="{getSelection().getSelectedSpeciesMaturityComment()}"/> + <javax.swing.text.Document javaBean="maturityCommentField.getDocument()" + onInsertUpdate='getSelection().setSelectedSpeciesMaturityComment(maturityCommentField.getText())' + onRemoveUpdate='getSelection().setSelectedSpeciesMaturityComment(maturityCommentField.getText())' /> </JScrollPane> </cell> </row> Modified: trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/selection/SelectionView.jaxx =================================================================== --- trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/selection/SelectionView.jaxx 2010-11-25 09:27:45 UTC (rev 272) +++ trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/selection/SelectionView.jaxx 2010-11-25 10:40:51 UTC (rev 273) @@ -45,7 +45,7 @@ </tab> <tab title="coser.ui.selection.tab.lists"> <SelectionListsView id="selectionListsView" constructorParams="this" - handler="{getHandler()}" /> + handler="{getHandler()}" selection="{getSelection()}" /> </tab> <tab title="coser.ui.selection.tab.rsufi"> <SelectionRsufiView id="selectionResultView" constructorParams="this"