1 /*
2 * Copyright (c) 1995, 2003, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
154 * isn't already a consumer of the filtered image,
155 * an instance of the original <code>ImageFilter</code>
156 * is created
157 * (using the filter's <code>getFilterInstance</code> method)
158 * to manipulate the image data
159 * for the <code>ImageConsumer</code>.
160 * The filter instance for the <code>ImageConsumer</code>
161 * is then passed to the <code>startProduction</code> method
162 * of the original <code>ImageProducer</code>.
163 *
164 * <p>
165 * This method is public as a side effect
166 * of this class implementing
167 * the <code>ImageProducer</code> interface.
168 * It should not be called from user code,
169 * and its behavior if called from user code is unspecified.
170 *
171 * @param ic the consumer for the filtered image
172 * @see ImageConsumer
173 */
174 public void startProduction(ImageConsumer ic) {
175 if (proxies == null) {
176 proxies = new Hashtable();
177 }
178 ImageFilter imgf = (ImageFilter) proxies.get(ic);
179 if (imgf == null) {
180 imgf = filter.getFilterInstance(ic);
181 proxies.put(ic, imgf);
182 }
183 src.startProduction(imgf);
184 }
185
186 /**
187 * Requests that a given ImageConsumer have the image data delivered
188 * one more time in top-down, left-right order. The request is
189 * handed to the ImageFilter for further processing, since the
190 * ability to preserve the pixel ordering depends on the filter.
191 *
192 * <p>
193 * This method is public as a side effect
194 * of this class implementing
195 * the <code>ImageProducer</code> interface.
196 * It should not be called from user code,
197 * and its behavior if called from user code is unspecified.
198 *
199 * @see ImageConsumer
200 */
201 public void requestTopDownLeftRightResend(ImageConsumer ic) {
202 if (proxies != null) {
203 ImageFilter imgf = (ImageFilter) proxies.get(ic);
204 if (imgf != null) {
205 imgf.resendTopDownLeftRight(src);
206 }
207 }
208 }
209 }
|
1 /*
2 * Copyright (c) 1995, 2018, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
154 * isn't already a consumer of the filtered image,
155 * an instance of the original <code>ImageFilter</code>
156 * is created
157 * (using the filter's <code>getFilterInstance</code> method)
158 * to manipulate the image data
159 * for the <code>ImageConsumer</code>.
160 * The filter instance for the <code>ImageConsumer</code>
161 * is then passed to the <code>startProduction</code> method
162 * of the original <code>ImageProducer</code>.
163 *
164 * <p>
165 * This method is public as a side effect
166 * of this class implementing
167 * the <code>ImageProducer</code> interface.
168 * It should not be called from user code,
169 * and its behavior if called from user code is unspecified.
170 *
171 * @param ic the consumer for the filtered image
172 * @see ImageConsumer
173 */
174 public synchronized void startProduction(ImageConsumer ic) {
175 if (proxies == null) {
176 proxies = new Hashtable();
177 }
178 ImageFilter imgf = (ImageFilter) proxies.get(ic);
179 if (imgf == null) {
180 imgf = filter.getFilterInstance(ic);
181 proxies.put(ic, imgf);
182 }
183 src.startProduction(imgf);
184 }
185
186 /**
187 * Requests that a given ImageConsumer have the image data delivered
188 * one more time in top-down, left-right order. The request is
189 * handed to the ImageFilter for further processing, since the
190 * ability to preserve the pixel ordering depends on the filter.
191 *
192 * <p>
193 * This method is public as a side effect
194 * of this class implementing
195 * the <code>ImageProducer</code> interface.
196 * It should not be called from user code,
197 * and its behavior if called from user code is unspecified.
198 *
199 * @see ImageConsumer
200 */
201 public synchronized void requestTopDownLeftRightResend(ImageConsumer ic) {
202 if (proxies != null) {
203 ImageFilter imgf = (ImageFilter) proxies.get(ic);
204 if (imgf != null) {
205 imgf.resendTopDownLeftRight(src);
206 }
207 }
208 }
209 }
|