/* */ package quicktime.app.event;
/* */
/* */ import quicktime.QTException;
/* */ import quicktime.QTRuntimeException;
/* */ import quicktime.QTSession;
/* */ import quicktime.app.anim.SWCompositor;
/* */ import quicktime.app.display.GroupDrawable;
/* */ import quicktime.app.display.QTDisplaySpace;
/* */ import quicktime.app.spaces.ListenerController;
/* */ import quicktime.app.spaces.Space;
/* */ import quicktime.qd.QDRect;
/* */
/* */ /** @deprecated */
/* */ public class QTMouseController
/* */ implements ListenerController
/* */ {
/* */ private Object listenerSource;
/* 64 */ private boolean isWithinItsSpace = false;
/* 65 */ private boolean isInEnclosingSpace = false;
/* */ SWCompositor compSpace;
/* */ QTDisplaySpace displaySpace;
/* */ GroupDrawable drawSpace;
/* */ EventDispatcher handler;
/* */ MouseButtonListener mouseButtonListener;
/* */ MouseEnterExitListener mouseEnterExitListener;
/* */ MouseMoveListener mouseMoveListener;
/* */
/* */ /** @deprecated */
/* */ protected Space space;
/* */
/* */ /** @deprecated */
/* */ public Space getSpace()
/* */ {
/* 90 */ return this.space;
/* */ }
/* */
/* */ /** @deprecated */
/* */ public void addedToSpace(Space paramSpace)
/* */ {
/* 101 */ this.space = paramSpace;
/* 102 */ if ((this.space instanceof SWCompositor))
/* 103 */ this.compSpace = ((SWCompositor)this.space);
/* 104 */ else if ((this.space instanceof GroupDrawable))
/* 105 */ this.drawSpace = ((GroupDrawable)this.space);
/* 106 */ if ((this.space instanceof QTDisplaySpace))
/* 107 */ this.displaySpace = ((QTDisplaySpace)this.space);
/* 108 */ if ((this.listenerSource != null) && (this.handler == null))
/* 109 */ addHandler();
/* */ }
/* */
/* */ /** @deprecated */
/* */ public void removedFromSpace()
/* */ {
/* 120 */ this.space = null;
/* 121 */ this.compSpace = null;
/* 122 */ this.displaySpace = null;
/* 123 */ this.drawSpace = null;
/* 124 */ if ((this.listenerSource != null) && (this.handler != null))
/* 125 */ removeActiveHandler();
/* */ }
/* */
/* */ /** @deprecated */
/* */ public void addedTo(Object paramObject)
/* */ {
/* 140 */ this.listenerSource = paramObject;
/* 141 */ if (this.handler == null)
/* 142 */ addHandler();
/* */ }
/* */
/* */ /** @deprecated */
/* */ public void removedFrom(Object paramObject)
/* */ {
/* 154 */ this.listenerSource = null;
/* 155 */ if (this.handler != null)
/* 156 */ removeActiveHandler();
/* */ }
/* */
/* */ /** @deprecated */
/* */ protected void addHandler()
/* */ {
/* 165 */ this.handler = EventDispatcher.makeDispatcher(this, getSpace(), this.listenerSource);
/* 166 */ if (this.handler != null) {
/* 167 */ this.handler.addedTo();
/* 168 */ if (hasMouseButtonListener())
/* 169 */ this.handler.addMouseButtonListener();
/* 170 */ if (hasMouseMoveListener())
/* 171 */ this.handler.addMouseMoveListener();
/* 172 */ if (hasMouseEnterExitListener())
/* 173 */ this.handler.addMouseEnterExitListener();
/* */ }
/* */ }
/* */
/* */ /** @deprecated */
/* */ protected void removeActiveHandler()
/* */ {
/* 183 */ this.handler.removedFrom();
/* 184 */ this.handler = null;
/* */ }
/* */
/* */ /** @deprecated */
/* */ protected boolean translateAndIsWithin(QTMouseEvent paramQTMouseEvent)
/* */ {
/* 202 */ if (this.displaySpace != null) {
/* */ try {
/* 204 */ QDRect localQDRect1 = this.displaySpace.getDisplayBounds();
/* 205 */ int i = localQDRect1.getX();
/* 206 */ int j = localQDRect1.getY();
/* 207 */ if (this.compSpace != null) {
/* 208 */ int k = i;
/* 209 */ int m = j;
/* */
/* 211 */ SWCompositor localSWCompositor1 = this.compSpace.getParent();
/* 212 */ while (localSWCompositor1 != null) {
/* 213 */ SWCompositor localSWCompositor2 = localSWCompositor1;
/* 214 */ QDRect localQDRect2 = localSWCompositor2.getDisplayBounds();
/* 215 */ k += localQDRect2.getX();
/* 216 */ m += localQDRect2.getY();
/* 217 */ localSWCompositor1 = localSWCompositor2.getParent();
/* */ }
/* 219 */ paramQTMouseEvent.translate(-k, -m);
/* */ } else {
/* 221 */ paramQTMouseEvent.translate(-i, -j);
/* */ }
/* */
/* 224 */ if (localQDRect1.inside(paramQTMouseEvent.getX() + i, paramQTMouseEvent.getY() + j)) {
/* 225 */ return true;
/* */ }
/* 227 */ return false;
/* */ } catch (QTException localQTException) {
/* 229 */ QTRuntimeException.handleOrThrow(new QTRuntimeException(localQTException), this.compSpace, "getDisplayBounds");
/* */ }
/* */ }
/* 232 */ return true;
/* */ }
/* */
/* */ /** @deprecated */
/* */ public void addQTMouseListener(QTMouseListener paramQTMouseListener)
/* */ {
/* 243 */ if ((paramQTMouseListener instanceof MouseButtonListener))
/* 244 */ addMouseButtonListener((MouseButtonListener)paramQTMouseListener);
/* 245 */ if ((paramQTMouseListener instanceof MouseMoveListener))
/* 246 */ addMouseMoveListener((MouseMoveListener)paramQTMouseListener);
/* 247 */ if ((paramQTMouseListener instanceof MouseEnterExitListener))
/* 248 */ addMouseEnterExitListener((MouseEnterExitListener)paramQTMouseListener);
/* */ }
/* */
/* */ /** @deprecated */
/* */ public void removeQTMouseListener(QTMouseListener paramQTMouseListener)
/* */ {
/* 257 */ if ((paramQTMouseListener instanceof MouseButtonListener))
/* 258 */ removeMouseButtonListener((MouseButtonListener)paramQTMouseListener);
/* 259 */ if ((paramQTMouseListener instanceof MouseMoveListener))
/* 260 */ removeMouseMoveListener((MouseMoveListener)paramQTMouseListener);
/* 261 */ if ((paramQTMouseListener instanceof MouseEnterExitListener))
/* 262 */ removeMouseEnterExitListener((MouseEnterExitListener)paramQTMouseListener);
/* */ }
/* */
/* */ void addMouseButtonListener(MouseButtonListener paramMouseButtonListener) {
/* 266 */ boolean bool = hasMouseButtonListener();
/* 267 */ this.mouseButtonListener = QTEventCaster.add(this.mouseButtonListener, paramMouseButtonListener);
/* 268 */ updateMouseButtonListener(bool);
/* */ }
/* */
/* */ void removeMouseButtonListener(MouseButtonListener paramMouseButtonListener) {
/* 272 */ boolean bool = hasMouseButtonListener();
/* 273 */ this.mouseButtonListener = QTEventCaster.remove(this.mouseButtonListener, paramMouseButtonListener);
/* 274 */ updateMouseButtonListener(bool);
/* */ }
/* */
/* */ void updateMouseButtonListener(boolean paramBoolean) {
/* 278 */ if (this.handler != null)
/* 279 */ if ((paramBoolean) && (!hasMouseButtonListener()))
/* 280 */ this.handler.removeMouseButtonListener();
/* 281 */ else if ((hasMouseButtonListener()) && (!paramBoolean))
/* 282 */ this.handler.addMouseButtonListener();
/* */ }
/* */
/* */ boolean hasMouseButtonListener()
/* */ {
/* 287 */ return this.mouseButtonListener != null;
/* */ }
/* */
/* */ /** @deprecated */
/* */ public void mouseClicked(QTMouseEvent paramQTMouseEvent)
/* */ {
/* 297 */ if ((this.mouseButtonListener != null) && (this.mouseButtonListener.matchModifierFilter(paramQTMouseEvent.getModifiers())) &&
/* 298 */ (translateAndIsWithin(paramQTMouseEvent)))
/* 299 */ doMouseClicked(paramQTMouseEvent);
/* */ }
/* */
/* */ /** @deprecated */
/* */ protected void doMouseClicked(QTMouseEvent paramQTMouseEvent)
/* */ {
/* 311 */ this.mouseButtonListener.mouseClicked(paramQTMouseEvent);
/* */ }
/* */
/* */ /** @deprecated */
/* */ public void mousePressed(QTMouseEvent paramQTMouseEvent)
/* */ {
/* 321 */ if ((this.mouseButtonListener != null) && (this.mouseButtonListener.matchModifierFilter(paramQTMouseEvent.getModifiers())) &&
/* 322 */ (translateAndIsWithin(paramQTMouseEvent)))
/* 323 */ doMousePressed(paramQTMouseEvent);
/* */ }
/* */
/* */ /** @deprecated */
/* */ protected void doMousePressed(QTMouseEvent paramQTMouseEvent)
/* */ {
/* 335 */ this.mouseButtonListener.mousePressed(paramQTMouseEvent);
/* */ }
/* */
/* */ /** @deprecated */
/* */ public void mouseReleased(QTMouseEvent paramQTMouseEvent)
/* */ {
/* 345 */ if ((this.mouseButtonListener != null) && (this.mouseButtonListener.matchModifierFilter(paramQTMouseEvent.getModifiers())) &&
/* 346 */ (translateAndIsWithin(paramQTMouseEvent)))
/* 347 */ doMouseReleased(paramQTMouseEvent);
/* */ }
/* */
/* */ /** @deprecated */
/* */ protected void doMouseReleased(QTMouseEvent paramQTMouseEvent)
/* */ {
/* 359 */ this.mouseButtonListener.mouseReleased(paramQTMouseEvent);
/* */ }
/* */
/* */ void addMouseMoveListener(MouseMoveListener paramMouseMoveListener) {
/* 363 */ boolean bool = hasMouseMoveListener();
/* 364 */ this.mouseMoveListener = QTEventCaster.add(this.mouseMoveListener, paramMouseMoveListener);
/* 365 */ updateMouseMoveListener(bool);
/* */ }
/* */
/* */ void removeMouseMoveListener(MouseMoveListener paramMouseMoveListener) {
/* 369 */ boolean bool = hasMouseMoveListener();
/* 370 */ this.mouseMoveListener = QTEventCaster.remove(this.mouseMoveListener, paramMouseMoveListener);
/* 371 */ updateMouseMoveListener(bool);
/* */ }
/* */
/* */ void updateMouseMoveListener(boolean paramBoolean) {
/* 375 */ if (this.handler != null)
/* 376 */ if ((paramBoolean) && (!hasMouseMoveListener()))
/* 377 */ this.handler.removeMouseMoveListener();
/* 378 */ else if ((hasMouseMoveListener()) && (!paramBoolean))
/* 379 */ this.handler.addMouseMoveListener();
/* */ }
/* */
/* */ boolean hasMouseMoveListener()
/* */ {
/* 384 */ return this.mouseMoveListener != null;
/* */ }
/* */
/* */ boolean isInterestedInMouseMoveEvents(QTMouseEvent paramQTMouseEvent) {
/* 388 */ return (this.mouseMoveListener != null) && (this.mouseMoveListener.matchModifierFilter(paramQTMouseEvent.getModifiers()));
/* */ }
/* */
/* */ /** @deprecated */
/* */ public void mouseDragged(QTMouseEvent paramQTMouseEvent)
/* */ {
/* 401 */ int i = 0;
/* 402 */ if ((this.isInEnclosingSpace) &&
/* 403 */ (this.mouseEnterExitListener != null) && (this.mouseEnterExitListener.matchModifierFilter(paramQTMouseEvent.getModifiers()))) {
/* 404 */ boolean bool = this.isWithinItsSpace;
/* 405 */ this.isWithinItsSpace = translateAndIsWithin(paramQTMouseEvent);
/* 406 */ i = 1;
/* 407 */ if ((bool) && (!this.isWithinItsSpace)) {
/* 408 */ paramQTMouseEvent.setEventType(505);
/* 409 */ doMouseExited(paramQTMouseEvent);
/* 410 */ paramQTMouseEvent.setEventType(506);
/* 411 */ } else if ((this.isWithinItsSpace) && (!bool)) {
/* 412 */ paramQTMouseEvent.setEventType(504);
/* 413 */ doMouseEntered(paramQTMouseEvent);
/* 414 */ paramQTMouseEvent.setEventType(506);
/* */ }
/* */ }
/* */
/* 418 */ if (isInterestedInMouseMoveEvents(paramQTMouseEvent)) {
/* 419 */ if (i == 0)
/* 420 */ translateAndIsWithin(paramQTMouseEvent);
/* 421 */ doMouseDragged(paramQTMouseEvent);
/* */ }
/* */ }
/* */
/* */ /** @deprecated */
/* */ protected void doMouseDragged(QTMouseEvent paramQTMouseEvent)
/* */ {
/* 432 */ this.mouseMoveListener.mouseDragged(paramQTMouseEvent);
/* */ }
/* */
/* */ /** @deprecated */
/* */ public void mouseMoved(QTMouseEvent paramQTMouseEvent)
/* */ {
/* 442 */ if ((this.mouseEnterExitListener != null) && (this.mouseEnterExitListener.matchModifierFilter(paramQTMouseEvent.getModifiers()))) {
/* 443 */ boolean bool = this.isWithinItsSpace;
/* 444 */ this.isWithinItsSpace = translateAndIsWithin(paramQTMouseEvent);
/* 445 */ if ((bool) && (!this.isWithinItsSpace)) {
/* 446 */ paramQTMouseEvent.setEventType(505);
/* 447 */ doMouseExited(paramQTMouseEvent);
/* 448 */ } else if ((this.isWithinItsSpace) && (!bool)) {
/* 449 */ paramQTMouseEvent.setEventType(504);
/* 450 */ doMouseEntered(paramQTMouseEvent);
/* 451 */ } else if (isInterestedInMouseMoveEvents(paramQTMouseEvent)) {
/* 452 */ doMouseMoved(paramQTMouseEvent, this.isWithinItsSpace);
/* */ }
/* 454 */ } else if (isInterestedInMouseMoveEvents(paramQTMouseEvent)) {
/* 455 */ doMouseMoved(paramQTMouseEvent, translateAndIsWithin(paramQTMouseEvent));
/* */ }
/* */ }
/* */
/* */ /** @deprecated */
/* */ protected void doMouseMoved(QTMouseEvent paramQTMouseEvent, boolean paramBoolean)
/* */ {
/* 468 */ if (paramBoolean)
/* 469 */ this.mouseMoveListener.mouseMoved(paramQTMouseEvent);
/* */ }
/* */
/* */ void addMouseEnterExitListener(MouseEnterExitListener paramMouseEnterExitListener) {
/* 473 */ boolean bool = hasMouseEnterExitListener();
/* 474 */ this.mouseEnterExitListener = QTEventCaster.add(this.mouseEnterExitListener, paramMouseEnterExitListener);
/* 475 */ updateMouseEnterExitListener(bool);
/* */ }
/* */
/* */ void removeMouseEnterExitListener(MouseEnterExitListener paramMouseEnterExitListener) {
/* 479 */ boolean bool = hasMouseEnterExitListener();
/* 480 */ this.mouseEnterExitListener = QTEventCaster.remove(this.mouseEnterExitListener, paramMouseEnterExitListener);
/* 481 */ updateMouseEnterExitListener(bool);
/* */ }
/* */
/* */ void updateMouseEnterExitListener(boolean paramBoolean) {
/* 485 */ if (this.handler != null)
/* 486 */ if ((paramBoolean) && (!hasMouseEnterExitListener()))
/* 487 */ this.handler.removeMouseEnterExitListener();
/* 488 */ else if ((hasMouseEnterExitListener()) && (!paramBoolean))
/* 489 */ this.handler.addMouseEnterExitListener();
/* */ }
/* */
/* */ boolean hasMouseEnterExitListener()
/* */ {
/* 494 */ return this.mouseEnterExitListener != null;
/* */ }
/* */
/* */ /** @deprecated */
/* */ public void mouseEntered(QTMouseEvent paramQTMouseEvent)
/* */ {
/* 504 */ if ((this.mouseEnterExitListener != null) && (this.mouseEnterExitListener.matchModifierFilter(paramQTMouseEvent.getModifiers()))) {
/* 505 */ this.isWithinItsSpace = translateAndIsWithin(paramQTMouseEvent);
/* 506 */ if (this.isWithinItsSpace) {
/* 507 */ doMouseEntered(paramQTMouseEvent);
/* */ }
/* */ }
/* 510 */ this.isInEnclosingSpace = true;
/* */ }
/* */
/* */ /** @deprecated */
/* */ protected void doMouseEntered(QTMouseEvent paramQTMouseEvent)
/* */ {
/* 520 */ this.mouseEnterExitListener.mouseEntered(paramQTMouseEvent);
/* */ }
/* */
/* */ /** @deprecated */
/* */ public void mouseExited(QTMouseEvent paramQTMouseEvent)
/* */ {
/* 530 */ this.isInEnclosingSpace = false;
/* 531 */ if ((this.mouseEnterExitListener != null) && (this.mouseEnterExitListener.matchModifierFilter(paramQTMouseEvent.getModifiers()))) {
/* 532 */ boolean bool = this.isWithinItsSpace;
/* 533 */ translateAndIsWithin(paramQTMouseEvent);
/* 534 */ this.isWithinItsSpace = false;
/* 535 */ if (bool)
/* 536 */ doMouseExited(paramQTMouseEvent);
/* */ }
/* */ }
/* */
/* */ /** @deprecated */
/* */ protected void doMouseExited(QTMouseEvent paramQTMouseEvent)
/* */ {
/* 547 */ this.mouseEnterExitListener.mouseExited(paramQTMouseEvent);
/* */ }
/* */
/* */ static
/* */ {
/* 50 */ if ((QTSession.isCurrentOS(4)) && (QTSession.getJavaVersion() >= 65540))
/* 51 */ 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.event.QTMouseController
* JD-Core Version: 0.6.2
*/