Revision 32405 branches/gvSIG_19_ext3D_osgVP_2_2_0/libraries/lib3DMap/src/org/gvsig/gvsig3d/cacheservices/OSGCacheService.java
OSGCacheService.java | ||
---|---|---|
23 | 23 |
import org.gvsig.osgvp.core.osg.Node; |
24 | 24 |
import org.gvsig.osgvp.core.osg.PositionAttitudeTransform; |
25 | 25 |
import org.gvsig.osgvp.core.osg.Vec3; |
26 |
import org.gvsig.osgvp.core.osg.Vec4; |
|
26 | 27 |
import org.gvsig.osgvp.core.osgdb.osgDB; |
27 | 28 |
import org.gvsig.osgvp.exceptions.node.NodeException; |
29 |
import org.gvsig.osgvp.features.Text; |
|
28 | 30 |
import org.gvsig.osgvp.manipulator.EditionManager; |
29 | 31 |
import org.gvsig.osgvp.manipulator.ManipulatorHandler; |
30 | 32 |
import org.gvsig.osgvp.manipulator.RemoveAllSelectionCommand; |
... | ... | |
35 | 37 |
|
36 | 38 |
import com.hardcode.gdbms.driver.exceptions.ReadDriverException; |
37 | 39 |
import com.iver.ai2.gvsig3d.map3d.layers.Layer3DProps; |
40 |
|
|
41 |
import com.iver.ai2.gvsig3d.resources.ResourcesFactory; |
|
38 | 42 |
import com.iver.andami.PluginServices; |
43 |
|
|
44 |
import com.iver.andami.PluginServices; |
|
45 |
|
|
39 | 46 |
import com.iver.cit.gvsig.exceptions.expansionfile.ExpansionFileReadException; |
40 | 47 |
import com.iver.cit.gvsig.fmap.layers.FLayer; |
41 | 48 |
import com.iver.cit.gvsig.fmap.layers.FLyrVect; |
... | ... | |
52 | 59 |
private ManipulatorHandler _manipulatorHandler; |
53 | 60 |
private RemoveAllSelectionCommand _command; |
54 | 61 |
private String _filePath; |
62 |
private Text _textoHud; |
|
55 | 63 |
private static Logger _logger = Logger.getLogger(OSGCacheService.class |
56 | 64 |
.getName()); |
57 | 65 |
|
... | ... | |
93 | 101 |
else |
94 | 102 |
cacheType += PLANE; |
95 | 103 |
setCacheType(cacheType); |
104 |
initTextHud(); |
|
96 | 105 |
|
97 | 106 |
} |
98 | 107 |
|
... | ... | |
406 | 415 |
public String getLayerPath() { |
407 | 416 |
return _filePath; |
408 | 417 |
} |
418 |
|
|
419 |
private void initTextHud(){ |
|
420 |
|
|
421 |
// Seting up text |
|
422 |
try { |
|
423 |
_textoHud = new Text(); |
|
424 |
} catch (NodeException e) { |
|
425 |
// TODO Auto-generated catch block |
|
426 |
e.printStackTrace(); |
|
427 |
} |
|
428 |
_textoHud.setCharacterSize(14); |
|
429 |
_textoHud.setColor(new Vec4(1.0f, 1.0f, 0.0f, 1.0f)); |
|
430 |
_textoHud.setBackdropColor(1.0f, 1.0f, 0.0f, 1.0f); |
|
409 | 431 |
|
432 |
if (ResourcesFactory.exitsResouce("arial.ttf")) |
|
433 |
_textoHud.setFont(ResourcesFactory.getResourcePath("arial.ttf")); |
|
434 |
else { |
|
435 |
// TODO: This freeze the execution.. disable when working. |
|
436 |
_textoHud.setFont("arial.ttf"); |
|
437 |
} |
|
438 |
|
|
439 |
_textoHud.setPosition(10, _canvas3D.getHeight()-10, 0); |
|
440 |
_textoHud.setBackdropType(Text.BackdropType.OUTLINE); |
|
441 |
_textoHud.setAlignment(Text.AlignmentType.LEFT_CENTER); |
|
442 |
_textoHud.setText(PluginServices.getText(this, "Hold_Control_Camera")); |
|
443 |
|
|
444 |
} |
|
445 |
|
|
446 |
public void addMessageToHud(){ |
|
447 |
|
|
448 |
try { |
|
449 |
_terrainViewer.addNodeToCameraHUD(_textoHud); |
|
450 |
} catch (NodeException e) { |
|
451 |
// TODO Auto-generated catch block |
|
452 |
e.printStackTrace(); |
|
453 |
} |
|
454 |
|
|
455 |
} |
|
456 |
|
|
457 |
public void removeMessageFromHud(){ |
|
458 |
|
|
459 |
try { |
|
460 |
_terrainViewer.removeNodeFromCameraHUD(_textoHud); |
|
461 |
} catch (NodeException e) { |
|
462 |
// TODO Auto-generated catch block |
|
463 |
e.printStackTrace(); |
|
464 |
} |
|
465 |
|
|
466 |
|
|
467 |
} |
|
468 |
|
|
410 | 469 |
} |
Also available in: Unified diff