8067086: Suppress mac-specific deprecation warnings in the java.desktop module

Reviewed-by: prr
This commit is contained in:
Joe Darcy 2014-12-16 10:09:01 -08:00
parent 31ae349097
commit 0204a1cd9c
18 changed files with 36 additions and 6 deletions

View File

@ -70,6 +70,7 @@ class AquaComboBoxButton extends JButton {
return comboBox == null ? true : comboBox.isEnabled();
}
@SuppressWarnings("deprecation")
public boolean isFocusTraversable() {
return false;
}

View File

@ -303,6 +303,7 @@ public class AquaInternalFrameDockIconUI extends DesktopIconUI implements MouseL
}
}
@SuppressWarnings("deprecation")
public void hide() {
final Container parent = getParent();
final Rectangle r = this.getBounds();

View File

@ -2231,6 +2231,7 @@ public class AquaTabbedPaneCopyFromBasicUI extends TabbedPaneUI implements Swing
return total;
}
@SuppressWarnings("deprecation")
public void layoutContainer(final Container parent) {
/* Some of the code in this method deals with changing the
* visibility of components to hide and show the contents for the
@ -2725,6 +2726,7 @@ public class AquaTabbedPaneCopyFromBasicUI extends TabbedPaneUI implements Swing
return calculateMaxTabWidth(tabPlacement);
}
@SuppressWarnings("deprecation")
public void layoutContainer(final Container parent) {
/* Some of the code in this method deals with changing the
* visibility of components to hide and show the contents for the

View File

@ -229,6 +229,7 @@ final class ScreenMenu extends Menu
}
@Override
@SuppressWarnings("deprecation")
public void addNotify() {
synchronized (getTreeLock()) {
super.addNotify();
@ -354,6 +355,7 @@ final class ScreenMenu extends Menu
public void setIndeterminate(boolean indeterminate) { }
@Override
@SuppressWarnings("deprecation")
public void setToolTipText(final String text) {
final MenuComponentPeer peer = getPeer();
if (!(peer instanceof CMenuItem)) return;
@ -363,6 +365,7 @@ final class ScreenMenu extends Menu
}
@Override
@SuppressWarnings("deprecation")
public void setIcon(final Icon i) {
final MenuComponentPeer peer = getPeer();
if (!(peer instanceof CMenuItem)) return;

View File

@ -246,6 +246,7 @@ public class ScreenMenuBar extends MenuBar implements ContainerListener, ScreenM
fSubmenus.remove(menu);
}
@SuppressWarnings("deprecation")
public Menu add(final Menu m, final int index) {
synchronized (getTreeLock()) {
if (m.getParent() != null) {

View File

@ -97,6 +97,7 @@ final class ScreenMenuItem extends MenuItem implements ActionListener, Component
fMenuItem.removeComponentListener(this);
}
@SuppressWarnings("deprecation")
static void syncLabelAndKS(MenuItem menuItem, String label, KeyStroke ks) {
final MenuComponentPeer peer = menuItem.getPeer();
if (!(peer instanceof CMenuItem)) {
@ -165,6 +166,7 @@ final class ScreenMenuItem extends MenuItem implements ActionListener, Component
}
}
@SuppressWarnings("deprecation")
public void setToolTipText(final String text) {
final MenuComponentPeer peer = getPeer();
if (!(peer instanceof CMenuItem)) return;
@ -173,6 +175,7 @@ final class ScreenMenuItem extends MenuItem implements ActionListener, Component
cmi.setToolTipText(text);
}
@SuppressWarnings("deprecation")
public void setIcon(final Icon i) {
final MenuComponentPeer peer = getPeer();
if (!(peer instanceof CMenuItem)) return;

View File

@ -57,6 +57,7 @@ final class ScreenMenuItemCheckbox extends CheckboxMenuItem implements ActionLis
}
ScreenMenuPropertyListener fPropertyListener;
@SuppressWarnings("deprecation")
public void addNotify() {
super.addNotify();
@ -154,6 +155,7 @@ final class ScreenMenuItemCheckbox extends CheckboxMenuItem implements ActionLis
setVisible(false);
}
@SuppressWarnings("deprecation")
public void setToolTipText(final String text) {
final MenuComponentPeer peer = getPeer();
if (!(peer instanceof CMenuItem)) return;
@ -161,6 +163,7 @@ final class ScreenMenuItemCheckbox extends CheckboxMenuItem implements ActionLis
((CMenuItem)peer).setToolTipText(text);
}
@SuppressWarnings("deprecation")
public void setIcon(final Icon i) {
final MenuComponentPeer peer = getPeer();
if (!(peer instanceof CMenuItem)) return;
@ -205,6 +208,7 @@ final class ScreenMenuItemCheckbox extends CheckboxMenuItem implements ActionLis
}
}
@SuppressWarnings("deprecation")
public void setIndeterminate(final boolean indeterminate) {
final MenuComponentPeer peer = getPeer();
if (peer instanceof CCheckboxMenuItem) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -202,6 +202,7 @@ public final class CGraphicsDevice extends GraphicsDevice
return true;
}
@SuppressWarnings("deprecation")
private static void enterFullScreenExclusive(Window w) {
FullScreenCapable peer = (FullScreenCapable)w.getPeer();
if (peer != null) {
@ -209,6 +210,7 @@ public final class CGraphicsDevice extends GraphicsDevice
}
}
@SuppressWarnings("deprecation")
private static void exitFullScreenExclusive(Window w) {
FullScreenCapable peer = (FullScreenCapable)w.getPeer();
if (peer != null) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -125,6 +125,7 @@ public abstract class OSXSurfaceData extends BufImgSurfaceData {
return fConfig;
}
@SuppressWarnings("deprecation")
protected void setBounds(int x, int y, int w, int h) {
fBounds.reshape(x, y, w, y + h);
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -74,6 +74,7 @@ public class CGLVolatileSurfaceManager extends VolatileSurfaceManager {
* Create a pbuffer-based SurfaceData object (or init the backbuffer
* of an existing window if this is a double buffered GraphicsConfig)
*/
@SuppressWarnings("deprecation")
protected SurfaceData initAcceleratedSurface() {
SurfaceData sData = null;
Component comp = vImg.getComponent();

View File

@ -1243,6 +1243,7 @@ public class LWWindowPeer
changeFocusedWindow(activate, null);
}
@SuppressWarnings("deprecation")
private boolean isOneOfOwnersOf(LWWindowPeer peer) {
Window owner = (peer != null ? peer.getTarget().getOwner() : null);
while (owner != null) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -88,6 +88,7 @@ public final class CDragSourceContextPeer extends SunDragSourceContextPeer {
super.startDrag(dsc, cursor, dragImage, dragImageOffset);
}
@SuppressWarnings("deprecation")
protected void startDrag(Transferable transferable, long[] formats, Map<Long, DataFlavor> formatMap) {
DragGestureEvent trigger = getTrigger();
InputEvent triggerEvent = trigger.getTriggerEvent();

View File

@ -46,6 +46,7 @@ public class CEmbeddedFrame extends EmbeddedFrame {
show();
}
@SuppressWarnings("deprecation")
public void addNotify() {
if (getPeer() == null) {
LWCToolkit toolkit = (LWCToolkit)Toolkit.getDefaultToolkit();
@ -60,6 +61,7 @@ public class CEmbeddedFrame extends EmbeddedFrame {
public void unregisterAccelerator(AWTKeyStroke stroke) {}
@SuppressWarnings("deprecation")
protected long getLayerPtr() {
LWWindowPeer peer = (LWWindowPeer)getPeer();
return peer.getLayerPtr();

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -385,6 +385,7 @@ public class CInputMethod extends InputMethodAdapter {
// java.awt.Toolkit#getNativeContainer() is not available
// from this package
@SuppressWarnings("deprecation")
private LWComponentPeer<?, ?> getNearestNativePeer(Component comp) {
if (comp==null)
return null;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -43,6 +43,7 @@ public class CMenuBar extends CMenuComponent implements MenuBarPeer {
}
@Override
@SuppressWarnings("deprecation")
public void addHelpMenu(Menu m) {
CMenu cMenu = (CMenu)m.getPeer();
nativeSetHelpMenu(getModel(), cMenu.getModel());

View File

@ -190,6 +190,7 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
nativeSetNSWindowRepresentedFilename(c.getNSWindowPtr(), filename);
}}
}) {
@SuppressWarnings("deprecation")
public CPlatformWindow convertJComponentToTarget(final JRootPane p) {
Component root = SwingUtilities.getRoot(p);
if (root == null || (LWWindowPeer)root.getPeer() == null) return null;
@ -519,6 +520,7 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
}
@Override // PlatformWindow
@SuppressWarnings("deprecation")
public void setVisible(boolean visible) {
final long nsWindowPtr = getNSWindowPtr();
@ -674,6 +676,7 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
}
@Override // PlatformWindow
@SuppressWarnings("deprecation")
public void toFront() {
final long nsWindowPtr = getNSWindowPtr();
LWCToolkit lwcToolkit = (LWCToolkit) Toolkit.getDefaultToolkit();

View File

@ -68,6 +68,7 @@ public class CTrayIcon extends CFRetainedResource implements TrayIconPeer {
updateImage();
}
@SuppressWarnings("deprecation")
private CPopupMenu checkAndCreatePopupPeer() {
CPopupMenu menuPeer = null;
if (popup != null) {

View File

@ -78,6 +78,7 @@ public class CViewEmbeddedFrame extends EmbeddedFrame {
* Synthetic event delivery for focus management
*/
@Override
@SuppressWarnings("deprecation")
public void synthesizeWindowActivation(boolean activated) {
if (isActive != activated) {
isActive = activated;