Package quicktime.app.actions

Source Code of quicktime.app.actions.MouseController

/*     */ package quicktime.app.actions;
/*     */
/*     */ import java.awt.Component;
/*     */ import java.awt.event.MouseEvent;
/*     */ import java.awt.event.MouseListener;
/*     */ import java.awt.event.MouseMotionListener;
/*     */ import java.util.Enumeration;
/*     */ import java.util.Vector;
/*     */ import quicktime.QTException;
/*     */ import quicktime.QTRuntimeException;
/*     */ import quicktime.QTSession;
/*     */ import quicktime.app.spaces.Collection;
/*     */ import quicktime.app.spaces.ListenerController;
/*     */ import quicktime.app.spaces.Space;
/*     */
/*     */ /** @deprecated */
/*     */ public abstract class MouseController
/*     */   implements ListenerController, Collection, MouseListener, MouseMotionListener
/*     */ {
/*  62 */   private static boolean apriori = QTSession.apriori();
/*     */   private boolean wholespace;
/*     */   private Vector table;
/*     */   private MouseResponder responder;
/*     */   private Object mouseMoveCurrentTarget;
/*     */   private Object originalDragTarget;
/*     */   private Object currentTargetInDrag;
/*     */   protected int xLocationOffset;
/*     */   protected int yLocationOffset;
/*     */
/*     */   /** @deprecated */
/*     */   protected MouseController(MouseResponder paramMouseResponder, boolean paramBoolean)
/*     */   {
/*  78 */     this.responder = paramMouseResponder;
/*  79 */     if (paramMouseResponder == null) throw new NullPointerException("Responder must NOT be null");
/*  80 */     this.wholespace = paramBoolean;
/*  81 */     this.table = new Vector();
/*  82 */     this.responder.controller = this;
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public abstract Space getSpace();
/*     */
/*     */   /** @deprecated */
/*     */   public final void addedToSpace(Space paramSpace)
/*     */   {
/* 113 */     setTargetSpace(paramSpace);
/* 114 */     this.responder.setTargetSpace(paramSpace);
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public void removedFromSpace()
/*     */   {
/* 125 */     setTargetSpace(null);
/* 126 */     this.responder.setTargetSpace(null);
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   protected MouseResponder getResponder()
/*     */   {
/* 135 */     return this.responder;
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   protected abstract void setTargetSpace(Space paramSpace);
/*     */
/*     */   /** @deprecated */
/*     */   public void addedTo(Object paramObject)
/*     */   {
/* 160 */     if ((paramObject instanceof Component)) {
/* 161 */       if (this.responder.isInterested(51))
/* 162 */         ((Component)paramObject).addMouseListener(this);
/* 163 */       if (this.responder.isInterested(12))
/* 164 */         ((Component)paramObject).addMouseMotionListener(this);
/*     */     }
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public void removedFrom(Object paramObject)
/*     */   {
/* 180 */     if ((paramObject instanceof Component)) {
/* 181 */       ((Component)paramObject).removeMouseListener(this);
/* 182 */       ((Component)paramObject).removeMouseMotionListener(this);
/*     */     }
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   protected abstract Object getSelected(MouseEvent paramMouseEvent)
/*     */     throws QTException;
/*     */
/*     */   /** @deprecated */
/*     */   public boolean isWholespace()
/*     */   {
/* 200 */     return this.wholespace;
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public void setWholespace(boolean paramBoolean)
/*     */   {
/* 206 */     this.wholespace = paramBoolean;
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public boolean addMember(Object paramObject)
/*     */   {
/* 219 */     if (!isAppropriate(paramObject)) return false;
/* 220 */     if (!hasMember(paramObject))
/* 221 */       this.table.addElement(paramObject);
/* 222 */     return true;
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public boolean isAppropriate(Object paramObject)
/*     */   {
/* 237 */     return this.responder.isAppropriate(paramObject);
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public void removeMember(Object paramObject)
/*     */   {
/* 246 */     this.table.removeElement(paramObject);
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public Enumeration members()
/*     */   {
/* 259 */     return this.table.elements();
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public boolean isEmpty()
/*     */   {
/* 272 */     return this.table.isEmpty();
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public int size()
/*     */   {
/* 279 */     return this.table.size();
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public boolean hasMember(Object paramObject)
/*     */   {
/* 292 */     return paramObject == null ? false : this.table.contains(paramObject);
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public void mouseEntered(MouseEvent paramMouseEvent)
/*     */   {
/* 302 */     if (this.responder.isInterested(16, paramMouseEvent.getModifiers())) {
/* 303 */       boolean bool = this.responder.isActive();
/* 304 */       if (!bool) {
/* 305 */         this.responder.activate(16);
/* 306 */         responderActivated();
/*     */       }
/* 308 */       this.responder.mouseEntered(paramMouseEvent);
/* 309 */       if (!bool)
/* 310 */         deactivateResponder();
/*     */     }
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public void mouseExited(MouseEvent paramMouseEvent)
/*     */   {
/* 321 */     if (this.responder.isInterested(32, paramMouseEvent.getModifiers())) {
/* 322 */       boolean bool = this.responder.isActive();
/* 323 */       if (!bool) {
/* 324 */         this.responder.activate(32);
/* 325 */         responderActivated();
/*     */       }
/* 327 */       this.responder.mouseExited(paramMouseEvent);
/* 328 */       if (this.mouseMoveCurrentTarget != null) {
/* 329 */         this.responder.mouseExitedTarget(paramMouseEvent);
/* 330 */         this.mouseMoveCurrentTarget = null;
/*     */       }
/* 332 */       if (bool)
/* 333 */         deactivateResponder();
/*     */     }
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   protected void setTranslation()
/*     */   {
/* 348 */     this.xLocationOffset = 0;
/* 349 */     this.yLocationOffset = 0;
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public void mousePressed(MouseEvent paramMouseEvent)
/*     */   {
/* 359 */     if (this.responder.isInterested(2, paramMouseEvent.getModifiers())) {
/* 360 */       setTranslation();
/* 361 */       paramMouseEvent.translatePoint(-this.xLocationOffset, -this.yLocationOffset);
/* 362 */       if (_activateResponder(paramMouseEvent, 2)) {
/* 363 */         this.responder.mousePressed(paramMouseEvent);
/*     */       }
/* 365 */       paramMouseEvent.translatePoint(this.xLocationOffset, this.yLocationOffset);
/*     */     }
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public void mouseReleased(MouseEvent paramMouseEvent)
/*     */   {
/* 376 */     if ((this.responder.isInterested(2, paramMouseEvent.getModifiers())) && (this.responder.isActive())) {
/* 377 */       setTranslation();
/* 378 */       paramMouseEvent.translatePoint(-this.xLocationOffset, -this.yLocationOffset);
/* 379 */       this.responder.mouseReleased(paramMouseEvent);
/* 380 */       if (this.mouseMoveCurrentTarget == null) {
/* 381 */         deactivateResponder();
/* 382 */       } else if (this.currentTargetInDrag == null) {
/* 383 */         deactivateResponder();
/* 384 */         this.mouseMoveCurrentTarget = null;
/*     */       }
/* 386 */       this.originalDragTarget = null;
/* 387 */       paramMouseEvent.translatePoint(this.xLocationOffset, this.yLocationOffset);
/*     */     }
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public void mouseClicked(MouseEvent paramMouseEvent)
/*     */   {
/* 398 */     if (this.responder.isInterested(1, paramMouseEvent.getModifiers())) {
/* 399 */       setTranslation();
/* 400 */       paramMouseEvent.translatePoint(-this.xLocationOffset, -this.yLocationOffset);
/* 401 */       if (_activateResponder(paramMouseEvent, 1)) {
/* 402 */         this.responder.mouseClicked(paramMouseEvent);
/* 403 */         deactivateResponder();
/*     */       }
/* 405 */       paramMouseEvent.translatePoint(this.xLocationOffset, this.yLocationOffset);
/*     */     }
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public void mouseMoved(MouseEvent paramMouseEvent)
/*     */   {
/* 416 */     if (!this.responder.isInterested(72, paramMouseEvent.getModifiers())) {
/* 417 */       return;
/*     */     }
/* 419 */     setTranslation();
/* 420 */     paramMouseEvent.translatePoint(-this.xLocationOffset, -this.yLocationOffset);
/* 421 */     if (this.responder.isInterested(64, paramMouseEvent.getModifiers())) {
/*     */       try {
/* 423 */         Object localObject = getSelected(paramMouseEvent);
/* 424 */         if (localObject == null) {
/* 425 */           if (this.mouseMoveCurrentTarget != null) {
/* 426 */             this.responder.mouseExitedTarget(paramMouseEvent);
/* 427 */             deactivateResponder();
/* 428 */             this.mouseMoveCurrentTarget = null;
/*     */           }
/*     */         }
/* 431 */         else if (this.responder.isAppropriate(localObject)) {
/* 432 */           if (this.mouseMoveCurrentTarget == null) {
/* 433 */             this.responder.setTarget(localObject);
/* 434 */             this.responder.activate(64);
/* 435 */             responderActivated();
/* 436 */             this.responder.mouseEnteredTarget(paramMouseEvent);
/* 437 */             this.mouseMoveCurrentTarget = localObject;
/* 438 */           } else if (this.mouseMoveCurrentTarget != localObject) {
/* 439 */             this.responder.mouseExitedTarget(paramMouseEvent);
/* 440 */             deactivateResponder();
/* 441 */             this.responder.setTarget(localObject);
/* 442 */             this.responder.activate(64);
/* 443 */             responderActivated();
/* 444 */             this.responder.mouseEnteredTarget(paramMouseEvent);
/* 445 */             this.mouseMoveCurrentTarget = localObject;
/*     */           } else {
/* 447 */             this.responder.mouseMoved(paramMouseEvent);
/* 448 */             paramMouseEvent.translatePoint(this.xLocationOffset, this.yLocationOffset);
/*     */           }
/*     */         }
/* 451 */         else if (this.mouseMoveCurrentTarget != null) {
/* 452 */           this.responder.mouseExitedTarget(paramMouseEvent);
/* 453 */           deactivateResponder();
/* 454 */           this.mouseMoveCurrentTarget = null;
/*     */         }
/*     */       }
/*     */       catch (QTException localQTException) {
/* 458 */         QTRuntimeException.handleOrThrow(new QTRuntimeException(localQTException), this, "getSelected");
/*     */       }
/*     */     }
/* 461 */     if (this.responder.isInterested(8, paramMouseEvent.getModifiers())) {
/* 462 */       boolean bool = this.responder.isActive();
/* 463 */       if (!bool) {
/* 464 */         this.responder.activate(8);
/* 465 */         responderActivated();
/*     */       }
/* 467 */       this.responder.mouseMoved(paramMouseEvent);
/* 468 */       if (!bool)
/* 469 */         deactivateResponder();
/*     */     }
/* 471 */     paramMouseEvent.translatePoint(this.xLocationOffset, this.yLocationOffset);
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public void mouseDragged(MouseEvent paramMouseEvent)
/*     */   {
/* 481 */     if ((this.responder.isInterested(4)) && (this.responder.isActive())) {
/* 482 */       setTranslation();
/* 483 */       paramMouseEvent.translatePoint(-this.xLocationOffset, -this.yLocationOffset);
/* 484 */       doDragTarget(paramMouseEvent);
/* 485 */       this.responder.mouseDragged(paramMouseEvent);
/* 486 */       paramMouseEvent.translatePoint(this.xLocationOffset, this.yLocationOffset);
/*     */     }
/*     */   }
/*     */
/*     */   protected void doDragTarget(MouseEvent paramMouseEvent) {
/* 491 */     if (this.responder.isInterested(64, paramMouseEvent.getModifiers()))
/*     */       try {
/* 493 */         Object localObject = getSelected(paramMouseEvent);
/* 494 */         if ((localObject == null) && (this.currentTargetInDrag != null)) {
/* 495 */           this.responder.mouseExitedTarget(paramMouseEvent);
/* 496 */           this.currentTargetInDrag = null;
/* 497 */         } else if ((localObject != null) && (this.currentTargetInDrag == null) && (localObject == this.originalDragTarget)) {
/* 498 */           this.responder.mouseEnteredTarget(paramMouseEvent);
/* 499 */           this.currentTargetInDrag = localObject;
/*     */         }
/*     */       } catch (QTException localQTException) {
/* 502 */         QTRuntimeException.handleOrThrow(new QTRuntimeException(localQTException), this, "getSelected");
/*     */       }
/*     */   }
/*     */
/*     */   private boolean _activateResponder(MouseEvent paramMouseEvent, int paramInt)
/*     */   {
/*     */     try {
/* 509 */       Object localObject = getSelected(paramMouseEvent);
/* 510 */       if ((localObject != null) && (this.responder.isAppropriate(localObject))) {
/* 511 */         this.responder.activate(paramInt);
/* 512 */         this.responder.setTarget(localObject);
/* 513 */         this.originalDragTarget = localObject;
/* 514 */         this.currentTargetInDrag = localObject;
/* 515 */         responderActivated();
/* 516 */         return true;
/*     */       }
/*     */     } catch (QTException localQTException) {
/* 519 */       QTRuntimeException.handleOrThrow(new QTRuntimeException(localQTException), this, "activateResponder");
/*     */     }
/* 521 */     return false;
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   protected void deactivateResponder()
/*     */   {
/* 533 */     this.responder.deactivate();
/* 534 */     this.originalDragTarget = null;
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   protected void responderActivated()
/*     */   {
/*     */   }
/*     */
/*     */   static
/*     */   {
/*  65 */     if ((QTSession.isCurrentOS(4)) && (QTSession.getJavaVersion() >= 65540))
/*  66 */       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.actions.MouseController
* JD-Core Version:    0.6.2
*/
TOP

Related Classes of quicktime.app.actions.MouseController

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.