/trunk/src/org/tela_botanica/del/client/vues/plateformedetermination/DeterminationPresenteur.java |
---|
18,6 → 18,7 |
import org.tela_botanica.del.client.vues.plateformedetermination.forum.ForumPresenteur; |
import org.tela_botanica.del.client.vues.plateformedetermination.vote.EnsembleVotesPresenteur; |
import org.tela_botanica.del.client.vues.plateformedetermination.vote.barrerepartition.BarreRepartitionVotePresenteur; |
import org.tela_botanica.del.client.vues.plateformedetermination.vote.barrerepartition.BarreRepartitionVoteVue; |
import com.google.gwt.event.dom.client.ClickEvent; |
import com.google.gwt.event.dom.client.ClickHandler; |
40,7 → 41,7 |
new ForumPresenteur().go(determinationVue.getForum()); |
new FormulaireRechercheEflorePresenteur().go(determinationVue.getFormulaireRechercheEflore()); |
barreRepartitionVotePresenteur = new BarreRepartitionVotePresenteur(); |
barreRepartitionVotePresenteur = new BarreRepartitionVotePresenteur(new BarreRepartitionVoteVue()); |
barreRepartitionVotePresenteur.go(determinationVue.getBarreRepartition()); |
calculerEtAfficherVoteDeterminationPlusPopulaire(); |
/trunk/src/org/tela_botanica/del/client/vues/plateformedetermination/forum/LigneForumPresenteur.java |
---|
4,6 → 4,7 |
import org.tela_botanica.del.client.modeles.PropositionDetermination; |
import org.tela_botanica.del.client.services.CalculVoteDeterminationService; |
import org.tela_botanica.del.client.vues.plateformedetermination.vote.barrerepartition.BarreRepartitionVotePresenteur; |
import org.tela_botanica.del.client.vues.plateformedetermination.vote.barrerepartition.BarreRepartitionVoteVue; |
import com.google.gwt.user.client.ui.FlexTable; |
10,7 → 11,7 |
public class LigneForumPresenteur { |
private LigneForumVue ligneforumVue; |
private BarreRepartitionVotePresenteur barreRepartitionVotePresenteur = new BarreRepartitionVotePresenteur(); |
private BarreRepartitionVotePresenteur barreRepartitionVotePresenteur = new BarreRepartitionVotePresenteur(new BarreRepartitionVoteVue()); |
private PropositionDetermination determination; |
/trunk/src/org/tela_botanica/del/client/vues/plateformedetermination/vote/barrerepartition/BarreRepartitionVoteVue.java |
---|
5,11 → 5,10 |
import com.google.gwt.uibinder.client.UiField; |
import com.google.gwt.user.client.ui.Composite; |
import com.google.gwt.user.client.ui.HTML; |
import com.google.gwt.user.client.ui.IsWidget; |
import com.google.gwt.user.client.ui.PushButton; |
import com.google.gwt.user.client.ui.Widget; |
public class BarreRepartitionVoteVue extends Composite implements IsWidget { |
public class BarreRepartitionVoteVue extends Composite implements BarreRepartitionVotePresenteur.Vue { |
interface MyUiBinder extends UiBinder<Widget, BarreRepartitionVoteVue> {} |
36,6 → 35,10 |
boutonOui.setWidth("20px"); |
} |
/* (non-Javadoc) |
* @see org.tela_botanica.del.client.vues.plateformedetermination.vote.barrerepartition.BarreRepartitionVoteVueInterface#afficherVotes(int, java.lang.String) |
*/ |
@Override |
public void afficherVotes(int pourcentage, String NomTaxon) { |
this.pourcentage = pourcentage; |
57,15 → 60,30 |
barreRepartitionHtmlBrut.setHTML(chaineHtml); |
} |
@Override |
public HTML getBarreRepartitionHtmlBrut() { |
return barreRepartitionHtmlBrut; |
} |
@Override |
public PushButton getBoutonOui() { |
return boutonOui; |
} |
@Override |
public PushButton getBoutonNon() { |
return boutonNon; |
} |
@Override |
public void setVoteOuiEffectue() { |
getBoutonOui().setEnabled(false); |
getBoutonNon().setEnabled(true); |
} |
@Override |
public void setVoteNonEffectue() { |
getBoutonOui().setEnabled(true); |
getBoutonNon().setEnabled(false); |
} |
} |
/trunk/src/org/tela_botanica/del/client/vues/plateformedetermination/vote/barrerepartition/BarreRepartitionVotePresenteur.java |
---|
12,34 → 12,51 |
import com.google.gwt.event.dom.client.ClickEvent; |
import com.google.gwt.event.dom.client.ClickHandler; |
import com.google.gwt.event.dom.client.HasClickHandlers; |
import com.google.gwt.event.shared.HandlerRegistration; |
import com.google.gwt.user.client.Window; |
import com.google.gwt.user.client.ui.HTML; |
import com.google.gwt.user.client.ui.HasWidgets; |
import com.google.gwt.user.client.ui.IsWidget; |
import com.google.gwt.user.client.ui.PushButton; |
public class BarreRepartitionVotePresenteur { |
private BarreRepartitionVoteVue vue = new BarreRepartitionVoteVue(); |
public interface Vue extends IsWidget { |
public abstract void afficherVotes(int pourcentage, String NomTaxon); |
public abstract IsWidget getBarreRepartitionHtmlBrut(); |
public abstract HasClickHandlers getBoutonOui(); |
public abstract HasClickHandlers getBoutonNon(); |
public abstract void setVoteOuiEffectue(); |
public abstract void setVoteNonEffectue(); |
} |
private MockDatasource validationService = MockDatasource.getInstance(); |
private Vue vue; |
private MoyenneVote moyenneVote; |
public void go(HasWidgets container) { |
container.add(vue); |
public BarreRepartitionVotePresenteur(Vue vue) { |
this.vue = vue; |
gererEvenements(); |
} |
public void go(HasWidgets container) { |
container.add(vue.asWidget()); |
} |
public void afficherVotes(MoyenneVote moyenneVote) { |
this.moyenneVote = moyenneVote; |
vue.afficherVotes(moyenneVote.getScore(), moyenneVote.getIntituleAssocie()); |
} |
public BarreRepartitionVoteVue getBarreRepartitionVoteVue() { |
public Vue getBarreRepartitionVoteVue() { |
return vue; |
} |
public HTML getBarreRepartitionVoteVueHTML() { |
public MoyenneVote getMoyenneVote() { |
return moyenneVote; |
} |
public IsWidget getBarreRepartitionVoteVueHTML() { |
return vue.getBarreRepartitionHtmlBrut(); |
} |
70,8 → 87,7 |
@Override |
public void onClick(ClickEvent event) { |
voter(false); |
vue.getBoutonOui().setEnabled(true); |
vue.getBoutonNon().setEnabled(false); |
vue.setVoteNonEffectue(); |
} |
}); |
} |
87,8 → 103,7 |
vd.setVote(valeurVote); |
vd.setId("3"); |
vue.getBoutonOui().setEnabled(!oui); |
vue.getBoutonNon().setEnabled(oui); |
if(oui) {vue.setVoteOuiEffectue();} else {vue.setVoteNonEffectue();} |
BusEvenementiel.getInstance().fireEvent(new EvenementVoteDetermination(vd)); |
} |