/* */ package quicktime.app.image;
/* */
/* */ import java.util.Vector;
/* */ import quicktime.QTException;
/* */ import quicktime.QTRuntimeException;
/* */ import quicktime.QTSession;
/* */ import quicktime.app.actions.Invalidator;
/* */ import quicktime.app.anim.SWCompositor;
/* */ import quicktime.app.anim.TwoDSprite;
/* */ import quicktime.app.display.DrawingListener;
/* */ import quicktime.app.display.DrawingNotifier;
/* */ import quicktime.qd.PixMap;
/* */ import quicktime.qd.QDGraphics;
/* */ import quicktime.qd.QDRect;
/* */ import quicktime.qd.Region;
/* */ import quicktime.std.image.ImageDescription;
/* */
/* */ /** @deprecated */
/* */ public class QTEffectPresenter extends ImagePresenter
/* */ implements DynamicImage, DrawingNotifier
/* */ {
/* 42 */ private Vector listenerList = new Vector();
/* */ private QDGraphics g;
/* */ private QTEffect ef;
/* */ TwoDSprite sprite;
/* */
/* */ private static QDRect moveToZero(QDRect paramQDRect)
/* */ {
/* 46 */ paramQDRect.move(0, 0);
/* 47 */ return paramQDRect;
/* */ }
/* */
/* */ /** @deprecated */
/* */ public QTEffectPresenter(QTEffect paramQTEffect)
/* */ throws QTException
/* */ {
/* 59 */ this(paramQTEffect, new QDGraphics(32, paramQTEffect.getDisplayBounds(), 4096));
/* */ }
/* */
/* */ /** @deprecated */
/* */ public QTEffectPresenter(QTEffect paramQTEffect, QDGraphics paramQDGraphics)
/* */ throws QTException
/* */ {
/* 72 */ super(moveToZero(paramQTEffect.getDisplayBounds()));
/* 73 */ this.ef = paramQTEffect;
/* 74 */ this.g = paramQDGraphics;
/* 75 */ paramQTEffect.setGWorld(paramQDGraphics);
/* 76 */ paramQTEffect.redraw(null);
/* 77 */ PixMap localPixMap = paramQDGraphics.getPixMap();
/* 78 */ setImageData(localPixMap.getPixelData(), new ImageDescription(localPixMap));
/* */
/* 80 */ if ((paramQTEffect instanceof QTTransition))
/* 81 */ ((QTTransition)paramQTEffect).thePresenter = this;
/* */ }
/* */
/* */ /** @deprecated */
/* */ public void redraw(Region paramRegion)
/* */ throws QTException
/* */ {
/* 101 */ if (this.ef.isRedrawing())
/* 102 */ this.ef.redraw(paramRegion);
/* 103 */ super.redraw(paramRegion);
/* */ }
/* */
/* */ /** @deprecated */
/* */ public QTEffect getEffect()
/* */ {
/* 134 */ return this.ef;
/* */ }
/* */
/* */ /** @deprecated */
/* */ public void doTransition()
/* */ throws QTException
/* */ {
/* 143 */ if ((this.ef instanceof QTTransition))
/* 144 */ ((QTTransition)this.ef).doTransition();
/* */ }
/* */
/* */ /** @deprecated */
/* */ public Invalidator addedToCompositor(SWCompositor paramSWCompositor, TwoDSprite paramTwoDSprite)
/* */ {
/* 168 */ this.sprite = paramTwoDSprite;
/* 169 */ return this.ef.isSingleFrame() ? null : new EFInvalidator(paramTwoDSprite, this);
/* */ }
/* */
/* */ /** @deprecated */
/* */ public void removedFromCompositor(SWCompositor paramSWCompositor)
/* */ {
/* 180 */ this.sprite = null;
/* */ }
/* */
/* */ /** @deprecated */
/* */ public synchronized void addDrawingListener(DrawingListener paramDrawingListener)
/* */ {
/* 188 */ if (this.listenerList.contains(paramDrawingListener))
/* 189 */ return;
/* 190 */ this.listenerList.addElement(paramDrawingListener);
/* */ }
/* */
/* */ /** @deprecated */
/* */ public synchronized void removeDrawingListener(DrawingListener paramDrawingListener)
/* */ {
/* 198 */ if (this.listenerList.contains(paramDrawingListener))
/* 199 */ this.listenerList.removeElement(paramDrawingListener);
/* */ }
/* */
/* */ static
/* */ {
/* 37 */ if ((QTSession.isCurrentOS(4)) && (QTSession.getJavaVersion() >= 65540))
/* 38 */ throw new QTRuntimeException("Unsupported on Mac OS X and Java 1.4 and higher.");
/* */ }
/* */
/* */ class EFInvalidator extends Invalidator
/* */ {
/* */ QTEffectPresenter pres;
/* */
/* */ EFInvalidator(TwoDSprite paramQTEffectPresenter, QTEffectPresenter arg3)
/* */ {
/* 108 */ super();
/* */ Object localObject;
/* 109 */ this.pres = localObject;
/* */ }
/* */
/* */ public boolean tickle(float paramFloat, int paramInt) throws QTException {
/* 113 */ if (QTEffectPresenter.this.ef.isRedrawing()) {
/* 114 */ QTEffectPresenter.this.ef.redraw(null);
/* */
/* 116 */ synchronized (QTEffectPresenter.this) {
/* 117 */ for (int i = 0; i < QTEffectPresenter.this.listenerList.size(); i++)
/* 118 */ ((DrawingListener)QTEffectPresenter.this.listenerList.elementAt(i)).drawingComplete(this.pres);
/* */ }
/* 120 */ this.s.invalidate();
/* */ }
/* 122 */ return true;
/* */ }
/* */ }
/* */ }
/* Location: Z:\System\Library\Java\Extensions\QTJava.zip
* Qualified Name: quicktime.app.image.QTEffectPresenter
* JD-Core Version: 0.6.2
*/