salut tt le monde je suis en train de realiser un projet gwt mais je suis bloqué sur un machin bizare au niveau d'une classe TavlGeofincingRule et plus precisament au niveau de la fonction RechercheButton.addClickHandler(new ClickHandler() { }
c'est une fonction qui fait une recherche apres le debug elle retourne le résultat souhaité comme elle ne peux rien retournée :cry:
chwi bloqué sur ce truc ca fait 15 jours et mon patron me presse trop je sais pas quoi faire aidez moi :arf:
voila le code source de la classe qui contien la methode RechercheButton.addClickHandler(new ClickHandler() { } :
////////////////////////////////////////////////////////////////////////parcourir par geofencing Configuration/////////////////////////////////////////////////////////
RechercheButton.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
// retourner les geofencingRuleId **/
compteur=0;
rechercheGeofencings.clear();
textItem3. clearValue();
textItem.clearValue();
textItem1.clearValue();
checkboxItem2.clearValue();
radioGroupItem.clearValue();
geofincingGrid.deselectAllRecords();
map.clearOverlays();
label.setContents("");
previousButton.setDisabled(true);
SuprimerButton.setDisabled(true);
UpdateButton.setDisabled(true);
FixerButton.setVisible(false);
ModifierButton.setVisible(false);
GeofencingRuleServiceAsync ruleServiceAsync=GeofencingRuleServiceAsync.Util.getInstance();
ruleServiceAsync.getGeofencingIdByObject(tavlObject.getSelectedRecord().getAttributeAsInt("id"), new AsyncCallback<List<GeofencingRuleDTO>>() {
@Override
public void onFailure(Throwable arg0) {
}
@Override
public void onSuccess(List<GeofencingRuleDTO> arg0) {
label.setVisible(true);
nextButton.setVisible(true) ;
previousButton.setVisible(true);
geofincingButton.setVisible(false) ;
SuprimerButton.setVisible(true);
UpdateButton.setVisible(true);
final int longeur=arg0.size();
longeurClass=longeur;
int tailleGeofencingRule= arg0.size();
int[] geofencingRuleId=new int[tailleGeofencingRule];
for( int s=0;s<tailleGeofencingRule;s++){
final RechercheGeofencing rechercheGeofencing=new RechercheGeofencing();
geofencingRuleId[s]=arg0.get(s).getGeofencingRuleId();
final String GeofencingName=arg0.get(s).getName();
final int valeur=geofencingRuleId[s];
final int[] verseau = new int[30];
// retourner les TavlObjectId
TavlObjectServiceAsync objectServiceAsync=TavlObjectServiceAsync.Util.getInstance();
objectServiceAsync.getObjectByGeofencingId(valeur, new AsyncCallback<List<TavlObjectDTO>>() {
@Override
public void onFailure(Throwable arg1) {
}
@Override
public void onSuccess(List<TavlObjectDTO> arg1) {
int taille3= arg1.size();
final int[] tavlObjectId;
tavlObjectId=new int[taille3];
for(int h=0;h<taille3;h++){
tavlObjectId[h]=arg1.get(h).getObjectId();
verseau[h]=tavlObjectId[h];
}
}
});
// ici la requette de recherche pour chaque zone et sa propre Polygon
ZoneServiceAsync async= ZoneServiceAsync.Util.getInstance();
async.getZoneByGofincingId(geofencingRuleId[s], new AsyncCallback<List<ZoneDTO>>() {
@Override
public void onFailure(Throwable arg2) {
}
@Override
public void onSuccess(List<ZoneDTO> arg2) {
final int TableForPolygon=arg2.get(0).getZoneId();
final String ZoneName=arg2.get(0).getName();
final String Comment=arg2.get(0).getComment();
final int InOut=arg2.get(0).getType();
PolygonZoneServiceAsync polygonZoneServiceAsync=PolygonZoneServiceAsync.Util.getInstance();
polygonZoneServiceAsync.getPolygonByZoneId(TableForPolygon, new AsyncCallback<List<PolygonZoneDTO>>() {
@Override
public void onFailure(Throwable arg3) {
}
@Override
public void onSuccess(List<PolygonZoneDTO> arg3) {
rechercheGeofencing.setGeofencingId(valeur);
rechercheGeofencing.setGeofencingName(GeofencingName);
rechercheGeofencing.setObjectId(verseau);
rechercheGeofencing.setZoneId(TableForPolygon);
rechercheGeofencing.setZoneName(ZoneName);
rechercheGeofencing.setComment(Comment);
rechercheGeofencing.setInOut(InOut);
int taille4= arg3.size();
int[] polygonZoneId=new int[taille4];
float[] X=new float[taille4] ;
float[] Y=new float[taille4] ;
for(int w=0;w<taille4;w++){
polygonZoneId[w]=arg3.get(w).getPolygonZoneId();
X[w]=arg3.get(w).getX();
Y[w]=arg3.get(w).getY();
rechercheGeofencing.setPolygonZoneId(polygonZoneId);
rechercheGeofencing.setX(X);
rechercheGeofencing.setY(Y);
// rechercheGeofencings.add(rechercheGeofencing);
}
rechercheGeofencings.add(rechercheGeofencing); // objet 17 le 134 fine kayemchi pourtatn kayna 3 dans longeur
compt++;
if(compt==longeurClass){
//lahnaya 1er resulta de recherche/////////////////////////////////////////////////////
if(!rechercheGeofencings.isEmpty()){
int delimiteur= rechercheGeofencings.size();
label.setContents((compteur+1)+"/"+delimiteur);
geofincingGrid.deselectAllRecords();
RechercheGeofencing geofencing1=new RechercheGeofencing();
geofencing1=rechercheGeofencings.get(compteur);
textItem3.setDefaultValue(geofencing1.getGeofencingName()) ;
textItem.setDefaultValue(geofencing1.getZoneName());
textItem1.setDefaultValue(geofencing1.getComment());
checkboxItem2.setDefaultValue(geofencing1.getInOut());
radioGroupItem.setDefaultValue(geofencing1.getInOut());
for(int y=0;y<geofencing1.ObjectId.length;y++){
Record record =new Record();
if(geofencing1.ObjectId[y]!=0){
record=geofincingGrid.getRecordList().find("id", geofencing1.ObjectId[y]);
geofincingGrid.selectRecord(record);//verifiha
}
}
//parcourir les polygons sur carte
int color=rechercheGeofencings.get(compteur).getInOut();
float[] X1= rechercheGeofencings.get(compteur).getX();
float[] Y1= rechercheGeofencings.get(compteur).getY();
int longeur=X1.length;
LatLng[] lngs=new LatLng[longeur];
map.clearOverlays();
for(int r=0;r<longeur-1;r++){
double latt=(double)X1[r];
double longg=(double)Y1[r];
LatLng overlay=LatLng.newInstance(latt, longg);
lngs[r]=overlay;
if(r==lngs.length-2){
if(color==0){
Polygon polygon5=new Polygon(lngs,"red",1,1.0,"red",0.1);
map.addOverlay(polygon5);
}
if(color==1){
Polygon polygon5=new Polygon(lngs,"lime",1,1.0,"lime",0.1);
map.addOverlay(polygon5);
}
}
}
compteur++;
compt=0;
}
//////////////////////////////////////////////////////////////
}
}
});
}
});
} //end of for
}
});
}
});