Subversion Repositories eFlore/Applications.del

Rev

Rev 966 | Rev 1005 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 966 Rev 1004
Line 2... Line 2...
2
 
2
 
3
import com.google.gwt.core.client.GWT;
3
import com.google.gwt.core.client.GWT;
4
import com.google.gwt.event.dom.client.HasClickHandlers;
4
import com.google.gwt.event.dom.client.HasClickHandlers;
5
import com.google.gwt.uibinder.client.UiBinder;
5
import com.google.gwt.uibinder.client.UiBinder;
6
import com.google.gwt.uibinder.client.UiField;
-
 
7
import com.google.gwt.user.client.Element;
-
 
8
import com.google.gwt.user.client.Window;
6
import com.google.gwt.uibinder.client.UiField;
9
import com.google.gwt.user.client.ui.Composite;
7
import com.google.gwt.user.client.ui.Composite;
10
import com.google.gwt.user.client.ui.Label;
8
import com.google.gwt.user.client.ui.Label;
11
import com.google.gwt.user.client.ui.Panel;
9
import com.google.gwt.user.client.ui.Panel;
12
import com.google.gwt.user.client.ui.PushButton;
10
import com.google.gwt.user.client.ui.PushButton;
Line 13... Line 11...
13
import com.google.gwt.user.client.ui.Widget;
11
import com.google.gwt.user.client.ui.Widget;
14
 
12
 
15
public class BarreRepartitionVoteVue extends Composite implements BarreRepartitionVotePresenteur.Vue {
13
public class BarreRepartitionVoteVue extends Composite implements BarreRepartitionVotePresenteur.Vue {
-
 
14
 
-
 
15
	interface MyUiBinder extends UiBinder<Widget, BarreRepartitionVoteVue> {
16
	
16
	}
-
 
17
 
17
	interface MyUiBinder extends UiBinder<Widget, BarreRepartitionVoteVue> {}
18
	private static MyUiBinder uiBinder = GWT.create(MyUiBinder.class);
18
	private static MyUiBinder uiBinder = GWT.create(MyUiBinder.class);
19
	private InfoBulleAnim animerVotePrisEnCompte;
-
 
20
	private InfoBulleAnim animerVoteModifie;
19
	private InfoBulleAnim animer;
21
 
-
 
22
	@UiField
20
	
23
	Label nomTaxon;
-
 
24
	@UiField
21
	@UiField Label nomTaxon;
25
	Panel barreOui, barreNon, votePrisEnCompte, voteModifie;
22
	@UiField Panel barreOui, barreNon, votePrisEnCompte;
26
	@UiField
23
	@UiField PushButton boutonOui, boutonNon;
27
	PushButton boutonOui, boutonNon;
24
	
28
 
25
	public BarreRepartitionVoteVue() {
29
	public BarreRepartitionVoteVue() {
-
 
30
		initWidget(uiBinder.createAndBindUi(this));
26
		initWidget(uiBinder.createAndBindUi(this));
31
		votePrisEnCompte.setVisible(false);
-
 
32
		voteModifie.setVisible(false);
27
		votePrisEnCompte.setVisible(false);
33
		animerVotePrisEnCompte = new InfoBulleAnim(votePrisEnCompte);
28
		animer = new InfoBulleAnim(votePrisEnCompte);
34
		animerVoteModifie = new InfoBulleAnim(voteModifie);
29
	}
35
	}
30
	
36
 
31
	@Override
37
	@Override
32
	public void afficherVotes(int pourcentage, String nomTaxon) {
38
	public void afficherVotes(int pourcentage, String nomTaxon) {
33
		this.nomTaxon.setText(nomTaxon);
39
		this.nomTaxon.setText(nomTaxon);
34
		this.nomTaxon.setTitle(nomTaxon);
40
		this.nomTaxon.setTitle(nomTaxon);
35
		
41
 
36
		if (pourcentage > -1) {
42
		if (pourcentage > -1) {
37
			
43
 
38
			int pourcentageNon = 100-pourcentage;
44
			int pourcentageNon = 100 - pourcentage;
39
			barreOui.setWidth(pourcentage + "%");
45
			barreOui.setWidth(pourcentage + "%");
40
			barreNon.setWidth(pourcentageNon + "%");
46
			barreNon.setWidth(pourcentageNon + "%");
41
		} else {
47
		} else {
42
			barreNon.setWidth("0px");
48
			barreNon.setWidth("0px");
43
			barreOui.setWidth("0px");
49
			barreOui.setWidth("0px");
44
		}
50
		}
45
	}
51
	}
46
	
52
 
47
	@Override
53
	@Override
48
	public HasClickHandlers getBoutonOui() {
54
	public HasClickHandlers getBoutonOui() {
49
		return boutonOui;
55
		return boutonOui;
50
	}
56
	}
51
	
57
 
52
	@Override
58
	@Override
53
	public HasClickHandlers getBoutonNon() {
59
	public HasClickHandlers getBoutonNon() {
Line 66... Line 72...
66
		boutonNon.setEnabled(false);
72
		boutonNon.setEnabled(false);
67
	}
73
	}
Line 68... Line 74...
68
 
74
 
69
	@Override
75
	@Override
70
	public void afficherVotePrisEnCompte(boolean voteOui) {
76
	public void afficherVotePrisEnCompte(boolean voteOui) {
71
		if (voteOui) { 
77
		if (voteOui) {
72
			votePrisEnCompte.removeStyleName("votePrisEnCompteNon");
78
			votePrisEnCompte.removeStyleName("votePrisEnCompteNon");
73
			votePrisEnCompte.setStyleName("votePrisEnCompteOui");
79
			votePrisEnCompte.setStyleName("votePrisEnCompteOui");
74
		} else {
80
		} else {
75
			votePrisEnCompte.removeStyleName("votePrisEnCompteOui");
81
			votePrisEnCompte.removeStyleName("votePrisEnCompteOui");
76
			votePrisEnCompte.setStyleName("votePrisEnCompteNon");
82
			votePrisEnCompte.setStyleName("votePrisEnCompteNon");
-
 
83
		}
-
 
84
		animerVotePrisEnCompte.run(2000);
-
 
85
	}
-
 
86
 
-
 
87
	public void afficherVoteModifie(boolean voteOui) {
-
 
88
		if (voteOui) {
-
 
89
			voteModifie.removeStyleName("votePrisEnCompteNon");
-
 
90
			voteModifie.setStyleName("votePrisEnCompteOui");
-
 
91
		} else {
-
 
92
			voteModifie.removeStyleName("votePrisEnCompteOui");
-
 
93
			voteModifie.setStyleName("votePrisEnCompteNon");
77
		}
94
		}
78
		animer.run(2000);
95
		animerVoteModifie.run(2000);
Line 79... Line 96...
79
	}
96
	}
80
 
97
 
81
	@Override
98
	@Override