/** * Retrieves the image from this ImageComponent2D object. If the * data access mode is not by-reference, a copy of the image * is made. If the data access mode is by-reference, the * reference is returned. * * @return either a new BufferedImage object created from the data * in this image component, or the BufferedImage object referenced * by this image component. * * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph * * @exception IllegalStateException if the image class is not * ImageClass.BUFFERED_IMAGE. */ public BufferedImage getImage() { if (isLiveOrCompiled()) { if(!this.getCapability(ImageComponent.ALLOW_IMAGE_READ)) throw new CapabilityNotSetException(J3dI18N.getString("ImageComponent2D0")); } RenderedImage img = ((ImageComponent2DRetained)this.retained).getImage(); if ((img != null) && !(img instanceof BufferedImage)) { throw new IllegalStateException(J3dI18N.getString("ImageComponent2D5")); } return (BufferedImage) img; }
/** * Retrieves the image from this ImageComponent2D object. If the * data access mode is not by-reference, a copy of the image * is made. If the data access mode is by-reference, the * reference is returned. * * @return either a new RenderedImage object created from the data * in this image component, or the RenderedImage object referenced * by this image component. * * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph * * @exception IllegalStateException if the image class is not one of: * ImageClass.BUFFERED_IMAGE or ImageClass.RENDERED_IMAGE. * * @since Java 3D 1.2 */ public RenderedImage getRenderedImage() { if (isLiveOrCompiled()) if(!this.getCapability(ImageComponent.ALLOW_IMAGE_READ)) throw new CapabilityNotSetException(J3dI18N.getString("ImageComponent2D0")); return ((ImageComponent2DRetained)this.retained).getImage(); }
/** * Retrieves the image from this ImageComponent2D object. If the * data access mode is not by-reference, a copy of the image * is made. If the data access mode is by-reference, the * reference is returned. * * @return either a new NioImageBuffer object created from the data * in this image component, or the NioImageBuffer object referenced * by this image component. * * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph * * @exception IllegalStateException if the image class is not * ImageClass.NIO_IMAGE_BUFFER. * * @since Java 3D 1.5 */ public NioImageBuffer getNioImage() { if (isLiveOrCompiled()) { if (!this.getCapability(ImageComponent.ALLOW_IMAGE_READ)) { throw new CapabilityNotSetException(J3dI18N.getString("ImageComponent2D0")); } } return ((ImageComponent2DRetained)this.retained).getNioImage(); }
/** * Sets this image component to the specified BufferedImage * object. * If the data access mode is not by-reference, then the * BufferedImage data is copied into this object. If * the data access mode is by-reference, then a reference to the * BufferedImage is saved, but the data is not necessarily * copied. * <p> * The image class is set to ImageClass.BUFFERED_IMAGE. * * @param image BufferedImage object containing the image. * Its size must be the same as the current size of this * ImageComponent2D object. * * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph * * @exception IllegalArgumentException if the width and height of the * specified image is not equal to the width and height of this * ImageComponent object. */ public void set(BufferedImage image) { if (isLiveOrCompiled()) { if(!this.getCapability(ALLOW_IMAGE_WRITE)) throw new CapabilityNotSetException( J3dI18N.getString("ImageComponent2D1")); } ((ImageComponent2DRetained)this.retained).set(image); }
if(!this.getCapability(ALLOW_IMAGE_WRITE)) throw new CapabilityNotSetException( J3dI18N.getString("ImageComponent2D1"));
if(!this.getCapability(ALLOW_IMAGE_WRITE)) { throw new CapabilityNotSetException( J3dI18N.getString("ImageComponent2D1"));
int srcX, int srcY, int dstX, int dstY) { if (isLiveOrCompiled() && !this.getCapability(ALLOW_IMAGE_WRITE)) { throw new CapabilityNotSetException( J3dI18N.getString("ImageComponent2D1"));
!this.getCapability(ALLOW_IMAGE_WRITE)) { throw new CapabilityNotSetException( J3dI18N.getString("ImageComponent2D1"));