Revision 768
2.1/trunk/org.gvsig.view3d/org.gvsig.view3d.swing/org.gvsig.view3d.swing.impl/src/main/java/org/gvsig/view3d/swing/impl/DefaultMapControl3D.java | ||
---|---|---|
81 | 81 |
import org.gvsig.view3d.lib.api.loader.Loader; |
82 | 82 |
import org.gvsig.view3d.lib.api.loader.LoaderFactory; |
83 | 83 |
import org.gvsig.view3d.lib.api.loader.LoaderParameters; |
84 |
import org.gvsig.view3d.lib.api.loader.RasterLoaderParameters; |
|
85 | 84 |
import org.gvsig.view3d.swing.api.MapControl3D; |
86 | 85 |
import org.gvsig.view3d.swing.api.View3DSwingLocator; |
87 | 86 |
import org.gvsig.view3d.swing.api.View3DSwingManager; |
... | ... | |
281 | 280 |
LoaderParameters loaderParameters = manager.getLoaderParameters(layer); |
282 | 281 |
if (loaderParameters == null) { |
283 | 282 |
// Default loader |
284 |
try { |
|
285 |
LoaderFactory loaderFactory = manager.getLoaderFactory(RasterLoaderParameters.NAME); |
|
286 |
loaderParameters = loaderFactory.createParameters(layer); |
|
287 |
} catch (FactoryNotRegisteredException e) { |
|
288 |
LOG.warn(String.format( |
|
289 |
"%1s has not been registered. Using first loader factory registered.", |
|
290 |
RasterLoaderParameters.NAME), e); |
|
291 |
List<LoaderFactory> loaderFactories = manager.getLoaderFactories(); |
|
292 |
if (loaderFactories.isEmpty()) { |
|
293 |
throw new IllegalStateException("There are not loader registered factories"); |
|
294 |
} else { |
|
295 |
loaderParameters = loaderFactories.get(0).createParameters(layer); |
|
296 |
} |
|
283 |
List<LoaderFactory> loaderFactories = manager.getLoaderFactories(); |
|
284 |
if(loaderFactories.isEmpty()) { |
|
285 |
return; |
|
297 | 286 |
} |
287 |
loaderParameters = loaderFactories.get(0).createParameters(layer); |
|
298 | 288 |
|
299 | 289 |
} |
300 | 290 |
LoaderFactory loaderFactory = null; |
... | ... | |
302 | 292 |
loaderFactory = manager.getLoaderFactory(loaderParameters.getName()); |
303 | 293 |
} catch (FactoryNotRegisteredException e) { |
304 | 294 |
LOG.error("{} loader factory is not registered", loaderParameters.getName()); |
305 |
|
|
295 |
return; |
|
306 | 296 |
} |
307 | 297 |
Loader loader = loaderFactory.createLoader(); |
308 | 298 |
Object object = null; |
... | ... | |
437 | 427 |
for (Layer layer : layersByClass) { |
438 | 428 |
layer.setEnabled(visiblity); |
439 | 429 |
} |
440 |
};
|
|
430 |
} |
|
441 | 431 |
|
442 | 432 |
private void setWWLayerVisibility(String layerName, boolean visibilty) { |
443 | 433 |
Layer layer = getWwd().getModel().getLayers().getLayerByName(layerName); |
444 | 434 |
if (layer != null) { |
445 | 435 |
layer.setEnabled(visibilty); |
446 | 436 |
} |
447 |
};
|
|
437 |
} |
|
448 | 438 |
|
449 | 439 |
private void addNavigation() { |
450 | 440 |
|
... | ... | |
677 | 667 |
} |
678 | 668 |
|
679 | 669 |
public boolean getAtmosphereVisibility() { |
680 |
if (isWWLayerVisible(SkyGradientLayer.class) || isWWLayerVisible(SkyColorLayer.class)) { |
|
681 |
return true; |
|
682 |
} |
|
683 |
return false; |
|
670 |
return isWWLayerVisible(SkyGradientLayer.class) || isWWLayerVisible(SkyColorLayer.class); |
|
684 | 671 |
} |
685 | 672 |
|
686 | 673 |
public boolean getMinimapVisibility() { |
687 |
if (isWWLayerVisible(WorldMapLayer.class)) { |
|
688 |
return true; |
|
689 |
} |
|
690 |
return false; |
|
674 |
return isWWLayerVisible(WorldMapLayer.class); |
|
691 | 675 |
} |
692 | 676 |
|
693 | 677 |
public boolean getNorthIndicatorVisibility() { |
694 |
if (isWWLayerVisible(CompassLayer.class)) { |
|
695 |
return true; |
|
696 |
} |
|
697 |
return false; |
|
678 |
return isWWLayerVisible(CompassLayer.class); |
|
698 | 679 |
} |
699 | 680 |
|
700 | 681 |
public boolean getStarBackgroundVisibility() { |
701 |
if (isWWLayerVisible(StarsLayer.class)) { |
|
702 |
return true; |
|
703 |
} |
|
704 |
return false; |
|
682 |
return isWWLayerVisible(StarsLayer.class); |
|
705 | 683 |
} |
706 | 684 |
|
707 | 685 |
public boolean getScaleVisibility() { |
708 |
if (isWWLayerVisible(ScalebarLayer.class)) { |
|
709 |
return true; |
|
710 |
} |
|
711 |
return false; |
|
686 |
return isWWLayerVisible(ScalebarLayer.class); |
|
712 | 687 |
} |
713 | 688 |
|
714 | 689 |
@SuppressWarnings("rawtypes") |
Also available in: Unified diff