Package quicktime.app.display

Source Code of quicktime.app.display.DirectGroup

/*     */ 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.spaces.Protocol;
/*     */ import quicktime.jdirect.QTNative;
/*     */ import quicktime.qd.QDColor;
/*     */ import quicktime.qd.QDDimension;
/*     */ import quicktime.qd.QDGraphics;
/*     */ import quicktime.qd.QDRect;
/*     */ import quicktime.qd.Region;
/*     */ import quicktime.std.image.Matrix;
/*     */ import quicktime.util.QTHandle;
/*     */ import quicktime.util.QTUtils;
/*     */
/*     */ /** @deprecated */
/*     */ public class DirectGroup extends GroupDrawable
/*     */ {
/*  71 */   private static Protocol p = makeP();
/*     */   private boolean doMemCleanup;
/* 438 */   private boolean redoCachedMembersClip = false;
/*     */
/*     */   private static Protocol makeP()
/*     */   {
/*     */     try
/*     */     {
/*  74 */       return new Protocol(Class.forName("quicktime.app.display.QTDrawable"));
/*     */     } catch (Exception localException) {
/*  76 */       throw new QTRuntimeException(localException.getMessage());
/*     */     }
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public DirectGroup(Dimension paramDimension, QDColor paramQDColor)
/*     */     throws QTException
/*     */   {
/*  88 */     this(new QDDimension(paramDimension.width, paramDimension.height), paramQDColor, 10, 1, p);
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public DirectGroup(QDDimension paramQDDimension, QDColor paramQDColor)
/*     */     throws QTException
/*     */   {
/*  98 */     this(paramQDDimension, paramQDColor, 10, 1, p);
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   protected DirectGroup(QDDimension paramQDDimension, QDColor paramQDColor, int paramInt1, int paramInt2, Protocol paramProtocol)
/*     */     throws QTException
/*     */   {
/* 111 */     super(paramQDDimension, paramQDColor, paramInt1, paramInt2, paramProtocol);
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public boolean isAppropriate(Object paramObject)
/*     */   {
/* 129 */     return (getProtocol().passProtocol(paramObject)) && (!(paramObject instanceof GroupDrawable));
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public boolean addMember(Object paramObject, int paramInt, float paramFloat1, float paramFloat2)
/*     */     throws QTException
/*     */   {
/* 144 */     if (!isAppropriate(paramObject)) return false;
/* 145 */     setAlignedMemberLocation((QTDrawable)paramObject, paramFloat1, paramFloat2);
/* 146 */     _addQTDrawable(new GroupMember(this, (QTDrawable)paramObject, paramInt));
/* 147 */     return true;
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public boolean addMember(Object paramObject, int paramInt)
/*     */     throws QTException
/*     */   {
/* 159 */     if (!isAppropriate(paramObject)) return false;
/* 160 */     QTDrawable localQTDrawable = (QTDrawable)paramObject;
/* 161 */     _addQTDrawable(new GroupMember(this, localQTDrawable, paramInt));
/* 162 */     return true;
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public boolean addMember(Object paramObject)
/*     */     throws QTException
/*     */   {
/* 174 */     int i = 1;
/* 175 */     if ((paramObject instanceof Layerable))
/* 176 */       i = ((Layerable)paramObject).getLayer();
/* 177 */     return addMember((QTDrawable)paramObject, i);
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public void setGWorld(QDGraphics paramQDGraphics)
/*     */     throws QTException
/*     */   {
/* 190 */     super.setGWorld(paramQDGraphics);
/* 191 */     Enumeration localEnumeration = this.vec.elements();
/* 192 */     while (localEnumeration.hasMoreElements()) {
/* 193 */       GroupMember localGroupMember = (GroupMember)localEnumeration.nextElement();
/* 194 */       localGroupMember.drawer.setGWorld(this.port);
/*     */     }
/* 196 */     if (this.visible)
/* 197 */       setClip(null);
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public void setDisplayBounds(QDRect paramQDRect)
/*     */     throws QTException
/*     */   {
/* 208 */     super.setDisplayBounds(paramQDRect);
/* 209 */     setClip(null);
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public synchronized void redrawMember(QTDrawable paramQTDrawable, Region paramRegion)
/*     */     throws QTException
/*     */   {
/* 225 */     if (paramQTDrawable != null) {
/* 226 */       GroupMember localGroupMember1 = null;
/*     */       try {
/* 228 */         localGroupMember1 = memberChanged(paramQTDrawable);
/*     */       }
/*     */       catch (QTException localQTException) {
/* 231 */         if ((localQTException.errorCode() == -500) || (localQTException.errorCode() == -108)) {
/* 232 */           QTUtils.reclaimMemory();
/*     */         }
/*     */
/* 238 */         throw localQTException;
/*     */       }
/* 240 */       if (localGroupMember1 == null) {
/* 241 */         redraw(null);
/* 242 */         return;
/*     */       }
/*     */
/* 247 */       synchronized (QTNative.globalsLock)
/*     */       {
/* 250 */         int i = 0;
/* 251 */         int j = 0;
/* 252 */         for (int k = 0; k < this.vec.size(); k++) {
/* 253 */           GroupMember localGroupMember2 = (GroupMember)this.vec.elementAt(k);
/* 254 */           if (i != 0) {
/* 255 */             Region localRegion2 = localGroupMember2.drawer.getClip().sect(paramRegion);
/* 256 */             if (!localRegion2.empty()) {
/* 257 */               localGroupMember2.drawer.redraw(localRegion2);
/*     */             }
/*     */           }
/* 260 */           if ((i == 0) && (localGroupMember2.drawer.equals(paramQTDrawable))) {
/* 261 */             localGroupMember2.drawer.redraw(null);
/* 262 */             i = 1;
/* 263 */             if (paramRegion != null)
/* 264 */               paramRegion = paramRegion.union(localGroupMember1.clipRegion);
/*     */             else
/* 266 */               paramRegion = localGroupMember1.clipRegion;
/*     */           }
/*     */         }
/* 269 */         Region localRegion1 = paramRegion.sect(this.eraseRegion);
/* 270 */         if (!localRegion1.empty()) {
/* 271 */           this.port.setBackColor(this.bgColor);
/* 272 */           this.port.eraseRgn(localRegion1);
/*     */         }
/*     */       }
/*     */     } else {
/* 276 */       redraw(null);
/*     */     }
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public void setClip(Region paramRegion)
/*     */     throws QTException
/*     */   {
/* 286 */     this.clip = (paramRegion == null ? new Region(getDisplayBounds()) : paramRegion.sect(getDisplayBounds()));
/* 287 */     Region localRegion = this.clip;
/* 288 */     Object localObject = null;
/* 289 */     this.doMemCleanup = true;
/* 290 */     for (int i = 0; i < this.vec.size(); i++) {
/* 291 */       GroupMember localGroupMember = (GroupMember)this.vec.elementAt(i);
/* 292 */       if (localObject != null)
/* 293 */         localRegion = localRegion.diff(drawersRegion((GroupMember)localObject));
/* 294 */       localGroupMember.drawer.setClip(localRegion);
/*     */
/* 296 */       localObject = localGroupMember;
/*     */     }
/* 298 */     if (localObject != null)
/* 299 */       this.eraseRegion = localRegion.diff(drawersRegion((GroupMember)localObject));
/*     */     else {
/* 301 */       this.eraseRegion = localRegion;
/*     */     }
/*     */
/* 304 */     if (!this.doMemCleanup)
/* 305 */       QTUtils.reclaimMemory();
/*     */   }
/*     */
/*     */   private Region drawersRegion(GroupMember paramGroupMember) throws QTException {
/* 309 */     QTDrawable localQTDrawable = paramGroupMember.drawer;
/* 310 */     int i = localQTDrawable.getMatrix().getType();
/* 311 */     int j = 0;
/* 312 */     switch (i) {
/*     */     case 4:
/*     */     case 5:
/*     */     case 6:
/* 316 */       j = 1;
/* 317 */       break;
/*     */     case 2:
/*     */     case 3:
/* 320 */       Matrix localMatrix = localQTDrawable.getMatrix();
/* 321 */       if ((localMatrix.getSx() < 0.0F) || (localMatrix.getSy() < 0.0F))
/* 322 */         j = 1; break;
/*     */     }
/*     */
/* 334 */     if ((paramGroupMember.clipRegion == null) || (this.redoCachedMembersClip))
/* 335 */       paramGroupMember.clipRegion = (j != 0 ? createRotatedRegion(localQTDrawable) : new Region(localQTDrawable.getDisplayBounds()));
/* 336 */     return paramGroupMember.clipRegion;
/*     */   }
/*     */
/*     */   private Region createRotatedRegion(QTDrawable paramQTDrawable)
/*     */     throws QTException
/*     */   {
/* 345 */     if (this.doMemCleanup) {
/* 346 */       QTUtils.reclaimMemory();
/* 347 */       QTUtils.checkFreeMemory();
/* 348 */       this.doMemCleanup = false;
/*     */     }
/*     */
/* 351 */     Matrix localMatrix = paramQTDrawable.getMatrix().copy();
/* 352 */     QDRect localQDRect = new QDRect(paramQTDrawable.getOriginalSize());
/* 353 */     localMatrix.transformRect(localQDRect);
/*     */
/* 355 */     QDGraphics localQDGraphics = new QDGraphics(1, localQDRect);
/* 356 */     localQDGraphics.setBackColor(QDColor.white);
/* 357 */     localQDGraphics.eraseRect(localQDRect);
/* 358 */     paramQTDrawable.setGWorld(localQDGraphics);
/* 359 */     paramQTDrawable.redraw(null);
/* 360 */     paramQTDrawable.setGWorld(getGWorld());
/*     */     try
/*     */     {
/* 363 */       return new Region(localQDGraphics.getPixMap());
/*     */     } catch (QTException localQTException1) {
/* 365 */       if ((localQTException1.errorCode() == -108) || (localQTException1.errorCode() == -500))
/*     */       {
/* 368 */         QTUtils.reclaimMemory();
/*     */         try {
/* 370 */           return new Region(localQDGraphics.getPixMap());
/*     */         } catch (QTException localQTException2) {
/* 372 */           if (localQTException2.errorCode() == -500) {
/* 373 */             new QTHandle(512000, false);
/* 374 */             return new Region(localQDGraphics.getPixMap());
/*     */           }
/*     */         }
/*     */       }
/* 378 */       throw localQTException1;
/*     */     }
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public GroupMember memberChanged(QTDrawable paramQTDrawable)
/*     */     throws QTException
/*     */   {
/* 394 */     GroupMember localGroupMember = getGroupMember(paramQTDrawable);
/* 395 */     if (localGroupMember != null) {
/* 396 */       setClips(paramQTDrawable);
/*     */     }
/* 398 */     return localGroupMember;
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public boolean setMemberAlignment(QTDrawable paramQTDrawable, float paramFloat1, float paramFloat2)
/*     */     throws QTException
/*     */   {
/* 410 */     boolean bool = super.setMemberAlignment(paramQTDrawable, paramFloat1, paramFloat2);
/* 411 */     if (bool) {
/* 412 */       setClips(paramQTDrawable);
/* 413 */       redraw(null);
/*     */     }
/* 415 */     return bool;
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public boolean setMemberLayer(QTDrawable paramQTDrawable, int paramInt)
/*     */     throws QTException
/*     */   {
/* 428 */     boolean bool = super.setMemberLayer(paramQTDrawable, paramInt);
/* 429 */     if (bool) {
/* 430 */       this.redoCachedMembersClip = true;
/* 431 */       setClip(null);
/* 432 */       this.redoCachedMembersClip = false;
/* 433 */       redraw(null);
/*     */     }
/* 435 */     return bool;
/*     */   }
/*     */
/*     */   private boolean setClips(QTDrawable paramQTDrawable)
/*     */     throws QTException
/*     */   {
/* 442 */     boolean bool = false;
/* 443 */     Region localRegion = this.clip;
/* 444 */     Object localObject = null;
/* 445 */     for (int i = 0; i < this.vec.size(); i++) {
/* 446 */       GroupMember localGroupMember = (GroupMember)this.vec.elementAt(i);
/* 447 */       if (localObject != null)
/* 448 */         localRegion = localRegion.diff(localObject.clipRegion);
/* 449 */       localObject = localGroupMember;
/* 450 */       if (localObject.drawer.equals(paramQTDrawable)) {
/* 451 */         bool = true;
/*     */
/* 453 */         this.doMemCleanup = true;
/* 454 */         localObject.clipRegion = null;
/* 455 */         this.redoCachedMembersClip = true;
/* 456 */         for (i++; i < this.vec.size(); i++) {
/* 457 */           localGroupMember = (GroupMember)this.vec.elementAt(i);
/* 458 */           localRegion = localRegion.diff(drawersRegion(localObject));
/* 459 */           localGroupMember.drawer.setClip(localRegion);
/* 460 */           localObject = localGroupMember;
/*     */         }
/*     */       }
/*     */
/*     */     }
/*     */
/* 466 */     if (localObject != null) {
/* 467 */       this.eraseRegion = localRegion.diff(drawersRegion(localObject));
/*     */     }
/* 469 */     this.redoCachedMembersClip = false;
/*     */
/* 472 */     if (!this.doMemCleanup) {
/* 473 */       QTUtils.reclaimMemory();
/*     */     }
/* 475 */     return bool;
/*     */   }
/*     */
/*     */   static
/*     */   {
/*  66 */     if ((QTSession.isCurrentOS(4)) && (QTSession.getJavaVersion() >= 65540))
/*  67 */       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.DirectGroup
* JD-Core Version:    0.6.2
*/
TOP

Related Classes of quicktime.app.display.DirectGroup

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.