66 while (cq != null) {
67 if (cq.interested) {
68 return cq;
69 }
70 cq = cq.next;
71 }
72 }
73 return null;
74 }
75
76 protected int setDimensions(int w, int h) {
77 ImageConsumerQueue cq = null;
78 int count = 0;
79 while ((cq = nextConsumer(cq)) != null) {
80 cq.consumer.setDimensions(w, h);
81 count++;
82 }
83 return count;
84 }
85
86 protected int setProperties(Hashtable props) {
87 ImageConsumerQueue cq = null;
88 int count = 0;
89 while ((cq = nextConsumer(cq)) != null) {
90 cq.consumer.setProperties(props);
91 count++;
92 }
93 return count;
94 }
95
96 protected int setColorModel(ColorModel model) {
97 ImageConsumerQueue cq = null;
98 int count = 0;
99 while ((cq = nextConsumer(cq)) != null) {
100 cq.consumer.setColorModel(model);
101 count++;
102 }
103 return count;
104 }
105
106 protected int setHints(int hints) {
147 finished = true;
148 source.doneDecoding(this);
149 }
150 ImageConsumerQueue cq = null;
151 int count = 0;
152 while ((cq = nextConsumer(cq)) != null) {
153 cq.consumer.imageComplete(status);
154 count++;
155 }
156 return count;
157 }
158
159 public abstract void produceImage() throws IOException,
160 ImageFormatException;
161
162 public void abort() {
163 aborted = true;
164 source.doneDecoding(this);
165 close();
166 java.security.AccessController.doPrivileged(
167 new java.security.PrivilegedAction() {
168 public Object run() {
169 feeder.interrupt();
170 return null;
171 }
172 });
173 }
174
175 public synchronized void close() {
176 if (input != null) {
177 try {
178 input.close();
179 } catch (IOException e) {
180 }
181 }
182 }
183 }
|
66 while (cq != null) {
67 if (cq.interested) {
68 return cq;
69 }
70 cq = cq.next;
71 }
72 }
73 return null;
74 }
75
76 protected int setDimensions(int w, int h) {
77 ImageConsumerQueue cq = null;
78 int count = 0;
79 while ((cq = nextConsumer(cq)) != null) {
80 cq.consumer.setDimensions(w, h);
81 count++;
82 }
83 return count;
84 }
85
86 protected int setProperties(Hashtable<?,?> props) {
87 ImageConsumerQueue cq = null;
88 int count = 0;
89 while ((cq = nextConsumer(cq)) != null) {
90 cq.consumer.setProperties(props);
91 count++;
92 }
93 return count;
94 }
95
96 protected int setColorModel(ColorModel model) {
97 ImageConsumerQueue cq = null;
98 int count = 0;
99 while ((cq = nextConsumer(cq)) != null) {
100 cq.consumer.setColorModel(model);
101 count++;
102 }
103 return count;
104 }
105
106 protected int setHints(int hints) {
147 finished = true;
148 source.doneDecoding(this);
149 }
150 ImageConsumerQueue cq = null;
151 int count = 0;
152 while ((cq = nextConsumer(cq)) != null) {
153 cq.consumer.imageComplete(status);
154 count++;
155 }
156 return count;
157 }
158
159 public abstract void produceImage() throws IOException,
160 ImageFormatException;
161
162 public void abort() {
163 aborted = true;
164 source.doneDecoding(this);
165 close();
166 java.security.AccessController.doPrivileged(
167 new java.security.PrivilegedAction<Object>() {
168 public Object run() {
169 feeder.interrupt();
170 return null;
171 }
172 });
173 }
174
175 public synchronized void close() {
176 if (input != null) {
177 try {
178 input.close();
179 } catch (IOException e) {
180 }
181 }
182 }
183 }
|