src/share/classes/java/awt/image/ReplicateScaleFilter.java

Print this page




 104                                                 ") must be non-zero");
 105         }
 106         destWidth = width;
 107         destHeight = height;
 108     }
 109 
 110     /**
 111      * Passes along the properties from the source object after adding a
 112      * property indicating the scale applied.
 113      * This method invokes <code>super.setProperties</code>,
 114      * which might result in additional properties being added.
 115      * <p>
 116      * Note: This method is intended to be called by the
 117      * <code>ImageProducer</code> of the <code>Image</code> whose pixels
 118      * are being filtered. Developers using
 119      * this class to filter pixels from an image should avoid calling
 120      * this method directly since that operation could interfere
 121      * with the filtering operation.
 122      */
 123     public void setProperties(Hashtable<?,?> props) {

 124         Hashtable<Object,Object> p = (Hashtable<Object,Object>)props.clone();
 125         String key = "rescale";
 126         String val = destWidth + "x" + destHeight;
 127         Object o = p.get(key);
 128         if (o != null && o instanceof String) {
 129             val = ((String) o) + ", " + val;
 130         }
 131         p.put(key, val);
 132         super.setProperties(p);
 133     }
 134 
 135     /**
 136      * Override the dimensions of the source image and pass the dimensions
 137      * of the new scaled size to the ImageConsumer.
 138      * <p>
 139      * Note: This method is intended to be called by the
 140      * <code>ImageProducer</code> of the <code>Image</code> whose pixels
 141      * are being filtered. Developers using
 142      * this class to filter pixels from an image should avoid calling
 143      * this method directly since that operation could interfere




 104                                                 ") must be non-zero");
 105         }
 106         destWidth = width;
 107         destHeight = height;
 108     }
 109 
 110     /**
 111      * Passes along the properties from the source object after adding a
 112      * property indicating the scale applied.
 113      * This method invokes <code>super.setProperties</code>,
 114      * which might result in additional properties being added.
 115      * <p>
 116      * Note: This method is intended to be called by the
 117      * <code>ImageProducer</code> of the <code>Image</code> whose pixels
 118      * are being filtered. Developers using
 119      * this class to filter pixels from an image should avoid calling
 120      * this method directly since that operation could interfere
 121      * with the filtering operation.
 122      */
 123     public void setProperties(Hashtable<?,?> props) {
 124         @SuppressWarnings("unchecked")
 125         Hashtable<Object,Object> p = (Hashtable<Object,Object>)props.clone();
 126         String key = "rescale";
 127         String val = destWidth + "x" + destHeight;
 128         Object o = p.get(key);
 129         if (o != null && o instanceof String) {
 130             val = ((String) o) + ", " + val;
 131         }
 132         p.put(key, val);
 133         super.setProperties(p);
 134     }
 135 
 136     /**
 137      * Override the dimensions of the source image and pass the dimensions
 138      * of the new scaled size to the ImageConsumer.
 139      * <p>
 140      * Note: This method is intended to be called by the
 141      * <code>ImageProducer</code> of the <code>Image</code> whose pixels
 142      * are being filtered. Developers using
 143      * this class to filter pixels from an image should avoid calling
 144      * this method directly since that operation could interfere