Subversion Repositories eFlore/Applications.cel

Compare Revisions

Ignore whitespace Rev 211 → Rev 212

/trunk/src/org/tela_botanica/client/image/ImageModele.java
369,7 → 369,7
// si l'on a reçu une liste d'images
if (nouvelleDonnees instanceof ListeImageCarnet) {
ListeImageCarnet data = (ListeImageCarnet) nouvelleDonnees;
Object[][] photoData = new Object[data.size()][11];
Object[][] photoData = new Object[data.size()][12];
int i = 0;
 
if (data.size() == 0) {
380,16 → 380,17
for (Iterator<String> it = data.keySet().iterator(); it.hasNext();) {
ImageCarnet im = 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.getMUrl();
photoData[i][6] = im.getLUrl();
photoData[i][7] = im.getNote();
photoData[i][8] = im.getId();
photoData[i][9] = im.getTailleImage()[1];
photoData[i][10] = im.getTailleImage()[0];
photoData[i][1] = im.getNomOriginal();
photoData[i][2] = im.getDate();
photoData[i][3] = im.getIptcCity();
photoData[i][4] = im.getMake() + " " + im.getModel();
photoData[i][5] = im.getSUrl();
photoData[i][6] = im.getMUrl();
photoData[i][7] = im.getLUrl();
photoData[i][8] = im.getNote();
photoData[i][9] = im.getId();
photoData[i][10] = im.getTailleImage()[1];
photoData[i][11] = im.getTailleImage()[0];
 
i++;
}
396,6 → 397,7
 
// creation du store qui les contient
FieldDef defNumImage = new IntegerFieldDef("num_image");
FieldDef defNomImage = new StringFieldDef("nom_original");
FieldDef defDatImage = new StringFieldDef("dat_image");
FieldDef defLieImage = new StringFieldDef("lie_image");
FieldDef defAppImage = new StringFieldDef("app_image");
406,7 → 408,7
FieldDef defIdImage = new IntegerFieldDef("id_image");
FieldDef defTailleX = new IntegerFieldDef("taille_x");
FieldDef defTailleY = new IntegerFieldDef("taille_y");
FieldDef[] defTab = { defNumImage, defDatImage, defLieImage,
FieldDef[] defTab = { defNumImage,defNomImage, defDatImage, defLieImage,
defAppImage, defUrlImageS, defUrlImageM, defUrlImage,
defNoteImage, defIdImage, defTailleX, defTailleY };
RecordDef rd = new RecordDef(defTab);
/trunk/src/org/tela_botanica/client/image/ImageMediateur.java
1,6 → 1,8
package org.tela_botanica.client.image;
 
 
import java.util.List;
 
import org.tela_botanica.client.CarnetEnLigneMediateur;
import org.tela_botanica.client.interfaces.IdVue;
import org.tela_botanica.client.interfaces.ListePaginable;
173,8 → 175,7
/**
* constructeur privé (on accède a la classe par la méthode getInstance)
*/
private ImageMediateur() {
private ImageMediateur() {
initialiser() ;
}
 
808,6 → 809,16
public void montrerContextMenu(EventObject e) {
menuImageVue.showAt(e.getXY());
}
/**
* montre le menu au coordonnées indiquées
*
* @param e
* l'objet source de l'évenement
*/
public void montrerContextMenu(int[] XY) {
menuImageVue.showAt(XY);
}
 
/**
* appelé lors du double clic sur l'image agrandie
1350,11 → 1361,32
// SI l'enregistrement existe bel et bien
if(rddrop != null)
{
String idObs = rddrop.getAsString("id_obs")+"," ;
// on lie les observations
lierImagesObservation(idObs, idsImg) ;
String idObss = "";
Record[] selection = mv.getSelectionModel().getSelections();
boolean lierSelection = false;
// on itère sur toutes les observations selectionnées
for(int i=0; i<selection.length && lierSelection == false; i++) {
// si l'element sur lequel on a fait le drop fait partie
// de la selection alors on lie tout à la selection
if(selection[i].getId() == rddrop.getId()) {
lierSelection = true;
}
// si l'élement ne fait pas partie de la selection
//alors on ne lit qu'à celui sur lequel on a fait le drop
idObss += selection[i].getAsString("id_obs")+"," ;
}
String message = "";
if(!lierSelection) {
idObss = rddrop.getAsString("id_obs")+",";
message = "Lier la selection d'images à l'observation pointée ?";
} else {
message = "Lier la selection d'images aux observations selectionnées ?";
}
if(Window.confirm(message)) {
lierImagesObservation(idObss, idsImg) ;
}
}
return true ;
}
1418,10 → 1450,31
// si on a bien obtenu un enregistrement
if(rddrop != null)
{
// on récupère l'id de l'image et alors on appelle la fonction de liaison
String idImg = rddrop.getAsString("id_image")+"," ;
lierImagesObservation(idsObs, idImg) ;
String idImgs = "";
Record[] selection = galerieImage.getDView().getSelectedRecords();
boolean lierSelection = false;
// on itère sur toutes les images selectionnées
for(int i=0; i<selection.length && lierSelection == false; i++) {
// si l'element sur lequel on a fait le drop fait partie
// de la selection alors on lie tout à la selection
if(selection[i].getId() == rddrop.getId()) {
lierSelection = true;
}
// si l'élement ne fait pas partie de la selection
//alors on ne lit qu'à celui sur lequel on a fait le drop
idImgs += selection[i].getAsString("id_image")+"," ;
}
String message = "";
if(!lierSelection) {
idImgs = rddrop.getAsString("id_image")+",";
message = "Lier la selection d'observations à l'image pointée ?";
} else {
message = "Lier la selection d'observations aux images selectionnées ?";
}
if(Window.confirm(message)) {
lierImagesObservation(idsObs, idImgs) ;
}
return true ;
}