/* */ package quicktime.app.ui;
/* */
/* */ import quicktime.QTException;
/* */ import quicktime.QTRuntimeException;
/* */ import quicktime.QTSession;
/* */ import quicktime.app.QTAppException;
/* */ import quicktime.app.actions.Invalidator;
/* */ import quicktime.app.anim.SWCompositor;
/* */ import quicktime.app.anim.TwoDSprite;
/* */ import quicktime.app.image.DynamicImage;
/* */ import quicktime.app.image.ImageSpec;
/* */ import quicktime.qd.QDDimension;
/* */ import quicktime.qd.QDRect;
/* */ import quicktime.std.image.GraphicsMode;
/* */ import quicktime.std.image.Matrix;
/* */
/* */ /** @deprecated */
/* */ public class UIElement extends TwoDSprite
/* */ implements DynamicImage
/* */ {
/* */ protected ImageSpec deactiveImage;
/* */ protected ImageSpec currentImage;
/* */ SWCompositor c;
/* */ Invalidator currentInvalidator;
/* 67 */ private boolean active = true;
/* */
/* */ /** @deprecated */
/* */ protected UIElement(ImageSpec paramImageSpec1, ImageSpec paramImageSpec2, Matrix paramMatrix, int paramInt, GraphicsMode paramGraphicsMode)
/* */ throws QTException
/* */ {
/* 50 */ super(paramMatrix, paramInt, paramGraphicsMode);
/* 51 */ this.deactiveImage = paramImageSpec2;
/* 52 */ if (paramImageSpec1 == null)
/* 53 */ throw new QTAppException("QTButton:released and pressed images must be specified");
/* 54 */ setCurrentImage(paramImageSpec1);
/* */ }
/* */
/* */ /** @deprecated */
/* */ public void setLocation(int paramInt1, int paramInt2)
/* */ throws QTException
/* */ {
/* 77 */ Matrix localMatrix = getMatrix();
/* 78 */ if (localMatrix != null) {
/* 79 */ localMatrix.setTx(paramInt1);
/* 80 */ localMatrix.setTy(paramInt2);
/* 81 */ setMatrix(localMatrix);
/* */ }
/* */ }
/* */
/* */ /** @deprecated */
/* */ public void setSize(QDDimension paramQDDimension)
/* */ throws QTException
/* */ {
/* 91 */ Matrix localMatrix1 = getMatrix();
/* 92 */ float f1 = localMatrix1.getTx();
/* 93 */ float f2 = localMatrix1.getTy();
/* */
/* 95 */ if (localMatrix1 != null) {
/* 96 */ Matrix localMatrix2 = new Matrix();
/* 97 */ QDDimension localQDDimension = getOriginalSize();
/* 98 */ localMatrix2.map(new QDRect(localQDDimension), new QDRect(paramQDDimension));
/* 99 */ localMatrix2.translate(f1, f2);
/* 100 */ setMatrix(localMatrix2);
/* */ }
/* */ }
/* */
/* */ /** @deprecated */
/* */ public QDRect getBounds()
/* */ throws QTException
/* */ {
/* 109 */ Matrix localMatrix = getMatrix();
/* 110 */ QDDimension localQDDimension = getOriginalSize();
/* 111 */ return new QDRect((int)localMatrix.getTx(), (int)localMatrix.getTy(), (int)(localMatrix.getSx() * localQDDimension.getWidth()), (int)(localMatrix.getSy() * localQDDimension.getHeight()));
/* */ }
/* */
/* */ /** @deprecated */
/* */ protected void setCurrentImage(ImageSpec paramImageSpec)
/* */ throws QTException
/* */ {
/* 125 */ if ((this.c != null) && ((this.currentImage instanceof DynamicImage))) {
/* 126 */ ((DynamicImage)this.currentImage).removedFromCompositor(this.c);
/* */ }
/* 128 */ if (paramImageSpec == null) {
/* 129 */ setVisible(false);
/* */ } else {
/* 131 */ setImageData(paramImageSpec.getImage(), paramImageSpec.getDescription());
/* 132 */ if ((this.c != null) && ((paramImageSpec instanceof DynamicImage)))
/* 133 */ this.currentInvalidator = ((DynamicImage)paramImageSpec).addedToCompositor(this.c, this);
/* 134 */ if (this.currentImage == null)
/* 135 */ setVisible(true);
/* */ }
/* 137 */ this.currentImage = paramImageSpec;
/* */ }
/* */
/* */ /** @deprecated */
/* */ public void setActive(boolean paramBoolean)
/* */ throws QTException
/* */ {
/* 201 */ this.active = paramBoolean;
/* 202 */ if (paramBoolean)
/* 203 */ setCurrentImage(this.currentImage);
/* 204 */ else if (this.deactiveImage != null)
/* 205 */ setCurrentImage(this.deactiveImage);
/* */ }
/* */
/* */ /** @deprecated */
/* */ public boolean isActive()
/* */ {
/* 214 */ return this.active;
/* */ }
/* */
/* */ /** @deprecated */
/* */ public Invalidator addedToCompositor(SWCompositor paramSWCompositor, TwoDSprite paramTwoDSprite)
/* */ throws QTException
/* */ {
/* 222 */ this.c = paramSWCompositor;
/* 223 */ setCurrentImage(this.currentImage);
/* 224 */ return new UIInvalidator(this);
/* */ }
/* */
/* */ /** @deprecated */
/* */ public void removedFromCompositor(SWCompositor paramSWCompositor)
/* */ throws QTException
/* */ {
/* 232 */ this.c = null;
/* 233 */ this.currentInvalidator = null;
/* */ }
/* */
/* */ static
/* */ {
/* 34 */ if ((QTSession.isCurrentOS(4)) && (QTSession.getJavaVersion() >= 65540))
/* 35 */ throw new QTRuntimeException("Unsupported on Mac OS X and Java 1.4 and higher.");
/* */ }
/* */
/* */ class UIInvalidator extends Invalidator
/* */ {
/* */ UIInvalidator(TwoDSprite arg2)
/* */ {
/* 239 */ super();
/* */ }
/* */
/* */ public boolean tickle(float paramFloat, int paramInt) throws QTException {
/* 243 */ if (UIElement.this.currentInvalidator != null)
/* 244 */ return UIElement.this.currentInvalidator.tickle(paramFloat, paramInt);
/* 245 */ return true;
/* */ }
/* */ }
/* */ }
/* Location: Z:\System\Library\Java\Extensions\QTJava.zip
* Qualified Name: quicktime.app.ui.UIElement
* JD-Core Version: 0.6.2
*/