116 * java.awt.Image.UndefinedProperty. 117 */ 118 public Object getProperty(String name) { 119 return myCRIF.getProperty(paramBlock, name); 120 } 121 122 /** 123 * Return a list of names recognized by getProperty. 124 * @return a list of property names. 125 */ 126 public String[] getPropertyNames() { 127 return myCRIF.getPropertyNames(); 128 } 129 130 /** 131 * Returns true if successive renderings (that is, calls to 132 * createRendering() or createScaledRendering()) with the same arguments 133 * may produce different results. This method may be used to 134 * determine whether an existing rendering may be cached and 135 * reused. The CRIF's isDynamic method will be called. 136 * @return <code>true</code> if successive renderings with the 137 * same arguments might produce different results; 138 * <code>false</code> otherwise. 139 */ 140 public boolean isDynamic() { 141 return myCRIF.isDynamic(); 142 } 143 144 /** 145 * Gets the width in user coordinate space. By convention, the 146 * usual width of a RenderableImage is equal to the image's aspect 147 * ratio (width divided by height). 148 * 149 * @return the width of the image in user coordinates. 150 */ 151 public float getWidth() { 152 if (boundingBox == null) { 153 boundingBox = myCRIF.getBounds2D(paramBlock); 154 } 155 return (float)boundingBox.getWidth(); 156 } 157 158 /** 189 } 190 191 /** 192 * Change the current ParameterBlock of the operation, allowing 193 * editing of image rendering chains. The effects of such a 194 * change will be visible when a new rendering is created from 195 * this RenderableImageOp or any dependent RenderableImageOp. 196 * 197 * @param paramBlock the new ParameterBlock. 198 * @return the old ParameterBlock. 199 * @see #getParameterBlock 200 */ 201 public ParameterBlock setParameterBlock(ParameterBlock paramBlock) { 202 ParameterBlock oldParamBlock = this.paramBlock; 203 this.paramBlock = (ParameterBlock)paramBlock.clone(); 204 return oldParamBlock; 205 } 206 207 /** 208 * Returns a reference to the current parameter block. 209 * @return the <code>ParameterBlock</code> of this 210 * <code>RenderableImageOp</code>. 211 * @see #setParameterBlock(ParameterBlock) 212 */ 213 public ParameterBlock getParameterBlock() { 214 return paramBlock; 215 } 216 217 /** 218 * Creates a RenderedImage instance of this image with width w, and 219 * height h in pixels. The RenderContext is built automatically 220 * with an appropriate usr2dev transform and an area of interest 221 * of the full image. All the rendering hints come from hints 222 * passed in. 223 * 224 * <p> If w == 0, it will be taken to equal 225 * Math.round(h*(getWidth()/getHeight())). 226 * Similarly, if h == 0, it will be taken to equal 227 * Math.round(w*(getHeight()/getWidth())). One of 228 * w or h must be non-zero or else an IllegalArgumentException 229 * will be thrown. 230 * | 116 * java.awt.Image.UndefinedProperty. 117 */ 118 public Object getProperty(String name) { 119 return myCRIF.getProperty(paramBlock, name); 120 } 121 122 /** 123 * Return a list of names recognized by getProperty. 124 * @return a list of property names. 125 */ 126 public String[] getPropertyNames() { 127 return myCRIF.getPropertyNames(); 128 } 129 130 /** 131 * Returns true if successive renderings (that is, calls to 132 * createRendering() or createScaledRendering()) with the same arguments 133 * may produce different results. This method may be used to 134 * determine whether an existing rendering may be cached and 135 * reused. The CRIF's isDynamic method will be called. 136 * @return {@code true} if successive renderings with the 137 * same arguments might produce different results; 138 * {@code false} otherwise. 139 */ 140 public boolean isDynamic() { 141 return myCRIF.isDynamic(); 142 } 143 144 /** 145 * Gets the width in user coordinate space. By convention, the 146 * usual width of a RenderableImage is equal to the image's aspect 147 * ratio (width divided by height). 148 * 149 * @return the width of the image in user coordinates. 150 */ 151 public float getWidth() { 152 if (boundingBox == null) { 153 boundingBox = myCRIF.getBounds2D(paramBlock); 154 } 155 return (float)boundingBox.getWidth(); 156 } 157 158 /** 189 } 190 191 /** 192 * Change the current ParameterBlock of the operation, allowing 193 * editing of image rendering chains. The effects of such a 194 * change will be visible when a new rendering is created from 195 * this RenderableImageOp or any dependent RenderableImageOp. 196 * 197 * @param paramBlock the new ParameterBlock. 198 * @return the old ParameterBlock. 199 * @see #getParameterBlock 200 */ 201 public ParameterBlock setParameterBlock(ParameterBlock paramBlock) { 202 ParameterBlock oldParamBlock = this.paramBlock; 203 this.paramBlock = (ParameterBlock)paramBlock.clone(); 204 return oldParamBlock; 205 } 206 207 /** 208 * Returns a reference to the current parameter block. 209 * @return the {@code ParameterBlock} of this 210 * {@code RenderableImageOp}. 211 * @see #setParameterBlock(ParameterBlock) 212 */ 213 public ParameterBlock getParameterBlock() { 214 return paramBlock; 215 } 216 217 /** 218 * Creates a RenderedImage instance of this image with width w, and 219 * height h in pixels. The RenderContext is built automatically 220 * with an appropriate usr2dev transform and an area of interest 221 * of the full image. All the rendering hints come from hints 222 * passed in. 223 * 224 * <p> If w == 0, it will be taken to equal 225 * Math.round(h*(getWidth()/getHeight())). 226 * Similarly, if h == 0, it will be taken to equal 227 * Math.round(w*(getHeight()/getWidth())). One of 228 * w or h must be non-zero or else an IllegalArgumentException 229 * will be thrown. 230 * |