changeset 232:5b1734431fa5

6693507: There are unnecessary compilation warnings in the com.sun.java.swing.plaf.motif package Summary: Removed unnecessary castings and other warnings Reviewed-by: peterz Contributed-by: Florian Brunner <fbrunnerlist@gmx.ch>
author rupashka
date Tue, 29 Apr 2008 15:47:17 +0400
parents 0447f9c7aed7
children aaa771ded30b
files src/share/classes/com/sun/java/swing/plaf/motif/MotifGraphicsUtils.java src/share/classes/com/sun/java/swing/plaf/motif/MotifInternalFrameTitlePane.java src/share/classes/com/sun/java/swing/plaf/motif/MotifLookAndFeel.java
diffstat 3 files changed, 15 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/com/sun/java/swing/plaf/motif/MotifGraphicsUtils.java	Tue Apr 29 13:49:13 2008 +0400
+++ b/src/share/classes/com/sun/java/swing/plaf/motif/MotifGraphicsUtils.java	Tue Apr 29 15:47:17 2008 +0400
@@ -225,15 +225,15 @@
         if(b.getIcon() != null) {
             Icon icon;
             if(!model.isEnabled()) {
-                icon = (Icon) b.getDisabledIcon();
+                icon = b.getDisabledIcon();
             } else if(model.isPressed() && model.isArmed()) {
-                icon = (Icon) b.getPressedIcon();
+                icon = b.getPressedIcon();
                 if(icon == null) {
                     // Use default icon
-                    icon = (Icon) b.getIcon();
+                    icon = b.getIcon();
                 }
             } else {
-                icon = (Icon) b.getIcon();
+                icon = b.getIcon();
             }
 
             if (icon!=null) {
--- a/src/share/classes/com/sun/java/swing/plaf/motif/MotifInternalFrameTitlePane.java	Tue Apr 29 13:49:13 2008 +0400
+++ b/src/share/classes/com/sun/java/swing/plaf/motif/MotifInternalFrameTitlePane.java	Tue Apr 29 15:47:17 2008 +0400
@@ -86,18 +86,18 @@
 
     protected void assembleSystemMenu() {
         systemMenu = new JPopupMenu();
-        JMenuItem mi = (JMenuItem)systemMenu.add(new JMenuItem(restoreAction));
+        JMenuItem mi = systemMenu.add(new JMenuItem(restoreAction));
         mi.setMnemonic('R');
-        mi = (JMenuItem) systemMenu.add(new JMenuItem(moveAction));
+        mi = systemMenu.add(new JMenuItem(moveAction));
         mi.setMnemonic('M');
-        mi = (JMenuItem) systemMenu.add(new JMenuItem(sizeAction));
+        mi = systemMenu.add(new JMenuItem(sizeAction));
         mi.setMnemonic('S');
-        mi = (JMenuItem) systemMenu.add(new JMenuItem(iconifyAction));
+        mi = systemMenu.add(new JMenuItem(iconifyAction));
         mi.setMnemonic('n');
-        mi = (JMenuItem) systemMenu.add(new JMenuItem(maximizeAction));
+        mi = systemMenu.add(new JMenuItem(maximizeAction));
         mi.setMnemonic('x');
         systemMenu.add(new JSeparator());
-        mi = (JMenuItem) systemMenu.add(new JMenuItem(closeAction));
+        mi = systemMenu.add(new JMenuItem(closeAction));
         mi.setMnemonic('C');
 
         systemButton = new SystemButton();
@@ -157,7 +157,7 @@
     }
 
     public void propertyChange(PropertyChangeEvent evt) {
-        String prop = (String)evt.getPropertyName();
+        String prop = evt.getPropertyName();
         JInternalFrame f = (JInternalFrame)evt.getSource();
         boolean value = false;
         if (JInternalFrame.IS_SELECTED_PROPERTY.equals(prop)) {
--- a/src/share/classes/com/sun/java/swing/plaf/motif/MotifLookAndFeel.java	Tue Apr 29 13:49:13 2008 +0400
+++ b/src/share/classes/com/sun/java/swing/plaf/motif/MotifLookAndFeel.java	Tue Apr 29 15:47:17 2008 +0400
@@ -290,7 +290,7 @@
 
         Object unselectedTabBackground = new UIDefaults.LazyValue() {
             public Object createValue(UIDefaults table) {
-                Color c = (Color)table.getColor("control");
+                Color c = table.getColor("control");
                 return new ColorUIResource(Math.max((int)(c.getRed()*.85),0),
                                            Math.max((int)(c.getGreen()*.85),0),
                                            Math.max((int)(c.getBlue()*.85),0));
@@ -299,7 +299,7 @@
 
         Object unselectedTabForeground = new UIDefaults.LazyValue() {
             public Object createValue(UIDefaults table) {
-                Color c = (Color)table.getColor("controlText");
+                Color c = table.getColor("controlText");
                 return new ColorUIResource(Math.max((int)(c.getRed()*.85),0),
                                            Math.max((int)(c.getGreen()*.85),0),
                                            Math.max((int)(c.getBlue()*.85),0));
@@ -308,7 +308,7 @@
 
         Object unselectedTabShadow = new UIDefaults.LazyValue() {
             public Object createValue(UIDefaults table) {
-                Color c = (Color)table.getColor("control");
+                Color c = table.getColor("control");
                 Color base = new Color(Math.max((int)(c.getRed()*.85),0),
                                        Math.max((int)(c.getGreen()*.85),0),
                                        Math.max((int)(c.getBlue()*.85),0));
@@ -318,7 +318,7 @@
 
         Object unselectedTabHighlight = new UIDefaults.LazyValue() {
             public Object createValue(UIDefaults table) {
-                Color c = (Color)table.getColor("control");
+                Color c = table.getColor("control");
                 Color base = new Color(Math.max((int)(c.getRed()*.85),0),
                                        Math.max((int)(c.getGreen()*.85),0),
                                        Math.max((int)(c.getBlue()*.85),0));