Subversion Repositories eFlore/Applications.del

Rev

Rev 144 | Rev 186 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 144 Rev 172
1
package org.tela_botanica.del.client.vues.plateformedetermination.vote.barrerepartition;
1
package org.tela_botanica.del.client.vues.plateformedetermination.vote.barrerepartition;
2
 
2
 
3
import org.tela_botanica.del.client.vues.plateformedetermination.vote.EnsembleVotesVue;
3
import org.tela_botanica.del.client.vues.plateformedetermination.vote.EnsembleVotesVue;
4
 
4
 
5
import com.google.gwt.core.client.GWT;
5
import com.google.gwt.core.client.GWT;
6
import com.google.gwt.uibinder.client.UiBinder;
6
import com.google.gwt.uibinder.client.UiBinder;
7
import com.google.gwt.uibinder.client.UiField;
7
import com.google.gwt.uibinder.client.UiField;
8
import com.google.gwt.user.client.Window;
8
import com.google.gwt.user.client.Window;
9
import com.google.gwt.user.client.ui.Composite;
9
import com.google.gwt.user.client.ui.Composite;
10
import com.google.gwt.user.client.ui.HTML;
10
import com.google.gwt.user.client.ui.HTML;
11
import com.google.gwt.user.client.ui.Widget;
11
import com.google.gwt.user.client.ui.Widget;
12
 
12
 
13
public class BarreRepartitionVoteVue extends Composite {
13
public class BarreRepartitionVoteVue extends Composite {
14
	
14
	
15
	interface MyUiBinder extends UiBinder<Widget, BarreRepartitionVoteVue> {}
15
	interface MyUiBinder extends UiBinder<Widget, BarreRepartitionVoteVue> {}
16
 
16
 
17
	private static MyUiBinder uiBinder = GWT.create(MyUiBinder.class);
17
	private static MyUiBinder uiBinder = GWT.create(MyUiBinder.class);
18
	
18
	
-
 
19
	private int pourcentage = -1;
-
 
20
	
19
	private int pourcentage = 0;
21
	private int tailleBarre = 0;
20
	
22
	
21
	private String NomTaxon = "";
23
	private String NomTaxon = "";
22
	
24
	
23
	@UiField(provided = true)
25
	@UiField(provided = true)
24
	public HTML barreRepartitionHtmlBrut = new HTML("<div class=\"barreRepartition\"></div>");
26
	public HTML barreRepartitionHtmlBrut = new HTML("<div class=\"barreRepartition\"></div>");
25
	
27
	
26
	public BarreRepartitionVoteVue() {
28
	public BarreRepartitionVoteVue() {
27
		initWidget(uiBinder.createAndBindUi(this));
29
		initWidget(uiBinder.createAndBindUi(this));
28
	}
30
	}
29
	
31
	
30
	public void afficherVotes(int pourcentage, String NomTaxon) {
32
	public void afficherVotes(int pourcentage, String NomTaxon) {
31
		
33
		
32
		this.pourcentage = pourcentage;
34
		this.pourcentage = pourcentage;
33
		this.NomTaxon = NomTaxon;
35
		this.NomTaxon = NomTaxon;
-
 
36
		
-
 
37
		tailleBarre = (pourcentage > -1) ? pourcentage : 0;
-
 
38
		
-
 
39
		String classe = "barreRepartition";
-
 
40
		if(pourcentage == -1) {
-
 
41
			classe = "barreRepartitionAucunVote";
-
 
42
		}
-
 
43
		
34
		String chaineHtml = "<div class=\"conteneurBarreRepartition\">" +
44
		String chaineHtml = "<div class=\"conteneurBarreRepartition\">" +
35
							"<div class=\"barreRepartition\">"+
45
							"<div class=\""+classe+"\">"+
36
							"<div style=\"width:"+pourcentage+"%\" class=\"elementBarreRepartition voteOui\"></div>"+
46
							"<div style=\"width:"+tailleBarre+"%\" class=\"elementBarreRepartition voteOui\"></div>"+
37
							"</div>"+
47
							"</div>"+
38
							"<span class=\"nomTaxonBarreRepartition\">"+NomTaxon+"</span>"+
48
							"<span class=\"nomTaxonBarreRepartition\">"+NomTaxon+"</span>"+
39
							"</div>";
49
							"</div>";
40
		barreRepartitionHtmlBrut.setHTML(chaineHtml);	
50
		barreRepartitionHtmlBrut.setHTML(chaineHtml);	
41
	}
51
	}
-
 
52
	
-
 
53
	public HTML getBarreRepartitionHtmlBrut() {
-
 
54
		return barreRepartitionHtmlBrut;
-
 
55
	}
42
 
56
 
43
}
57
}