482 return peer.getBoundsPrivate();
483 }
484 else {
485 return getBounds();
486 }
487 }
488
489 public void toFront() {}
490 public void toBack() {}
491
492 public abstract void registerAccelerator(AWTKeyStroke stroke);
493 public abstract void unregisterAccelerator(AWTKeyStroke stroke);
494
495 /**
496 * Checks if the component is in an EmbeddedFrame. If so,
497 * returns the applet found in the hierarchy or null if
498 * not found.
499 * @return the parent applet or {@ null}
500 * @since 1.6
501 */
502 public static Applet getAppletIfAncestorOf(Component comp) {
503 Container parent = comp.getParent();
504 Applet applet = null;
505 while (parent != null && !(parent instanceof EmbeddedFrame)) {
506 if (parent instanceof Applet) {
507 applet = (Applet)parent;
508 }
509 parent = parent.getParent();
510 }
511 return parent == null ? null : applet;
512 }
513
514 /**
515 * This method should be overriden in subclasses. It is
516 * called when window this frame is within should be blocked
517 * by some modal dialog.
518 */
519 public void notifyModalBlocked(Dialog blocker, boolean blocked) {
520 }
521
|
482 return peer.getBoundsPrivate();
483 }
484 else {
485 return getBounds();
486 }
487 }
488
489 public void toFront() {}
490 public void toBack() {}
491
492 public abstract void registerAccelerator(AWTKeyStroke stroke);
493 public abstract void unregisterAccelerator(AWTKeyStroke stroke);
494
495 /**
496 * Checks if the component is in an EmbeddedFrame. If so,
497 * returns the applet found in the hierarchy or null if
498 * not found.
499 * @return the parent applet or {@ null}
500 * @since 1.6
501 */
502 @SuppressWarnings("deprecation")
503 public static Applet getAppletIfAncestorOf(Component comp) {
504 Container parent = comp.getParent();
505 Applet applet = null;
506 while (parent != null && !(parent instanceof EmbeddedFrame)) {
507 if (parent instanceof Applet) {
508 applet = (Applet)parent;
509 }
510 parent = parent.getParent();
511 }
512 return parent == null ? null : applet;
513 }
514
515 /**
516 * This method should be overriden in subclasses. It is
517 * called when window this frame is within should be blocked
518 * by some modal dialog.
519 */
520 public void notifyModalBlocked(Dialog blocker, boolean blocked) {
521 }
522
|