Package quicktime.app.display

Source Code of quicktime.app.display.JQTCanvas

/*     */ package quicktime.app.display;
/*     */
/*     */ import java.awt.AWTEventMulticaster;
/*     */ import java.awt.Container;
/*     */ import java.awt.Dimension;
/*     */ import java.awt.Graphics;
/*     */ import java.awt.Image;
/*     */ import java.awt.Rectangle;
/*     */ import java.awt.Toolkit;
/*     */ import java.awt.event.ComponentListener;
/*     */ import java.awt.image.BufferedImage;
/*     */ import java.awt.image.DirectColorModel;
/*     */ import java.awt.image.ImageProducer;
/*     */ import java.awt.image.MacDirectColorModel;
/*     */ import java.awt.image.MemoryImageSource;
/*     */ import java.io.PrintStream;
/*     */ import javax.swing.JComponent;
/*     */ import quicktime.QTException;
/*     */ import quicktime.QTObject;
/*     */ import quicktime.QTRuntimeException;
/*     */ import quicktime.QTSession;
/*     */ import quicktime.app.anim.Compositor;
/*     */ import quicktime.app.anim.SWCompositor;
/*     */ import quicktime.app.image.QTImageProducer;
/*     */ import quicktime.qd.QDGraphics;
/*     */ import quicktime.qd.QDRect;
/*     */ import quicktime.std.image.ImageDescription;
/*     */ import quicktime.util.RawEncodedImage;
/*     */
/*     */ /** @deprecated */
/*     */ public class JQTCanvas extends JComponent
/*     */   implements DrawingListener
/*     */ {
/*     */
/*     */   /** @deprecated */
/*     */   public static final int kIntegralResize = 1;
/*     */
/*     */   /** @deprecated */
/*     */   public static final int kInitialSize = 2;
/*     */
/*     */   /** @deprecated */
/*     */   public static final int kFreeResize = 3;
/*     */
/*     */   /** @deprecated */
/*     */   public static final int kAspectResize = 4;
/*     */
/*     */   /** @deprecated */
/*     */   public static final int kPerformanceResize = 5;
/*     */
/*     */   /** @deprecated */
/*     */   public static final int kHorizontalResize = 6;
/*     */
/*     */   /** @deprecated */
/*     */   public static final int kVerticalResize = 7;
/*     */
/*     */   /** @deprecated */
/*     */   public static final int kInitialSizeNoResize = 8;
/*  94 */   public static boolean flashScaling = false;
/*  95 */   public static boolean useMacOSXAcceleration = true;
/*     */   transient QTDrawable client;
/* 130 */   int initialWidth = 0;
/* 131 */   int initialHeight = 0;
/*     */   int currentWidth;
/*     */   int currentHeight;
/*     */   private int currentX;
/*     */   private int currentY;
/*     */   private int resizeFlag;
/* 138 */   private transient boolean inited = false;
/*     */
/* 140 */   private boolean debug = false;
/*     */
/* 142 */   private boolean paintlock = false;
/*     */
/* 144 */   DirectColorModel colorModel = new DirectColorModel(32, 16711680, 65280, 255, 0);
/*     */   public QTImageProducer ip;
/*     */   Image image;
/* 148 */   QDGraphics gw = null;
/*     */   QDRect gwBounds;
/*     */   int[] pixels;
/*     */   private ComponentListener clientListener;
/*     */
/*     */   /** @deprecated */
/*     */   public JQTCanvas()
/*     */   {
/* 104 */     this(3, 0.0F, 0.0F);
/*     */   }
/*     */
/*     */   public JQTCanvas(int paramInt, float paramFloat1, float paramFloat2)
/*     */   {
/* 118 */     this.resizeFlag = paramInt;
/* 119 */     setAlignmentX(paramFloat1);
/* 120 */     setAlignmentY(paramFloat2);
/* 121 */     this.initialWidth = 1;
/* 122 */     this.initialHeight = 1;
/* 123 */     setMinimumSize(new Dimension(1, 1));
/* 124 */     setMaximumSize(new Dimension(2147483647, 2147483647));
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public void paint(Graphics paramGraphics)
/*     */   {
/* 159 */     if ((!this.inited) && (this.client != null)) {
/* 160 */       this.client.addedTo(this);
/* 161 */       this.inited = true;
/* 162 */       super.paint(paramGraphics);
/* 163 */       return;
/*     */     }
/*     */
/* 166 */     if (this.image != null) {
/* 167 */       Dimension localDimension = getSize();
/* 168 */       paramGraphics.drawImage(this.image, 0, 0, localDimension.width, localDimension.height, this);
/*     */     }
/*     */   }
/*     */
/* 172 */   public void setFlashScaling(boolean paramBoolean) { flashScaling = paramBoolean; }
/*     */   public boolean isFlashScaling() {
/* 174 */     return flashScaling;
/*     */   }
/*     */
/*     */   Image imageFromEncodedImage(RawEncodedImage paramRawEncodedImage, QDRect paramQDRect)
/*     */   {
/* 179 */     paramRawEncodedImage.copyToArray(0, this.pixels, 0, this.pixels.length);
/* 180 */     MemoryImageSource localMemoryImageSource = new MemoryImageSource(paramQDRect.getWidth(), paramQDRect.getHeight(), this.colorModel, this.pixels, 0, paramRawEncodedImage.getRowBytes() / 4);
/*     */
/* 182 */     return getToolkit().createImage(localMemoryImageSource);
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public void setClient(QTDrawable paramQTDrawable, boolean paramBoolean)
/*     */     throws QTException
/*     */   {
/* 207 */     doSetClient(paramQTDrawable, paramQTDrawable != null ? paramQTDrawable.getDisplayBounds() : null, getMinimumSize(), getMaximumSize(), paramBoolean);
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public synchronized void setClient(QTDrawable paramQTDrawable, QDRect paramQDRect)
/*     */     throws QTException
/*     */   {
/* 225 */     doSetClient(paramQTDrawable, paramQDRect, getMinimumSize(), getMaximumSize(), true);
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public final void removeClient()
/*     */   {
/* 233 */     if ((this.client instanceof DrawingNotifier)) {
/* 234 */       ((DrawingNotifier)this.client).removeDrawingListener(this);
/*     */     }
/* 236 */     this.client.removedFrom(this);
/* 237 */     this.client = null;
/* 238 */     if (QTSession.isCurrentOS(4))
/* 239 */       this.gw = null;
/* 240 */     this.image = null;
/*     */
/* 242 */     repaint();
/*     */   }
/*     */
/*     */   private void doSetClient(QTDrawable paramQTDrawable, QDRect paramQDRect, Dimension paramDimension1, Dimension paramDimension2, boolean paramBoolean) throws QTException
/*     */   {
/* 247 */     if (paramQTDrawable == this.client) return;
/*     */
/* 249 */     if (this.client != null) {
/* 250 */       removeClient();
/*     */     }
/* 252 */     if (paramQTDrawable != null) {
/* 253 */       this.client = paramQTDrawable;
/*     */
/* 255 */       if (paramBoolean) {
/* 256 */         setMinimumSize(paramDimension1);
/* 257 */         setMaximumSize(paramDimension2);
/* 258 */         setPreferredSize(new Dimension(paramQDRect.getWidth(), paramQDRect.getHeight()));
/* 259 */         this.initialWidth = paramQDRect.getWidth();
/* 260 */         this.initialHeight = paramQDRect.getHeight();
/* 261 */         this.currentX = paramQDRect.getX();
/* 262 */         this.currentY = paramQDRect.getY();
/* 263 */         this.currentWidth = this.initialWidth;
/* 264 */         this.currentHeight = this.initialHeight;
/*     */
/* 266 */         doParentLayout();
/*     */       }
/*     */
/* 269 */       if (((paramQTDrawable instanceof SWCompositor)) || ((paramQTDrawable instanceof Compositor))) {
/* 270 */         SWCompositor localSWCompositor = (SWCompositor)paramQTDrawable;
/*     */
/* 272 */         this.gwBounds = localSWCompositor.getDisplayBounds();
/* 273 */         this.gw = localSWCompositor.getGWorld();
/* 274 */         if (this.gw == null) {
/* 275 */           this.gw = new QDGraphics(this.gwBounds);
/* 276 */           localSWCompositor.setGWorld(this.gw);
/*     */         }
/*     */
/* 279 */         if ((QTSession.isCurrentOS(4)) && (useMacOSXAcceleration)) {
/* 280 */           boolean bool = false;
/* 281 */           this.image = MacDirectColorModel.GetWrappedGWorldImage(QTObject.ID(this.gw), 32, this.gwBounds.getWidth(), this.gwBounds.getHeight(), bool);
/*     */         } else {
/* 283 */           this.pixels = new int[((RawEncodedImage)localSWCompositor.getImage()).getRowBytes() / 4 * paramQDRect.getHeight()];
/* 284 */           this.image = imageFromEncodedImage((RawEncodedImage)localSWCompositor.getImage(), localSWCompositor.getDescription().getBounds());
/*     */         }
/* 286 */         prepareImage(this.image, this);
/* 287 */         localSWCompositor.addDrawingListener(this);
/*     */       }
/*     */       else {
/* 290 */         paramQTDrawable.redraw(null);
/* 291 */         this.ip = new QTImageProducer(this.client, new Dimension(paramQDRect.getWidth(), paramQDRect.getHeight()));
/* 292 */         this.image = createImage(this.ip);
/* 293 */         prepareImage(this.image, this);
/*     */       }
/* 295 */       if ((paramQTDrawable instanceof DrawingNotifier))
/* 296 */         ((DrawingNotifier)paramQTDrawable).addDrawingListener(this);
/*     */     }
/* 298 */     repaint();
/*     */   }
/*     */
/*     */   public Image createImage(ImageProducer paramImageProducer)
/*     */   {
/* 303 */     if ((QTSession.isCurrentOS(4)) && (useMacOSXAcceleration))
/*     */     {
/* 305 */       boolean bool = false;
/*     */
/* 307 */       QTImageProducer localQTImageProducer = (QTImageProducer)paramImageProducer;
/*     */
/* 309 */       Dimension localDimension = localQTImageProducer.getSize();
/* 310 */       QDGraphics localQDGraphics = localQTImageProducer.getGWorld();
/* 311 */       this.gw = localQDGraphics;
/*     */
/* 313 */       BufferedImage localBufferedImage = MacDirectColorModel.GetWrappedGWorldImage(QTObject.ID(localQDGraphics), 32, localDimension.width, localDimension.height, bool);
/*     */
/* 315 */       return localBufferedImage;
/*     */     }
/*     */
/* 319 */     return super.createImage(paramImageProducer);
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public void setBounds(int paramInt1, int paramInt2, int paramInt3, int paramInt4)
/*     */   {
/* 334 */     if (this.debug) System.out.println("setBounds( " + paramInt1 + ", " + paramInt2 + ", " + paramInt3 + ", " + paramInt4 + ")");
/*     */
/* 336 */     Dimension localDimension = setCurrentWidthHeight(paramInt3, paramInt4);
/* 337 */     if (flashScaling) {
/* 338 */       setPreferredSize(localDimension);
/* 339 */       this.initialWidth = paramInt3;
/* 340 */       this.initialHeight = paramInt4;
/*     */       try
/*     */       {
/* 343 */         if (((this.client instanceof SWCompositor)) || ((this.client instanceof Compositor))) {
/* 344 */           SWCompositor localSWCompositor = (SWCompositor)this.client;
/*     */
/* 346 */           this.gwBounds = new QDRect(getX(), getY(), paramInt3, paramInt4);
/* 347 */           this.gw = new QDGraphics(this.gwBounds);
/* 348 */           localSWCompositor.setGWorld(this.gw);
/*     */
/* 350 */           if ((QTSession.isCurrentOS(4)) && (useMacOSXAcceleration)) {
/* 351 */             boolean bool = false;
/* 352 */             this.image = MacDirectColorModel.GetWrappedGWorldImage(QTObject.ID(this.gw), 32, this.gwBounds.getWidth(), this.gwBounds.getHeight(), bool);
/*     */           } else {
/* 354 */             this.pixels = new int[((RawEncodedImage)localSWCompositor.getImage()).getRowBytes() / 4 * this.gwBounds.getHeight()];
/* 355 */             this.image = imageFromEncodedImage((RawEncodedImage)localSWCompositor.getImage(), this.gwBounds);
/*     */           }
/*     */
/* 358 */           prepareImage(this.image, this);
/*     */         } else {
/* 360 */           this.client.redraw(null);
/* 361 */           this.ip = new QTImageProducer(this.client, localDimension);
/* 362 */           this.image = createImage(this.ip);
/* 363 */           prepareImage(this.image, this);
/*     */         }
/*     */       } catch (QTException localQTException) {
/* 366 */         localQTException.printStackTrace();
/*     */       }
/* 368 */       repaint();
/*     */     }
/*     */
/* 371 */     int i = paramInt3 - this.currentWidth;
/* 372 */     if (i < 0) i = 0;
/*     */
/* 374 */     int j = paramInt4 - this.currentHeight;
/* 375 */     if (j < 0) j = 0;
/* 376 */     this.currentX = (paramInt1 + (int)(getAlignmentX() * i));
/* 377 */     this.currentY = (paramInt2 + (int)(getAlignmentY() * j));
/*     */
/* 379 */     if (this.debug) {
/* 380 */       System.out.println("setBounds(" + paramInt1 + ", " + paramInt2 + ", " + paramInt3 + ", " + paramInt4 + ")");
/* 381 */       System.out.println("Alignment x: " + getAlignmentX() + ", y: " + getAlignmentY());
/* 382 */       System.out.println("widthDiff: " + i);
/* 383 */       System.out.println("heightDiff: " + j);
/* 384 */       System.out.println("currentX:" + this.currentX);
/* 385 */       System.out.println("currentY:" + this.currentY);
/*     */     }
/* 387 */     super.reshape(this.currentX, this.currentY, localDimension.width, localDimension.height);
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public void setBounds(Rectangle paramRectangle)
/*     */   {
/* 397 */     if (this.debug) System.out.println("setBounds( " + paramRectangle + ")");
/* 398 */     setBounds(paramRectangle.x, paramRectangle.y, paramRectangle.width, paramRectangle.height);
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public void setSize(Dimension paramDimension)
/*     */   {
/* 408 */     if (this.debug) System.out.println("setSize( " + paramDimension + ")");
/*     */
/* 410 */     setSize(paramDimension.width, paramDimension.height);
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public void setSize(int paramInt1, int paramInt2)
/*     */   {
/* 420 */     if (this.debug) System.out.println("setSize( " + paramInt1 + ", " + paramInt2 + ")");
/* 421 */     setBounds(this.currentX, this.currentY, paramInt1, paramInt2);
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public final void reshape(int paramInt1, int paramInt2, int paramInt3, int paramInt4)
/*     */   {
/* 430 */     if (this.debug) System.out.println("reshape( " + paramInt1 + ", " + paramInt2 + ", " + paramInt3 + ", " + paramInt4 + ")");
/* 431 */     setBounds(paramInt1, paramInt2, paramInt3, paramInt4);
/*     */   }
/*     */
/*     */   private final void doParentLayout()
/*     */   {
/* 436 */     if (this.debug)
/* 437 */       System.out.println("doParentLayout()");
/* 438 */     Container localContainer = getParent();
/* 439 */     if (localContainer != null) {
/* 440 */       invalidate();
/* 441 */       localContainer.validate();
/* 442 */       return;
/*     */     }
/* 444 */     super.reshape(this.currentX, this.currentY, getWidth(), getHeight());
/*     */   }
/*     */
/*     */   private Dimension setCurrentWidthHeight(int paramInt1, int paramInt2) {
/* 448 */     if (this.debug) System.out.println("setCurrentWidthHeight( " + paramInt1 + ", " + paramInt2 + "), flag " + getResizeFlag());
/* 449 */     Dimension localDimension1 = getMinimumSize(); Dimension localDimension2 = getMaximumSize();
/* 450 */     int i = localDimension1.width;
/* 451 */     int j = localDimension1.height;
/* 452 */     int k = localDimension2.width;
/* 453 */     int m = localDimension2.height;
/*     */     Dimension localDimension3;
/*     */     int n;
/*     */     int i1;
/*     */     int i2;
/* 455 */     switch (getResizeFlag())
/*     */     {
/*     */     case 2:
/* 458 */       this.currentWidth = this.initialWidth;
/* 459 */       this.currentHeight = this.initialHeight;
/*     */
/* 463 */       if (this.currentWidth < i) this.currentWidth = i;
/* 464 */       else if (this.currentWidth > k) this.currentWidth = k;
/* 465 */       if (this.currentHeight < j) this.currentHeight = j;
/* 466 */       else if (this.currentHeight > m) this.currentHeight = m;
/*     */
/* 470 */       if ((this.currentWidth > paramInt1) || (this.currentHeight > paramInt2)) {
/* 471 */         localDimension3 = getAspectSize(paramInt1, paramInt2);
/* 472 */         this.currentWidth = localDimension3.width;
/* 473 */         this.currentHeight = localDimension3.height;
/* 474 */       }break;
/*     */     case 4:
/* 481 */       localDimension3 = getAspectSize(paramInt1, paramInt2);
/* 482 */       this.currentWidth = localDimension3.width;
/* 483 */       this.currentHeight = localDimension3.height;
/* 484 */       break;
/*     */     case 6:
/* 487 */       this.currentWidth = paramInt1;
/* 488 */       this.currentHeight = this.initialHeight;
/*     */
/* 492 */       if (this.currentWidth < i) this.currentWidth = i;
/* 493 */       else if (this.currentWidth > k) this.currentWidth = k;
/* 494 */       if (this.currentHeight < j) this.currentHeight = j;
/* 495 */       else if (this.currentHeight > m) this.currentHeight = m;
/*     */
/* 499 */       if (this.currentHeight > paramInt2) {
/* 500 */         localDimension3 = getAspectSize(paramInt1, paramInt2);
/* 501 */         this.currentHeight = localDimension3.height;
/* 502 */       }break;
/*     */     case 7:
/* 506 */       this.currentWidth = this.initialWidth;
/* 507 */       this.currentHeight = paramInt2;
/*     */
/* 511 */       if (this.currentWidth < i) this.currentWidth = i;
/* 512 */       else if (this.currentWidth > k) this.currentWidth = k;
/* 513 */       if (this.currentHeight < j) this.currentHeight = j;
/* 514 */       else if (this.currentHeight > m) this.currentHeight = m;
/*     */
/* 518 */       if (this.currentWidth > paramInt1) {
/* 519 */         localDimension3 = getAspectSize(paramInt1, paramInt2);
/* 520 */         this.currentWidth = localDimension3.width;
/* 521 */       }break;
/*     */     case 5:
/* 528 */       if (paramInt1 < i) paramInt1 = i;
/* 529 */       else if (paramInt1 > k) paramInt1 = k;
/* 530 */       if (paramInt2 < j) paramInt2 = j;
/* 531 */       else if (paramInt2 > m) paramInt2 = m;
/*     */
/* 533 */       n = 0;
/*     */
/* 537 */       for (int i3 = 2; n == 0; i3 *= 2)
/*     */       {
/*     */         int i4;
/* 538 */         if ((paramInt1 < this.initialWidth) || (paramInt2 < this.initialHeight)) {
/* 539 */           i1 = this.initialWidth / i3;
/* 540 */           i2 = this.initialHeight / i3;
/* 541 */           if ((i1 <= paramInt1) && (i2 <= paramInt2)) {
/* 542 */             n = 1;
/*     */
/* 544 */             i4 = 0;
/* 545 */             this.currentWidth = i1; for (this.currentHeight = i2;
/* 546 */               i4 != 0;
/* 547 */               this.currentHeight *= 2) {
/* 548 */               if ((this.currentWidth >= i) && (this.currentHeight >= j))
/* 549 */                 i4 = 1;
/* 547 */               this.currentWidth *= 2;
/*     */             }
/*     */
/*     */           }
/*     */
/*     */         }
/*     */         else
/*     */         {
/* 555 */           i1 = this.initialWidth * i3;
/* 556 */           i2 = this.initialHeight * i3;
/* 557 */           if ((i1 >= paramInt1) || (i2 >= paramInt2)) {
/* 558 */             n = 1;
/*     */
/* 560 */             if ((i1 > paramInt1) || (i2 > paramInt2)) {
/* 561 */               i1 /= 2;
/* 562 */               i2 /= 2;
/*     */             }
/*     */
/* 565 */             i4 = 0;
/* 566 */             this.currentWidth = i1; for (this.currentHeight = i2;
/* 567 */               i4 != 0;
/* 568 */               this.currentHeight /= 2) {
/* 569 */               if ((this.currentWidth <= k) && (this.currentHeight <= m))
/* 570 */                 i4 = 1;
/* 568 */               this.currentWidth /= 2;
/*     */             }
/*     */           }
/*     */
/*     */         }
/*     */
/*     */       }
/*     */
/* 576 */       break;
/*     */     case 1:
/* 581 */       if (paramInt1 < i) paramInt1 = i;
/* 582 */       else if (paramInt1 > k) paramInt1 = k;
/* 583 */       if (paramInt2 < j) paramInt2 = j;
/* 584 */       else if (paramInt2 > m) paramInt2 = m;
/*     */
/* 586 */       n = this.initialWidth == 0 ? 0 : paramInt1 / this.initialWidth;
/* 587 */       i1 = this.initialHeight == 0 ? 0 : paramInt2 / this.initialHeight;
/*     */
/* 589 */       i2 = Math.min(n, i1);
/* 590 */       if (i2 < 1) {
/* 591 */         float f1 = this.initialWidth == 0 ? 0.0F : paramInt1 / this.initialWidth;
/* 592 */         float f2 = this.initialHeight == 0 ? 0.0F : paramInt2 / this.initialHeight;
/*     */
/* 594 */         i2 = 0;
/* 595 */         if (f1 <= f2)
/* 596 */           i2 = this.initialWidth / paramInt1 + 1;
/*     */         else
/* 598 */           i2 = this.initialHeight / paramInt2 + 1;
/* 599 */         this.currentWidth = ((int)(this.initialWidth * 1.0F / i2));
/* 600 */         this.currentHeight = ((int)(this.initialHeight * 1.0F / i2));
/*     */       } else {
/* 602 */         this.currentWidth = (this.initialWidth * i2);
/* 603 */         this.currentHeight = (this.initialHeight * i2);
/*     */       }
/*     */
/* 606 */       break;
/*     */     case 8:
/* 610 */       this.currentWidth = this.initialWidth;
/* 611 */       this.currentHeight = this.initialHeight;
/*     */
/* 615 */       if (this.currentWidth < i) this.currentWidth = i;
/* 616 */       else if (this.currentWidth > k) this.currentWidth = k;
/* 617 */       if (this.currentHeight < j) this.currentHeight = j;
/* 618 */       else if (this.currentHeight > m) this.currentHeight = m; break;
/*     */     case 3:
/*     */     default:
/* 625 */       if (paramInt1 < i) paramInt1 = i;
/* 626 */       else if (paramInt1 > k) paramInt1 = k;
/* 627 */       if (paramInt2 < j) paramInt2 = j;
/* 628 */       else if (paramInt2 > m) paramInt2 = m;
/*     */
/* 630 */       this.currentWidth = paramInt1;
/* 631 */       this.currentHeight = paramInt2;
/*     */     }
/*     */
/* 634 */     return new Dimension(this.currentWidth, this.currentHeight);
/*     */   }
/*     */
/*     */   private Dimension getAspectSize(int paramInt1, int paramInt2)
/*     */   {
/* 640 */     Dimension localDimension1 = getMinimumSize(); Dimension localDimension2 = getMaximumSize();
/* 641 */     int i = localDimension1.width;
/* 642 */     int j = localDimension1.height;
/* 643 */     int k = localDimension2.width;
/* 644 */     int m = localDimension2.height;
/*     */
/* 647 */     if (paramInt1 < i) paramInt1 = i;
/* 648 */     else if (paramInt1 > k) paramInt1 = k;
/* 649 */     if (paramInt2 < j) paramInt2 = j;
/* 650 */     else if (paramInt2 > m) paramInt2 = m;
/*     */
/* 653 */     float f1 = paramInt1 / (this.initialWidth < 1 ? 1 : this.initialWidth);
/* 654 */     float f2 = paramInt2 / (this.initialHeight < 1 ? 1 : this.initialHeight);
/*     */     int n;
/*     */     int i1;
/* 659 */     if (f1 < f2) {
/* 660 */       n = (int)(this.initialWidth * f1);
/* 661 */       i1 = (int)(this.initialHeight * f1);
/*     */     }
/*     */     else {
/* 664 */       n = (int)(this.initialWidth * f2);
/* 665 */       i1 = (int)(this.initialHeight * f2);
/*     */     }
/*     */
/* 668 */     return new Dimension(n, i1);
/*     */   }
/*     */
/*     */   public void setAlignment(float paramFloat1, float paramFloat2) {
/* 672 */     setAlignmentX(paramFloat1);
/* 673 */     setAlignmentY(paramFloat2);
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public void setResizeFlag(int paramInt)
/*     */   {
/* 693 */     this.resizeFlag = paramInt;
/* 694 */     Rectangle localRectangle = getBounds();
/* 695 */     doParentLayout();
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public int getResizeFlag()
/*     */   {
/* 703 */     return this.resizeFlag;
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public void drawingComplete(QTDrawable paramQTDrawable)
/*     */   {
/* 711 */     if (((paramQTDrawable instanceof SWCompositor)) || ((paramQTDrawable instanceof Compositor))) {
/*     */       try {
/* 713 */         if ((QTSession.isCurrentOS(4)) && (useMacOSXAcceleration)) {
/* 714 */           boolean bool = false;
/* 715 */           this.image = MacDirectColorModel.GetWrappedGWorldImage(QTObject.ID(this.gw), 32, this.gwBounds.getWidth(), this.gwBounds.getHeight(), bool);
/*     */         } else {
/* 717 */           this.image = imageFromEncodedImage((RawEncodedImage)((SWCompositor)paramQTDrawable).getImage(), ((SWCompositor)paramQTDrawable).getDescription().getBounds());
/*     */         }
/*     */       } catch (QTException localQTException1) {
/* 720 */         localQTException1.printStackTrace();
/*     */       }
/* 722 */       repaint();
/*     */     }
/*     */     else {
/* 725 */       if ((QTSession.isCurrentOS(4)) && (useMacOSXAcceleration)) {
/* 726 */         repaint();
/* 727 */         return;
/*     */       }
/*     */       try
/*     */       {
/* 731 */         this.ip.updateConsumers(null);
/*     */       }
/*     */       catch (QTException localQTException2) {
/* 734 */         localQTException2.printStackTrace();
/*     */       }
/*     */     }
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public void addQTClientListener(ComponentListener paramComponentListener)
/*     */   {
/* 755 */     this.clientListener = AWTEventMulticaster.add(this.clientListener, paramComponentListener);
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public void removeQTClientListener(ComponentListener paramComponentListener)
/*     */   {
/* 766 */     this.clientListener = AWTEventMulticaster.remove(this.clientListener, paramComponentListener);
/*     */   }
/*     */
/*     */   static
/*     */   {
/*  39 */     if ((QTSession.isCurrentOS(4)) && (QTSession.getJavaVersion() >= 65540))
/*  40 */       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.JQTCanvas
* JD-Core Version:    0.6.2
*/
TOP

Related Classes of quicktime.app.display.JQTCanvas

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.