Revision 12716 trunk/extensions/extRasterTools-SE/src/org/gvsig/rastertools/properties/panels/InfoPanel.java
InfoPanel.java | ||
---|---|---|
21 | 21 |
import java.awt.BorderLayout; |
22 | 22 |
import java.awt.event.ItemEvent; |
23 | 23 |
import java.awt.event.ItemListener; |
24 |
import java.awt.geom.NoninvertibleTransformException; |
|
25 | 24 |
import java.awt.geom.Point2D; |
26 | 25 |
import java.io.File; |
27 | 26 |
|
... | ... | |
73 | 72 |
* <P> |
74 | 73 |
* Metadatos |
75 | 74 |
* </P> |
76 |
*
|
|
75 |
* |
|
77 | 76 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
78 |
*
|
|
77 |
* |
|
79 | 78 |
*/ |
80 | 79 |
|
81 | 80 |
public class InfoPanel extends JPanel implements IRegistrablePanel { //, ComponentListener { |
... | ... | |
134 | 133 |
|
135 | 134 |
/** |
136 | 135 |
* This method initializes this |
137 |
*
|
|
136 |
* |
|
138 | 137 |
* @return void |
139 | 138 |
*/ |
140 | 139 |
public void initialize() { |
... | ... | |
153 | 152 |
|
154 | 153 |
/** |
155 | 154 |
* This method initializes jScrollPane |
156 |
*
|
|
155 |
* |
|
157 | 156 |
* @return javax.swing.JScrollPane |
158 | 157 |
*/ |
159 | 158 |
private JScrollPane getJScrollPane() { |
... | ... | |
166 | 165 |
|
167 | 166 |
/** |
168 | 167 |
* This method initializes jComboBox |
169 |
*
|
|
168 |
* |
|
170 | 169 |
* @return javax.swing.JComboBox |
171 | 170 |
*/ |
172 | 171 |
private JComboBox getJComboBox() { |
... | ... | |
178 | 177 |
|
179 | 178 |
/** |
180 | 179 |
* This method initializes jEditorPane |
181 |
*
|
|
180 |
* |
|
182 | 181 |
* @return javax.swing.JEditorPane |
183 | 182 |
*/ |
184 | 183 |
private JEditorPane getJEditorPane() { |
... | ... | |
196 | 195 |
|
197 | 196 |
/** |
198 | 197 |
* Controla la alternatividad de colores en la tabla. |
199 |
*
|
|
198 |
* |
|
200 | 199 |
* @return Cadena con el color de la fila siguiente. |
201 | 200 |
*/ |
202 | 201 |
private String getColor() { |
... | ... | |
208 | 207 |
/** |
209 | 208 |
* Obtiene una entrada de la tabla en formato HTML a partir de una propiedad, |
210 | 209 |
* un valor y un color. |
211 |
*
|
|
210 |
* |
|
212 | 211 |
* @param prop |
213 | 212 |
* Nombre de la propiedad |
214 | 213 |
* @param value |
215 | 214 |
* Valor |
216 | 215 |
* @param color |
217 | 216 |
* Color |
218 |
*
|
|
217 |
* |
|
219 | 218 |
* @return Entrada HTML de la tabla |
220 | 219 |
*/ |
221 | 220 |
private String setHTMLBasicProperty(String prop, String value) { |
... | ... | |
230 | 229 |
|
231 | 230 |
/** |
232 | 231 |
* Obtiene una cabecera de tabla en formato HTML a partir de un titulo. |
233 |
*
|
|
232 |
* |
|
234 | 233 |
* @param title |
235 | 234 |
* Nombre del titulo |
236 | 235 |
* @param colspan |
237 | 236 |
* Numero de celdas que ocupara el titulo |
238 |
*
|
|
237 |
* |
|
239 | 238 |
* @return Entrada HTML del titulo |
240 | 239 |
*/ |
241 | 240 |
private String setHTMLTitleTable(String title, int colspan) { |
... | ... | |
247 | 246 |
|
248 | 247 |
/** |
249 | 248 |
* Obtiene una cabecera de tabla en formato HTML a partir de un titulo. |
250 |
*
|
|
249 |
* |
|
251 | 250 |
* @param content |
252 | 251 |
* Codigo HTML de las filas que componen la tabla. |
253 |
*
|
|
252 |
* |
|
254 | 253 |
* @return Entrada HTML de la tabla completa |
255 | 254 |
*/ |
256 | 255 |
private String setHTMLTable(String content) { |
... | ... | |
259 | 258 |
|
260 | 259 |
/** |
261 | 260 |
* Genera el HTML para todo el contenido. |
262 |
*
|
|
261 |
* |
|
263 | 262 |
* @param content |
264 | 263 |
* Codigo HTML que ira en el <body>...</body>. |
265 |
*
|
|
264 |
* |
|
266 | 265 |
* @return HTML completo |
267 | 266 |
*/ |
268 | 267 |
private String setHTMLBody(String content) { |
... | ... | |
277 | 276 |
/** |
278 | 277 |
* M?todo que crea el c?digo HTML para la tabla de informaci?n general dentro |
279 | 278 |
* del panel de informaci?n de raster |
280 |
*
|
|
279 |
* |
|
281 | 280 |
* @return String con el c?figo HTML que corresponde con la tabla de |
282 | 281 |
* informaci?n general |
283 | 282 |
*/ |
... | ... | |
302 | 301 |
/** |
303 | 302 |
* M?todo que crea el c?digo HTML para la tabla de Coordenadas Geogr?ficas |
304 | 303 |
* dentro del panel de informaci?n de raster |
305 |
*
|
|
304 |
* |
|
306 | 305 |
* @return String con el c?figo HTML que corresponde con la tabla de |
307 | 306 |
* Coordenadas Geogr?ficas |
308 | 307 |
*/ |
... | ... | |
323 | 322 |
|
324 | 323 |
double pixelSizeX = op.getAffineTransform().getScaleX(); |
325 | 324 |
double pixelSizeY = op.getAffineTransform().getScaleY(); |
326 |
|
|
325 |
|
|
327 | 326 |
propiedades += setHTMLBasicProperty(PluginServices.getText(this, "tamPixX"), String.valueOf(pixelSizeX)); |
328 | 327 |
propiedades += setHTMLBasicProperty(PluginServices.getText(this, "tamPixY"), String.valueOf(pixelSizeY)); |
329 | 328 |
|
... | ... | |
333 | 332 |
/** |
334 | 333 |
* M?todo que crea la tabla de origen de datos dentro del panel |
335 | 334 |
* de Informaci?n. |
336 |
*
|
|
335 |
* |
|
337 | 336 |
* @return String con el c?digo HTML de la tabla. |
338 | 337 |
*/ |
339 | 338 |
public String tablaOrigen() { |
340 | 339 |
rowColor = true; |
341 | 340 |
String propiedades = ""; |
342 | 341 |
String bandType = ""; |
343 |
|
|
342 |
|
|
344 | 343 |
String cabOrig = PluginServices.getText(this, "origin"); |
345 |
|
|
344 |
|
|
346 | 345 |
String cabecera = setHTMLTitleTable(cabOrig, 2); |
347 | 346 |
bandType = RasterUtilities.typesToString(op.getDataType()[selectedDataSet]); |
348 | 347 |
|
... | ... | |
352 | 351 |
|
353 | 352 |
return "<br>" + setHTMLTable(cabecera + propiedades); |
354 | 353 |
} |
355 |
|
|
354 |
|
|
356 | 355 |
/** |
357 | 356 |
* M?todo para crear la tabla de proyecci?n del raster en el |
358 | 357 |
* panel de informaci?n de propiedades de raster. |
359 |
*
|
|
358 |
* |
|
360 | 359 |
* @return String con el c?digo HTML que genera la tabla de proyecci?n. |
361 | 360 |
*/ |
362 | 361 |
public String tablaProjection() { |
363 | 362 |
rowColor = true; |
364 | 363 |
String propiedades = ""; |
365 | 364 |
String projection = null; |
366 |
|
|
365 |
|
|
367 | 366 |
boolean datos = false; |
368 | 367 |
|
369 | 368 |
String cabProjection = PluginServices.getText(this, "projection"); |
... | ... | |
375 | 374 |
datos = true; |
376 | 375 |
propiedades += setHTMLBasicProperty(null, projection); |
377 | 376 |
} |
378 |
|
|
377 |
|
|
379 | 378 |
if (datos == false) return ""; |
380 | 379 |
|
381 | 380 |
return "<br>" + setHTMLTable(cabecera + propiedades); |
382 | 381 |
} |
383 |
|
|
382 |
|
|
384 | 383 |
/** |
385 | 384 |
* M?todo para crear la tabla de informaci?n de metadatos del raster en el |
386 | 385 |
* panel de informaci?n de propiedades de raster. |
387 |
*
|
|
386 |
* |
|
388 | 387 |
* @param Vector |
389 | 388 |
* con los georasterfiles cargados en la capa. |
390 | 389 |
* @return String con el c?digo HTML que genera la tabla. |
... | ... | |
393 | 392 |
rowColor = true; |
394 | 393 |
String propiedades = ""; |
395 | 394 |
String[] metadatos = null; |
396 |
|
|
395 |
|
|
397 | 396 |
DatasetMetadata meta = null; |
398 | 397 |
boolean datos = false; |
399 | 398 |
|
... | ... | |
407 | 406 |
for(int j = 0 ; j<metadatos.length ; j++){ |
408 | 407 |
datos = true; |
409 | 408 |
int index = metadatos[j].indexOf("="); |
410 |
|
|
409 |
|
|
411 | 410 |
propiedades += setHTMLBasicProperty(metadatos[j].substring(0,index), metadatos[j].substring(index+1)); |
412 | 411 |
} |
413 | 412 |
} |
414 |
|
|
413 |
|
|
415 | 414 |
if(datos == false) |
416 | 415 |
return ""; |
417 | 416 |
|
418 | 417 |
return "<br>" + setHTMLTable(cabecera + propiedades); |
419 | 418 |
} |
420 | 419 |
|
421 |
/**
|
|
420 |
/** |
|
422 | 421 |
* M?todo que dibuja las tablas HTML del panel de informaci?n dentro de las |
423 | 422 |
* propiedades de r?ster. Se llama cada vez que se actualiza alg?n dato de las |
424 | 423 |
* tablas. |
425 |
*
|
|
424 |
* |
|
426 | 425 |
*/ |
427 | 426 |
public void refresh() { |
428 | 427 |
boolean refresh = false; |
... | ... | |
490 | 489 |
} |
491 | 490 |
|
492 | 491 |
public void accept() { |
493 |
|
|
492 |
|
|
494 | 493 |
} |
495 | 494 |
|
496 | 495 |
public void apply() { |
497 |
|
|
496 |
|
|
498 | 497 |
} |
499 | 498 |
|
500 | 499 |
public void cancel() { |
501 |
|
|
500 |
|
|
502 | 501 |
} |
503 | 502 |
|
504 | 503 |
public void setComponentSize(int w, int h) { |
505 |
|
|
504 |
|
|
506 | 505 |
} |
507 | 506 |
} |
Also available in: Unified diff