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 4... Line 4...
4
 
4
 
5
import org.tela_botanica.client.image.ImageMediateur;
5
import org.tela_botanica.client.image.ImageMediateur;
Line -... Line 6...
-
 
6
import org.tela_botanica.client.interfaces.Rafraichissable;
6
import org.tela_botanica.client.interfaces.Rafraichissable;
7
 
-
 
8
 
7
 
9
import com.gwtext.client.data.ArrayReader;
8
 
10
import com.gwtext.client.data.FieldDef;
9
import com.gwtext.client.data.FieldDef;
11
import com.gwtext.client.data.MemoryProxy;
10
import com.gwtext.client.data.Record;
12
import com.gwtext.client.data.Record;
11
import com.gwtext.client.data.RecordDef;
13
import com.gwtext.client.data.RecordDef;
-
 
14
import com.gwtext.client.data.Store;
-
 
15
import com.gwtext.client.data.StoreMgr;
-
 
16
import com.gwtext.client.data.StringFieldDef;
-
 
17
import com.gwtext.client.widgets.Component;
12
import com.gwtext.client.data.Store;
18
import com.gwtext.client.widgets.event.ContainerListenerAdapter;
13
import com.gwtext.client.data.StoreMgr;
19
import com.gwtext.client.widgets.event.PanelListener;
14
import com.gwtext.client.data.StringFieldDef;
20
import com.gwtext.client.widgets.event.PanelListenerAdapter;
15
import com.gwtext.client.widgets.grid.CellMetadata;
21
import com.gwtext.client.widgets.grid.CellMetadata;
16
import com.gwtext.client.widgets.grid.ColumnConfig;
22
import com.gwtext.client.widgets.grid.ColumnConfig;
Line 40... Line 46...
40
	
46
	
Line 41... Line 47...
41
	
47
	
42
	public ListeImageVue(ImageMediateur im) {
-
 
43
		
-
 
Line 44... Line 48...
44
		this.iMediateur = im ;
48
	public ListeImageVue(ImageMediateur im) {
45
		configurerColonnes();
49
		
46
		configurerStore();
-
 
47
		
-
 
48
		
-
 
49
		setAutoWidth(true);
-
 
50
		setAutoHeight(true);	
-
 
Line 51... Line 50...
51
	}
50
		this.iMediateur = im ;
52
	
51
		
Line 53... Line 52...
53
	
52
		
54
	// role : configurer les colonnes affichées dans la grille
53
		setAutoWidth(true);
Line 55... Line 54...
55
	private void configurerColonnes() {	
54
		setAutoHeight(true);
56
		
55
		
57
		numImage = new ColumnConfig("numéro d'image","num_image",150,true);		
56
		numImage = new ColumnConfig("numéro d'image","num_image",150,true);		
Line 58... Line 57...
58
		urlImage = new ColumnConfig("Image","url_image",150,true,new Renderer() {
57
		urlImage = new ColumnConfig("Image","url_image",150,true,new Renderer() {
Line 76... Line 75...
76
		FieldDef[] defTab = {defNumImage,defUrlImage};
75
		FieldDef[] defTab = {defNumImage,defUrlImage};
77
		RecordDef rd = new RecordDef(defTab) ;
76
		RecordDef rd = new RecordDef(defTab) ;
78
		st = new Store(rd) ;
77
		st = new Store(rd) ;
79
		this.setStore(st);
78
		this.setStore(st);
Line 80... Line -...
80
		
-
 
-
 
79
		
81
		
80
		ajouterListeners() ;
Line 82... Line 81...
82
	}
81
	}
83
	
82
	
Line -... Line 83...
-
 
83
	
Line 84... Line 84...
84
	
84
	// role : configurer les colonnes affichées dans la grille
-
 
85
	private void initialiser() {
-
 
86
		
-
 
87
		getIMediateur().ObtenirPhotoGalerie(this);
-
 
88
		
-
 
89
		
-
 
90
	}
-
 
91
	
-
 
92
	public void ajouterListeners()
-
 
93
	{
-
 
94
		this.addListener(new ContainerListenerAdapter() {
-
 
95
 
-
 
96
 
-
 
97
			public void onHide(Component component) {
-
 
98
				// TODO Auto-generated method stub
-
 
99
				
-
 
100
			}
-
 
101
 
-
 
102
 
-
 
103
			public void onRender(Component component) {
-
 
104
				// TODO Auto-generated method stub
-
 
105
				
-
 
106
			}
-
 
107
 
-
 
108
 
-
 
109
			public void onShow(Component component) {
-
 
110
				
Line 85... Line 111...
85
	// role : préparer le store et faire l'appel aux données nécessaires
111
				
86
	private void configurerStore() {
112
					initialiser();
Line -... Line 113...
-
 
113
			}
-
 
114
			
-
 
115
		});
-
 
116
	}
-
 
117
 
-
 
118
 
-
 
119
	public void rafraichir(Object nouvelleDonnees) {
-
 
120
		// TODO Auto-generated method stub
-
 
121
		
-
 
122
		Object[][] photoData = (Object[][])nouvelleDonnees ;
-
 
123
		final MemoryProxy dataProxy = new MemoryProxy(photoData);
-
 
124
		final ArrayReader reader = new ArrayReader(new RecordDef(
-
 
125
				new FieldDef[]{new StringFieldDef("num_image"),
-
 
126
						new StringFieldDef("url_image")}));
-
 
127
 
-
 
128
		final Store photoStore = new Store(dataProxy, reader);
-
 
129
		photoStore.load();
-
 
130
 
-
 
131
		st = photoStore;
-
 
132
		this.reconfigure(st, modeleColonnes);
-
 
133
	}
-
 
134
 
-
 
135
 
-
 
136
	public ImageMediateur getIMediateur() {
-
 
137
		return iMediateur;
-
 
138
	}
-
 
139
 
-
 
140
 
-
 
141
	public ColumnConfig getNumImage() {
-
 
142
		return numImage;
-
 
143
	}
-
 
144
 
-
 
145
 
-
 
146
	public ColumnConfig getUrlImage() {
-
 
147
		return urlImage;
-
 
148
	}
-
 
149
 
-
 
150
 
-
 
151
	public ColumnModel getModeleColonnes() {
-
 
152
		return modeleColonnes;
-
 
153
	}
87
		
154
 
Line 88... Line 155...
88
		
155