/** * Returns the time associated with the kth-most recent sensor reading; * where 0 is the most recent sensor reading, 1 is the next most recent * sensor reading, etc. * @return the time associated with the kth-most recent sensor reading. */ public long lastTime(int k){ if(k >= sensorReadCount) { throw new IllegalArgumentException(J3dI18N.getString("Sensor4")); } return readings[previousIndex(k)].time; }
@Override void setLive(boolean inBackgroundGroup, int refCount) { // Do illegalSharing check. if(getUsedByOffScreen()) { throw new IllegalSharingException(J3dI18N.getString("ImageComponent3")); } super.setLive(inBackgroundGroup, refCount); }
/** * Retrieves the boundary mode for the S coordinate. * @return the current boundary mode for the S coordinate. * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph */ public int getBoundaryModeS() { if (isLiveOrCompiled()) if(!this.getCapability(ALLOW_BOUNDARY_MODE_READ)) throw new CapabilityNotSetException(J3dI18N.getString("Texture4")); return ((TextureRetained)this.retained).getBoundaryModeS(); }
/** * Retrieves the vertexFormat of this GeometryArray * @return format of vertices in this GeometryArray * @exception CapabilityNotSetException if the appropriate capability is * not set and this object is part of a live or compiled scene graph */ public int getVertexFormat() { if (isLiveOrCompiled()) if(!this.getCapability(ALLOW_FORMAT_READ)) throw new CapabilityNotSetException(J3dI18N.getString("GeometryArray2")); return ((GeometryArrayRetained)this.retained).getVertexFormat(); }
/** * Retrieves the alpha test value. * @return the alpha test value. * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph */ public float getAlphaTestValue(){ if (isLiveOrCompiled()) if (!this.getCapability(ALLOW_ALPHA_TEST_VALUE_READ)) throw new CapabilityNotSetException(J3dI18N.getString("RenderingAttributes5")); return ((RenderingAttributesRetained)this.retained).getAlphaTestValue(); }
/** * Retrieves the current position in object coordinates of this raster. * @param pos the vector that will receive the current position * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph */ public void getPosition(Point3f pos) { if (isLiveOrCompiled()) if(!this.getCapability(ALLOW_POSITION_READ)) throw new CapabilityNotSetException(J3dI18N.getString("Raster1")); ((RasterRetained)this.retained).getPosition(pos); }
/** * Sets the node's SharedGroup reference. * @param sharedGroup the SharedGroup node to reference * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph */ public void setSharedGroup(SharedGroup sharedGroup) { if (isLiveOrCompiled()) if (!this.getCapability(ALLOW_SHARED_GROUP_WRITE)) throw new CapabilityNotSetException(J3dI18N.getString("Link0")); ((LinkRetained)this.retained).setSharedGroup(sharedGroup); }
/** * Retrieves the back clip distance. * @return the current back clip distance, in meters */ public double getBackDistance() { if (isLiveOrCompiled()) if(!this.getCapability(ALLOW_BACK_DISTANCE_READ)) throw new CapabilityNotSetException(J3dI18N.getString("Clip1")); return ((ClipRetained)this.retained).getBackDistance(); }
/** * Retrieve Reverberation Order * @return reverb order * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph */ public int getReverbOrder() { if (!this.getCapability(ALLOW_REVERB_ORDER_READ)) if (isLiveOrCompiled()) throw new CapabilityNotSetException(J3dI18N.getString("AuralAttributes9")); return ((AuralAttributesRetained)this.retained).getReverbOrder(); }
/** * Retrieve Velocity Scale Factor used to calculate Doppler Effect. * @return scale factor applied to Doppler velocity of sound * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph */ public float getVelocityScaleFactor() { if (isLiveOrCompiled()) if (!this.getCapability(ALLOW_VELOCITY_SCALE_FACTOR_READ)) throw new CapabilityNotSetException(J3dI18N.getString("AuralAttributes20")); return ((AuralAttributesRetained)this.retained).getVelocityScaleFactor(); }
/** * Retrieves the width of this image component object. * @return the width of this image component object * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph */ public int getWidth() { if (isLiveOrCompiled()) if(!this.getCapability(ALLOW_SIZE_READ)) throw new CapabilityNotSetException(J3dI18N.getString("ImageComponent0")); return ((ImageComponentRetained)this.retained).getWidth(); }
/** * @deprecated As of Java 3D version 1.2, replaced by * <code>setURLString</code> */ public void setURL(String path) { if (isLiveOrCompiled()) { if(!this.getCapability(ALLOW_URL_WRITE)) throw new CapabilityNotSetException(J3dI18N.getString("MediaContainer3")); } ((MediaContainerRetained)this.retained).setURLString(path); } /**
/** * @deprecated As of Java 3D version 1.2, replaced by * <code>setURLObject</code> */ public void setURL(URL url) { if (isLiveOrCompiled()) if(!this.getCapability(ALLOW_URL_WRITE)) throw new CapabilityNotSetException(J3dI18N.getString("MediaContainer3")); ((MediaContainerRetained)this.retained).setURLObject(url); }
/** * Retrieves this material's diffuse color. * @param color the vector that will receive this material's diffuse color * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph */ public void getDiffuseColor(Color3f color) { if (isLiveOrCompiled()) if (!this.getCapability(ALLOW_COMPONENT_READ)) throw new CapabilityNotSetException(J3dI18N.getString("Material2")); ((MaterialRetained)this.retained).getDiffuseColor(color); }
/** * Retrieves this material's shininess. * @return the material's shininess * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph */ public float getShininess() { if (isLiveOrCompiled()) if (!this.getCapability(ALLOW_COMPONENT_READ)) throw new CapabilityNotSetException(J3dI18N.getString("Material2")); return ((MaterialRetained)this.retained).getShininess(); }
/** * Retrieves this BoundingLeaf's bounding region. * @return the bounding region of this leaf node * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph */ public Bounds getRegion() { if (isLiveOrCompiled()) if(!this.getCapability(ALLOW_REGION_READ)) throw new CapabilityNotSetException(J3dI18N.getString("BoundingLeaf1")); return ((BoundingLeafRetained)this.retained).getRegion(); }
@Override public Shader[] getShaders() { if (isLiveOrCompiled()) { if(!this.getCapability(ALLOW_SHADERS_READ)) { throw new CapabilityNotSetException(J3dI18N.getString("GLSLShaderProgram1")); } } return ((GLSLShaderProgramRetained)this.retained).getShaders(); }
/** * Retrieves the current transparencyAttributes object. * @return the transparencyAttributes object * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph */ public TransparencyAttributes getTransparencyAttributes() { if (isLiveOrCompiled()) if (!this.getCapability(ALLOW_TRANSPARENCY_ATTRIBUTES_READ)) throw new CapabilityNotSetException(J3dI18N.getString("Appearance9")); return ((AppearanceRetained)this.retained).getTransparencyAttributes(); }
/** * Retrieves the current texture object. * @return the texture object * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph */ public Texture getTexture() { if (isLiveOrCompiled()) if (!this.getCapability(ALLOW_TEXTURE_READ)) throw new CapabilityNotSetException(J3dI18N.getString("Appearance3")); return ((AppearanceRetained)this.retained).getTexture(); }
/** * Retrieves the height of this depth component object. * @return the height of the array of depth values * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph */ public int getHeight() { if (isLiveOrCompiled()) if (!this.getCapability(ALLOW_SIZE_READ)) throw new CapabilityNotSetException(J3dI18N.getString("DepthComponent0")); return ((DepthComponentRetained)this.retained).getHeight(); }