479 protected Rectangle getBoundsPrivate() { 480 final FramePeer peer = AWTAccessor.getComponentAccessor().getPeer(this); 481 if (peer != null) { 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 | 479 protected Rectangle getBoundsPrivate() { 480 final FramePeer peer = AWTAccessor.getComponentAccessor().getPeer(this); 481 if (peer != null) { 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 {@code null} 500 * @since 1.6 501 * 502 * @deprecated The Applet API is deprecated. See the 503 * <a href="../../java/applet/package-summary.html"> java.applet package 504 * documentation</a> for further information. 505 */ 506 @Deprecated(since = "9") 507 public static Applet getAppletIfAncestorOf(Component comp) { 508 Container parent = comp.getParent(); 509 Applet applet = null; 510 while (parent != null && !(parent instanceof EmbeddedFrame)) { 511 if (parent instanceof Applet) { 512 applet = (Applet)parent; 513 } 514 parent = parent.getParent(); 515 } 516 return parent == null ? null : applet; 517 } 518 519 /** 520 * This method should be overriden in subclasses. It is 521 * called when window this frame is within should be blocked 522 * by some modal dialog. 523 */ 524 public void notifyModalBlocked(Dialog blocker, boolean blocked) { 525 } 526 |