Beispiel #1
0
    protected RenderableLayer getLayer() {
      for (Layer layer : getWwd().getModel().getLayers()) {
        if (layer.getName().contains("Renderable")) {
          return (RenderableLayer) layer;
        }
      }

      return null;
    }
Beispiel #2
0
  public Layer addInternalActiveLayer(Layer layer) {
    // Internal Active layers are not shown in the layer tree but are shown in the active layers
    // list
    layer.setValue(Constants.ACTIVE_LAYER, true);

    return addLayer(layer, Constants.INTERNAL_LAYER);
  }
Beispiel #3
0
  private Layer addLayer(Layer layer, String layerType) {
    if (layer != null) {
      layer.setValue(layerType, true);
      this.getWWPanel().addLayer(layer);
    }

    return layer;
  }
Beispiel #4
0
  public static void legendAction() {
    try {
      LegendColorTable.countTable = 0;
      Layer layer = content.layers().get(content.layers().size() - 1);
      SimpleFeatureSource featureSource = (SimpleFeatureSource) layer.getFeatureSource();
      String fieldName = getFieldForColour(featureSource);

      if (fieldName != null && fieldName.length() > 0) {

        Style style = createStyle(featureSource, fieldName);

        content.removeLayer(layer);
        Layer newLayer = new FeatureLayer(featureSource, style);
        content.addLayer(newLayer);

      } else throw new NullPointerException("Error occured during making legend");

    } catch (ArrayIndexOutOfBoundsException ex) {
      JOptionPane.showMessageDialog(null, "No layers are added !");
    } catch (Exception ex) {
      ex.printStackTrace();
      // JOptionPane.showMessageDialog(null, ex.getMessage());
    }
  }