src/java.desktop/share/classes/javax/swing/JComponent.java
Print this page
*** 55,64 ****
--- 55,65 ----
import javax.swing.event.*;
import javax.swing.plaf.*;
import static javax.swing.ClientPropertyKey.*;
import javax.accessibility.*;
+ import sun.awt.AWTAccessor;
import sun.awt.SunToolkit;
import sun.swing.SwingUtilities2;
import sun.swing.UIClientPropertyKey;
/**
*** 4216,4228 ****
* have a native window system peer.
*
* @param c the {@code Component} to be checked
* @return true if this component is lightweight
*/
- @SuppressWarnings("deprecation")
public static boolean isLightweightComponent(Component c) {
! return c.getPeer() instanceof LightweightPeer;
}
/**
* @deprecated As of JDK 5,
--- 4217,4230 ----
* have a native window system peer.
*
* @param c the {@code Component} to be checked
* @return true if this component is lightweight
*/
public static boolean isLightweightComponent(Component c) {
! // TODO we cannot call c.isLightweight() because it is incorrectly
! // overriden in DelegateContainer on osx.
! return AWTAccessor.getComponentAccessor().isLightweight(c);
}
/**
* @deprecated As of JDK 5,
*** 5031,5041 ****
void setPaintingChild(Component paintingChild) {
this.paintingChild = paintingChild;
}
- @SuppressWarnings("deprecation")
void _paintImmediately(int x, int y, int w, int h) {
Graphics g;
Container c;
Rectangle b;
--- 5033,5042 ----
*** 5157,5167 ****
offsetY += by;
}
}
// If the clip width or height is negative, don't bother painting
! if(c == null || c.getPeer() == null ||
paintImmediatelyClip.width <= 0 ||
paintImmediatelyClip.height <= 0) {
recycleRectangle(paintImmediatelyClip);
return;
}
--- 5158,5168 ----
offsetY += by;
}
}
// If the clip width or height is negative, don't bother painting
! if(c == null || !c.isDisplayable() ||
paintImmediatelyClip.width <= 0 ||
paintImmediatelyClip.height <= 0) {
recycleRectangle(paintImmediatelyClip);
return;
}