本文整理汇总了Java中gov.nasa.worldwind.layers.Layer.isEnabled方法的典型用法代码示例。如果您正苦于以下问题:Java Layer.isEnabled方法的具体用法?Java Layer.isEnabled怎么用?Java Layer.isEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gov.nasa.worldwind.layers.Layer
的用法示例。
在下文中一共展示了Layer.isEnabled方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateCreditButtonState
import gov.nasa.worldwind.layers.Layer; //导入方法依赖的package包/类
protected void updateCreditButtonState() {
LayerList ll = wwModel.getLayers();
for (int i = ll.size() - 1; i >= 0; i--) {
Layer l = ll.get(i);
if (l.isEnabled() && (l.getOpacity() > .2)) {
for (Class<?> c : l.getClass().getInterfaces())
if (c.equals( InfoSupplier.class )) {
((WWMapTools)tools).creditB.setEnabled(true);
return;
}
((WWMapTools)tools).creditB.setEnabled(false);
return;
}
}
((WWMapTools)tools).creditB.setEnabled(false);
}
示例2: isLayerVisible
import gov.nasa.worldwind.layers.Layer; //导入方法依赖的package包/类
private boolean isLayerVisible(Class<?> c) {
Layer layer = null;
for (Layer l : wwModel.getLayers())
if (c.isInstance(l)) {
layer = l;
break;
}
if (layer == null)
return false;
if (!layer.isEnabled())
return false;
if (layer.getOpacity() < .3)
return false;
return true;
}
示例3: fill
import gov.nasa.worldwind.layers.Layer; //导入方法依赖的package包/类
private void fill(WorldWindow wwd) {
// Fill the layers panel with the titles of all layers in the world window's current model.
for (Layer layer : wwd.getModel().getLayers()) {
if (layer.getName().equalsIgnoreCase("Atmosphere") || layer.getName().equalsIgnoreCase("World Map") ||
layer.getName().equalsIgnoreCase("Scale bar") || layer.getName().equalsIgnoreCase("Compass"))
continue;
final LayerAction action = new LayerAction(layer, wwd, layer.isEnabled());
final JCheckBox jcb = new JCheckBox(action);
jcb.setSelected(action.selected);
this.layersPanel.add(jcb);
if (defaultFont == null) {
this.defaultFont = jcb.getFont();
}
}
}
示例4: updateSunAngleProvider
import gov.nasa.worldwind.layers.Layer; //导入方法依赖的package包/类
protected void updateSunAngleProvider() {
LayerList ll = wwModel.getLayers();
for (int i = ll.size() - 1; i >= 0; i--) {
Layer l = ll.get(i);
if (l.isEnabled() && (l.getOpacity() > .4) &&
true)
for (Class<?> c : l.getClass().getInterfaces())
if (c.equals( SunAngle.class ) && ((SunAngle) l).isSunValid()) {
compassLayer.setAngleSupplier((SunAngle) l);
return;
}
}
compassLayer.setAngleSupplier(null);
}
示例5: updateColorScaleProvider
import gov.nasa.worldwind.layers.Layer; //导入方法依赖的package包/类
protected void updateColorScaleProvider() {
LayerList ll = wwModel.getLayers();
for (int i = ll.size() - 1; i >= 0; i--) {
Layer l = ll.get(i);
if (l.isEnabled() && (l.getOpacity() > .2)) {
for (Class<?> c : l.getClass().getInterfaces())
if (c.equals( ColorScale.class ) && ((ColorScale) l).isColorScaleValid()) {
colorScaleLayer.setScaleSupplier((ColorScale) l);
return;
}
}
}
colorScaleLayer.setScaleSupplier(null);
}
示例6: showCredit
import gov.nasa.worldwind.layers.Layer; //导入方法依赖的package包/类
public void showCredit() {
LayerList ll = wwModel.getLayers();
for (int i = ll.size() - 1; i >= 0; i--) {
Layer l = ll.get(i);
if (l.isEnabled() && (l.getOpacity() > .2)) {
for (Class<?> c : l.getClass().getInterfaces())
if (c.equals( InfoSupplier.class )) {
String url = ((InfoSupplier) l).getInfoURL();
BrowseURL.browseURL(url);
}
return;
}
}
}
示例7: updateInfo
import gov.nasa.worldwind.layers.Layer; //导入方法依赖的package包/类
protected void updateInfo() {
if (lastPoint != null) {
Position position = WWMapTools.this.wwCanvas.getView().computePositionFromScreenPoint(lastPoint.x, lastPoint.y);
if (position != null) {
elev = WWMapTools.this.wwCanvas.getModel().getGlobe().getElevation(position.getLatitude(), position.getLongitude());
lat = position.getLatitude().getDegrees();
lon = position.getLongitude().getDegrees();
gridValue = Double.NaN;
LayerList ll = WWMapTools.this.wwCanvas.getModel().getLayers();
outer: for (int i = ll.size() - 1; i >= 0; i--) {
Layer l = ll.get(i);
if (l.isEnabled() && (l.getOpacity() > .4))
for (Class<?> c : l.getClass().getInterfaces())
if (c.equals( QueryableGridLayer.class )) {
QueryableGridLayer grid = (QueryableGridLayer) l;
if (grid.getValueUnits() == null) continue;
gridUnits = grid.getValueUnits().replaceAll("%", "%%");
gridValue = grid.getValueAt(lat, lon);
break outer;
}
}
}
}
updateInfoLabel();
}
示例8: getCheckboxForLayer
import gov.nasa.worldwind.layers.Layer; //导入方法依赖的package包/类
private JCheckBox getCheckboxForLayer(Layer layer) {
LayerAction action = new LayerAction(layer, wwd, layer.isEnabled());
JCheckBox jcb = new JCheckBox(action);
jcb.setSelected(action.selected);
if (defaultFont == null) {
this.defaultFont = jcb.getFont();
}
return jcb;
}
示例9: LayerListRowPanel
import gov.nasa.worldwind.layers.Layer; //导入方法依赖的package包/类
public LayerListRowPanel(LayerEventsListener layerListener, final NwwPanel wwdPanel, final Layer layer) {
super(new BorderLayout(10, 10));
SelectLayerAction action = new SelectLayerAction(layerListener, wwdPanel.getWwd(), layer, layer.isEnabled());
JCheckBox checkBox = new JCheckBox(action);
checkBox.setSelected(action.isSelected());
add(checkBox, BorderLayout.CENTER);
JPanel buttonsPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
add(buttonsPanel, BorderLayout.EAST);
if (layer instanceof NwwVectorLayer) {
StyleVectorLayerAction styleVectorLayerAction = new StyleVectorLayerAction(wwdPanel,
(NwwVectorLayer) layer);
JButton styleButton = new JButton(styleVectorLayerAction);
styleButton.setBorderPainted(false);
styleButton.setFocusPainted(false);
styleButton.setContentAreaFilled(false);
buttonsPanel.add(styleButton);
}
if (layer instanceof NwwLayer) {
ZoomToLayerAction zoomToLayerAction = new ZoomToLayerAction(wwdPanel, (NwwLayer) layer);
JButton zoomToButton = new JButton(zoomToLayerAction);
zoomToButton.setBorderPainted(false);
zoomToButton.setFocusPainted(false);
zoomToButton.setContentAreaFilled(false);
buttonsPanel.add(zoomToButton);
}
DeleteLayerAction deleteAction = new DeleteLayerAction(layerListener, wwdPanel.getWwd(), layer);
JButton deleteButton = new JButton(deleteAction);
deleteButton.setBorderPainted(false);
deleteButton.setFocusPainted(false);
deleteButton.setContentAreaFilled(false);
buttonsPanel.add(deleteButton);
}
示例10: propertyChange
import gov.nasa.worldwind.layers.Layer; //导入方法依赖的package包/类
public void propertyChange(PropertyChangeEvent evt) {
if (evt.getPropertyName().equals(AVKey.LAYER) ||
evt.getPropertyName().equals(AVKey.LAYERS)) {
updateSunAngleProvider();
updateColorScaleProvider();
updateCreditButtonState();
compassMI.setSelected( compassLayer.isEnabled() &&
wwModel.getLayers().contains(compassLayer));
colorScaleMI.setSelected( colorScaleLayer.isEnabled() &&
wwModel.getLayers().contains(colorScaleLayer));
scalebarMI.setSelected( scalebarLayer.isEnabled() &&
wwModel.getLayers().contains(scalebarLayer));
placeNamesMI.setSelected( placeNamesLayer.isEnabled() &&
wwModel.getLayers().contains(placeNamesLayer));
/// Check to make sure the topmost visible DB is enabled
LayerList layers = wwModel.getLayers();
ListIterator<Layer> li = layers.listIterator(layers.size());
while (li.hasPrevious()) {
Layer layer = li.previous();
if (layer.isEnabled() &&
layer instanceof WWLayer) {
final Database topDB = ((WWLayer) layer).getDB();
if (currentDB == topDB) return;
SwingUtilities.invokeLater(new Runnable() {
public void run() {
if (currentDB != null) {
dialog.remove( currentDB.getSelectionDialog() );
getDataDisplayDialog().remove( currentDB.getDataDisplay() );
}
setCurrentDB(topDB);
addDBToDisplay(topDB);
}
});
return;
}
}
setCurrentDB(null);
SwingUtilities.invokeLater(new Runnable() {
public void run() {
if (currentDB != null) {
dialog.remove( currentDB.getSelectionDialog() );
getDataDisplayDialog().remove( currentDB.getDataDisplay() );
}
hPane.setRightComponent( null );
vPane.setBottomComponent( null );
setCurrentDB(null);
}
});
}
}
示例11: selected
import gov.nasa.worldwind.layers.Layer; //导入方法依赖的package包/类
/**
* <code>SelectListener</code> implementation.
*
* @param event the current <code>SelectEvent</code>
*/
@Override
public void selected(SelectEvent event) {
//System.out.println("event.getEventAction(): " + event.getEventAction());
final ScreenAnnotation annotation = getAnnotation();
if (event.hasObjects() && event.getTopObject() == annotation) {
boolean update = false;
if (event.getEventAction().equals(SelectEvent.ROLLOVER)
|| event.getEventAction().equals(SelectEvent.LEFT_CLICK)) {
// Highlight annotation
if (!annotation.getAttributes().isHighlighted()) {
annotation.getAttributes().setHighlighted(true);
update = true;
}
// Check for text or url
final PickedObject po = event.getTopPickedObject();
if (po.getValue(AVKey.URL) != null) {
// Set cursor hand on hyperlinks
((Component) this.wwd).setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
int i = Integer.parseInt((String) po.getValue(AVKey.URL));
// Select current hyperlink
if (getSelectedIndex() != i) {
setSelectedIndex(i);
update = true;
}
// Enable/disable layer on left click
if (event.getEventAction().equals(SelectEvent.LEFT_CLICK)) {
final LayerList layers = getValidLayers();
if (i >= 0 && i < layers.size()) {
final Layer layer = layers.get(i);
final boolean enable = !layer.isEnabled();
layer.setEnabled(enable);
updateVirtualEarthLayers(layer, enable);
update = true;
}
}
} else {
// Unselect if not on an hyperlink
if (getSelectedIndex() != -1) {
setSelectedIndex(-1);
update = true;
}
// Set cursor
if (this.isComponentDragEnabled())
((Component) this.wwd).setCursor(Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR));
else
((Component) this.wwd).setCursor(Cursor.getDefaultCursor());
}
}
if (event.getEventAction().equals(SelectEvent.DRAG)
|| event.getEventAction().equals(SelectEvent.DRAG_END)) {
// Handle dragging
if (this.isComponentDragEnabled() || this.isLayerDragEnabled()) {
final boolean wasDraggingLayer = this.draggingLayer;
this.drag(event);
// Update list if dragging a layer, otherwise just redraw the world window
if (this.draggingLayer || wasDraggingLayer)
update = true;
else
this.wwd.redraw();
}
}
// Redraw annotation if needed
if (update)
this.update();
} else if (event.getEventAction().equals(SelectEvent.ROLLOVER) && annotation.getAttributes().isHighlighted()) {
// de-highlight annotation
annotation.getAttributes().setHighlighted(false);
((Component) this.wwd).setCursor(Cursor.getDefaultCursor());
this.update();
}
}