Subversion Repositories eFlore/Archives.cel-v2

Compare Revisions

Ignore whitespace Rev 21 → Rev 22

/trunk/src/org/tela_botanica/client/vues/ListeImageVue.java
11,6 → 11,7
import org.tela_botanica.client.modeles.ListeImageCarnet;
 
 
import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.user.client.Window;
import com.gwtext.client.core.EventObject;
import com.gwtext.client.data.ArrayReader;
22,7 → 23,11
import com.gwtext.client.data.Store;
import com.gwtext.client.data.StoreMgr;
import com.gwtext.client.data.StringFieldDef;
import com.gwtext.client.widgets.BoxComponent;
import com.gwtext.client.widgets.Component;
import com.gwtext.client.widgets.Container;
import com.gwtext.client.widgets.Panel;
import com.gwtext.client.widgets.event.ComponentListenerAdapter;
import com.gwtext.client.widgets.event.ContainerListener;
import com.gwtext.client.widgets.event.ContainerListenerAdapter;
import com.gwtext.client.widgets.event.PanelListener;
33,9 → 38,12
import com.gwtext.client.widgets.grid.GridPanel;
import com.gwtext.client.widgets.grid.GridView;
import com.gwtext.client.widgets.grid.Renderer;
import com.gwtext.client.widgets.grid.RowSelectionModel;
import com.gwtext.client.widgets.grid.event.GridCellListener;
import com.gwtext.client.widgets.grid.event.GridListener;
import com.gwtext.client.widgets.grid.event.GridRowListener;
import com.gwtext.client.widgets.grid.event.RowSelectionListener;
import com.gwtext.client.widgets.grid.event.RowSelectionListenerAdapter;
import com.gwtext.client.widgets.layout.AnchorLayout;
import com.gwtext.client.widgets.layout.FitLayout;
import com.gwtextux.client.data.BufferedStore;
101,45 → 109,32
this.setAutoWidth(true);
FieldDef defNumImage = new StringFieldDef("num_image");
// creation du store
FieldDef defNumImage = new IntegerFieldDef("num_image");
FieldDef defDatImage = new StringFieldDef("dat_image");
FieldDef defLieImage = new StringFieldDef("lie_image");
FieldDef defAppImage = new StringFieldDef("app_image");
FieldDef defUrlImageS = new StringFieldDef("url_image_S");
FieldDef defUrlImage = new StringFieldDef("url_imag");
FieldDef[] defTab = {defNumImage,defDatImage,defLieImage,defAppImage,defUrlImageS,defUrlImage};
FieldDef defUrlImageM = new StringFieldDef("url_image_M");
FieldDef defUrlImage = new StringFieldDef("url_image");
FieldDef[] defTab = {defNumImage,defDatImage,defLieImage,defAppImage,defUrlImageS,defUrlImageM,defUrlImage};
RecordDef rd = new RecordDef(defTab) ;
st = new Store(rd) ;
this.setStore(st);
this.getView().setAutoFill(true) ;
this.setLoadMask(true) ;
//this.setLoadMask(true) ;
this.setLoadMask("chargement") ;
ajouterListeners() ;
}
// role : configurer les colonnes affichées dans la grille
private void initialiser() {
getIMediateur().obtenirPhotoGalerie(this);
estInstancie = true ;
}
public void ajouterListeners()
{
{
this.addListener(new ContainerListenerAdapter() {
 
 
public boolean doBeforeRender(Component component)
{
initialiser();
return true ;
}
public void onHide(Component component) {
// TODO Auto-generated method stub
146,16 → 141,22
}
 
public void onRender(Component component) {
 
public void onRender(Component component) {
// TODO Auto-generated method stub
if(!isEstInstancie())
{
setEstInstancie(true) ;
getIMediateur().synchroniserSelection("galerie") ;
}
}
 
 
public void onShow(Component component) {
}
 
});
163,25 → 164,44
 
 
public void onRowClick(GridPanel grid, int rowIndex, EventObject e) {
getIMediateur().clicListeImage(rowIndex, e) ;
;
getIMediateur().clicListeImage(rowIndex) ;
}
 
public void onRowContextMenu(GridPanel grid, int rowIndex,
EventObject e) {
// TODO Auto-generated method stub
getIMediateur().montrerContextMenu(e) ;
}
 
public void onRowDblClick(GridPanel grid, int rowIndex,
EventObject e) {
getIMediateur().doubleClicListeImage(rowIndex, e) ;
 
getIMediateur().doubleClicListeImage(rowIndex) ;
}
});
this.getSelectionModel().addListener(new RowSelectionListenerAdapter() {
 
public void onSelectionChange(RowSelectionModel sm) {
if(sm.getCount() <= 0)
{
getIMediateur().aucuneSelection() ;
}
else
{
getIMediateur().selection() ;
getIMediateur().synchroniserSelection("liste");
}
}
});
}
202,45 → 222,17
 
public void rafraichir(Object nouvelleDonnees, boolean repandreRafraichissement) {
if(nouvelleDonnees instanceof ListeImageCarnet && estInstancie)
if(nouvelleDonnees instanceof Store)
{
ListeImageCarnet data = (ListeImageCarnet) nouvelleDonnees ;
Object[][] photoData = new Object[data.size()][6];
int i = 0 ;
for (Iterator it = data.keySet().iterator(); it.hasNext();)
{
ImageCarnet im = (ImageCarnet) data.get(it.next());
photoData[i][0] = im.getOrdre() ;
photoData[i][1] = im.getDate() ;
photoData[i][2] = im.getIptcCity() ;
photoData[i][3] = im.getMake()+" "+im.getModel() ;
photoData[i][4] = im.getSUrl() ;
photoData[i][5] = im.getUrl() ;
i++ ;
}
FieldDef defNumImage = new IntegerFieldDef("num_image");
FieldDef defDatImage = new StringFieldDef("dat_image");
FieldDef defLieImage = new StringFieldDef("lie_image");
FieldDef defAppImage = new StringFieldDef("app_image");
FieldDef defUrlImage = new StringFieldDef("url_image_S");
FieldDef defUrlImageL = new StringFieldDef("url_image");
FieldDef[] defTab = {defNumImage,defDatImage,defLieImage,defAppImage,defUrlImage,defUrlImageL};
final MemoryProxy dataProxy = new MemoryProxy(photoData);
final ArrayReader reader = new ArrayReader(new RecordDef(defTab));
final Store photoStore = new Store(dataProxy, reader);
st = photoStore;
st = (Store)nouvelleDonnees;
st.load();
this.reconfigure(st, this.getColumnModel());
photoStore.load();
}
if(repandreRafraichissement)
{
getIMediateur().synchroniserZoomListeGalerie(nouvelleDonnees, this) ;
getIMediateur().synchroniserDonneesZoomListeGalerie(nouvelleDonnees, this) ;
}
}
 
273,6 → 265,39
public ColumnConfig getCl() {
return cl;
}
 
 
/**
* @return the estInstancie
*/
public boolean isEstInstancie() {
return estInstancie;
}
 
 
/**
* @param estInstancie the estInstancie to set
*/
public void setEstInstancie(boolean estInstancie) {
this.estInstancie = estInstancie;
}
 
 
/**
* @param mediateur the iMediateur to set
*/
public void setIMediateur(ImageMediateur mediateur) {
iMediateur = mediateur;
}
 
public void selectionnerEnregistrements(Record[] sel) {
if(isEstInstancie())
{
getSelectionModel().clearSelections() ;
getSelectionModel().selectRecords(sel) ;
}
}
 
/trunk/src/org/tela_botanica/client/vues/MenuImageVue.java
4,6 → 4,7
 
import com.google.gwt.user.client.ui.MenuItem;
import com.gwtext.client.core.EventObject;
import com.gwtext.client.widgets.Toolbar;
import com.gwtext.client.widgets.menu.BaseItem;
import com.gwtext.client.widgets.menu.Item;
import com.gwtext.client.widgets.menu.Menu;
24,8 → 25,9
iMediateur = im ;
uploaderImage = new Item("Uploader des images") ;
supprimerImage = new Item("Supprimer les images selectionnées") ;
addItem(uploaderImage);
//this.addItem(supprimerImage) ;
addItem(supprimerImage) ;
ajouterListeners() ;
63,11 → 65,17
if(item.equals(uploaderImage))
{
getIMediateur().uploaderImage() ;
getIMediateur().uploaderImages() ;
hide() ;
}
if(item.equals(supprimerImage))
{
getIMediateur().supprimerImages() ;
hide() ;
}
}
 
/trunk/src/org/tela_botanica/client/vues/ZoomImageVue.java
40,7 → 40,7
 
image.sinkEvents(Event.ONDBLCLICK);
image.setUrl("image/vide.jpg");
image.setUrl("vide.jpg");
this.setLayout(new BorderLayout());
61,10 → 61,26
{
getImage().setUrl((String)nouvelleDonnees);
}
else
{
getImage().setUrl("/images/vide.jpeg") ;
}
}
public void desactiverPanneau()
{
getImage().setUrl("/images/vide.jpeg") ;
prev.setEnabled(false) ;
suiv.setEnabled(false);
}
public void activerPanneau()
{
prev.setEnabled(true);
suiv.setEnabled(true);
}
public void ajouterListenersBoutons()
{
prev.addClickListener(new ClickListener() {
/trunk/src/org/tela_botanica/client/vues/PanneauMetadonneesVue.java
1,6 → 1,7
package org.tela_botanica.client.vues;
 
import java.util.Date;
import java.util.HashMap;
 
import org.tela_botanica.client.image.ImageMediateur;
import org.tela_botanica.client.interfaces.Rafraichissable;
30,6 → 31,8
import com.gwtext.client.widgets.layout.VerticalLayout;
import com.gwtext.client.widgets.menu.DateItem;
import com.gwtext.client.widgets.menu.Menu;
import com.gwtext.client.widgets.tree.TreeNode;
import com.gwtext.client.widgets.tree.TreePanel;
 
public class PanneauMetadonneesVue extends TabPanel implements Rafraichissable {
 
45,6 → 48,9
private Panel panneauIptcGrid = null ;
private Panel panneauInfoGrid = null ;
private TreePanel panneauMotsCles = null ;
private HashMap motclesIds = null ;
private TextField commentaireGeneral = null ;
private DateField dateImage = null ;
Button validerInfo = null ;
60,7 → 66,13
panneauExifGrid = new Panel("Exif") ;
panneauIptcGrid = new Panel("Iptc") ;
panneauInfoGrid = new Panel("info") ;
panneauMotsCles = new TreePanel("Mots clés") ;
TreeNode root = new TreeNode("Mots clés") ;
panneauMotsCles.setRootNode(root) ;
panneauMotsCles.setRootVisible(false);
panneauInfoGrid.setLayout(new VerticalLayout());
panneauInfoGrid.setHeight(500);
Label labelComm = new Label("Commentaires :") ;
96,6 → 108,7
this.add(panneauInfoGrid) ;
this.add(panneauExifGrid) ;
this.add(panneauIptcGrid) ;
this.add(panneauMotsCles) ;
gViewExif = new GridView();
gViewExif.setForceFit(true);
107,6 → 120,7
ExifGrid.setAutoWidth(true);
ExifGrid.setAutoHeight(true);
ExifGrid.setSorted(false);
ExifGrid.setDisableSelection(true);
gViewIptc = new GridView();
gViewIptc.setForceFit(true);
123,8 → 137,20
panneauExifGrid.add(ExifGrid);
panneauIptcGrid.add(IptcGrid);
this.doLayout(true) ;
}
public void desactiverPanneau()
{
this.setDisabled(true) ;
}
public void activerPanneau()
{
this.setDisabled(false) ;
}
public ImageMediateur getIMediateur()
{
return imediateur ;
173,11 → 199,7
ExifGrid.setSource(exifSource);
IptcGrid.setSource(iptcSource);
gViewExif.refresh(true) ;
gViewIptc.refresh(true) ;
 
}
}
}
/trunk/src/org/tela_botanica/client/vues/BarreOutilsVue.java
New file
0,0 → 1,50
package org.tela_botanica.client.vues;
 
import org.tela_botanica.client.image.ImageMediateur;
 
import com.google.gwt.core.client.JavaScriptObject;
import com.gwtext.client.core.EventObject;
import com.gwtext.client.widgets.Button;
import com.gwtext.client.widgets.Component;
import com.gwtext.client.widgets.Toolbar;
import com.gwtext.client.widgets.ToolbarMenuButton;
import com.gwtext.client.widgets.event.ButtonListener;
import com.gwtext.client.widgets.event.ButtonListenerAdapter;
import com.gwtext.client.widgets.menu.Menu;
 
public class BarreOutilsVue extends Toolbar {
ToolbarMenuButton images = null ;
ImageMediateur iMediateur = null ;
MenuImageVue imageMenu = null ;
 
public BarreOutilsVue(ImageMediateur im) {
super() ;
iMediateur = im ;
imageMenu = new MenuImageVue(im) ;
images = new ToolbarMenuButton("Images",imageMenu) ;
this.addButton(images) ;
}
 
 
/**
* @return the images
*/
public ToolbarMenuButton getImages() {
return images;
}
 
 
/**
* @return the iMediateur
*/
public ImageMediateur getIMediateur() {
return iMediateur;
}
 
}
/trunk/src/org/tela_botanica/client/vues/GalerieImageVue.java
18,6 → 18,7
import com.gwtext.client.core.XTemplate;
import com.gwtext.client.data.ArrayReader;
import com.gwtext.client.data.FieldDef;
import com.gwtext.client.data.IntegerFieldDef;
import com.gwtext.client.data.MemoryProxy;
import com.gwtext.client.data.Record;
import com.gwtext.client.data.RecordDef;
124,8 → 125,16
 
 
public void onSelectionChange(DataView view, Element[] selections) {
//TODO: appeler le mediateur
if(selections.length <= 0)
{
getIMediateur().aucuneSelection();
}
else
{
getIMediateur().selection() ;
getIMediateur().synchroniserSelection("galerie") ;
}
}
});
142,7 → 151,7
new String[]{
"<tpl for='.'>",
"<div class='thumb-wrap' id='{num_image}'>",
"<div class='thumb'><img src='{url_image_S}' title='{num_image}'></div>",
"<div class='thumb'><img src='{url_image_M}' title='{num_image}'></div>",
"<span>{nom}</span></div>", "</tpl>",
"<div class='x-clear'></div>"});
template.compile();
166,11 → 175,14
// creation du store
FieldDef defNumImage = new StringFieldDef("num_image");
FieldDef defNumImage = new IntegerFieldDef("num_image");
FieldDef defDatImage = new StringFieldDef("dat_image");
FieldDef defLieImage = new StringFieldDef("lie_image");
FieldDef defAppImage = new StringFieldDef("app_image");
FieldDef defUrlImageS = new StringFieldDef("url_image_S");
FieldDef defUrlImageM = new StringFieldDef("url_image_M");
FieldDef defUrlImage = new StringFieldDef("url_image");
FieldDef defUrlImageM = new StringFieldDef("url_image_M");
FieldDef defUrlImageS = new StringFieldDef("url_image_S");
FieldDef[] defTab = {defNumImage,defUrlImage,defUrlImageM,defUrlImageS};
FieldDef[] defTab = {defNumImage,defDatImage,defLieImage,defAppImage,defUrlImageS,defUrlImageM,defUrlImage};
RecordDef rd = new RecordDef(defTab) ;
st = new Store(rd) ;
dView.setStore(st);
189,42 → 201,18
public void rafraichir(Object nouvelleDonnees, boolean repandreRafraichissement) {
if(nouvelleDonnees instanceof ListeImageCarnet)
{
ListeImageCarnet data = (ListeImageCarnet) nouvelleDonnees ;
Object[][] photoData = new Object[data.size()][4];
int i = 0 ;
for (Iterator it = data.keySet().iterator(); it.hasNext();)
{
ImageCarnet im = (ImageCarnet) data.get(it.next());
photoData[i][0] = im.getOrdre() ;
photoData[i][1] = im.getUrl() ;
photoData[i][2] = im.getSUrl() ;
photoData[i][3] = im.getMUrl() ;
i++ ;
}
final MemoryProxy dataProxy = new MemoryProxy(photoData);
final ArrayReader reader = new ArrayReader(new RecordDef(
new FieldDef[]{new StringFieldDef("num_image"),
new StringFieldDef("url_image"),
new StringFieldDef("url_image_S"),
new StringFieldDef("url_image_M")}));
final Store photoStore = new Store(dataProxy, reader);
photoStore.load();
st = photoStore;
if(nouvelleDonnees instanceof Store)
{
st = (Store)nouvelleDonnees;
st.load() ;
dView.setStore(st);
dView.refresh();
if(repandreRafraichissement)
{
getIMediateur().synchroniserZoomListeGalerie(nouvelleDonnees, this) ;
}
dView.refresh();
}
 
if(repandreRafraichissement)
{
getIMediateur().synchroniserDonneesZoomListeGalerie(nouvelleDonnees, this) ;
}
}
 
 
255,4 → 243,11
return id_selection ;
}
 
 
public void selectionnerImages(int[] ids) {
getDView().select(ids) ;
}
}