提交 f07d5175 编写于 作者: R rupashka

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: NFlorian Brunner <fbrunnerlist@gmx.ch>
上级 6bf6bca4
...@@ -225,15 +225,15 @@ public class MotifGraphicsUtils implements SwingConstants ...@@ -225,15 +225,15 @@ public class MotifGraphicsUtils implements SwingConstants
if(b.getIcon() != null) { if(b.getIcon() != null) {
Icon icon; Icon icon;
if(!model.isEnabled()) { if(!model.isEnabled()) {
icon = (Icon) b.getDisabledIcon(); icon = b.getDisabledIcon();
} else if(model.isPressed() && model.isArmed()) { } else if(model.isPressed() && model.isArmed()) {
icon = (Icon) b.getPressedIcon(); icon = b.getPressedIcon();
if(icon == null) { if(icon == null) {
// Use default icon // Use default icon
icon = (Icon) b.getIcon(); icon = b.getIcon();
} }
} else { } else {
icon = (Icon) b.getIcon(); icon = b.getIcon();
} }
if (icon!=null) { if (icon!=null) {
......
...@@ -86,18 +86,18 @@ public class MotifInternalFrameTitlePane ...@@ -86,18 +86,18 @@ public class MotifInternalFrameTitlePane
protected void assembleSystemMenu() { protected void assembleSystemMenu() {
systemMenu = new JPopupMenu(); systemMenu = new JPopupMenu();
JMenuItem mi = (JMenuItem)systemMenu.add(new JMenuItem(restoreAction)); JMenuItem mi = systemMenu.add(new JMenuItem(restoreAction));
mi.setMnemonic('R'); mi.setMnemonic('R');
mi = (JMenuItem) systemMenu.add(new JMenuItem(moveAction)); mi = systemMenu.add(new JMenuItem(moveAction));
mi.setMnemonic('M'); mi.setMnemonic('M');
mi = (JMenuItem) systemMenu.add(new JMenuItem(sizeAction)); mi = systemMenu.add(new JMenuItem(sizeAction));
mi.setMnemonic('S'); mi.setMnemonic('S');
mi = (JMenuItem) systemMenu.add(new JMenuItem(iconifyAction)); mi = systemMenu.add(new JMenuItem(iconifyAction));
mi.setMnemonic('n'); mi.setMnemonic('n');
mi = (JMenuItem) systemMenu.add(new JMenuItem(maximizeAction)); mi = systemMenu.add(new JMenuItem(maximizeAction));
mi.setMnemonic('x'); mi.setMnemonic('x');
systemMenu.add(new JSeparator()); systemMenu.add(new JSeparator());
mi = (JMenuItem) systemMenu.add(new JMenuItem(closeAction)); mi = systemMenu.add(new JMenuItem(closeAction));
mi.setMnemonic('C'); mi.setMnemonic('C');
systemButton = new SystemButton(); systemButton = new SystemButton();
...@@ -157,7 +157,7 @@ public class MotifInternalFrameTitlePane ...@@ -157,7 +157,7 @@ public class MotifInternalFrameTitlePane
} }
public void propertyChange(PropertyChangeEvent evt) { public void propertyChange(PropertyChangeEvent evt) {
String prop = (String)evt.getPropertyName(); String prop = evt.getPropertyName();
JInternalFrame f = (JInternalFrame)evt.getSource(); JInternalFrame f = (JInternalFrame)evt.getSource();
boolean value = false; boolean value = false;
if (JInternalFrame.IS_SELECTED_PROPERTY.equals(prop)) { if (JInternalFrame.IS_SELECTED_PROPERTY.equals(prop)) {
......
...@@ -290,7 +290,7 @@ public class MotifLookAndFeel extends BasicLookAndFeel ...@@ -290,7 +290,7 @@ public class MotifLookAndFeel extends BasicLookAndFeel
Object unselectedTabBackground = new UIDefaults.LazyValue() { Object unselectedTabBackground = new UIDefaults.LazyValue() {
public Object createValue(UIDefaults table) { 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), return new ColorUIResource(Math.max((int)(c.getRed()*.85),0),
Math.max((int)(c.getGreen()*.85),0), Math.max((int)(c.getGreen()*.85),0),
Math.max((int)(c.getBlue()*.85),0)); Math.max((int)(c.getBlue()*.85),0));
...@@ -299,7 +299,7 @@ public class MotifLookAndFeel extends BasicLookAndFeel ...@@ -299,7 +299,7 @@ public class MotifLookAndFeel extends BasicLookAndFeel
Object unselectedTabForeground = new UIDefaults.LazyValue() { Object unselectedTabForeground = new UIDefaults.LazyValue() {
public Object createValue(UIDefaults table) { 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), return new ColorUIResource(Math.max((int)(c.getRed()*.85),0),
Math.max((int)(c.getGreen()*.85),0), Math.max((int)(c.getGreen()*.85),0),
Math.max((int)(c.getBlue()*.85),0)); Math.max((int)(c.getBlue()*.85),0));
...@@ -308,7 +308,7 @@ public class MotifLookAndFeel extends BasicLookAndFeel ...@@ -308,7 +308,7 @@ public class MotifLookAndFeel extends BasicLookAndFeel
Object unselectedTabShadow = new UIDefaults.LazyValue() { Object unselectedTabShadow = new UIDefaults.LazyValue() {
public Object createValue(UIDefaults table) { 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), Color base = new Color(Math.max((int)(c.getRed()*.85),0),
Math.max((int)(c.getGreen()*.85),0), Math.max((int)(c.getGreen()*.85),0),
Math.max((int)(c.getBlue()*.85),0)); Math.max((int)(c.getBlue()*.85),0));
...@@ -318,7 +318,7 @@ public class MotifLookAndFeel extends BasicLookAndFeel ...@@ -318,7 +318,7 @@ public class MotifLookAndFeel extends BasicLookAndFeel
Object unselectedTabHighlight = new UIDefaults.LazyValue() { Object unselectedTabHighlight = new UIDefaults.LazyValue() {
public Object createValue(UIDefaults table) { 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), Color base = new Color(Math.max((int)(c.getRed()*.85),0),
Math.max((int)(c.getGreen()*.85),0), Math.max((int)(c.getGreen()*.85),0),
Math.max((int)(c.getBlue()*.85),0)); Math.max((int)(c.getBlue()*.85),0));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册