Line 28... |
Line 28... |
28 |
import com.gwtext.client.widgets.Container;
|
28 |
import com.gwtext.client.widgets.Container;
|
29 |
import com.gwtext.client.widgets.DataView;
|
29 |
import com.gwtext.client.widgets.DataView;
|
30 |
import com.gwtext.client.widgets.Panel;
|
30 |
import com.gwtext.client.widgets.Panel;
|
31 |
import com.gwtext.client.widgets.event.ContainerListener;
|
31 |
import com.gwtext.client.widgets.event.ContainerListener;
|
32 |
import com.gwtext.client.widgets.event.ContainerListenerAdapter;
|
32 |
import com.gwtext.client.widgets.event.ContainerListenerAdapter;
|
- |
|
33 |
import com.gwtext.client.widgets.event.DataViewListener;
|
33 |
import com.gwtext.client.widgets.event.DataViewListenerAdapter;
|
34 |
import com.gwtext.client.widgets.event.DataViewListenerAdapter;
|
34 |
import com.gwtext.client.widgets.event.PanelListenerAdapter;
|
35 |
import com.gwtext.client.widgets.event.PanelListenerAdapter;
|
35 |
import com.gwtext.client.widgets.grid.GridDragData;
|
36 |
import com.gwtext.client.widgets.grid.GridDragData;
|
Line 36... |
Line 37... |
36 |
|
37 |
|
Line 64... |
Line 65... |
64 |
/**
|
65 |
/**
|
65 |
* Booleen indiquant si la galerie est instanciƩe ou pas
|
66 |
* Booleen indiquant si la galerie est instanciƩe ou pas
|
66 |
*/
|
67 |
*/
|
67 |
private boolean estInstancie = false;
|
68 |
private boolean estInstancie = false;
|
Line 68... |
Line 69... |
68 |
|
69 |
|
Line 69... |
Line 70... |
69 |
private boolean garderRatio = false;
|
70 |
private boolean garderRatio = true;
|
Line 70... |
Line 71... |
70 |
|
71 |
|
Line 246... |
Line 247... |
246 |
// pour chacune des photos
|
247 |
// pour chacune des photos
|
247 |
final XTemplate template = new XTemplate(
|
248 |
final XTemplate template = new XTemplate(
|
248 |
new String[] {
|
249 |
new String[] {
|
249 |
"<tpl for='.'>",
|
250 |
"<tpl for='.'>",
|
250 |
"<div class='thumb-wrap' id='{num_image}'>",
|
251 |
"<div class='thumb-wrap' id='{num_image}'>",
|
251 |
"<div class='thumb'><img src='{url_image_M}' width='{taille_x_s} px' height='{taille_y_s} px' title='{num_image}'></div>",
|
252 |
"<div class='thumb dview-list'><img src='{url_image_M}' width='{taille_x_s} px' height='{taille_y_s} px' title='{nom_original}'></div>",
|
252 |
"<span>{nom}</span></div>", "</tpl>",
|
253 |
"<span></span></div>", "</tpl>",
|
253 |
"<div class='x-clear'></div>" });
|
254 |
"<div class='x-clear'></div>" });
|
254 |
// pour des raisons de performances on compile le template en une
|
255 |
// pour des raisons de performances on compile le template en une
|
255 |
// fonction
|
256 |
// fonction
|
256 |
template.compile();
|
257 |
template.compile();
|
Line 259... |
Line 260... |
259 |
// cree precedemment
|
260 |
// cree precedemment
|
260 |
dView = new DataView("div.thumb-wrap") {
|
261 |
dView = new DataView("div.thumb-wrap") {
|
Line 261... |
Line 262... |
261 |
|
262 |
|
262 |
public void prepareData(Data data) {
|
263 |
public void prepareData(Data data) {
|
263 |
data.setProperty("shortName", Format.ellipsis(data
|
264 |
data.setProperty("shortName", Format.ellipsis(data
|
Line 264... |
Line 265... |
264 |
.getProperty("num_image"), 15));
|
265 |
.getProperty("nom_original"), 15));
|
265 |
|
266 |
|
Line 266... |
Line 267... |
266 |
int[] XY = {data.getPropertyAsInt("taille_x") ,data.getPropertyAsInt("taille_y")} ;
|
267 |
int[] XY = {data.getPropertyAsInt("taille_x") ,data.getPropertyAsInt("taille_y")} ;
|
Line 288... |
Line 289... |
288 |
dView.setOverCls("x-view-over");
|
289 |
dView.setOverCls("x-view-over");
|
289 |
dView.setEmptyText("");
|
290 |
dView.setEmptyText("");
|
Line 290... |
Line 291... |
290 |
|
291 |
|
291 |
// creation du store
|
292 |
// creation du store
|
- |
|
293 |
FieldDef defNumImage = new IntegerFieldDef("num_image");
|
292 |
FieldDef defNumImage = new IntegerFieldDef("num_image");
|
294 |
FieldDef defNomImage = new StringFieldDef("nom_original");
|
293 |
FieldDef defDatImage = new StringFieldDef("dat_image");
|
295 |
FieldDef defDatImage = new StringFieldDef("dat_image");
|
294 |
FieldDef defLieImage = new StringFieldDef("lie_image");
|
296 |
FieldDef defLieImage = new StringFieldDef("lie_image");
|
295 |
FieldDef defAppImage = new StringFieldDef("app_image");
|
297 |
FieldDef defAppImage = new StringFieldDef("app_image");
|
296 |
FieldDef defUrlImageS = new StringFieldDef("url_image_S");
|
298 |
FieldDef defUrlImageS = new StringFieldDef("url_image_S");
|
297 |
FieldDef defUrlImageM = new StringFieldDef("url_image_M");
|
299 |
FieldDef defUrlImageM = new StringFieldDef("url_image_M");
|
298 |
FieldDef defUrlImage = new StringFieldDef("url_image");
|
300 |
FieldDef defUrlImage = new StringFieldDef("url_image");
|
299 |
FieldDef defTailleX = new IntegerFieldDef("taille_x");
|
301 |
FieldDef defTailleX = new IntegerFieldDef("taille_x");
|
300 |
FieldDef defTailleY = new IntegerFieldDef("taille_y");
|
302 |
FieldDef defTailleY = new IntegerFieldDef("taille_y");
|
301 |
FieldDef[] defTab = { defNumImage, defDatImage, defLieImage,
|
303 |
FieldDef[] defTab = { defNumImage, defNomImage, defDatImage, defLieImage,
|
302 |
defAppImage, defUrlImageS, defUrlImageM, defUrlImage,defTailleX,defTailleY};
|
304 |
defAppImage, defUrlImageS, defUrlImageM, defUrlImage,defTailleX,defTailleY};
|
303 |
RecordDef rd = new RecordDef(defTab);
|
305 |
RecordDef rd = new RecordDef(defTab);
|
304 |
st = new Store(rd);
|
306 |
st = new Store(rd);
|