home *** CD-ROM | disk | FTP | other *** search
- package sun.awt.image;
-
- import java.awt.Component;
- import java.awt.image.ImageConsumer;
- import java.awt.image.ImageProducer;
- import java.util.Hashtable;
-
- public class OffScreenImageSource implements ImageProducer {
- Component target;
- int width;
- int height;
- ImageRepresentation baseIR;
- private ImageConsumer theConsumer;
-
- public OffScreenImageSource(Component var1, int var2, int var3) {
- this.target = var1;
- this.width = var2;
- this.height = var3;
- }
-
- void setImageRep(ImageRepresentation var1) {
- this.baseIR = var1;
- }
-
- public ImageRepresentation getImageRep() {
- return this.baseIR;
- }
-
- public synchronized void addConsumer(ImageConsumer var1) {
- this.theConsumer = var1;
- this.produce();
- }
-
- public synchronized boolean isConsumer(ImageConsumer var1) {
- return var1 == this.theConsumer;
- }
-
- public synchronized void removeConsumer(ImageConsumer var1) {
- if (this.theConsumer == var1) {
- this.theConsumer = null;
- }
-
- }
-
- public void startProduction(ImageConsumer var1) {
- this.addConsumer(var1);
- }
-
- public void requestTopDownLeftRightResend(ImageConsumer var1) {
- }
-
- private native void sendPixels();
-
- private void produce() {
- if (this.theConsumer != null) {
- this.theConsumer.setDimensions(this.width, this.height);
- }
-
- if (this.theConsumer != null) {
- this.theConsumer.setProperties(new Hashtable());
- }
-
- this.sendPixels();
- if (this.theConsumer != null) {
- this.theConsumer.imageComplete(2);
- }
-
- }
- }
-