本文整理汇总了Java中gov.nasa.worldwind.layers.LayerList.size方法的典型用法代码示例。如果您正苦于以下问题:Java LayerList.size方法的具体用法?Java LayerList.size怎么用?Java LayerList.size使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gov.nasa.worldwind.layers.LayerList
的用法示例。
在下文中一共展示了LayerList.size方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateCreditButtonState
import gov.nasa.worldwind.layers.LayerList; //导入方法依赖的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: isUpToDate
import gov.nasa.worldwind.layers.LayerList; //导入方法依赖的package包/类
protected boolean isUpToDate(WorldWindow wwd)
{
// Determines whether this layer manager's layer list is consistent with the specified WorldWindow's. Knowing
// this prevents redundant updates.
LayerList layerList = wwd.getModel().getLayers();
if (this.layerPanels.size() != layerList.size())
return false;
for (int i = 0; i < layerList.size(); i++)
{
if (layerList.get(i) != this.layerPanels.get(i).getLayer())
return false;
}
return true;
}
示例3: updateSunAngleProvider
import gov.nasa.worldwind.layers.LayerList; //导入方法依赖的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);
}
示例4: updateColorScaleProvider
import gov.nasa.worldwind.layers.LayerList; //导入方法依赖的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);
}
示例5: showCredit
import gov.nasa.worldwind.layers.LayerList; //导入方法依赖的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;
}
}
}
示例6: updateInfo
import gov.nasa.worldwind.layers.LayerList; //导入方法依赖的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();
}
示例7: moveLayer
import gov.nasa.worldwind.layers.LayerList; //导入方法依赖的package包/类
protected void moveLayer(WorldWindow wwd, Layer layer, int direction)
{
// Moves the layer associated with this instance in the direction indicated relative to the other layers.
int index = this.findLayerPosition(wwd, layer);
if (index < 0)
return; // layer not found
LayerList layerList = wwd.getModel().getLayers();
this.upButton.setEnabled(true);
this.downButton.setEnabled(true);
if (direction < 0 && index == 0) // can't move lowest layer any lower
{
this.upButton.setEnabled(false);
return;
}
if (direction > 0 && index == layerList.size() - 1) // can't move highest layer any higher
{
this.downButton.setEnabled(false);
return;
}
// Remove the layer from the layer list and then re-insert it.
layerList.remove(layer);
if (direction > 0)
layerList.add(index + 1, layer);
else if (direction < 0)
layerList.add(index - 1, layer);
// Update WorldWind so the change is visible.
wwd.redraw();
}
示例8: makeAnnotationText
import gov.nasa.worldwind.layers.LayerList; //导入方法依赖的package包/类
/**
* Compose the annotation text from the given <code>LayerList</code>.
*
* @param layers the <code>LayerList</code> to draw names from.
* @return the annotation text to be displayed.
*/
protected String makeAnnotationText(LayerList layers)
{
// Compose html text
StringBuilder text = new StringBuilder();
Color color;
for(int i = layers.size()-1; i>0; i = i-1 )
{
Layer layer = layers.get(i);
if (!this.isMinimized() || layer == this)
{
if(this.visibleLayerNames.contains(layer.getName()) )
{
color = (i == this.selectedIndex) ? this.highlightColor : this.color;
color = (i == this.dragRefIndex) ? dragColor : color;
text.append("<a href=\"");
text.append(i);
text.append("\"><font color=\"");
text.append(encodeHTMLColor(color));
text.append("\">");
text.append((layer.isEnabled() ? layerEnabledSymbol : layerDisabledSymbol));
text.append(" ");
text.append((layer.isEnabled() ? "<b>" : "<i>"));
text.append(layer.getName());
text.append((layer.isEnabled() ? "</b>" : "</i>"));
text .append("</a><br />");
}
else if (layer == this)
{
color = (i == this.selectedIndex) ? this.highlightColor : this.color;
color = (i == this.dragRefIndex) ? dragColor : color;
text.append("<a href=\"");
text.append(i);
text.append("\"><font color=\"");
text.append(encodeHTMLColor(color));
text.append("\">");
text.append("<b>Layer List</b>");
text .append("</a><br />");
}
}
}
return text.toString();
}
示例9: selected
import gov.nasa.worldwind.layers.LayerList; //导入方法依赖的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();
}
}