Subversion Repositories eFlore/Archives.cel-v2

Rev

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

Rev 4 Rev 12
Line 1... Line 1...
1
package org.tela_botanica.client.modeles;
1
package org.tela_botanica.client.modeles;
Line -... Line 2...
-
 
2
 
-
 
3
import java.util.HashMap;
-
 
4
import java.util.Iterator;
-
 
5
import java.util.Set;
-
 
6
 
-
 
7
import com.google.gwt.json.client.JSONObject;
-
 
8
 
-
 
9
/**
-
 
10
 * 
-
 
11
 * Classe representant une image du carnet,
-
 
12
 * elle ne contient pas d'image à proprement parler mais
-
 
13
 * plutôt les informations associées ainsi que l'url distante 
-
 
14
 * 
2
 
15
 */
-
 
16
public class ImageCarnet extends HashMap {
-
 
17
	
-
 
18
	/*
-
 
19
	// infos sur l'image
-
 
20
	private String url = " " ;
-
 
21
	private String ordre = " " ;
-
 
22
	private String utilisateur = " " ;
-
 
23
	private boolean publiable = false ;
-
 
24
	private String height = "0" ;
-
 
25
	private String width = "0" ;
-
 
26
	private String make = " " ;
-
 
27
	private String model = " " ;
-
 
28
	private String xResolution = "0" ;
-
 
29
	private String yResolution = "0" ;
-
 
30
	private String date = " " ;
-
 
31
	private String GPS = " " ;
-
 
32
	private String comment = " " ;
-
 
33
	
-
 
34
	// metadonnees exif
-
 
35
	private String exifExposureTime = " " ;
-
 
36
	private String exifFNumber = " " ;
-
 
37
	private String exifVersion = " " ;
-
 
38
	private String exifCompressedBitsPerPixel = " " ;
-
 
39
	private String exifShutterSpeedValue = " " ;
-
 
40
	private String exifApertureValue = " " ;
-
 
41
	private String exifExposureBiasValue = " " ;
-
 
42
	private String exifMaxApertureValue = " " ;
-
 
43
	private String exifMeteringMode = " " ;
-
 
44
	private String exifLightSource = " " ;
-
 
45
	private String exifFlash = "  " ;
-
 
46
	private String exifFocalLength = " " ;
-
 
47
	private String exifFlashPixVersion = " " ;
-
 
48
	private String exifColorSpace = " " ;
-
 
49
	private String exifInteroperabilityOffset = " " ;
-
 
50
	private String exifFocalPlaneXResolution = " " ;
-
 
51
	private String exifFocalPlaneYResolution = " " ;
-
 
52
	private String exifFocalPlaneResolutionUnit = " " ;
-
 
53
	private String exifSensingMethod = " " ;
-
 
54
	private String exifFileSource = " " ;
-
 
55
	private String exifCustomRendered = " " ;
-
 
56
	private String exifExposureMode = " " ;
-
 
57
	private String exifWhiteBalance = " " ;
-
 
58
	private String exifDigitalZoomRatio = " " ;
-
 
59
	private String exifSceneCaptureType = " " ;
-
 
60
	private String exifGainControl = " " ;
-
 
61
	private String exifContrast = " " ;
-
 
62
	private String exifSaturation = " " ;
-
 
63
	private String exifSharpness = " " ;
-
 
64
	private String exifSubjectDistanceRange = " " ;
Line -... Line 65...
-
 
65
	private String exifAutres = " " ;
-
 
66
	
-
 
67
	// metadonnes iptc
-
 
68
	private String iptcMotsCles = " " ;
3
public class ImageCarnet {
69
	private String iptcByLine = " " ;
-
 
70
	private String iptcByLineTitle = " " ;
-
 
71
	private String iptcCity = " " ;
-
 
72
	private String iptcSubLocation = " " ;
-
 
73
	private String iptcProvinceState = " " ;
4
	
74
	private String iptcCountryPrimaryLocationCode = " " ;
-
 
75
	private String iptcHeadline = " " ;
5
	private String url = null ;
76
	private String iptcCredit = " " ;
-
 
77
	private String iptcCopyrightNotice = " " ;
-
 
78
	private String iptcContact = " " ;
-
 
79
	private String iptcAutres = " " ;
-
 
80
	*/
-
 
81
 
-
 
82
	public ImageCarnet(JSONObject image)
-
 
83
	{	
-
 
84
		Set im = image.keySet() ;
-
 
85
		
-
 
86
		for (Iterator iterator = im.iterator(); iterator.hasNext();) {
-
 
87
			
-
 
88
			String key = (String) iterator.next();
-
 
89
			if(image.get(key).isString() != null)
-
 
90
			{
-
 
91
				String valeur = image.get(key).isString().stringValue() ;
-
 
92
				this.put(key, valeur) ;
-
 
93
			}
-
 
94
			
-
 
95
		}
-
 
96
 
-
 
97
	}
-
 
98
	
-
 
99
	public String renvoyerValeurCorrecte(String cle)
-
 
100
	{
-
 
101
		if(this.containsKey((cle)))
-
 
102
		{
-
 
103
			String valeur = (String)this.get(cle) ;
-
 
104
			if(valeur.equals("null"))
-
 
105
			{
-
 
106
				return " " ;
-
 
107
			}
-
 
108
			else
-
 
109
			{
-
 
110
				return valeur ;
-
 
111
			}
-
 
112
		}
-
 
113
		else
-
 
114
		{
-
 
115
			return " " ;
-
 
116
		}
-
 
117
	}
-
 
118
 
-
 
119
	
-
 
120
	public String getOrdre() {
-
 
121
		
Line 6... Line 122...
6
	private int numero = 0 ;
122
		return renvoyerValeurCorrecte("ci_ordre") ;
7
	private String nom = null ;
123
	}
8
	
-
 
9
	public ImageCarnet(String url,int numero,String nom)
124
	
10
	{
-
 
11
		this.url = url ;
125
	public String getBaseUrl()
Line 12... Line 126...
12
		this.numero = numero ;
126
	{
-
 
127
		return "http://localhost/Documents/images_serveur/" ;
13
		this.nom = nom ;
128
	}
14
	}
129
 
-
 
130
	public String getUrl() {
-
 
131
		
-
 
132
		return getBaseUrl()+(String)this.get("ci_id_image")+".jpg" ;
-
 
133
	}
-
 
134
	
-
 
135
	public String getSUrl() {
-
 
136
		
-
 
137
		return getBaseUrl()+(String)this.get("ci_id_image")+"_S.jpg" ;
-
 
138
	}
-
 
139
	
-
 
140
	public String getMUrl() {
-
 
141
		
Line 15... Line 142...
15
 
142
		return getBaseUrl()+(String)this.get("ci_id_image")+"_M.jpg" ;
-
 
143
	}
16
	public String getUrl() {
144
	
17
		return url;
145
 
Line -... Line 146...
-
 
146
 
18
	}
147
	public String getDate() {
-
 
148
		
19
 
149
		return renvoyerValeurCorrecte("ci_meta_date_time") ;
20
	public int getNumero() {
150
	}
21
		return numero;
-
 
Line -... Line 151...
-
 
151
 
-
 
152
 
-
 
153
	public Object getIptcCity() {
-
 
154
		
-
 
155
		return renvoyerValeurCorrecte("ci_meta_iptc_city") ;
-
 
156
	}
-
 
157
 
-
 
158
 
-
 
159
	public String getMake() {
-
 
160
		
-
 
161
		return renvoyerValeurCorrecte("ci_meta_make") ;
22
	}
162
	}