src/windows/classes/sun/awt/windows/WWindowPeer.java
Print this page
@@ -90,11 +90,11 @@
static {
initIDs();
}
// WComponentPeer overrides
-
+ @SuppressWarnings("unchecked")
protected void disposeImpl() {
AppContext appContext = SunToolkit.targetToAppContext(target);
synchronized (appContext) {
List<WWindowPeer> l = (List<WWindowPeer>)appContext.get(ACTIVE_WINDOWS_KEY);
if (l != null) {
@@ -376,10 +376,11 @@
public boolean isModalBlocked() {
return modalBlocker != null;
}
+ @SuppressWarnings("deprecation")
public void setModalBlocked(Dialog dialog, boolean blocked) {
synchronized (((Component)getTarget()).getTreeLock()) // State lock should always be after awtLock
{
// use WWindowPeer instead of WDialogPeer because of FileDialogs and PrintDialogs
WWindowPeer blockerPeer = (WWindowPeer)dialog.getPeer();
@@ -415,10 +416,11 @@
/*
* Returns all the ever active windows from the current AppContext.
* The list is sorted by the time of activation, so the latest
* active window is always at the end.
*/
+ @SuppressWarnings("unchecked")
public static long[] getActiveWindowHandles() {
AppContext appContext = AppContext.getAppContext();
synchronized (appContext) {
List<WWindowPeer> l = (List<WWindowPeer>)appContext.get(ACTIVE_WINDOWS_KEY);
if (l == null) {
@@ -569,10 +571,11 @@
g.setClip(shape);
}
super.print(g);
}
+ @SuppressWarnings("deprecation")
private void replaceSurfaceDataRecursively(Component c) {
if (c instanceof Container) {
for (Component child : ((Container)c).getComponents()) {
replaceSurfaceDataRecursively(child);
}
@@ -689,17 +692,17 @@
// On Vista: setting the window non-opaque makes the window look
// rectangular, though still catching the mouse clicks within
// its shape only. To restore the correct visual appearance
// of the window (i.e. w/ the correct shape) we have to reset
// the shape.
- Shape shape = ((Window)target).getShape();
+ Shape shape = target.getShape();
if (shape != null) {
- ((Window)target).setShape(shape);
+ target.setShape(shape);
}
}
- if (((Window)target).isVisible()) {
+ if (target.isVisible()) {
updateWindow(true);
}
}
public native void updateWindowImpl(int[] data, int width, int height);
@@ -728,10 +731,11 @@
/*
* The method maps the list of the active windows to the window's AppContext,
* then the method registers ActiveWindowListener, GuiDisposedListener listeners;
* it executes the initilialization only once per AppContext.
*/
+ @SuppressWarnings("unchecked")
private static void initActiveWindowsTracking(Window w) {
AppContext appContext = AppContext.getAppContext();
synchronized (appContext) {
List<WWindowPeer> l = (List<WWindowPeer>)appContext.get(ACTIVE_WINDOWS_KEY);
if (l == null) {
@@ -772,10 +776,11 @@
/*
* Static inner class, listens for 'activeWindow' KFM property changes and
* updates the list of active windows per AppContext, so the latest active
* window is always at the end of the list. The list is stored in AppContext.
*/
+ @SuppressWarnings( value = {"deprecation", "unchecked"})
private static class ActiveWindowListener implements PropertyChangeListener {
public void propertyChange(PropertyChangeEvent e) {
Window w = (Window)e.getNewValue();
if (w == null) {
return;