/* */ package quicktime.app.spaces;
/* */
/* */ import java.util.Enumeration;
/* */ import java.util.Vector;
/* */ import quicktime.QTException;
/* */ import quicktime.QTRuntimeException;
/* */ import quicktime.QTSession;
/* */ import quicktime.app.actions.TickleList;
/* */ import quicktime.app.time.Timeable;
/* */ import quicktime.app.time.Timer;
/* */ import quicktime.std.clocks.TimeBase;
/* */
/* */ /** @deprecated */
/* */ public abstract class SimpleSpace
/* */ implements Space
/* */ {
/* 54 */ private static boolean apriori = QTSession.apriori();
/* */
/* 102 */ protected Vector controllersVec = new Vector();
/* */
/* 105 */ protected Vector containedSpaces = new Vector();
/* */
/* 108 */ protected TickleList ticklers = new TickleList();
/* */ protected Timer timer;
/* */ private Object listenerSource;
/* */ private Protocol prots;
/* */
/* */ /** @deprecated */
/* */ protected SimpleSpace(Protocol paramProtocol)
/* */ throws QTException
/* */ {
/* 77 */ this.prots = paramProtocol;
/* */ }
/* */
/* */ /** @deprecated */
/* */ protected SimpleSpace(Protocol paramProtocol, int paramInt1, int paramInt2)
/* */ throws QTException
/* */ {
/* 95 */ this.prots = paramProtocol;
/* 96 */ this.timer = new Timer(paramInt1, paramInt2, this);
/* */ }
/* */
/* */ /** @deprecated */
/* */ public void timeChanged(int paramInt)
/* */ throws QTException
/* */ {
/* 124 */ this.ticklers.timeChanged(paramInt);
/* */ }
/* */
/* */ /** @deprecated */
/* */ public boolean tickle(float paramFloat, int paramInt)
/* */ throws QTException
/* */ {
/* 139 */ return !this.ticklers.isEmpty() ? this.ticklers.tickle(paramFloat, paramInt) : false;
/* */ }
/* */
/* */ /** @deprecated */
/* */ public Enumeration tickleList()
/* */ {
/* 150 */ return this.ticklers.members();
/* */ }
/* */
/* */ /** @deprecated */
/* */ public Object getSource()
/* */ {
/* 162 */ return this.listenerSource;
/* */ }
/* */
/* */ /** @deprecated */
/* */ public Protocol getProtocol()
/* */ {
/* 171 */ return this.prots;
/* */ }
/* */
/* */ /** @deprecated */
/* */ public boolean isAppropriate(Object paramObject)
/* */ {
/* 182 */ return getProtocol().passProtocol(paramObject);
/* */ }
/* */
/* */ /** @deprecated */
/* */ public synchronized boolean hasMember(Object paramObject)
/* */ {
/* 191 */ if (!isAppropriate(paramObject)) return false;
/* 192 */ Enumeration localEnumeration = members();
/* 193 */ while (localEnumeration.hasMoreElements()) {
/* 194 */ if (localEnumeration.nextElement().equals(paramObject))
/* 195 */ return true;
/* */ }
/* 197 */ return false;
/* */ }
/* */
/* */ /** @deprecated */
/* */ public synchronized void addedTo(Object paramObject)
/* */ {
/* 208 */ if (this.listenerSource != null)
/* 209 */ removedFrom(this.listenerSource);
/* 210 */ this.listenerSource = paramObject;
/* 211 */ if (this.listenerSource != null) {
/* 212 */ Enumeration localEnumeration = this.containedSpaces.elements();
/* */ Object localObject;
/* 213 */ while (localEnumeration.hasMoreElements()) {
/* 214 */ localObject = (Space)localEnumeration.nextElement();
/* 215 */ ((Space)localObject).addedTo(this.listenerSource);
/* */ }
/* 217 */ localEnumeration = members();
/* 218 */ while (localEnumeration.hasMoreElements()) {
/* 219 */ localObject = localEnumeration.nextElement();
/* 220 */ if (((localObject instanceof Listener)) && (!(localObject instanceof Space))) {
/* 221 */ ((Listener)localObject).addedTo(this.listenerSource);
/* */ }
/* */ }
/* 224 */ localEnumeration = controllers();
/* 225 */ while (localEnumeration.hasMoreElements()) {
/* 226 */ localObject = (Controller)localEnumeration.nextElement();
/* 227 */ if ((localObject instanceof ListenerController))
/* 228 */ ((ListenerController)localObject).addedTo(this.listenerSource);
/* */ }
/* */ }
/* */ }
/* */
/* */ /** @deprecated */
/* */ public synchronized void removedFrom(Object paramObject)
/* */ {
/* 242 */ if (this.listenerSource != null) {
/* 243 */ if (paramObject != this.listenerSource) {
/* 244 */ QTRuntimeException.handleOrThrow(new QTRuntimeException(new QTRuntimeException("Remove from object Space has no interest in")), this, "removedFrom");
/* 245 */ return;
/* */ }
/* 247 */ Enumeration localEnumeration = controllers();
/* */ Object localObject;
/* 248 */ while (localEnumeration.hasMoreElements()) {
/* 249 */ localObject = (Controller)localEnumeration.nextElement();
/* 250 */ if ((localObject instanceof ListenerController)) {
/* 251 */ ((ListenerController)localObject).removedFrom(this.listenerSource);
/* */ }
/* */ }
/* 254 */ localEnumeration = this.containedSpaces.elements();
/* 255 */ while (localEnumeration.hasMoreElements()) {
/* 256 */ localObject = (Space)localEnumeration.nextElement();
/* 257 */ ((Space)localObject).removedFrom(this.listenerSource);
/* */ }
/* 259 */ localEnumeration = members();
/* 260 */ while (localEnumeration.hasMoreElements()) {
/* 261 */ localObject = localEnumeration.nextElement();
/* 262 */ if (((localObject instanceof Listener)) && (!(localObject instanceof Space)))
/* 263 */ ((Listener)localObject).removedFrom(this.listenerSource);
/* */ }
/* 265 */ this.listenerSource = null;
/* */ }
/* */ }
/* */
/* */ /** @deprecated */
/* */ public synchronized void addController(Controller paramController)
/* */ throws QTException
/* */ {
/* 276 */ if (paramController == null) return;
/* 277 */ if (this.controllersVec.contains(paramController)) return;
/* 278 */ paramController.addedToSpace(this);
/* 279 */ this.controllersVec.addElement(paramController);
/* */ Object localObject1;
/* */ Object localObject2;
/* 280 */ if ((paramController instanceof TimeableController)) {
/* 281 */ localObject1 = ((Timeable)paramController).getTimeBase();
/* 282 */ localObject2 = this.timer.getTimeBase();
/* 283 */ ((TimeBase)localObject1).setMasterTimeBase((TimeBase)localObject2, null);
/* */ }
/* 285 */ if (((paramController instanceof ListenerController)) &&
/* 286 */ (this.listenerSource != null)) {
/* 287 */ ((ListenerController)paramController).addedTo(this.listenerSource);
/* */ }
/* 289 */ if ((paramController instanceof CollectionController)) {
/* 290 */ localObject1 = (CollectionController)paramController;
/* 291 */ if (((CollectionController)localObject1).isWholespace()) {
/* 292 */ localObject2 = members();
/* 293 */ while (((Enumeration)localObject2).hasMoreElements())
/* 294 */ ((CollectionController)localObject1).addMember(((Enumeration)localObject2).nextElement());
/* */ }
/* */ }
/* 297 */ if ((paramController instanceof TicklishController))
/* 298 */ this.ticklers.addMember(paramController);
/* */ }
/* */
/* */ /** @deprecated */
/* */ public synchronized void removeController(Controller paramController)
/* */ throws QTException
/* */ {
/* 308 */ if (paramController == null) return;
/* 309 */ if (!this.controllersVec.contains(paramController)) return;
/* 310 */ this.controllersVec.removeElement(paramController);
/* 311 */ paramController.removedFromSpace();
/* */ Object localObject;
/* 312 */ if ((paramController instanceof TimeableController)) {
/* 313 */ localObject = ((Timeable)paramController).getTimeBase();
/* 314 */ ((TimeBase)localObject).setMasterTimeBase(null, null);
/* */ }
/* 316 */ if (((paramController instanceof ListenerController)) &&
/* 317 */ (this.listenerSource != null)) {
/* 318 */ ((ListenerController)paramController).removedFrom(this.listenerSource);
/* */ }
/* 320 */ if ((paramController instanceof CollectionController)) {
/* 321 */ localObject = (CollectionController)paramController;
/* 322 */ Enumeration localEnumeration = members();
/* 323 */ while (localEnumeration.hasMoreElements())
/* 324 */ ((CollectionController)localObject).removeMember(localEnumeration.nextElement());
/* */ }
/* 326 */ if ((paramController instanceof TicklishController))
/* 327 */ this.ticklers.removeMember(paramController);
/* */ }
/* */
/* */ /** @deprecated */
/* */ public Enumeration controllers()
/* */ {
/* 338 */ return this.controllersVec.elements();
/* */ }
/* */
/* */ /** @deprecated */
/* */ public Timer getTimer()
/* */ {
/* 349 */ return this.timer;
/* */ }
/* */
/* */ /** @deprecated */
/* */ public abstract boolean addMember(Object paramObject)
/* */ throws QTException;
/* */
/* */ /** @deprecated */
/* */ public abstract void removeMember(Object paramObject)
/* */ throws QTException;
/* */
/* */ /** @deprecated */
/* */ protected synchronized void memberAdded(Object paramObject)
/* */ throws QTException
/* */ {
/* */ Object localObject2;
/* */ Object localObject3;
/* 376 */ if ((paramObject instanceof Space)) {
/* 377 */ localObject1 = (Space)paramObject;
/* 378 */ localObject2 = ((Space)localObject1).getTimer().getTimeBase();
/* 379 */ localObject3 = this.timer.getTimeBase();
/* 380 */ ((TimeBase)localObject2).setMasterTimeBase((TimeBase)localObject3, null);
/* 381 */ this.containedSpaces.addElement(paramObject);
/* 382 */ if (this.listenerSource != null)
/* 383 */ ((Space)localObject1).addedTo(this.listenerSource);
/* */ } else {
/* 385 */ if ((paramObject instanceof Timeable)) {
/* 386 */ localObject1 = ((Timeable)paramObject).getTimeBase();
/* 387 */ localObject2 = this.timer.getTimeBase();
/* 388 */ ((TimeBase)localObject1).setMasterTimeBase((TimeBase)localObject2, null);
/* */ }
/* 390 */ if (((paramObject instanceof Listener)) && (this.listenerSource != null)) {
/* 391 */ ((Listener)paramObject).addedTo(this.listenerSource);
/* */ }
/* */ }
/* 394 */ Object localObject1 = controllers();
/* 395 */ while (((Enumeration)localObject1).hasMoreElements()) {
/* 396 */ localObject2 = ((Enumeration)localObject1).nextElement();
/* 397 */ if ((localObject2 instanceof CollectionController)) {
/* 398 */ localObject3 = (CollectionController)localObject2;
/* 399 */ if (((CollectionController)localObject3).isWholespace())
/* 400 */ ((CollectionController)localObject3).addMember(paramObject);
/* */ }
/* */ }
/* */ }
/* */
/* */ /** @deprecated */
/* */ protected synchronized void memberRemoved(Object paramObject)
/* */ throws QTException
/* */ {
/* */ Object localObject2;
/* 413 */ if ((paramObject instanceof Space)) {
/* 414 */ localObject1 = (Space)paramObject;
/* 415 */ localObject2 = ((Space)localObject1).getTimer().getTimeBase();
/* 416 */ ((TimeBase)localObject2).setMasterTimeBase(null, null);
/* 417 */ this.containedSpaces.removeElement(paramObject);
/* 418 */ if (this.listenerSource != null)
/* 419 */ ((Space)localObject1).removedFrom(this.listenerSource);
/* */ } else {
/* 421 */ if ((paramObject instanceof Timeable)) {
/* 422 */ localObject1 = ((Timeable)paramObject).getTimeBase();
/* 423 */ ((TimeBase)localObject1).setMasterTimeBase(null, null);
/* */ }
/* 425 */ if (((paramObject instanceof Listener)) && (this.listenerSource != null)) {
/* 426 */ ((Listener)paramObject).removedFrom(this.listenerSource);
/* */ }
/* */ }
/* 429 */ Object localObject1 = controllers();
/* 430 */ while (((Enumeration)localObject1).hasMoreElements()) {
/* 431 */ localObject2 = ((Enumeration)localObject1).nextElement();
/* 432 */ if ((localObject2 instanceof CollectionController))
/* 433 */ ((CollectionController)localObject2).removeMember(paramObject);
/* */ }
/* */ }
/* */
/* */ /** @deprecated */
/* */ public synchronized void removeAllControllers()
/* */ throws QTException
/* */ {
/* 444 */ Enumeration localEnumeration = controllers();
/* 445 */ while (localEnumeration.hasMoreElements())
/* 446 */ removeController((Controller)localEnumeration.nextElement());
/* */ }
/* */
/* */ /** @deprecated */
/* */ public synchronized void removeAllMembers()
/* */ throws QTException
/* */ {
/* 456 */ Enumeration localEnumeration = members();
/* 457 */ while (localEnumeration.hasMoreElements())
/* 458 */ removeMember(localEnumeration.nextElement());
/* */ }
/* */
/* */ protected void finalize() throws Throwable
/* */ {
/* 463 */ synchronized (QTSession.terminationLock()) {
/* 464 */ if (QTSession.isInitialized()) {
/* 465 */ removeAllControllers();
/* 466 */ removeAllMembers();
/* */ }
/* */ }
/* 469 */ super.finalize();
/* */ }
/* */
/* */ static
/* */ {
/* 57 */ if ((QTSession.isCurrentOS(4)) && (QTSession.getJavaVersion() >= 65540))
/* 58 */ 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.spaces.SimpleSpace
* JD-Core Version: 0.6.2
*/