Revision 488 2.1/trunk/org.gvsig.view3d/org.gvsig.view3d.app/org.gvsig.view3d.app.common/src/main/java/org/gvsig/view3d/app/mainplugin/View3DExtension.java
View3DExtension.java | ||
---|---|---|
32 | 32 |
import org.gvsig.app.project.documents.view.gui.IView; |
33 | 33 |
import org.gvsig.app.project.documents.view.legend.gui.ThemeManagerWindow; |
34 | 34 |
import org.gvsig.fmap.mapcontext.MapContext; |
35 |
import org.gvsig.fmap.mapcontext.layers.ExtendedPropertiesSupport; |
|
35 | 36 |
import org.gvsig.fmap.mapcontext.layers.FLayers; |
36 | 37 |
import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect; |
37 | 38 |
import org.gvsig.tools.ToolsLocator; |
... | ... | |
52 | 53 |
* @author <a href="mailto:lmarques@disid.com">Lluis Marques</a> |
53 | 54 |
* |
54 | 55 |
*/ |
55 |
public class View3DExtension extends Extension implements Observer{ |
|
56 |
public class View3DExtension extends Extension implements Observer {
|
|
56 | 57 |
|
57 | 58 |
public void initialize() { |
58 |
|
|
59 |
|
|
59 | 60 |
ThemeManagerWindow.addPage(LayerProperties3DThemeManagerPage.class); |
60 | 61 |
ThemeManagerWindow.setTabEnabledForLayer( |
61 | 62 |
LayerProperties3DThemeManagerPage.class, FLyrVect.class, true); |
62 |
|
|
63 |
ExtensionPointManager extensionPoints = ToolsLocator.getExtensionPointManager(); |
|
63 |
|
|
64 |
ExtensionPointManager extensionPoints = |
|
65 |
ToolsLocator.getExtensionPointManager(); |
|
64 | 66 |
ExtensionPoint point = extensionPoints.get("RasterSEPropertiesDialog"); |
65 |
if(point != null){
|
|
67 |
if (point != null) {
|
|
66 | 68 |
point.append("3D", "3D Raster properties panel", |
67 | 69 |
RasterLayerProperties3DPanel.class); |
68 | 70 |
} |
... | ... | |
84 | 86 |
View3DSwingManager manager = View3DSwingLocator.getManager(); |
85 | 87 |
|
86 | 88 |
MapControl3D mapControl3D = |
87 |
manager.getMapControl3D(view.getMapControl().getMapContext(),
|
|
88 |
type); |
|
89 |
manager.getMapControl3D( |
|
90 |
(ExtendedPropertiesSupport) view.getViewDocument(), type);
|
|
89 | 91 |
if (mapControl3D == null || mapControl3D.getType() != type) { |
90 | 92 |
View3DPanel view3DPanel = |
91 | 93 |
manager.createView3DPanel(view.getMapControl() |
92 |
.getMapContext(), type); |
|
94 |
.getMapContext(), type, |
|
95 |
(ExtendedPropertiesSupport) view.getViewDocument()); |
|
93 | 96 |
view3DPanel.getMapControl3D().addObserver(this); |
94 | 97 |
view3DPanel.show(); |
95 | 98 |
} |
... | ... | |
124 | 127 |
View3DSwingManager manager = View3DSwingLocator.getManager(); |
125 | 128 |
MapContext mapContext = view.getMapControl().getMapContext(); |
126 | 129 |
TYPE type = getType(actionCommand); |
127 |
|
|
128 |
if(type != null){
|
|
129 |
|
|
130 |
|
|
131 |
if (type != null) {
|
|
132 |
|
|
130 | 133 |
MapControl3D mapControl3D = |
131 |
manager.getMapControl3D(mapContext, getType(actionCommand)); |
|
132 |
|
|
134 |
manager.getMapControl3D( |
|
135 |
(ExtendedPropertiesSupport) view.getViewDocument(), |
|
136 |
getType(actionCommand)); |
|
137 |
|
|
133 | 138 |
FLayers layers = mapContext.getLayers(); |
134 |
|
|
139 |
|
|
135 | 140 |
boolean isEPSG4326 = |
136 | 141 |
mapContext.getProjection().getAbrev().equals("EPSG:4326"); |
137 |
|
|
142 |
|
|
138 | 143 |
if (mapControl3D == null && layers.getLayersCount() > 0 |
139 | 144 |
&& isEPSG4326) { |
140 | 145 |
return true; |
... | ... | |
175 | 180 |
appManager.refreshMenusAndToolBars(); |
176 | 181 |
} |
177 | 182 |
} |
178 |
|
|
183 |
|
|
179 | 184 |
} |
180 | 185 |
} |
Also available in: Unified diff