本文整理汇总了Java中gov.nasa.worldwind.layers.LayerList.contains方法的典型用法代码示例。如果您正苦于以下问题:Java LayerList.contains方法的具体用法?Java LayerList.contains怎么用?Java LayerList.contains使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gov.nasa.worldwind.layers.LayerList
的用法示例。
在下文中一共展示了LayerList.contains方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addOverlay
import gov.nasa.worldwind.layers.LayerList; //导入方法依赖的package包/类
@Override
public void addOverlay( String name, Overlay overlay, int index, String infoURLString, boolean fireChange, XML_Menu xml_item) {
super.addOverlay(name, overlay, index, infoURLString, fireChange, xml_item);
if (overlay instanceof WWOverlay) {
WWOverlay wwOverlay = (WWOverlay)overlay;
Layer layer = wwOverlay.getLayer();
if (layer instanceof WWLayer)
((WWLayer) layer).setInfoURL(infoURLString);
LayerList layers = wwd.getModel().getLayers();
if (layers.contains(layer)) return;
layers.add( layer );
wwd.addSelectListener( wwOverlay.getSelectListener() );
}
}
示例2: enable
import gov.nasa.worldwind.layers.LayerList; //导入方法依赖的package包/类
public void enable() {
this.getShape().setStartPosition(null);
LayerList layers = this.getWwd().getModel().getLayers();
if (!layers.contains(this.getLayer()))
layers.add(this.getLayer());
if (!this.getLayer().isEnabled())
this.getLayer().setEnabled(true);
this.setArmed(true);
this.getWwd().addRenderingListener(this);
this.getWwd().addSelectListener(this);
this.getWwd().getInputHandler().addMouseListener(this);
this.getWwd().getInputHandler().addMouseMotionListener(this);
this.setCursor(Cursor.getPredefinedCursor(Cursor.CROSSHAIR_CURSOR));
}
示例3: enable
import gov.nasa.worldwind.layers.LayerList; //导入方法依赖的package包/类
public void enable() {
// Clear any existing selection and clear set the SceneController's pick
// rectangle. This ensures that this
// ScreenSelector starts with the correct state when enabled.
this.selectionRect.clearSelection();
this.getWwd().getSceneController().setPickRectangle(null);
// Add and enable the layer that displays this ScreenSelector's
// selection rectangle.
LayerList layers = this.getWwd().getModel().getLayers();
if (!layers.contains(this.getLayer()))
layers.add(this.getLayer());
if (!this.getLayer().isEnabled())
this.getLayer().setEnabled(true);
// Listen for mouse input on the World Window.
this.getWwd().getInputHandler().addMouseListener(this);
this.getWwd().getInputHandler().addMouseMotionListener(this);
}
示例4: updateComponent
import gov.nasa.worldwind.layers.LayerList; //导入方法依赖的package包/类
protected void updateComponent(Object component, boolean enable)
{
if (component instanceof Layer)
{
Layer layer = (Layer) component;
LayerList layers = this.wwd.getModel().getLayers();
layer.setEnabled(enable);
if (enable)
{
if (!layers.contains(layer))
{
ApplicationTemplate.insertBeforePlacenames(this.wwd, layer);
this.firePropertyChange("LayersPanelUpdated", null, layer);
}
}
else
{
layers.remove(layer);
this.firePropertyChange("LayersPanelUpdated", layer, null);
}
}
else if (component instanceof ElevationModel)
{
ElevationModel model = (ElevationModel) component;
CompoundElevationModel compoundModel =
(CompoundElevationModel) this.wwd.getModel().getGlobe().getElevationModel();
if (enable)
{
if (!compoundModel.getElevationModels().contains(model))
compoundModel.addElevationModel(model);
}
}
}
示例5: setCustomLayerInWWModel
import gov.nasa.worldwind.layers.LayerList; //导入方法依赖的package包/类
/**
* Ensure All custom layers are set in the ww model.
*
* @param wwLayers
* Layers which are already added to the model.
*/
private static void setCustomLayerInWWModel(final LayerList wwLayers) {
final ArrayList<TVIMap3Layer> insertedLayers = new ArrayList<TVIMap3Layer>();
for (final TVIMap3Layer tviLayer : _uiCustomLayers.values()) {
final Layer customWWLayer = tviLayer.wwLayer;
if (wwLayers.contains(customWWLayer)) {
// layer is already contained in the model
continue;
}
TVIMap3Layer insertedUILayer = null;
// update ui/ww model
if (tviLayer.defaultPosition == INSERT_BEFORE_COMPASS) {
insertedUILayer = insertBeforeCompass(_ww, tviLayer);
} else if (tviLayer.defaultPosition == INSERT_BEFORE_PLACE_NAMES) {
insertedUILayer = insertBeforePlaceNames(_ww, tviLayer);
} else {
// insert in default position
insertedUILayer = insertBeforeCompass(_ww, tviLayer);
}
insertedLayers.add(insertedUILayer);
}
// update UI
if (_map3LayerSlideout != null && insertedLayers.size() > 0) {
_map3LayerSlideout.updateUI_NewLayer(insertedLayers);
}
}