/** * Saves the offset's current state in the specified <code>restorableSupport</code>. If <code>context</code> is not * <code>null</code>, the state is appended to it. Otherwise the state is added to the * <code>RestorableSupport</code> root. This state can be restored later by calling {@link * #restoreState(gov.nasa.worldwind.util.RestorableSupport, SharpEarth.util.RestorableSupport.StateObject)}. * * @param restorableSupport the <code>RestorableSupport</code> that receives the offset's state. * @param context the <code>StateObject</code> the state is appended to, if not <code>null</code>. * * @throws ArgumentException if <code>restorableSupport</code> is <code>null</code>. */ public void getRestorableState(RestorableSupport restorableSupport, RestorableSupport.StateObject context) { if (restorableSupport == null) { String message = Logging.getMessage("nullValue.RestorableSupportIsNull"); Logging.logger().severe(message); throw new ArgumentException(message); } if (this.getX() != null) { restorableSupport.addStateValueAsDouble(context, "x", this.getX()); } if (this.getY() != null) { restorableSupport.addStateValueAsDouble(context, "y", this.getY()); } if (this.getXUnits() != null) { restorableSupport.addStateValueAsString(context, "xUnits", this.getXUnits()); } if (this.getYUnits() != null) { restorableSupport.addStateValueAsString(context, "yUnits", this.getYUnits()); } }
/** * Saves the size's current state in the specified <code>restorableSupport</code>. If <code>context</code> is not * <code>null</code>, the state is appended to it. Otherwise the state is added to the * <code>RestorableSupport</code> root. This state can be restored later by calling {@link * #restoreState(gov.nasa.worldwind.util.RestorableSupport, SharpEarth.util.RestorableSupport.StateObject)}. * * @param restorableSupport the <code>RestorableSupport</code> that receives the size's state. * @param context the <code>StateObject</code> the state is appended to, if not <code>null</code>. * * @throws ArgumentException if <code>restorableSupport</code> is <code>null</code>. */ public void getRestorableState(RestorableSupport restorableSupport, RestorableSupport.StateObject context) { if (restorableSupport == null) { String message = Logging.getMessage("nullValue.RestorableSupportIsNull"); Logging.logger().severe(message); throw new ArgumentException(message); } RestorableSupport.StateObject so = restorableSupport.addStateObject(context, "width"); if (so != null) { restorableSupport.addStateValueAsString(so, "mode", this.getWidthMode()); restorableSupport.addStateValueAsDouble(so, "param", this.getWidth()); if (this.getWidthUnits() != null) { restorableSupport.addStateValueAsString(so, "units", this.getWidthUnits()); } } so = restorableSupport.addStateObject(context, "height"); if (so != null) { restorableSupport.addStateValueAsString(so, "mode", this.getHeightMode()); restorableSupport.addStateValueAsDouble(so, "param", this.getHeight()); if (this.getHeightUnits() != null) { restorableSupport.addStateValueAsString(so, "units", this.getHeightUnits()); } } }
public void getRestorableState(RestorableSupport rs, RestorableSupport.StateObject so) { String encodedColor = RestorableSupport.encodeColor(this.ambient); if (encodedColor != null) { rs.addStateValueAsString(so, "ambient", encodedColor); } encodedColor = RestorableSupport.encodeColor(this.diffuse); if (encodedColor != null) { rs.addStateValueAsString(so, "diffuse", encodedColor); } encodedColor = RestorableSupport.encodeColor(this.specular); if (encodedColor != null) { rs.addStateValueAsString(so, "specular", encodedColor); } encodedColor = RestorableSupport.encodeColor(this.emission); if (encodedColor != null) { rs.addStateValueAsString(so, "emission", encodedColor); } rs.addStateValueAsDouble(so, "shininess", this.shininess); }
//**************************************************************// //******************** Restorable Support ********************// //**************************************************************// public void getRestorableStateForAVPair(String key, Object value, RestorableSupport rs, RestorableSupport.StateObject context) { if (value is URLBuilder) { rs.addStateValueAsString(context, "wms.Version", ((URLBuilder)value).wmsVersion); rs.addStateValueAsString(context, "wms.Crs", ((URLBuilder)value).crs); } else { super.getRestorableStateForAVPair(key, value, rs, context); } }
//**************************************************************// //******************** Restorable Support ********************// //**************************************************************// public override void getRestorableStateForAVPair(String key, Object value, RestorableSupport rs, RestorableSupport.StateObject context) { if (value is URLBuilder) { rs.addStateValueAsString(context, AVKey.WCS_VERSION, ((URLBuilder)value).serviceVersion); } else if (!(value is WCS100DescribeCoverage)) { // Don't pass DescribeCoverage to superclass. The DescribeCoverage parameters will already be present in the // parameter list, so do nothing here. super.getRestorableStateForAVPair(key, value, rs, context); } }
public void getRestorableStateForAVPair(string key, object value, RestorableSupport rs, RestorableSupport.StateObject context) { if (value == null) { return; } if (key.Equals(PROPERTY_CHANGE_SUPPORT)) { return; } if (rs == null) { String message = Logging.getMessage("nullValue.RestorableStateIsNull"); Logging.logger().severe(message); throw new ArgumentException(message); } rs.addStateValueAsString(context, key, value.ToString()); }
/** {@inheritDoc} */ public void getRestorableState(RestorableSupport rs, RestorableSupport.StateObject so) { if (rs == null) { String message = Logging.getMessage("nullValue.RestorableSupportIsNull"); Logging.logger().severe(message); throw new ArgumentException(message); } rs.addStateValueAsBoolean(so, "drawInterior", this.isDrawInterior()); rs.addStateValueAsBoolean(so, "drawOutline", this.isDrawOutline()); rs.addStateValueAsBoolean(so, "enableAntialiasing", this.isEnableAntialiasing()); rs.addStateValueAsBoolean(so, "enableLighting", this.isEnableLighting()); this.getInteriorMaterial().getRestorableState(rs, rs.addStateObject(so, "interiorMaterial")); this.getOutlineMaterial().getRestorableState(rs, rs.addStateObject(so, "outlineMaterial")); rs.addStateValueAsDouble(so, "interiorOpacity", this.getInteriorOpacity()); rs.addStateValueAsDouble(so, "outlineOpacity", this.getOutlineOpacity()); rs.addStateValueAsDouble(so, "outlineWidth", this.getOutlineWidth()); rs.addStateValueAsInteger(so, "outlineStippleFactor", this.getOutlineStippleFactor()); rs.addStateValueAsInteger(so, "outlineStipplePattern", this.getOutlineStipplePattern()); if (this.getImageSource() != null && this.getImageSource() is String) { rs.addStateValueAsString(so, "interiorImagePath", (String)this.getImageSource()); } rs.addStateValueAsDouble(so, "interiorImageScale", this.getImageScale()); }