Exemplo n.º 1
0
        //**************************************************************//
        //******************** 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());
            }
        }
Exemplo n.º 2
0
        /** {@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());
        }