< prev index next >

src/share/classes/javax/swing/plaf/metal/MetalInternalFrameTitlePane.java

Print this page
rev 1580 : 6727661: Code improvement and warnings removing from the swing/plaf packages
Summary: Removed unnecessary castings and other warnings
Reviewed-by: alexp
Contributed-by: Florian Brunner <fbrunnerlist@gmx.ch>

@@ -189,11 +189,11 @@
 
     class MetalPropertyChangeHandler
         extends BasicInternalFrameTitlePane.PropertyChangeHandler
     {
         public void propertyChange(PropertyChangeEvent evt) {
-            String prop = (String)evt.getPropertyName();
+            String prop = evt.getPropertyName();
             if( prop.equals(JInternalFrame.IS_SELECTED_PROPERTY) ) {
                 Boolean b = (Boolean)evt.getNewValue();
                 iconButton.putClientProperty("paintActive", b);
                 closeButton.putClientProperty("paintActive", b);
                 maxButton.putClientProperty("paintActive", b);

@@ -240,11 +240,11 @@
             else {
                 width += title_w;
             }
 
             // Compute height.
-            int height = 0;
+            int height;
             if (isPalette) {
                 height = paletteTitleHeight;
             } else {
                 int fontHeight = fm.getHeight();
                 fontHeight += 7;

@@ -408,11 +408,11 @@
         g.drawLine ( 0, height - 1, width, height -1);
         g.drawLine ( 0, 0, 0 ,0);
         g.drawLine ( width - 1, 0 , width -1, 0);
 
 
-        int titleLength = 0;
+        int titleLength;
         int xOffset = leftToRight ? 5 : width - 5;
         String frameTitle = frame.getTitle();
 
         Icon icon = frame.getFrameIcon();
         if ( icon != null ) {
< prev index next >