Subversion Repositories eFlore/Applications.cel

Rev

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

Rev 338 Rev 735
Line 1... Line 1...
1
package org.tela_botanica.client.vues.observation.indicateurs;
1
package org.tela_botanica.client.vues.observation.indicateurs;
Line 2... Line 2...
2
 
2
 
3
import org.tela_botanica.client.interfaces.Rafraichissable;
3
import org.tela_botanica.client.interfaces.Rafraichissable;
-
 
4
import org.tela_botanica.client.modeles.Configuration;
4
import org.tela_botanica.client.modeles.Configuration;
5
import org.tela_botanica.client.modeles.ImageCarnet;
Line 5... Line 6...
5
import org.tela_botanica.client.observation.ObservationMediateur;
6
import org.tela_botanica.client.observation.ObservationMediateur;
6
 
7
 
7
import com.google.gwt.event.dom.client.ClickEvent;
8
import com.google.gwt.event.dom.client.ClickEvent;
Line 245... Line 246...
245
		// c'est l'url de l'image qu'on associe à la vue
246
		// c'est l'url de l'image qu'on associe à la vue
246
		if(infosImages != null && infosImages.length != 0)
247
		if(infosImages != null && infosImages.length != 0)
247
		{
248
		{
248
			setTitle(titrePanneau+"         "+(index+1)+" / "+infosImages.length);
249
			setTitle(titrePanneau+"         "+(index+1)+" / "+infosImages.length);
Line 249... Line 250...
249
			
250
			
250
			getImage().setUrl(convertirIdEnUrl(infosImages[index][0]));
251
			getImage().setUrl(getUrlMiniature(index));
251
			imageWidth = Integer.parseInt(infosImages[index][1]);
252
			imageWidth = Integer.parseInt(infosImages[index][1]);
252
			imageHeight = Integer.parseInt(infosImages[index][2]);
253
			imageHeight = Integer.parseInt(infosImages[index][2]);
253
			verifierEtRetaillerImage();
254
			verifierEtRetaillerImage();
254
			activerPanneau(true);
255
			activerPanneau(true);
Line 475... Line 476...
475
			
476
			
Line 476... Line 477...
476
		}) ;
477
		}) ;
477
		
478
		
478
		mn.showAt(xy) ;
-
 
479
	}
-
 
480
	
-
 
481
	public String convertirIdEnUrl(String idImg)
-
 
482
	{
-
 
483
		int maxZeros = 9 - idImg.length();
-
 
484
		
-
 
485
		for (int j = 0; j < maxZeros; j++) {
-
 
486
			idImg = "0" + idImg;
-
 
487
		}
-
 
488
		
-
 
489
		String baseUrl = Configuration.getImageBaseUrl() ;
-
 
490
 
-
 
491
		String dossierNv1 = idImg.substring(0, 3);
-
 
492
		String dossierNv2 = idImg.substring(3, 6);
-
 
493
		String fichierNv = idImg.substring(6, 9);
-
 
494
 
-
 
495
		String nomFichier = dossierNv1 + "_" + dossierNv2 + "_" + fichierNv;
-
 
496
 
-
 
497
		String[] infosFichier = { nomFichier, dossierNv1, dossierNv2 };
-
 
498
		
-
 
Line 499... Line -...
499
		String urlImg = baseUrl + infosFichier[1] + "/" + infosFichier[2] + "/M/"
-
 
500
		+ infosFichier[0] + "_M.jpg";
-
 
501
		
-
 
502
		return urlImg ;
479
		mn.showAt(xy) ;
503
	}
480
	}
504
	
481
		
505
	/**
482
	/**
506
	 * Verifie si l'image est plus grande que le conteneur et la retaille le cas
483
	 * Verifie si l'image est plus grande que le conteneur et la retaille le cas
Line 553... Line 530...
553
			
530
			
554
			if(infosImages == null) {
531
			if(infosImages == null) {
555
				urlAgrandie = "ill_liaison.png";
532
				urlAgrandie = "ill_liaison.png";
556
				setTailleImage(265, 270);
533
				setTailleImage(265, 270);
557
			} else {
-
 
558
				urlAgrandie = convertirIdEnUrl(infosImages[index][0]).replace("_M", "_L") ;
534
			} else {
559
				urlAgrandie = urlAgrandie.replace("/M/", "/L/") ;
535
				urlAgrandie = getUrlAgrandie(index);
Line 560... Line 536...
560
			}
536
			}
561
			
537
			
562
			if(imgAgrandie == null) {
538
			if(imgAgrandie == null) {
Line 593... Line 569...
593
				imgAgrandie.setUrl(urlAgrandie);
569
				imgAgrandie.setUrl(urlAgrandie);
594
				imgAgrandie.setVisible(true);
570
				imgAgrandie.setVisible(true);
595
			}
571
			}
596
	}
572
	}
Line -... Line 573...
-
 
573
	
-
 
574
	private String getUrlMiniature(int index) {
-
 
575
		
-
 
576
		String[][] paramsImage = {{"ci_id_image",infosImages[index][0]}};
-
 
577
		ImageCarnet ic = new ImageCarnet(paramsImage);
-
 
578
		
-
 
579
		return ic.getUrlFormatGalerie();
-
 
580
	}
-
 
581
	
-
 
582
	private String getUrlAgrandie(int index) {
-
 
583
		String[][] paramsImage = {{"ci_id_image",infosImages[index][0]}};
-
 
584
		ImageCarnet ic = new ImageCarnet(paramsImage);
-
 
585
		
-
 
586
		return ic.getUrlFormatZoom();
-
 
587
	}
597
	
588
	
598
	private void afficherPanneauAgrandi() {
589
	private void afficherPanneauAgrandi() {
599
		agrandirImage();
590
		agrandirImage();
600
		imgZoom.show(this.getElement());
591
		imgZoom.show(this.getElement());
601
		imgZoom.setPosition((int)(Window.getClientWidth() - Window.getClientWidth()*0.50),(int)(Window.getClientHeight() - Window.getClientHeight()*0.85));
592
		imgZoom.setPosition((int)(Window.getClientWidth() - Window.getClientWidth()*0.50),(int)(Window.getClientHeight() - Window.getClientHeight()*0.85));