/** * 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()); } } }
//**************************************************************// //******************** Restorable State ***********************// //**************************************************************// protected void doGetRestorableState(RestorableSupport rs, RestorableSupport.StateObject context) { this.getViewPropertyLimits().getRestorableState(rs, rs.addStateObject(context, "viewPropertyLimits")); rs.addStateValueAsBoolean(context, "detectCollisions", this.isDetectCollisions()); if (this.getFieldOfView() != null) { rs.addStateValueAsDouble(context, "fieldOfView", this.getFieldOfView().getDegrees()); } rs.addStateValueAsDouble(context, "nearClipDistance", this.getNearClipDistance()); rs.addStateValueAsDouble(context, "farClipDistance", this.getFarClipDistance()); if (this.getEyePosition() != null) { rs.addStateValueAsPosition(context, "eyePosition", this.getEyePosition()); } if (this.getHeading() != null) { rs.addStateValueAsDouble(context, "heading", this.getHeading().getDegrees()); } if (this.getPitch() != null) { rs.addStateValueAsDouble(context, "pitch", this.getPitch().getDegrees()); } }
//**************************************************************// //******************** Restorable State ***********************// //**************************************************************// protected void doGetRestorableState(RestorableSupport rs, RestorableSupport.StateObject context) { super.doGetRestorableState(rs, context); rs.addStateValueAsLatLon(context, "center", this.getCenter()); rs.addStateValueAsDouble(context, "width", this.getWidth()); rs.addStateValueAsDouble(context, "height", this.getHeight()); rs.addStateValueAsDouble(context, "headingDegrees", this.getHeading().degrees); }
//**************************************************************// //******************** Restorable State ***********************// //**************************************************************// public void getRestorableState(RestorableSupport rs, RestorableSupport.StateObject context) { base.getRestorableState(rs, context); rs.addStateValueAsSector(context, "centerLocationLimits", this.centerLocationLimits); rs.addStateValueAsDouble(context, "minCenterElevation", this.minCenterElevation); rs.addStateValueAsDouble(context, "maxCenterElevation", this.maxCenterElevation); rs.addStateValueAsDouble(context, "minZoom", this.minZoom); rs.addStateValueAsDouble(context, "maxZoom", this.maxZoom); }
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 State ***********************// //**************************************************************// protected void doGetRestorableState(RestorableSupport rs, RestorableSupport.StateObject context) { base.doGetRestorableState(rs, context); if (this.getCenterPosition() != null) { RestorableSupport.StateObject so = rs.addStateObject(context, "center"); if (so != null) { rs.addStateValueAsDouble(so, "latitude", this.getCenterPosition().getLatitude().degrees); rs.addStateValueAsDouble(so, "longitude", this.getCenterPosition().getLongitude().degrees); rs.addStateValueAsDouble(so, "elevation", this.getCenterPosition().getElevation()); } } rs.addStateValueAsDouble(context, "zoom", this.getZoom()); }
/** {@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()); }
//**************************************************************// //******************** Restorable State ***********************// //**************************************************************// public void getRestorableState(RestorableSupport rs, RestorableSupport.StateObject context) { rs.addStateValueAsSector(context, "eyeLocationLimits", this.eyeLocationLimits); rs.addStateValueAsDouble(context, "minEyeElevation", this.minEyeElevation); rs.addStateValueAsDouble(context, "maxEyeElevation", this.maxEyeElevation); rs.addStateValueAsDouble(context, "minHeadingDegrees", this.minHeading.degrees); rs.addStateValueAsDouble(context, "maxHeadingDegrees", this.maxHeading.degrees); rs.addStateValueAsDouble(context, "minPitchDegrees", this.minPitch.degrees); rs.addStateValueAsDouble(context, "maxPitchDegrees", this.maxPitch.degrees); }