Subversion Repositories eFlore/Archives.cel-v2

Rev

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

Rev 4 Rev 5
Line 1... Line 1...
1
package org.tela_botanica.client.image;
1
package org.tela_botanica.client.image;
Line -... Line 2...
-
 
2
 
2
 
3
import org.tela_botanica.client.interfaces.Rafraichissable;
3
import org.tela_botanica.client.vues.GalerieImageVue;
4
import org.tela_botanica.client.vues.GalerieImageVue;
4
import org.tela_botanica.client.vues.ListeImageVue;
5
import org.tela_botanica.client.vues.ListeImageVue;
Line -... Line 6...
-
 
6
import org.tela_botanica.client.vues.ZoomImageVue;
-
 
7
 
-
 
8
import com.google.gwt.user.client.DOM;
-
 
9
import com.google.gwt.user.client.Element;
-
 
10
import com.google.gwt.user.client.Event;
5
import org.tela_botanica.client.vues.ZoomImageVue;
11
import com.google.gwt.user.client.Window;
-
 
12
import com.gwtext.client.core.EventObject;
-
 
13
import com.gwtext.client.core.RegionPosition;
-
 
14
import com.gwtext.client.data.Record;
6
 
15
import com.gwtext.client.data.Store;
7
import com.gwtext.client.core.RegionPosition;
16
import com.gwtext.client.widgets.DataView;
8
import com.gwtext.client.widgets.Panel;
17
import com.gwtext.client.widgets.Panel;
9
import com.gwtext.client.widgets.TabPanel;
18
import com.gwtext.client.widgets.TabPanel;
Line 94... Line 103...
94
 
103
 
95
	public Panel getDetailsEtMotsCles() {
104
	public Panel getDetailsEtMotsCles() {
96
		return detailsEtMotsCles;
105
		return detailsEtMotsCles;
Line -... Line 106...
-
 
106
	}
-
 
107
	
-
 
108
	public void synchroniserZoomListeGalerie(Object o, Rafraichissable r)
-
 
109
	{
-
 
110
		if(r != getGalerieImage())
-
 
111
		{
-
 
112
			getGalerieImage().rafraichir(o);
-
 
113
		}
-
 
114
		if(r != getZoomImage())
-
 
115
		{
-
 
116
			getZoomImage().rafraichir(o);
-
 
117
		}
-
 
118
		if(r != getListeImage())
-
 
119
		{
-
 
120
			getListeImage().rafraichir(o);
-
 
121
		}
-
 
122
	}
-
 
123
	
-
 
124
	
-
 
125
	public void ObtenirPhotoGalerie(Rafraichissable r)
-
 
126
	{
-
 
127
		getIControleur().obtenirPhotoGalerie(r) ;
-
 
128
	}
-
 
129
	
-
 
130
	public void ClicGalerieImage(int index, Element node,
-
 
131
			EventObject e)
-
 
132
	{
-
 
133
		Record rd = getGalerieImage().getDView().getRecord(node) ;
-
 
134
		String imgUrl = rd.getAsString("url_image"); 
-
 
135
		
-
 
136
		getZoomImage().rafraichir(imgUrl);
-
 
137
		
-
 
138
		if(DOM.eventGetType(e.getBrowserEvent()) == Event.ONDBLCLICK)
-
 
139
		{
-
 
140
			getOngletsImage().setActiveTab(1);
-
 
141
		}
-
 
142
	}
-
 
143
	
-
 
144
	public void DoubleClicZoomImage()
-
 
145
	{
-
 
146
		getOngletsImage().setActiveTab(0);
-
 
147
	}
-
 
148
	
-
 
149
	public void ClicBoutonZoomImage(String arg)
-
 
150
	{
-
 
151
		
-
 
152
		DataView dv = getGalerieImage().getDView();
-
 
153
		Store st = getGalerieImage().getSt();
-
 
154
		Record nRec = null ;
-
 
155
		
-
 
156
		final int selected = st.indexOf(dv.getSelectedRecords()[0]);
-
 
157
		int storeIndex = dv.indexOf(selected);
-
 
158
		
-
 
159
		
-
 
160
		if(arg.equals("prev"))
-
 
161
		{
-
 
162
			// si la photo séléctionnée est la première, on passe à la
-
 
163
			// dernière
-
 
164
			if (selected == 0) {
-
 
165
				storeIndex = st.getCount() - 1 ;
-
 
166
				nRec = st.getAt(storeIndex);
-
 
167
	
-
 
168
			} 
-
 
169
			else 
-
 
170
			{
-
 
171
				storeIndex = storeIndex - 1 ;
-
 
172
				nRec = st.getAt(storeIndex);
-
 
173
			}
-
 
174
			
-
 
175
			
-
 
176
		}
-
 
177
		
-
 
178
		if(arg.equals("suiv"))
-
 
179
		{
-
 
180
			// si la photo selectionnée est la dernière on passe à la
-
 
181
			// première
-
 
182
			if (selected == st.getCount() - 1) {
-
 
183
				
-
 
184
				storeIndex = 0 ;
-
 
185
				nRec = st.getAt(0);
-
 
186
			} 
-
 
187
			else 
-
 
188
			{
-
 
189
				storeIndex = storeIndex + 1 ;
-
 
190
				nRec = st.getAt(storeIndex);
-
 
191
			}
-
 
192
		}
-
 
193
		
-
 
194
		if(nRec != null)
-
 
195
		{
-
 
196
			getZoomImage().rafraichir(nRec.getAsString("url_image"));
-
 
197
			dv.select(storeIndex);
-
 
198
		}
Line 97... Line 199...
97
	}
199
	}