本文整理汇总了Java中gov.nasa.worldwind.WorldWind.createConfigurationComponent方法的典型用法代码示例。如果您正苦于以下问题:Java WorldWind.createConfigurationComponent方法的具体用法?Java WorldWind.createConfigurationComponent怎么用?Java WorldWind.createConfigurationComponent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gov.nasa.worldwind.WorldWind
的用法示例。
在下文中一共展示了WorldWind.createConfigurationComponent方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createComponent
import gov.nasa.worldwind.WorldWind; //导入方法依赖的package包/类
protected static Object createComponent(WMSCapabilities caps, AVList params)
{
AVList configParams = params.copy(); // Copy to insulate changes from the caller.
// Some wms servers are slow, so increase the timeouts and limits used by world wind's retrievers.
configParams.setValue(AVKey.URL_CONNECT_TIMEOUT, 30000);
configParams.setValue(AVKey.URL_READ_TIMEOUT, 30000);
configParams.setValue(AVKey.RETRIEVAL_QUEUE_STALE_REQUEST_LIMIT, 60000);
try
{
String factoryKey = getFactoryKeyForCapabilities(caps);
Factory factory = (Factory) WorldWind.createConfigurationComponent(factoryKey);
return factory.createFromConfigSource(caps, params);
}
catch (Exception e)
{
// Ignore the exception, and just return null.
}
return null;
}
示例2: createComponent
import gov.nasa.worldwind.WorldWind; //导入方法依赖的package包/类
private Object createComponent(WMSCapabilities caps, AVList params) {
AVList configParams = params.copy(); // Copy to insulate changes from the caller.
// Some wms servers are slow, so increase the timeouts and limits used by world wind's retrievers.
configParams.setValue(AVKey.URL_CONNECT_TIMEOUT, 30000);
configParams.setValue(AVKey.URL_READ_TIMEOUT, 30000);
configParams.setValue(AVKey.RETRIEVAL_QUEUE_STALE_REQUEST_LIMIT, 60000);
try {
String factoryKey = getFactoryKeyForCapabilities(caps);
Factory factory = (Factory) WorldWind.createConfigurationComponent(factoryKey);
return factory.createFromConfigSource(caps, configParams);
} catch (Exception e) {
// Ignore the exception, and just return null.
}
return null;
}
示例3: initWorldWindLayerModel
import gov.nasa.worldwind.WorldWind; //导入方法依赖的package包/类
private void initWorldWindLayerModel()
{
Model model = (Model) WorldWind.createConfigurationComponent(AVKey.MODEL_CLASS_NAME);
model.setShowWireframeExterior(false);
model.setShowWireframeInterior(false);
model.setShowTessellationBoundingVolumes(false);
if (is3DGlobe) {
model.setGlobe(new Earth());
} else {
model.setGlobe(new EarthFlat());
}
world = new WorldWindowGLCanvas();
world.setModel(model);
}
示例4: AppPanel
import gov.nasa.worldwind.WorldWind; //导入方法依赖的package包/类
public AppPanel(final WorldWindowGLCanvas shareWith, final boolean includeStatusBar, final boolean flatWorld,
final boolean removeExtraLayers) {
super(new BorderLayout());
this.wwd = new WorldWindowGLCanvas(shareWith);
// Create the default model as described in the current worldwind properties.
final Model m = (Model) WorldWind.createConfigurationComponent(AVKey.MODEL_CLASS_NAME);
this.wwd.setModel(m);
if (flatWorld) {
m.setGlobe(new EarthFlat());
this.wwd.setView(new FlatOrbitView());
} else {
m.setGlobe(new Earth());
this.wwd.setView(new BasicOrbitView());
}
if (removeExtraLayers) {
final LayerList layerList = m.getLayers();
for (Layer layer : layerList) {
if (layer instanceof CompassLayer || layer instanceof WorldMapLayer || layer instanceof StarsLayer ||
layer instanceof LandsatI3WMSLayer || layer instanceof SkyGradientLayer)
layerList.remove(layer);
}
}
// Setup a select listener for the worldmap click-and-go feature
this.wwd.addSelectListener(new ClickAndGoSelectListener(wwd, WorldMapLayer.class));
this.wwd.getSceneController().setClutterFilter(new PlacemarkClutterFilter());
this.add(this.wwd, BorderLayout.CENTER);
if (includeStatusBar) {
this.statusBar = new MinimalStatusBar();
this.add(statusBar, BorderLayout.PAGE_END);
this.statusBar.setEventSource(wwd);
}
}
示例5: setupGui
import gov.nasa.worldwind.WorldWind; //导入方法依赖的package包/类
private void setupGui(Dimension canvasSize, boolean includeStatusBar)
{
this.wwd = new WorldWindowGLCanvas();
((Component) this.wwd).setPreferredSize(canvasSize);
// Create the default model as described in the current worldwind properties.
Model m = (Model) WorldWind.createConfigurationComponent(AVKey.MODEL_CLASS_NAME);
this.wwd.setModel(m);
// Setup a select listener for the worldmap click-and-go feature
this.wwd.addSelectListener(new ClickAndGoSelectListener(this.getWwd(), WorldMapLayer.class));
this.wwd.addRenderingExceptionListener(new RenderingExceptionListener()
{
public void exceptionThrown(Throwable t)
{
GISPanel.this.remove((Component) wwd);
GISPanel.this.failedReq();
return;
}
});
this.add((Component) this.wwd, BorderLayout.CENTER);
if (includeStatusBar)
{
this.statusBar = new StatusBar();
this.add(statusBar, BorderLayout.PAGE_END);
this.statusBar.setEventSource(wwd);
}
// Add the layer manager layer to the model layer list
if(isMiniMap)
{
TellervoLayerManagerLayer layermanager = new TellervoLayerManagerLayer(getWwd(), getWwd().getModel().getLayers());
layermanager.setName("Show/hide layer list");
layermanager.setMinimized(true);
layermanager.setPosition(AVKey.NORTHWEST);
getWwd().getModel().getLayers().add(layermanager);
}
this.validate();
}
示例6: _initializeMap3
import gov.nasa.worldwind.WorldWind; //导入方法依赖的package包/类
/**
* Initialize WW model with default layers.
*/
private static void _initializeMap3() {
// create default model
final Model wwModel = (Model) WorldWind.createConfigurationComponent(AVKey.MODEL_CLASS_NAME);
wwModel.setShowWireframeExterior(false);
wwModel.setShowWireframeInterior(false);
wwModel.setShowTessellationBoundingVolumes(false);
// get default layer
_wwDefaultLocaleLayers = wwModel.getLayers();
// dumpLayer(_wwDefaultLocaleLayers);
// create custom layer BEFORE state is applied and xml file is read which references these layers
createLayer_MT_TourTracks();
createLayer_MT_Marker();
createLayer_MT_TrackSlider();
createLayer_MT_TourInfo();
createLayer_MT_TourLegend();
createLayer_WW_StatusLine();
createLayer_WW_MapNavigator();
createLayer_WW_TerrainProfile();
// restore layer from xml file
_uiRootItem = parseLayerXml();
// set ww layers from xml layers
final Layer[] layerObject = _xmlLayers.toArray(new Layer[_xmlLayers.size()]);
final LayerList layers = new LayerList(layerObject);
wwModel.setLayers(layers);
// model must be set BEFORE model is updated
_ww.setModel(wwModel);
/*
* ensure All custom layers are in the model because it can happen, that a layer is created
* after the initial load of the layer list and new layers are not contained in the xml
* layer file.
*/
setCustomLayerInWWModel(wwModel.getLayers());
setToolLayerInWWModel();
}
示例7: NwwPanel
import gov.nasa.worldwind.WorldWind; //导入方法依赖的package包/类
protected NwwPanel( boolean useWwGlCanvas, boolean withStatusBar, boolean removeDefaultLayers ) {
super(new BorderLayout());
// Configuration.setValue(AVKey.INITIAL_LATITUDE, gpsLogShps[0].y);
// Configuration.setValue(AVKey.INITIAL_LONGITUDE, gpsLogShps[0].x);
// Configuration.setValue(AVKey.INITIAL_ALTITUDE, 1000);
// Configuration.setValue(AVKey.INITIAL_PITCH, 45);
long t1 = System.currentTimeMillis();
if (useWwGlCanvas) {
logger.insertDebug("NwwPanel", "Create GLCanvas");
wwd = new WorldWindowGLCanvas();
} else {
logger.insertDebug("NwwPanel", "Create GLJPanel");
wwd = new WorldWindowGLJPanel();
}
// ((Component) wwd).setPreferredSize(new Dimension(500, 500));
long t2 = System.currentTimeMillis();
logger.insertDebug("NwwPanel", "Create Canvas - DONE " + (t2 - t1) / 1000);
logger.insertDebug("NwwPanel", "Create Model");
Model model = (Model) WorldWind.createConfigurationComponent(AVKey.MODEL_CLASS_NAME);
this.getWwd().setModel(model);
long t3 = System.currentTimeMillis();
logger.insertDebug("NwwPanel", "Create Model - DONE " + (t3 - t2) / 1000);
if (removeDefaultLayers) {
logger.insertDebug("NwwPanel", "Remove and add layers");
LayerList layers = model.getLayers();
List<Layer> addBack = new ArrayList<>();
Iterator<Layer> layerIterator = layers.iterator();
List<String> namesToKeep = NwwUtilities.LAYERS_TO_KEEP_FROM_ORIGNALNWW;
while( layerIterator.hasNext() ) {
Layer layer = layerIterator.next();
if (namesToKeep.contains(layer.getName())) {
addBack.add(layer);
}
}
layers.clear();
layers.addAll(addBack);
long t4 = System.currentTimeMillis();
logger.insertDebug("NwwPanel", "Remove and add layers - DONE " + (t4 - t3) / 1000);
}
this.add((Component) this.getWwd(), BorderLayout.CENTER);
if (withStatusBar) {
this.statusBar = new StatusBar();
this.add(statusBar, BorderLayout.PAGE_END);
this.statusBar.setEventSource(getWwd());
}
}
示例8: setup
import gov.nasa.worldwind.WorldWind; //导入方法依赖的package包/类
public static void setup(final WorldWindow ww)
{
Model m = (Model) WorldWind.createConfigurationComponent(AVKey.MODEL_CLASS_NAME);
ww.setModel(m);
}