140 |
aurelien |
1 |
package org.tela_botanica.del.client.vues.plateformedetermination.vote.barrerepartition;
|
|
|
2 |
|
|
|
3 |
import org.tela_botanica.del.client.vues.plateformedetermination.vote.EnsembleVotesVue;
|
|
|
4 |
|
|
|
5 |
import com.google.gwt.core.client.GWT;
|
|
|
6 |
import com.google.gwt.uibinder.client.UiBinder;
|
|
|
7 |
import com.google.gwt.uibinder.client.UiField;
|
|
|
8 |
import com.google.gwt.user.client.ui.Composite;
|
|
|
9 |
import com.google.gwt.user.client.ui.HTML;
|
|
|
10 |
import com.google.gwt.user.client.ui.Widget;
|
|
|
11 |
|
|
|
12 |
public class BarreRepartitionVoteVue extends Composite {
|
|
|
13 |
|
|
|
14 |
interface MyUiBinder extends UiBinder<Widget, BarreRepartitionVoteVue> {}
|
|
|
15 |
|
|
|
16 |
private static MyUiBinder uiBinder = GWT.create(MyUiBinder.class);
|
|
|
17 |
|
|
|
18 |
private int pourcentage = 0;
|
|
|
19 |
|
|
|
20 |
@UiField(provided = true)
|
|
|
21 |
public HTML barreRepartitionHtmlBrut = new HTML("<div class=\"barreRepartition\"></div>");
|
|
|
22 |
|
|
|
23 |
public BarreRepartitionVoteVue() {
|
|
|
24 |
afficherVotes(70);
|
|
|
25 |
initWidget(uiBinder.createAndBindUi(this));
|
|
|
26 |
}
|
|
|
27 |
|
|
|
28 |
public void afficherVotes(int pourcentage) {
|
|
|
29 |
this.pourcentage = pourcentage;
|
|
|
30 |
String chaineHtml = "<div class=\"barreRepartition\">"+
|
|
|
31 |
"<div style=\"width:"+pourcentage+"%\" class=\"elementBarreRepartition voteOui\"></div>"+
|
|
|
32 |
"</div>";
|
|
|
33 |
barreRepartitionHtmlBrut = new HTML(chaineHtml);
|
|
|
34 |
}
|
|
|
35 |
|
|
|
36 |
}
|