Subversion Repositories eFlore/Archives.cel-v2

Rev

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

Rev 4 Rev 5
Line 3... Line 3...
3
 
3
 
4
import org.tela_botanica.client.image.ImageMediateur;
4
import org.tela_botanica.client.image.ImageMediateur;
Line -... Line 5...
-
 
5
import org.tela_botanica.client.interfaces.Rafraichissable;
-
 
6
 
-
 
7
 
-
 
8
import com.google.gwt.user.client.DOM;
5
import org.tela_botanica.client.interfaces.Rafraichissable;
9
import com.google.gwt.user.client.Event;
-
 
10
import com.google.gwt.user.client.Window;
6
 
11
import com.google.gwt.user.client.ui.ClickListener;
7
 
12
import com.google.gwt.user.client.ui.Image;
8
import com.google.gwt.user.client.ui.Image;
13
import com.google.gwt.user.client.ui.Widget;
9
import com.gwtext.client.core.RegionPosition;
14
import com.gwtext.client.core.RegionPosition;
10
import com.gwtext.client.widgets.Button;
15
import com.gwtext.client.widgets.Button;
Line 22... Line 27...
22
	public ZoomImageVue(ImageMediateur im)
27
	public ZoomImageVue(ImageMediateur im)
23
	{
28
	{
24
		super("Zoom");
29
		super("Zoom");
Line 25... Line 30...
25
		
30
		
26
		iMediateur = im ;
31
		iMediateur = im ;
-
 
32
		image = new Image() {
-
 
33
			public void onBrowserEvent(Event event) {
-
 
34
				if (Event.ONDBLCLICK == DOM.eventGetType(event)) {
-
 
35
 
-
 
36
					getIMediateur().DoubleClicZoomImage();
-
 
37
				}
-
 
38
			}
-
 
39
		};
-
 
40
 
-
 
41
		image.sinkEvents(Event.ONDBLCLICK);
27
		image = new Image();
42
		
Line 28... Line 43...
28
		image.setUrl("images/vide.jpg");
43
		image.setUrl("image/vide.jpg");
Line 29... Line 44...
29
		
44
		
30
		this.setLayout(new BorderLayout());
45
		this.setLayout(new BorderLayout());
Line 31... Line 46...
31
		
46
		
32
		prev.setWidth("5%");
47
		prev.setWidth("5%");
33
		suiv.setWidth("5%");
48
		suiv.setWidth("5%");
-
 
49
		
-
 
50
		this.add(prev,new BorderLayoutData(RegionPosition.WEST));
34
		
51
		this.add(image,new BorderLayoutData(RegionPosition.CENTER));
Line 35... Line 52...
35
		this.add(prev,new BorderLayoutData(RegionPosition.WEST));
52
		this.add(suiv,new BorderLayoutData(RegionPosition.EAST));
36
		this.add(image,new BorderLayoutData(RegionPosition.CENTER));
-
 
Line -... Line 53...
-
 
53
		
-
 
54
		ajouterListenersBoutons();
-
 
55
	}
-
 
56
 
-
 
57
	
-
 
58
	public void rafraichir(Object nouvelleDonnees) {
-
 
59
		
-
 
60
		if(nouvelleDonnees instanceof String)
-
 
61
		{
-
 
62
			getImage().setUrl((String)nouvelleDonnees);
-
 
63
		}
-
 
64
		
-
 
65
		
-
 
66
	}
-
 
67
	
-
 
68
	public void ajouterListenersBoutons()
-
 
69
	{
-
 
70
		prev.addClickListener(new ClickListener() {
-
 
71
 
-
 
72
			public void onClick(Widget sender) {
-
 
73
				
-
 
74
				getIMediateur().ClicBoutonZoomImage("prev");
-
 
75
			}
-
 
76
			
-
 
77
		});
-
 
78
		
-
 
79
		suiv.addClickListener(new ClickListener() {
-
 
80
 
-
 
81
			public void onClick(Widget sender) {
-
 
82
				
-
 
83
				
-
 
84
				getIMediateur().ClicBoutonZoomImage("suiv");
-
 
85
			}
-
 
86
			
-
 
87
		});
-
 
88
	}
-
 
89
 
-
 
90
 
-
 
91
	public ImageMediateur getIMediateur() {
-
 
92
		return iMediateur;
-
 
93
	}
-
 
94
 
-
 
95
 
-
 
96
	public Image getImage() {
-
 
97
		return image;
-
 
98
	}
-
 
99
 
-
 
100
 
37
		this.add(suiv,new BorderLayoutData(RegionPosition.EAST));
101
	public com.google.gwt.user.client.ui.Button getPrev() {
Line 38... Line 102...
38
	}
102
		return prev;