protected static void wmsRestoreStateToParams(
      RestorableSupport rs, RestorableSupport.StateObject context, AVList params) {
    // Invoke the BasicTiledImageLayer functionality.
    restoreStateForParams(rs, context, params);
    // Parse any legacy WMSTiledImageLayer state values.
    legacyWmsRestoreStateToParams(rs, context, params);

    String s = rs.getStateValueAsString(context, AVKey.IMAGE_FORMAT);
    if (s != null) params.setValue(AVKey.IMAGE_FORMAT, s);

    s = rs.getStateValueAsString(context, AVKey.TITLE);
    if (s != null) params.setValue(AVKey.TITLE, s);

    s = rs.getStateValueAsString(context, AVKey.DISPLAY_NAME);
    if (s != null) params.setValue(AVKey.DISPLAY_NAME, s);

    RestorableSupport.adjustTitleAndDisplayName(params);

    s = rs.getStateValueAsString(context, AVKey.LAYER_NAMES);
    if (s != null) params.setValue(AVKey.LAYER_NAMES, s);

    s = rs.getStateValueAsString(context, AVKey.STYLE_NAMES);
    if (s != null) params.setValue(AVKey.STYLE_NAMES, s);

    s = rs.getStateValueAsString(context, "wms.Version");
    if (s != null) params.setValue(AVKey.WMS_VERSION, s);
    params.setValue(AVKey.TILE_URL_BUILDER, new URLBuilder(params));
  }
Ejemplo n.º 2
0
  public void restoreState(RestorableSupport rs, RestorableSupport.StateObject so) {
    Boolean b = rs.getStateValueAsBoolean(so, "drawInterior");
    if (b != null) this.setDrawInterior(b);

    b = rs.getStateValueAsBoolean(so, "drawOutline");
    if (b != null) this.setDrawOutline(b);

    b = rs.getStateValueAsBoolean(so, "enableAntialiasing");
    if (b != null) this.setEnableAntialiasing(b);

    RestorableSupport.StateObject mo = rs.getStateObject(so, "interiorMaterial");
    if (mo != null) this.setInteriorMaterial(this.getInteriorMaterial().restoreState(rs, mo));

    mo = rs.getStateObject(so, "outlineMaterial");
    if (mo != null) this.setOutlineMaterial(this.getOutlineMaterial().restoreState(rs, mo));

    Double d = rs.getStateValueAsDouble(so, "interiorOpacity");
    if (d != null) this.setInteriorOpacity(d);

    d = rs.getStateValueAsDouble(so, "outlineOpacity");
    if (d != null) this.setOutlineOpacity(d);

    d = rs.getStateValueAsDouble(so, "outlineWidth");
    if (d != null) this.setOutlineWidth(d);

    Integer i = rs.getStateValueAsInteger(so, "outlineStippleFactor");
    if (i != null) this.setOutlineStippleFactor(i);

    i = rs.getStateValueAsInteger(so, "outlineStipplePattern");
    if (i != null) this.setOutlineStipplePattern(i.shortValue());

    String s = rs.getStateValueAsString(so, "interiorImagePath");
    if (s != null) this.setInteriorImageSource(s);

    d = rs.getStateValueAsDouble(so, "interiorImageScale");
    if (d != null) this.setInteriorImageScale(d);
  }