New file |
0,0 → 1,57 |
package org.tela_botanica.del.client.vues.plateformedetermination.vote.barrerepartition; |
|
import org.tela_botanica.del.client.vues.plateformedetermination.vote.EnsembleVotesVue; |
|
import com.google.gwt.core.client.GWT; |
import com.google.gwt.uibinder.client.UiBinder; |
import com.google.gwt.uibinder.client.UiField; |
import com.google.gwt.user.client.Window; |
import com.google.gwt.user.client.ui.Composite; |
import com.google.gwt.user.client.ui.HTML; |
import com.google.gwt.user.client.ui.Widget; |
|
public class BarreRepartitionVoteVue extends Composite { |
|
interface MyUiBinder extends UiBinder<Widget, BarreRepartitionVoteVue> {} |
|
private static MyUiBinder uiBinder = GWT.create(MyUiBinder.class); |
|
private int pourcentage = -1; |
|
private int tailleBarre = 0; |
|
private String NomTaxon = ""; |
|
@UiField(provided = true) |
public HTML barreRepartitionHtmlBrut = new HTML("<div class=\"barreRepartition\"></div>"); |
|
public BarreRepartitionVoteVue() { |
initWidget(uiBinder.createAndBindUi(this)); |
} |
|
public void afficherVotes(int pourcentage, String NomTaxon) { |
|
this.pourcentage = pourcentage; |
this.NomTaxon = NomTaxon; |
|
tailleBarre = (pourcentage > -1) ? pourcentage : 0; |
|
String classe = "barreRepartition"; |
if(pourcentage == -1) { |
classe = "barreRepartitionAucunVote"; |
} |
|
String chaineHtml = "<div class=\"conteneurBarreRepartition\">" + |
"<div class=\""+classe+"\">"+ |
"<div style=\"width:"+tailleBarre+"%\" class=\"elementBarreRepartition voteOui\"></div>"+ |
"</div>"+ |
"<span class=\"nomTaxonBarreRepartition\">"+NomTaxon+"</span>"+ |
"</div>"; |
barreRepartitionHtmlBrut.setHTML(chaineHtml); |
} |
|
public HTML getBarreRepartitionHtmlBrut() { |
return barreRepartitionHtmlBrut; |
} |
|
} |