Package quicktime.app.players

Source Code of quicktime.app.players.QTPlayerAWTEventHandler

/*     */ package quicktime.app.players;
/*     */
/*     */ import java.awt.Component;
/*     */ import java.awt.Container;
/*     */ import java.awt.Window;
/*     */ import java.awt.event.KeyEvent;
/*     */ import java.awt.event.KeyListener;
/*     */ import java.awt.event.MouseEvent;
/*     */ import java.awt.event.MouseListener;
/*     */ import java.awt.event.WindowAdapter;
/*     */ import java.awt.event.WindowEvent;
/*     */ import quicktime.QTException;
/*     */ import quicktime.QTRuntimeException;
/*     */ import quicktime.QTSession;
/*     */ import quicktime.qd.QDPoint;
/*     */ import quicktime.std.movies.MovieController;
/*     */
/*     */ /** @deprecated */
/*     */ public class QTPlayerAWTEventHandler extends QTPlayerEventHandler
/*     */   implements MouseListener, KeyListener
/*     */ {
/*     */   private WindowAdapter wa;
/*     */   private Window parentWindow;
/*     */   protected QTPlayer player;
/*     */
/*     */   /** @deprecated */
/*     */   protected Component component;
/*     */
/*     */   /** @deprecated */
/*     */   protected QTPlayerAWTEventHandler(QTPlayer paramQTPlayer, Object paramObject)
/*     */   {
/*  48 */     this.player = paramQTPlayer;
/*  49 */     this.component = ((Component)paramObject);
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   protected void addedTo()
/*     */   {
/*  71 */     this.component.addMouseListener(this);
/*  72 */     this.component.addKeyListener(this);
/*     */
/*  74 */     Object localObject1 = this.component.getParent();
/*  75 */     Object localObject2 = localObject1;
/*  76 */     while (localObject2 != null) {
/*  77 */       localObject1 = localObject2;
/*  78 */       if ((localObject1 instanceof Window))
/*     */         break;
/*  80 */       localObject2 = ((Container)localObject1).getParent();
/*     */     }
/*  82 */     if ((localObject1 instanceof Window)) {
/*  83 */       this.parentWindow = ((Window)localObject1);
/*  84 */       this.wa = new WindowAdapter() {
/*     */         public void windowActivated(WindowEvent paramAnonymousWindowEvent) {
/*     */           try {
/*  87 */             QTPlayerAWTEventHandler.this.player.controller.activate(QTPlayerAWTEventHandler.this.player.getGWorld(), true);
/*  88 */             QTPlayerAWTEventHandler.this.player.controller.activate();
/*  89 */             QTPlayerAWTEventHandler.this.player.redraw(null); } catch (QTException localQTException) {
/*     */           }
/*     */         }
/*     */
/*  93 */         public void windowDeactivated(WindowEvent paramAnonymousWindowEvent) { synchronized (QTSession.terminationLock()) {
/*  94 */             if (QTSession.isInitialized())
/*     */               try {
/*  96 */                 QTPlayerAWTEventHandler.this.player.controller.deactivate();
/*  97 */                 QTPlayerAWTEventHandler.this.player.controller.activate(QTPlayerAWTEventHandler.this.player.getGWorld(), false);
/*  98 */                 QTPlayerAWTEventHandler.this.player.redraw(null);
/*     */               } catch (QTException localQTException) {
/*     */               }
/* 101 */             else QTPlayerAWTEventHandler.this.player.removedFrom(QTPlayerAWTEventHandler.this.component);
/*     */           }
/*     */         }
/*     */       };
/* 106 */       this.parentWindow.addWindowListener(this.wa);
/*     */     }
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   protected void removedFrom()
/*     */   {
/* 115 */     this.component.removeMouseListener(this);
/* 116 */     this.component.removeKeyListener(this);
/*     */
/* 118 */     if (this.parentWindow != null) {
/* 119 */       this.parentWindow.removeWindowListener(this.wa);
/* 120 */       this.parentWindow = null;
/* 121 */       this.wa = null;
/*     */     }
/*     */   }
/*     */
/*     */   public void keyPressed(KeyEvent paramKeyEvent)
/*     */   {
/*     */     try {
/* 128 */       this.player.controller.key(paramKeyEvent.getKeyCode(), paramKeyEvent.getModifiers());
/*     */     } catch (QTException localQTException) {
/* 130 */       QTRuntimeException.handleOrThrow(new QTRuntimeException(localQTException), this, "keyPressed");
/*     */     }
/*     */   }
/*     */
/*     */   public void keyReleased(KeyEvent paramKeyEvent) {
/*     */   }
/*     */
/*     */   public void keyTyped(KeyEvent paramKeyEvent) {
/*     */   }
/*     */
/*     */   public void mousePressed(MouseEvent paramMouseEvent) {
/*     */     try { this.player.controller.click(new QDPoint(paramMouseEvent.getX(), paramMouseEvent.getY()), paramMouseEvent.getModifiers());
/*     */     } catch (QTException localQTException) {
/* 143 */       QTRuntimeException.handleOrThrow(new QTRuntimeException(localQTException), this, "mousePressed");
/*     */     }
/*     */   }
/*     */
/*     */   public void mouseClicked(MouseEvent paramMouseEvent)
/*     */   {
/*     */   }
/*     */
/*     */   public void mouseEntered(MouseEvent paramMouseEvent)
/*     */   {
/*     */   }
/*     */
/*     */   public void mouseExited(MouseEvent paramMouseEvent)
/*     */   {
/*     */   }
/*     */
/*     */   public void mouseReleased(MouseEvent paramMouseEvent)
/*     */   {
/*     */   }
/*     */
/*     */   static
/*     */   {
/*  35 */     if ((QTSession.isCurrentOS(4)) && (QTSession.getJavaVersion() >= 65540))
/*  36 */       throw new QTRuntimeException("Unsupported on Mac OS X and Java 1.4 and higher.");
/*     */   }
/*     */ }

/* Location:           Z:\System\Library\Java\Extensions\QTJava.zip
* Qualified Name:     quicktime.app.players.QTPlayerAWTEventHandler
* JD-Core Version:    0.6.2
*/
TOP

Related Classes of quicktime.app.players.QTPlayerAWTEventHandler

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.