Package quicktime.app.display

Source Code of quicktime.app.display.GroupDrawable

/*     */ package quicktime.app.display;
/*     */
/*     */ import java.awt.Dimension;
/*     */ import java.util.Enumeration;
/*     */ import java.util.Vector;
/*     */ import quicktime.QTException;
/*     */ import quicktime.QTRuntimeException;
/*     */ import quicktime.QTSession;
/*     */ import quicktime.app.image.Transformable;
/*     */ import quicktime.app.spaces.Protocol;
/*     */ import quicktime.app.spaces.SimpleSpace;
/*     */ import quicktime.qd.QDColor;
/*     */ import quicktime.qd.QDDimension;
/*     */ import quicktime.qd.QDGraphics;
/*     */ import quicktime.qd.QDRect;
/*     */ import quicktime.qd.Region;
/*     */ import quicktime.std.StdQTException;
/*     */ import quicktime.std.image.Matrix;
/*     */
/*     */ /** @deprecated */
/*     */ public abstract class GroupDrawable extends SimpleSpace
/*     */   implements QTDisplaySpace
/*     */ {
/*  53 */   private static boolean apriori = QTSession.apriori();
/*     */   static final boolean debug = false;
/*  98 */   QDGraphics port = QDGraphics.scratch;
/*     */   QDRect displayBounds;
/* 101 */   boolean visible = false;
/*     */   QDDimension initSize;
/*     */   Region eraseRegion;
/*     */   QDColor bgColor;
/*     */   protected Region clip;
/*     */
/*     */   /** @deprecated */
/* 114 */   protected Vector vec = new Vector(8);
/*     */
/*     */   /** @deprecated */
/*     */   protected GroupDrawable(Dimension paramDimension, QDColor paramQDColor, int paramInt1, int paramInt2, Protocol paramProtocol)
/*     */     throws QTException
/*     */   {
/*  76 */     this(new QDDimension(paramDimension.width, paramDimension.height), paramQDColor, paramInt1, paramInt2, paramProtocol);
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   protected GroupDrawable(QDDimension paramQDDimension, QDColor paramQDColor, int paramInt1, int paramInt2, Protocol paramProtocol)
/*     */     throws QTException
/*     */   {
/*  89 */     super(paramProtocol, paramInt1, paramInt2);
/*  90 */     this.displayBounds = new QDRect(paramQDDimension);
/*  91 */     this.initSize = paramQDDimension;
/*  92 */     this.eraseRegion = new Region(this.displayBounds);
/*  93 */     this.clip = this.eraseRegion;
/*  94 */     setBackgroundColor(paramQDColor);
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public QDGraphics getGWorld()
/*     */     throws StdQTException
/*     */   {
/* 123 */     return this.port;
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public void setGWorld(QDGraphics paramQDGraphics)
/*     */     throws QTException
/*     */   {
/* 137 */     this.port = paramQDGraphics;
/* 138 */     boolean bool = this.visible;
/* 139 */     this.visible = (!QDGraphics.scratch.equals(paramQDGraphics));
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public void setLocation(int paramInt1, int paramInt2)
/*     */     throws QTException
/*     */   {
/* 149 */     this.displayBounds.setX(paramInt1);
/* 150 */     this.displayBounds.setY(paramInt2);
/* 151 */     setDisplayBounds(this.displayBounds);
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public void setDisplayBounds(QDRect paramQDRect)
/*     */     throws QTException
/*     */   {
/* 163 */     this.displayBounds = paramQDRect;
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public QDRect getDisplayBounds()
/*     */     throws StdQTException
/*     */   {
/* 174 */     return this.displayBounds;
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public QDColor getBackgroundColor()
/*     */   {
/* 181 */     return this.bgColor;
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public void setBackgroundColor(QDColor paramQDColor)
/*     */     throws QTException
/*     */   {
/* 188 */     if (paramQDColor == null)
/* 189 */       this.bgColor = this.port.getBackColor();
/*     */     else
/* 191 */       this.bgColor = paramQDColor;
/* 192 */     if (this.visible)
/* 193 */       redraw(null);
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public synchronized void removeMember(Object paramObject)
/*     */     throws QTException
/*     */   {
/* 202 */     for (int i = 0; i < this.vec.size(); i++) {
/* 203 */       GroupMember localGroupMember = (GroupMember)this.vec.elementAt(i);
/* 204 */       QTDrawable localQTDrawable = localGroupMember.drawer;
/* 205 */       if (localQTDrawable.equals(paramObject)) {
/* 206 */         localQTDrawable.setGWorld(QDGraphics.scratch);
/* 207 */         this.vec.removeElementAt(i);
/* 208 */         memberRemoved(paramObject);
/*     */
/* 210 */         if (!this.visible)
/*     */         {
/*     */           break;
/*     */         }
/*     */
/* 223 */         setClip(null);
/* 224 */         redraw(null);
/* 225 */         break;
/*     */       }
/*     */     }
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public synchronized Enumeration members()
/*     */   {
/* 238 */     Vector localVector = new Vector();
/* 239 */     Enumeration localEnumeration = this.vec.elements();
/* 240 */     while (localEnumeration.hasMoreElements()) {
/* 241 */       GroupMember localGroupMember = (GroupMember)localEnumeration.nextElement();
/* 242 */       localVector.addElement(localGroupMember.drawer);
/*     */     }
/* 244 */     return localVector.elements();
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public boolean isEmpty()
/*     */   {
/* 252 */     return this.vec.isEmpty();
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public GroupMember getGroupMember(Object paramObject)
/*     */   {
/* 262 */     Enumeration localEnumeration = this.vec.elements();
/* 263 */     while (localEnumeration.hasMoreElements()) {
/* 264 */       GroupMember localGroupMember = (GroupMember)localEnumeration.nextElement();
/* 265 */       if (localGroupMember.drawer.equals(paramObject)) return localGroupMember;
/*     */     }
/* 267 */     return null;
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public int size()
/*     */   {
/* 276 */     return this.vec.size();
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public abstract GroupMember memberChanged(QTDrawable paramQTDrawable)
/*     */     throws QTException;
/*     */
/*     */   /** @deprecated */
/*     */   public abstract void redrawMember(QTDrawable paramQTDrawable, Region paramRegion)
/*     */     throws QTException;
/*     */
/*     */   /** @deprecated */
/*     */   public boolean setMemberAlignment(QTDrawable paramQTDrawable, float paramFloat1, float paramFloat2)
/*     */     throws QTException
/*     */   {
/* 318 */     GroupMember localGroupMember = getGroupMember(paramQTDrawable);
/* 319 */     if (localGroupMember != null) {
/* 320 */       setAlignedMemberLocation(localGroupMember.drawer, paramFloat1, paramFloat2);
/*     */     }
/* 322 */     return localGroupMember != null;
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public boolean setMemberLayer(QTDrawable paramQTDrawable, int paramInt)
/*     */     throws QTException
/*     */   {
/* 335 */     if (!isAppropriate(paramQTDrawable)) return false;
/* 336 */     if (!hasMember(paramQTDrawable)) return false;
/* 337 */     GroupMember localGroupMember1 = null;
/* 338 */     for (int i = 0; i < this.vec.size(); i++) {
/* 339 */       localGroupMember1 = (GroupMember)this.vec.elementAt(i);
/* 340 */       if (localGroupMember1.drawer.equals(paramQTDrawable)) {
/* 341 */         this.vec.removeElementAt(i);
/* 342 */         break;
/*     */       }
/* 344 */       localGroupMember1 = null;
/*     */     }
/* 346 */     if (localGroupMember1 != null) {
/* 347 */       i = 0;
/* 348 */       localGroupMember1.layer = paramInt;
/* 349 */       for (int j = 0; j < this.vec.size(); j++) {
/* 350 */         GroupMember localGroupMember2 = (GroupMember)this.vec.elementAt(j);
/* 351 */         if (paramInt <= localGroupMember2.layer) {
/* 352 */           i = 1;
/* 353 */           this.vec.insertElementAt(localGroupMember1, j);
/* 354 */           break;
/*     */         }
/*     */       }
/* 357 */       if (i == 0) {
/* 358 */         this.vec.addElement(localGroupMember1);
/*     */       }
/*     */     }
/* 361 */     return localGroupMember1 != null;
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public int getBackLayer()
/*     */   {
/* 370 */     if (this.vec.size() == 0) return -1;
/* 371 */     GroupMember localGroupMember = (GroupMember)this.vec.elementAt(this.vec.size() - 1);
/* 372 */     return localGroupMember.getLayer();
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public int getFrontLayer()
/*     */   {
/* 381 */     if (this.vec.size() == 0) return -1;
/* 382 */     GroupMember localGroupMember = (GroupMember)this.vec.elementAt(0);
/* 383 */     return localGroupMember.getLayer();
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public Dimension getInitialSize()
/*     */     throws QTException
/*     */   {
/* 393 */     return new Dimension(this.initSize.getWidth(), this.initSize.getHeight());
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public QDDimension getOriginalSize()
/*     */     throws QTException
/*     */   {
/* 403 */     return this.initSize.copy();
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public synchronized void redraw(Region paramRegion)
/*     */     throws QTException
/*     */   {
/* 418 */     if (!this.eraseRegion.empty()) {
/* 419 */       this.port.setBackColor(this.bgColor);
/* 420 */       this.port.eraseRgn(this.eraseRegion);
/*     */     }
/* 422 */     for (int i = this.vec.size() - 1; i >= 0; i--)
/* 423 */       ((GroupMember)this.vec.elementAt(i)).drawer.redraw(paramRegion);
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public Layerable getLayerable(Object paramObject)
/*     */   {
/* 437 */     return getGroupMember(paramObject);
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public Transformable getTransformable(Object paramObject)
/*     */   {
/* 453 */     if (hasMember(paramObject) == true) return (Transformable)paramObject;
/* 454 */     return null;
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public Object hitTest(int paramInt1, int paramInt2)
/*     */     throws QTException
/*     */   {
/* 466 */     if (this.vec != null) {
/* 467 */       if (!this.displayBounds.inside(paramInt1, paramInt2))
/* 468 */         return null;
/* 469 */       for (int i = 0; i < this.vec.size(); i++) {
/* 470 */         GroupMember localGroupMember = (GroupMember)this.vec.elementAt(i);
/* 471 */         if (localGroupMember.drawer.getDisplayBounds().inside(paramInt1, paramInt2))
/* 472 */           return localGroupMember.drawer;
/*     */       }
/*     */     }
/* 475 */     return null;
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public Matrix getMatrix()
/*     */     throws StdQTException
/*     */   {
/* 487 */     Matrix localMatrix = new Matrix();
/* 488 */     localMatrix.setTx(this.displayBounds.getX());
/* 489 */     localMatrix.setTy(this.displayBounds.getY());
/*     */
/* 492 */     return localMatrix;
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public void setMatrix(Matrix paramMatrix)
/*     */     throws QTException
/*     */   {
/* 504 */     int i = (int)(paramMatrix.getTx() + 0.5F);
/* 505 */     int j = (int)(paramMatrix.getTy() + 0.5F);
/* 506 */     setDisplayBounds(new QDRect(i, j, this.displayBounds.getWidth(), this.displayBounds.getHeight()));
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public Region getClip()
/*     */     throws QTException
/*     */   {
/* 514 */     return this.clip;
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public Region getBackgroundClip()
/*     */   {
/* 524 */     return this.eraseRegion;
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public abstract void setClip(Region paramRegion)
/*     */     throws QTException;
/*     */
/*     */   final synchronized void _addQTDrawable(GroupMember paramGroupMember)
/*     */     throws QTException
/*     */   {
/* 537 */     QDRect localQDRect = getDisplayBounds();
/* 538 */     int i = 0;
/*     */
/* 541 */     synchronized (this.vec) {
/* 542 */       for (int j = 0; j < this.vec.size(); j++) {
/* 543 */         GroupMember localGroupMember = (GroupMember)this.vec.elementAt(j);
/* 544 */         if (paramGroupMember.drawer.equals(localGroupMember.drawer))
/* 545 */           return;
/* 546 */         if (paramGroupMember.layer <= localGroupMember.layer) {
/* 547 */           this.vec.insertElementAt(paramGroupMember, j);
/* 548 */           i = 1;
/* 549 */           break;
/*     */         }
/*     */       }
/*     */
/* 553 */       if (i == 0) {
/* 554 */         this.vec.addElement(paramGroupMember);
/*     */       }
/*     */
/*     */     }
/*     */
/* 562 */     memberAdded(paramGroupMember.drawer);
/* 563 */     if (this.visible)
/* 564 */       setClip(null);
/* 565 */     paramGroupMember.drawer.setGWorld(getGWorld());
/* 566 */     if (this.visible)
/* 567 */       redraw(null);
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   protected void setAlignedMemberLocation(QTDrawable paramQTDrawable, float paramFloat1, float paramFloat2)
/*     */     throws QTException
/*     */   {
/* 581 */     if (paramFloat1 < 0.0F)
/* 582 */       paramFloat1 = 1.0F;
/* 583 */     else if (paramFloat1 > 1.0F)
/* 584 */       paramFloat1 = 1.0F;
/* 585 */     if (paramFloat2 < 0.0F)
/* 586 */       paramFloat2 = 1.0F;
/* 587 */     else if (paramFloat2 > 1.0F) {
/* 588 */       paramFloat2 = 1.0F;
/*     */     }
/* 590 */     QDRect localQDRect1 = getDisplayBounds();
/*     */
/* 592 */     int i = localQDRect1.getX();
/* 593 */     int j = localQDRect1.getY();
/* 594 */     int k = localQDRect1.getWidth();
/* 595 */     int m = localQDRect1.getHeight();
/*     */
/* 597 */     QDRect localQDRect2 = paramQTDrawable.getDisplayBounds();
/*     */
/* 600 */     int n = k - localQDRect2.getWidth();
/* 601 */     int i1 = m - localQDRect2.getHeight();
/* 602 */     if (n < 0) n = 0;
/* 603 */     if (i1 < 0) i1 = 0;
/*     */
/* 607 */     int i2 = (int)(n * paramFloat1);
/*     */
/* 610 */     int i3 = (int)(i1 * paramFloat2);
/*     */
/* 612 */     paramQTDrawable.setLocation(i + i2, j + i3);
/*     */   }
/*     */
/*     */   static
/*     */   {
/*  56 */     if ((QTSession.isCurrentOS(4)) && (QTSession.getJavaVersion() >= 65540))
/*  57 */       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.display.GroupDrawable
* JD-Core Version:    0.6.2
*/
TOP

Related Classes of quicktime.app.display.GroupDrawable

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.