/* */ package quicktime.app.ui;
/* */
/* */ import quicktime.QTException;
/* */ import quicktime.QTRuntimeException;
/* */ import quicktime.QTSession;
/* */ import quicktime.app.QTAppException;
/* */ import quicktime.app.event.MouseTargetListener;
/* */ import quicktime.app.event.QTActionEvent;
/* */ import quicktime.app.event.QTActionListener;
/* */ import quicktime.app.event.QTEventCaster;
/* */ import quicktime.app.event.QTMouseEvent;
/* */ import quicktime.app.image.ImageSpec;
/* */ import quicktime.std.image.GraphicsMode;
/* */ import quicktime.std.image.Matrix;
/* */
/* */ /** @deprecated */
/* */ public abstract class QTButton extends UIElement
/* */ {
/* 39 */ private static boolean apriori = QTSession.apriori();
/* */
/* */ /** @deprecated */
/* */ protected ImageSpec releasedImage;
/* */ protected ImageSpec rolloverImage;
/* */ protected ImageSpec pressedImage;
/* 100 */ protected QTActionListener actionListener = null;
/* */ private boolean pressedFlag;
/* */ private boolean outOfBounds;
/* */ private MouseTargetListener mouseTargetListener;
/* */
/* */ /** @deprecated */
/* */ protected QTButton(ImageSpec paramImageSpec1, ImageSpec paramImageSpec2, ImageSpec paramImageSpec3, ImageSpec paramImageSpec4) throws QTException {
/* 59 */ this(paramImageSpec1, paramImageSpec2, paramImageSpec3, paramImageSpec4, new Matrix(), 1, null);
/* */ }
/* */
/* */ /** @deprecated */
/* */ protected QTButton(ImageSpec paramImageSpec1, ImageSpec paramImageSpec2, ImageSpec paramImageSpec3, ImageSpec paramImageSpec4, Matrix paramMatrix, int paramInt, GraphicsMode paramGraphicsMode)
/* */ throws QTException
/* */ {
/* 75 */ super(paramImageSpec1, paramImageSpec3, paramMatrix, paramInt, paramGraphicsMode);
/* */
/* 77 */ if (paramImageSpec2 == null) {
/* 78 */ throw new QTAppException("QTButton:released and pressed images must be specified");
/* */ }
/* 80 */ this.releasedImage = paramImageSpec1;
/* 81 */ this.pressedImage = paramImageSpec2;
/* 82 */ this.rolloverImage = paramImageSpec4;
/* */ }
/* */
/* */ /** @deprecated */
/* */ public void released()
/* */ throws QTException
/* */ {
/* 113 */ this.pressedFlag = false;
/* 114 */ setImageOnRelease();
/* */ }
/* */
/* */ private void setImageOnRelease() throws QTException {
/* 118 */ if (this.outOfBounds) {
/* 119 */ setCurrentImage(this.releasedImage);
/* */ }
/* 121 */ else if (this.rolloverImage != null)
/* 122 */ setCurrentImage(this.rolloverImage);
/* */ else
/* 124 */ setCurrentImage(this.releasedImage);
/* */ }
/* */
/* */ /** @deprecated */
/* */ public void setReleasedImage(ImageSpec paramImageSpec)
/* */ throws QTException
/* */ {
/* 134 */ if (paramImageSpec == null) {
/* 135 */ throw new QTAppException("QTButton:released image cannot be null");
/* */ }
/* 137 */ this.releasedImage = paramImageSpec;
/* 138 */ setImageOnRelease();
/* */ }
/* */
/* */ /** @deprecated */
/* */ public ImageSpec getReleasedImage()
/* */ {
/* 146 */ return this.releasedImage;
/* */ }
/* */
/* */ /** @deprecated */
/* */ public void setRolloverImage(ImageSpec paramImageSpec)
/* */ throws QTException
/* */ {
/* 155 */ this.rolloverImage = paramImageSpec;
/* 156 */ if ((!this.pressedFlag) && (!this.outOfBounds) && (this.rolloverImage != null))
/* 157 */ setCurrentImage(this.rolloverImage);
/* */ }
/* */
/* */ /** @deprecated */
/* */ public ImageSpec getRolloverImage()
/* */ {
/* 165 */ return this.rolloverImage;
/* */ }
/* */
/* */ /** @deprecated */
/* */ public void setPressedImage(ImageSpec paramImageSpec)
/* */ throws QTException
/* */ {
/* 174 */ if (paramImageSpec == null) {
/* 175 */ throw new QTAppException("QTButton:pressed image cannot be null");
/* */ }
/* 177 */ this.pressedImage = paramImageSpec;
/* 178 */ if ((this.pressedFlag) && (!this.outOfBounds))
/* 179 */ setCurrentImage(this.pressedImage);
/* */ }
/* */
/* */ /** @deprecated */
/* */ public ImageSpec getPressedImage()
/* */ {
/* 187 */ return this.pressedImage;
/* */ }
/* */
/* */ /** @deprecated */
/* */ public void setDeactiveImage(ImageSpec paramImageSpec)
/* */ throws QTException
/* */ {
/* 196 */ this.deactiveImage = paramImageSpec;
/* 197 */ if ((this.deactiveImage != null) && (!isActive()))
/* 198 */ setCurrentImage(this.deactiveImage);
/* */ }
/* */
/* */ /** @deprecated */
/* */ public ImageSpec getDeactiveImage()
/* */ {
/* 206 */ return this.deactiveImage;
/* */ }
/* */
/* */ /** @deprecated */
/* */ public void pressed()
/* */ throws QTException
/* */ {
/* 216 */ this.pressedFlag = true;
/* 217 */ setCurrentImage(this.pressedImage);
/* */ }
/* */
/* */ /** @deprecated */
/* */ public boolean isPressed()
/* */ {
/* 225 */ return this.pressedFlag;
/* */ }
/* */
/* */ /** @deprecated */
/* */ public boolean isMouseInButton()
/* */ {
/* 233 */ return !this.outOfBounds;
/* */ }
/* */
/* */ /** @deprecated */
/* */ public void addActionListener(QTActionListener paramQTActionListener)
/* */ {
/* 242 */ this.actionListener = QTEventCaster.add(this.actionListener, paramQTActionListener);
/* */ }
/* */
/* */ /** @deprecated */
/* */ public void removeActionListener(QTActionListener paramQTActionListener)
/* */ {
/* 251 */ this.actionListener = QTEventCaster.remove(this.actionListener, paramQTActionListener);
/* */ }
/* */
/* */ /** @deprecated */
/* */ public void addMouseTargetListener(MouseTargetListener paramMouseTargetListener)
/* */ {
/* 261 */ this.mouseTargetListener = QTEventCaster.add(this.mouseTargetListener, paramMouseTargetListener);
/* */ }
/* */
/* */ /** @deprecated */
/* */ public void removeMouseTargetListener(MouseTargetListener paramMouseTargetListener)
/* */ {
/* 270 */ this.mouseTargetListener = QTEventCaster.remove(this.mouseTargetListener, paramMouseTargetListener);
/* */ }
/* */
/* */ /** @deprecated */
/* */ protected void entered(QTMouseEvent paramQTMouseEvent)
/* */ throws QTException
/* */ {
/* 278 */ this.outOfBounds = false;
/* 279 */ if (this.pressedFlag)
/* 280 */ setCurrentImage(this.pressedImage);
/* 281 */ else if (this.rolloverImage != null)
/* 282 */ setCurrentImage(this.rolloverImage);
/* 283 */ if (this.mouseTargetListener != null)
/* 284 */ this.mouseTargetListener.mouseTargetEntered(paramQTMouseEvent);
/* */ }
/* */
/* */ /** @deprecated */
/* */ protected void exited(QTMouseEvent paramQTMouseEvent)
/* */ throws QTException
/* */ {
/* 292 */ this.outOfBounds = true;
/* 293 */ setCurrentImage(this.releasedImage);
/* 294 */ if (this.mouseTargetListener != null)
/* 295 */ this.mouseTargetListener.mouseTargetExited(paramQTMouseEvent);
/* */ }
/* */
/* */ /** @deprecated */
/* */ protected void fireAction()
/* */ {
/* 304 */ if (this.actionListener != null)
/* 305 */ this.actionListener.actionPerformed(new QTActionEvent(this, this.label));
/* */ }
/* */
/* */ static
/* */ {
/* 42 */ if ((QTSession.isCurrentOS(4)) && (QTSession.getJavaVersion() >= 65540))
/* 43 */ 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.ui.QTButton
* JD-Core Version: 0.6.2
*/