/trunk/src/org/tela_botanica/del/client/vues/plateformedetermination/forum/interventions/ForumInterventionPresenteur.java |
---|
47,6 → 47,7 |
private void ajouterPropositionDetermination(PropositionDetermination propositionDetermination) { |
BarreRepartitionVotePresenteur barreRepartitionVotePresenteur = new BarreRepartitionVotePresenteur(new BarreRepartitionVoteVue(), new VoteDeterminationServiceConcret()); |
barreRepartitionVotePresenteur.toggleNomEspece(); |
calculerEtAfficherVoteDetermination(barreRepartitionVotePresenteur, propositionDetermination); |
ArbreCommentairePresenteur arbreCommentairePresenteur = new ArbreCommentairePresenteur(new ArbreCommentaireVue(), propositionDetermination); |
vue.ajouterInterventionDetermination(propositionDetermination, barreRepartitionVotePresenteur.getBarreRepartitionVoteVue(), arbreCommentairePresenteur.getArbreCommentaireVue()); |
/trunk/src/org/tela_botanica/del/client/vues/plateformedetermination/forum/interventions/ForumInterventionVue.java |
---|
1,6 → 1,5 |
package org.tela_botanica.del.client.vues.plateformedetermination.forum.interventions; |
import org.tela_botanica.del.client.i18n.I18n; |
import org.tela_botanica.del.client.modeles.Commentaire; |
import org.tela_botanica.del.client.modeles.PropositionDetermination; |
import org.tela_botanica.del.client.vues.plateformedetermination.forum.interventions.ForumInterventionPresenteur.Vue; |
11,9 → 10,9 |
import com.google.gwt.uibinder.client.UiBinder; |
import com.google.gwt.uibinder.client.UiField; |
import com.google.gwt.user.client.ui.Composite; |
import com.google.gwt.user.client.ui.FlexTable; |
import com.google.gwt.user.client.ui.HTML; |
import com.google.gwt.user.client.ui.HTMLPanel; |
import com.google.gwt.user.client.ui.IsWidget; |
import com.google.gwt.user.client.ui.Label; |
import com.google.gwt.user.client.ui.Widget; |
public class ForumInterventionVue extends Composite implements Vue { |
24,8 → 23,14 |
}; |
@UiField |
FlexTable htmlTableau; |
HTMLPanel proposition; |
@UiField |
Label nom, nomTaxon, date, commentaire; |
@UiField |
HTMLPanel voter; |
public ForumInterventionVue() { |
initWidget(uiBinder.createAndBindUi(this)); |
} |
33,36 → 38,30 |
@Override |
public void ajouterInterventionDetermination(PropositionDetermination determination, IsWidget barreRepartition, IsWidget arbreCommentaires) { |
nom.setText(determination.getAuteur()); |
nomTaxon.setText(determination.getEspece()); |
voter.add(barreRepartition); |
htmlTableau.setHTML(1, 1, I18n.getVocabulary().nom()); |
htmlTableau.setHTML(1, 2, I18n.getVocabulary().contributeur()); |
htmlTableau.setHTML(1, 3, I18n.getVocabulary().fiabilite()); |
htmlTableau.setHTML(1, 4, I18n.getVocabulary().date()); |
htmlTableau.setHTML(1, 5, I18n.getVocabulary().commentaire()); |
htmlTableau.setWidget(2, 1, barreRepartition); |
htmlTableau.setHTML(2, 2, determination.getAuteur()); |
htmlTableau.setHTML(2, 4, DateTimeFormat.getFormat("dd/MM/yyyy").format(determination.getDate())); |
htmlTableau.setWidget(2, 5, new HTML(determination.getCommentaire())); |
date.setText(DateTimeFormat.getFormat("dd/MM/yyyy").format(determination.getDate())); |
commentaire.setText(determination.getCommentaire()); |
if (determination.estFils()) { |
htmlTableau.setStyleName("enfant"); |
proposition.setStyleName("enfant"); |
} |
} |
@Override |
public void ajouterInterventionCommentaire(Commentaire commentaire, IsWidget arbreCommentaires) { |
public void ajouterInterventionCommentaire(Commentaire nouveauCommentaire, IsWidget arbreCommentaires) { |
htmlTableau.setHTML(1, 1, I18n.getVocabulary().contributeur()); |
htmlTableau.setHTML(1, 2, I18n.getVocabulary().date()); |
htmlTableau.setHTML(1, 3, I18n.getVocabulary().commentaire()); |
htmlTableau.setHTML(2, 1, commentaire.getAuteur()); |
htmlTableau.setHTML(2, 2, DateTimeFormat.getFormat("dd/MM/yyyy").format(commentaire.getDate())); |
htmlTableau.setWidget(2, 3, arbreCommentaires); |
nom.setText(nouveauCommentaire.getAuteur()); |
if (commentaire.estFils()) { |
htmlTableau.setStyleName("enfant"); |
date.setText(DateTimeFormat.getFormat("dd/MM/yyyy").format(nouveauCommentaire.getDate())); |
commentaire.setText(nouveauCommentaire.getCommentaire()); |
if (nouveauCommentaire.estFils()) { |
proposition.setStyleName("enfant"); |
} |
} |
/trunk/src/org/tela_botanica/del/client/vues/plateformedetermination/forum/interventions/forumIntervention.css |
---|
1,0 → 0,0 |
.table {border:solid 1px #DDD} |
.proposition { |
width:550px; |
padding:10px; |
} |
.nom { |
margin-right:5px |
} |
.le { |
margin-top:2px; |
} |
.date { |
margin-left:5px; |
margin-top:2px; |
} |
.determination { |
clear:left; |
float:left; |
margin-top:1px |
} |
.nomtaxon { |
float:left; |
margin-left:5px; |
} |
.voter { |
font-size:11px; |
} |
.commentaire { |
clear:left |
} |
.daccord { |
clear:left; |
margin-right:5px; |
} |
/trunk/src/org/tela_botanica/del/client/vues/plateformedetermination/forum/interventions/ForumInterventionVue.ui.xml |
---|
5,5 → 5,21 |
xmlns:vues="urn:import:org.tela_botanica.del.client.vues.plateformedetermination.forum"> |
<ui:with field="constants" type="org.tela_botanica.del.client.i18n.Vocabulary" /> |
<ui:style src="forumIntervention.css" /> |
<g:FlexTable ui:field='htmlTableau' styleName="{style.table}" /> |
<g:HTMLPanel ui:field="proposition" styleName="{style.proposition}"> |
<g:Label ui:field="nom" styleName="{style.nom} gauche"/> |
<g:Label text="le" styleName="{style.le} gauche petit"/> |
<g:Label ui:field="date" styleName="{style.date} gauche petit"/> |
<g:Label text="Détermination proposée : " styleName="{style.determination} petit" /> |
<g:Label ui:field="nomTaxon" styleName="{style.nomtaxon}" /> |
<g:HTMLPanel styleName="droite"> |
<g:Label text="Etes-vous d'accord ? " styleName="{style.daccord} petit gauche" /> |
<g:HTMLPanel ui:field="voter" styleName="{style.voter} gauche" /> |
</g:HTMLPanel> |
<g:Label ui:field="commentaire" styleName="{style.commentaire}"/> |
</g:HTMLPanel> |
</ui:UiBinder> |
/trunk/src/org/tela_botanica/del/client/vues/plateformedetermination/DeterminationVue.ui.xml |
---|
19,7 → 19,7 |
<g:HTMLPanel styleName="{style.zoneVote}"> |
<g:Label styleName="titre" text="{constants.titreDetermination}" /> |
<g:HTMLPanel> |
<g:Label styleName="gauche">Détermination la plus probable : </g:Label> |
<g:Label styleName="gauche" text="{constants.determinationPlusProbable}" /> |
<g:Label ui:field="nomTaxonProbable" styleName="gauche gras"/> |
</g:HTMLPanel> |
<g:HTMLPanel styleName="nettoyage {style.boutons}"> |
/trunk/src/org/tela_botanica/del/client/vues/plateformedetermination/DeterminationPresenteur.java |
---|
17,6 → 17,7 |
import org.tela_botanica.del.client.composants.presenteur.Presenteur; |
import org.tela_botanica.del.client.modeles.ModeRecherche; |
import org.tela_botanica.del.client.modeles.MoyenneVote; |
import org.tela_botanica.del.client.modeles.Observation; |
import org.tela_botanica.del.client.modeles.ObservationServiceResultat; |
import org.tela_botanica.del.client.modeles.Protocole; |
import org.tela_botanica.del.client.modeles.ProtocoleServiceResultat; |
51,58 → 52,52 |
public class DeterminationPresenteur extends Presenteur { |
/** |
* Vue de l'interface de détermination |
* */ |
public interface Vue extends IsWidget { |
public Panel getForum(); |
public Panel getDetailImageObservation(); |
public Panel getFormulaireRechercheEflore(); |
public Panel getVoteProtocole(); |
public Button getBoutonAjoutProposition(); |
public Button getBoutonAjoutCommentaire(); |
public Button getBoutonAjoutPropositionBas(); |
public Button getBoutonAjoutCommentaireBas(); |
public HasWidgets getMetadonnees(); |
// public void ajouterLigneVoteProtocole(IsWidget vue); |
// public void ajouterLigneVoteProtocole(String nom, IsWidget vue); |
public HasWidgets getNouvelleLigneProtocole(); |
public void afficherNomTaxonProbable(String nomTaxon); |
} |
private Vue vue; |
private FenetreOverlaySimplePresenteur fenetreOverlaySimplePresenteur; |
FenetreOverlaySimplePresenteur fenetreOverlaySimplePresenteur; |
// Déclaration des services à utiliser |
private ProtocoleService protocoleService; |
private ObservationService observationService; |
private CacheClient cache = CacheClient.getInstance(); |
public DeterminationPresenteur(Vue vue, ObservationService observationService, ProtocoleService protocoleService) { |
this.vue = vue; |
this.protocoleService = protocoleService; |
this.observationService = observationService; |
this.protocoleService = protocoleService; |
} |
public void go(final HasWidgets composite) { |
// TODO afficher une icone de chargement si le chargement devient trop |
// long |
// TODO afficher une icone de chargement si le chargement devient trop long |
// car tout l'écran est asynchrone ici |
observationService.getObservation(CacheClient.getInstance().getObservationCourante().getId(), new ObservationsCallback() { |
final Observation observationCourante = cache.getObservationCourante(); |
observationService.getObservation(observationCourante.getId(), new ObservationsCallback() { |
@Override |
public void surRetour(ObservationServiceResultat objetRetour) { |
CacheClient.getInstance().setImageCourante(CacheClient.getInstance().getObservationCourante().getImages().get(0)); |
cache.setImageCourante(observationCourante.getImages().get(0)); |
new MetadonneesPresenteur(new MetadonneesEnLigneVue(), CacheClient.getInstance().getObservationCourante(), ModeRecherche.MODE_OBSERVATION).go(vue.getMetadonnees()); |
new ObservationImagesPresenteur(new ObservationImagesVue(), CacheClient.getInstance().getObservationCourante()).go(vue.getDetailImageObservation()); |
new MetadonneesPresenteur(new MetadonneesEnLigneVue(), observationCourante, ModeRecherche.MODE_OBSERVATION).go(vue.getMetadonnees()); |
new ObservationImagesPresenteur(new ObservationImagesVue(), observationCourante).go(vue.getDetailImageObservation()); |
chargerEtAjouterLignesVotesProtocole(); |
new ForumPresenteur(new ForumVue()).go(vue.getForum()); |
122,7 → 117,7 |
} |
private void chargerEtAjouterLignesVotesProtocole() { |
if (CacheClient.getInstance().getListeProtocoles() == null) { |
if (cache.getListeProtocoles() == null) { |
protocoleService.getProtocoles(new ProtocolesCallback() { |
@Override |
132,7 → 127,7 |
} |
}); |
} else { |
List<Protocole> listeProtocoles = CacheClient.getInstance().getListeProtocoles(); |
List<Protocole> listeProtocoles = cache.getListeProtocoles(); |
ajouterLignesVotesProtocole(listeProtocoles); |
} |
} |
146,12 → 141,16 |
} |
private void calculerEtAfficherVoteDeterminationPlusPopulaire() { |
List<MoyenneVote> votesOrdonnes = CalculVoteDeterminationService.calculerVoteDeterminationPlusPopulaire(CacheClient.getInstance().getObservationCourante().getPropositionDeterminations()); |
Observation observation = cache.getObservationCourante(); |
String nomTaxon = observation.getNomRetenu(); |
List<MoyenneVote> votesOrdonnes = CalculVoteDeterminationService.calculerVoteDeterminationPlusPopulaire(cache.getObservationCourante().getPropositionDeterminations()); |
if (votesOrdonnes.size() > 0) { |
String nomTaxon = votesOrdonnes.get(0).getIntituleAssocie(); |
vue.afficherNomTaxonProbable(nomTaxon); |
nomTaxon = votesOrdonnes.get(0).getIntituleAssocie(); |
} |
vue.afficherNomTaxonProbable(nomTaxon); |
} |
public void gererEvenements() { |
171,11 → 170,11 |
}; |
vue.getBoutonAjoutProposition().addClickHandler(clicAjoutProposition); |
vue.getBoutonAjoutPropositionBas().addClickHandler(clicAjoutProposition); |
ClickHandler clicAjoutCommentaire = new ClickHandler() { |
@Override |
public void onClick(ClickEvent event) { |
FormulaireCommentairePresenteur commentairePresenteur = new FormulaireCommentairePresenteur(CacheClient.getInstance().getObservationCourante(), new CommentaireServiceConcret(), new FormulaireCommentaireVue()); |
FormulaireCommentairePresenteur commentairePresenteur = new FormulaireCommentairePresenteur(cache.getObservationCourante(), new CommentaireServiceConcret(), new FormulaireCommentaireVue()); |
fenetreOverlaySimplePresenteur = new FenetreOverlaySimplePresenteur(new FenetreOverlayDefilanteVue()); |
fenetreOverlaySimplePresenteur.ouvrirFenetreModale(commentairePresenteur); |
} |