Revision 25862
trunk/libraries/lib3DMap-share/src/main/java/com/iver/ai2/gvsig3d/gui/VectorLayerMenu.java | ||
---|---|---|
65 | 65 |
import com.iver.andami.PluginServices; |
66 | 66 |
|
67 | 67 |
/** |
68 |
* Dialogo donde se muestran las propiedades de una vista
|
|
68 |
* This dialog shows the preferences about a 3D layers
|
|
69 | 69 |
* |
70 |
* @author Fernando Gonz?lez Cort?s |
|
70 |
* @author Julio Campos Alvarez |
|
71 |
* @author Angel Fraile Gri?an |
|
71 | 72 |
*/ |
72 | 73 |
public class VectorLayerMenu extends JDialog implements MouseListener, |
73 | 74 |
ItemListener { |
74 | 75 |
|
75 |
// private int width = 273; |
|
76 |
// |
|
77 |
// private int height = 179; |
|
78 |
// |
|
79 | 76 |
private int width = 285; |
80 | 77 |
|
81 | 78 |
private int height = 190; |
... | ... | |
90 | 87 |
|
91 | 88 |
private Object panel; |
92 | 89 |
|
93 |
private JDialog jDialog = null; // @jve:decl-index=0:visual-constraint="519,70" |
|
94 |
|
|
95 | 90 |
private JPanel jContentPane = null; |
96 | 91 |
|
97 | 92 |
private JButton boton; |
... | ... | |
121 | 116 |
} |
122 | 117 |
|
123 | 118 |
/** |
124 |
* This method initializes this |
|
119 |
* This method initializes this class
|
|
125 | 120 |
*/ |
126 | 121 |
private void initialize() { |
127 | 122 |
// Inicialize component |
trunk/libraries/lib3DMap-share/src/main/java/com/iver/ai2/gvsig3d/map3d/layers/Layer3DProps.java | ||
---|---|---|
33 | 33 |
import com.iver.utiles.XMLEntity; |
34 | 34 |
import com.iver.utiles.xmlEntity.generate.XmlTag; |
35 | 35 |
|
36 |
/** |
|
37 |
* This class is used to manage all the 3d properties that the layer has. |
|
38 |
* |
|
39 |
* @author Salvador Bayarri |
|
40 |
* @author Julio Campos |
|
41 |
* |
|
42 |
*/ |
|
36 | 43 |
public class Layer3DProps implements IPersistence { |
37 | 44 |
|
38 | 45 |
// types of 3D layers |
... | ... | |
75 | 82 |
|
76 | 83 |
private boolean isEditing = false; |
77 | 84 |
|
78 |
public boolean isEditing() { |
|
79 |
return isEditing; |
|
80 |
} |
|
81 | 85 |
|
82 |
public void setEditing(boolean isEditing) { |
|
83 |
this.isEditing = isEditing; |
|
84 |
} |
|
85 |
|
|
86 |
/** |
|
87 |
* the constructor |
|
88 |
*/ |
|
86 | 89 |
public Layer3DProps() { |
87 | 90 |
m_tocOrder = -1; // not set |
88 | 91 |
m_planetOrder = -1; |
89 | 92 |
} |
90 | 93 |
|
94 |
/** |
|
95 |
* This method make an instance of the 3D props of the layer that get from parameters |
|
96 |
* |
|
97 |
* @param layer |
|
98 |
* @return the properties |
|
99 |
*/ |
|
91 | 100 |
public static Layer3DProps getLayer3DProps(FLayer layer) { |
92 | 101 |
FLyrDefault baseLayer = (FLyrDefault) layer; |
93 | 102 |
Object propsObj = baseLayer.getProperty("3DLayerExtension"); |
... | ... | |
104 | 113 |
return props3D; |
105 | 114 |
} |
106 | 115 |
|
116 |
/** |
|
117 |
* Return The editing state |
|
118 |
* |
|
119 |
* @return true->editing. false->not editing |
|
120 |
*/ |
|
121 |
public boolean isEditing() { |
|
122 |
return isEditing; |
|
123 |
} |
|
124 |
|
|
125 |
/** |
|
126 |
* Set the editing state |
|
127 |
* |
|
128 |
* @param true->editing. false->not editing |
|
129 |
*/ |
|
130 |
public void setEditing(boolean isEditing) { |
|
131 |
this.isEditing = isEditing; |
|
132 |
} |
|
133 |
|
|
107 | 134 |
public void setChooseType(boolean bChoose) { |
108 | 135 |
m_bChooseType = bChoose; |
109 | 136 |
} |
... | ... | |
116 | 143 |
m_hooked = hooked; |
117 | 144 |
} |
118 | 145 |
|
146 |
/** |
|
147 |
* Setting the layer |
|
148 |
* |
|
149 |
* @param layer |
|
150 |
*/ |
|
119 | 151 |
public void setLayer(FLayer layer) { |
120 | 152 |
|
121 | 153 |
if (m_layer == layer) |
... | ... | |
205 | 237 |
} |
206 | 238 |
} |
207 | 239 |
|
240 |
/** |
|
241 |
* Initialize the cache name for the layer. It uses the planet type the view projection and the type o coordinates |
|
242 |
* |
|
243 |
* @param planetType |
|
244 |
* @param viewProj |
|
245 |
* @param geocentricCoordinates |
|
246 |
*/ |
|
208 | 247 |
public void initCacheName(int planetType, IProjection viewProj, |
209 | 248 |
int geocentricCoordinates) { |
210 | 249 |
// TODO: use full path of source or service, not just layer name |
... | ... | |
277 | 316 |
} |
278 | 317 |
} |
279 | 318 |
|
319 |
/** |
|
320 |
* Return the cacheService of this layer. It depends of the type of the layer. |
|
321 |
* |
|
322 |
* @return |
|
323 |
*/ |
|
280 | 324 |
public CacheService getCacheService() { |
281 | 325 |
return m_cacheService; |
282 | 326 |
} |
283 | 327 |
|
328 |
/** |
|
329 |
* Set the cacheService of this layer. It depends of the type of the layer. |
|
330 |
* |
|
331 |
* @param srv |
|
332 |
*/ |
|
284 | 333 |
public void setCacheService(CacheService srv) { |
285 | 334 |
m_cacheService = srv; |
286 | 335 |
} |
287 | 336 |
|
337 |
/** |
|
338 |
* Set the type of this layer |
|
339 |
* |
|
340 |
* @param type |
|
341 |
*/ |
|
288 | 342 |
public void setType(int type) { |
289 | 343 |
m_type = type; |
290 | 344 |
} |
291 | 345 |
|
346 |
/** |
|
347 |
* Get the type of the layer |
|
348 |
* |
|
349 |
* @return |
|
350 |
*/ |
|
292 | 351 |
public int getType() { |
293 | 352 |
return m_type; |
294 | 353 |
} |
295 | 354 |
|
355 |
/** |
|
356 |
* Set the toc order of this layer |
|
357 |
* |
|
358 |
* @param order |
|
359 |
*/ |
|
296 | 360 |
public void setTocOrder(int order) { |
297 | 361 |
m_tocOrder = order; |
298 | 362 |
} |
299 | 363 |
|
364 |
/** |
|
365 |
* Get the toc order of this layer |
|
366 |
* |
|
367 |
* @return |
|
368 |
*/ |
|
300 | 369 |
public int getTocOrder() { |
301 | 370 |
return m_tocOrder; |
302 | 371 |
} |
303 | 372 |
|
373 |
/** |
|
374 |
* Set the planet order of this layer |
|
375 |
* |
|
376 |
* @param order |
|
377 |
*/ |
|
304 | 378 |
public void setPlanetOrder(int order) { |
305 | 379 |
m_planetOrder = order; |
306 | 380 |
} |
307 | 381 |
|
382 |
/** |
|
383 |
* Get the planet order of this layer |
|
384 |
* |
|
385 |
* @return |
|
386 |
*/ |
|
308 | 387 |
public int getPlanetOrder() { |
309 | 388 |
return m_planetOrder; |
310 | 389 |
} |
311 | 390 |
|
391 |
/** |
|
392 |
* Get the cache name for this layer |
|
393 |
* |
|
394 |
* @return |
|
395 |
*/ |
|
312 | 396 |
public String getCacheName() { |
313 | 397 |
return m_cacheName; |
314 | 398 |
} |
... | ... | |
379 | 463 |
return this.getClass().getName(); |
380 | 464 |
} |
381 | 465 |
|
466 |
/* (non-Javadoc) |
|
467 |
* @see com.iver.utiles.IPersistence#getXMLEntity() |
|
468 |
*/ |
|
382 | 469 |
public XMLEntity getXMLEntity() { |
383 | 470 |
XMLEntity xml = new XMLEntity(); |
384 | 471 |
|
... | ... | |
391 | 478 |
return xml; |
392 | 479 |
} |
393 | 480 |
|
481 |
/* (non-Javadoc) |
|
482 |
* @see com.iver.utiles.IPersistence#setXMLEntity(com.iver.utiles.XMLEntity) |
|
483 |
*/ |
|
394 | 484 |
public void setXMLEntity(XMLEntity xml) { |
395 | 485 |
if (xml.contains("type")) { |
396 | 486 |
m_bChooseType = false; |
... | ... | |
406 | 496 |
m_cacheName = xml.getStringProperty("cacheName"); |
407 | 497 |
} |
408 | 498 |
|
499 |
/** |
|
500 |
* Return the opacity of this layer |
|
501 |
* |
|
502 |
* @return |
|
503 |
*/ |
|
409 | 504 |
public float getOpacity() { |
410 | 505 |
return m_opacity; |
411 | 506 |
} |
412 | 507 |
|
508 |
/** |
|
509 |
* Set the opacity of this layer |
|
510 |
* |
|
511 |
* @param A value between 0 and 1 |
|
512 |
*/ |
|
413 | 513 |
public void setOpacity(float m_opacity) { |
414 | 514 |
this.m_opacity = m_opacity; |
415 | 515 |
} |
416 | 516 |
|
517 |
/** |
|
518 |
* Get the vertical exaggeration for this layer |
|
519 |
* |
|
520 |
* @return |
|
521 |
*/ |
|
417 | 522 |
public float getVerticalEx() { |
418 | 523 |
return m_verticalEx; |
419 | 524 |
} |
420 | 525 |
|
526 |
/** |
|
527 |
* Get the vertical exaggeration from this layer |
|
528 |
* |
|
529 |
* @param ex |
|
530 |
*/ |
|
421 | 531 |
public void setVerticalEx(float ex) { |
422 | 532 |
m_verticalEx = ex; |
423 | 533 |
} |
424 | 534 |
|
535 |
/** |
|
536 |
* Get the height that this layer has when it draws in 3D |
|
537 |
* |
|
538 |
* @return |
|
539 |
*/ |
|
425 | 540 |
public float getHeigth() { |
426 | 541 |
return m_heigth; |
427 | 542 |
} |
428 | 543 |
|
544 |
/** |
|
545 |
* Set the height that this layer has when it draws in 3D |
|
546 |
* |
|
547 |
* @param heigth |
|
548 |
*/ |
|
429 | 549 |
public void setHeigth(float m_heigth) { |
430 | 550 |
this.m_heigth = m_heigth; |
431 | 551 |
} |
432 | 552 |
|
553 |
/** |
|
554 |
* If the features of this layer have z value this method will return true. In the other case it will return false |
|
555 |
* |
|
556 |
* @return |
|
557 |
*/ |
|
433 | 558 |
public boolean isZEnable() { |
434 | 559 |
return m_Zenable; |
435 | 560 |
} |
436 | 561 |
|
562 |
/** |
|
563 |
* Set the z enable |
|
564 |
* |
|
565 |
* @param zenable |
|
566 |
*/ |
|
437 | 567 |
public void setZEnable(boolean zenable) { |
438 | 568 |
m_Zenable = zenable; |
439 | 569 |
} |
440 | 570 |
|
571 |
/** |
|
572 |
* It is to know if this layer is new. It only works with the OSG layers |
|
573 |
* |
|
574 |
* @return |
|
575 |
*/ |
|
441 | 576 |
public boolean isNewLayerOSG() { |
442 | 577 |
return newLayerOSG; |
443 | 578 |
} |
444 | 579 |
|
580 |
/** |
|
581 |
* Set if this layer is new. It only works with OSG layers. |
|
582 |
* |
|
583 |
* @param newLayerOSG |
|
584 |
*/ |
|
445 | 585 |
public void setNewLayerOSG(boolean newLayerOSG) { |
446 | 586 |
this.newLayerOSG = newLayerOSG; |
447 | 587 |
} |
trunk/libraries/lib3DMap-share/src/main/java/com/iver/ai2/gvsig3d/camera/ProjectCamera.java | ||
---|---|---|
47 | 47 |
import com.iver.utiles.XMLEntity; |
48 | 48 |
|
49 | 49 |
/** |
50 |
* DOCUMENT ME! |
|
50 |
* This class is used to manage the cameras that the "herramienta de encuades" |
|
51 |
* needs like a data model |
|
51 | 52 |
* |
52 |
* @author
|
|
53 |
* @author |
|
53 | 54 |
*/ |
54 | 55 |
public class ProjectCamera implements IPersistence { |
55 | 56 |
// private Object camera; |
... | ... | |
59 | 60 |
private String description; |
60 | 61 |
|
61 | 62 |
/** |
62 |
* DOCUMENT ME!
|
|
63 |
* Return the description
|
|
63 | 64 |
* |
64 |
* @return |
|
65 |
* @return description of the camera
|
|
65 | 66 |
*/ |
66 | 67 |
public String getDescription() { |
67 | 68 |
return description; |
68 | 69 |
} |
69 | 70 |
|
70 | 71 |
/** |
71 |
* DOCUMENT ME!
|
|
72 |
* Set the description
|
|
72 | 73 |
* |
73 |
* @param string |
|
74 |
* @param the |
|
75 |
* description of the camera |
|
74 | 76 |
*/ |
75 | 77 |
public void setDescription(String string) { |
76 | 78 |
description = string; |
... | ... | |
83 | 85 |
return description; |
84 | 86 |
} |
85 | 87 |
|
88 |
/** |
|
89 |
* Return the camera object |
|
90 |
* |
|
91 |
* @return camera object |
|
92 |
*/ |
|
86 | 93 |
public Camera getCamera() { |
87 | 94 |
return camera; |
88 | 95 |
} |
89 | 96 |
|
97 |
/** |
|
98 |
* Set the camera object |
|
99 |
* |
|
100 |
* @param the camera object |
|
101 |
*/ |
|
90 | 102 |
public void setCamera(Camera camera) { |
91 | 103 |
this.camera = camera; |
92 | 104 |
} |
93 | 105 |
|
106 |
/* (non-Javadoc) |
|
107 |
* @see com.iver.utiles.IPersistence#getClassName() |
|
108 |
*/ |
|
94 | 109 |
public String getClassName() { |
95 | 110 |
return this.getClass().getName(); |
96 | 111 |
} |
97 | 112 |
|
113 |
/* (non-Javadoc) |
|
114 |
* @see com.iver.utiles.IPersistence#getXMLEntity() |
|
115 |
*/ |
|
98 | 116 |
public XMLEntity getXMLEntity() { |
99 | 117 |
XMLEntity xml = new XMLEntity(); |
100 | 118 |
xml.putProperty("className", this.getClassName()); |
101 | 119 |
|
102 | 120 |
xml.putProperty("description", this.getDescription()); |
103 | 121 |
// Saving camera propeties |
104 |
|
|
122 |
|
|
105 | 123 |
// Eye |
106 | 124 |
xml.putProperty("eyeX", this.camera.getEye().x()); |
107 | 125 |
xml.putProperty("eyeY", this.camera.getEye().y()); |
... | ... | |
118 | 136 |
return xml; |
119 | 137 |
} |
120 | 138 |
|
139 |
/* (non-Javadoc) |
|
140 |
* @see com.iver.utiles.IPersistence#setXMLEntity(com.iver.utiles.XMLEntity) |
|
141 |
*/ |
|
121 | 142 |
public void setXMLEntity(XMLEntity xml) { |
122 | 143 |
if (xml.contains("description")) |
123 | 144 |
this.setDescription(xml.getStringProperty("description")); |
124 | 145 |
|
125 |
// Getting camera properties
|
|
146 |
// Getting camera properties |
|
126 | 147 |
camera = new Camera(); |
127 |
|
|
148 |
|
|
128 | 149 |
// Variables auxiliares |
129 |
Vec3 center = new Vec3(), |
|
130 |
eye = new Vec3(), |
|
131 |
up = new Vec3(); |
|
150 |
Vec3 center = new Vec3(), eye = new Vec3(), up = new Vec3(); |
|
132 | 151 |
|
133 | 152 |
// Eye |
134 | 153 |
if (xml.contains("eyeX")) |
... | ... | |
153 | 172 |
up.setY(xml.getDoubleProperty("upY")); |
154 | 173 |
if (xml.contains("upZ")) |
155 | 174 |
up.setZ(xml.getDoubleProperty("upZ")); |
156 |
|
|
175 |
|
|
157 | 176 |
this.camera.setViewByLookAt(eye, center, up); |
158 | 177 |
|
159 | 178 |
} |
trunk/libraries/lib3DMap-share/src/main/java/com/iver/ai2/gvsig3d/resources/MyFileFilter3D.java | ||
---|---|---|
7 | 7 |
/** |
8 | 8 |
* |
9 | 9 |
* @version 14/08/2007 |
10 |
* @author Borja S?nchez Zamorano (borja.sanchez@iver.es)
|
|
10 |
* @author Angel Fraile
|
|
11 | 11 |
* |
12 | 12 |
*/ |
13 | 13 |
public class MyFileFilter3D extends FileFilter { |
trunk/libraries/lib3DMap-share/src/main/java/com/iver/ai2/gvsig3d/resources/ResourcesFactory.java | ||
---|---|---|
3 | 3 |
import java.io.File; |
4 | 4 |
|
5 | 5 |
/** |
6 |
* @author julio
|
|
6 |
* @author Julio Campos
|
|
7 | 7 |
* |
8 | 8 |
* This class is a factory to find resources in 3D extensions |
9 | 9 |
* |
Also available in: Unified diff