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

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -54,11 +54,11 @@
      * indicator. Only used with the Ocean theme.
      */
     static Object NO_BUTTON_ROLLOVER =
         new StringUIClientPropertyKey("NoButtonRollover");
 
-
+    @SuppressWarnings("serial") // Superclass is not serializable across versions
     public static class Flush3DBorder extends AbstractBorder implements UIResource{
         public void paintBorder(Component c, Graphics g, int x, int y,
                           int w, int h) {
             if (c.isEnabled()) {
                 MetalUtils.drawFlush3DBorder(g, x, y, w, h);

@@ -71,10 +71,11 @@
             newInsets.set(2, 2, 2, 2);
             return newInsets;
         }
     }
 
+    @SuppressWarnings("serial") // Superclass is not serializable across versions
     public static class ButtonBorder extends AbstractBorder implements UIResource {
 
         protected static Insets borderInsets = new Insets( 3, 3, 3, 3 );
 
         public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) {

@@ -185,10 +186,11 @@
             newInsets.set(3, 3, 3, 3);
             return newInsets;
         }
     }
 
+    @SuppressWarnings("serial") // Superclass is not serializable across versions
     public static class InternalFrameBorder extends AbstractBorder implements UIResource {
         private static final int corner = 14;
 
         public void paintBorder(Component c, Graphics g, int x, int y,
                           int w, int h) {

@@ -246,10 +248,11 @@
 
     /**
      * Border for a Frame.
      * @since 1.4
      */
+    @SuppressWarnings("serial") // Superclass is not serializable across versions
     static class FrameBorder extends AbstractBorder implements UIResource {
         private static final int corner = 14;
 
         public void paintBorder(Component c, Graphics g, int x, int y,
             int w, int h) {

@@ -308,10 +311,11 @@
 
     /**
      * Border for a Frame.
      * @since 1.4
      */
+    @SuppressWarnings("serial") // Superclass is not serializable across versions
     static class DialogBorder extends AbstractBorder implements UIResource
     {
         private static final int corner = 14;
 
         protected Color getActiveBackground()

@@ -401,10 +405,11 @@
 
     /**
      * Border for an Error Dialog.
      * @since 1.4
      */
+    @SuppressWarnings("serial") // Superclass is not serializable across versions
     static class ErrorDialogBorder extends DialogBorder implements UIResource
     {
         protected Color getActiveBackground() {
             return UIManager.getColor("OptionPane.errorDialog.border.background");
         }

@@ -414,10 +419,11 @@
     /**
      * Border for a QuestionDialog.  Also used for a JFileChooser and a
      * JColorChooser..
      * @since 1.4
      */
+    @SuppressWarnings("serial") // Superclass is not serializable across versions
     static class QuestionDialogBorder extends DialogBorder implements UIResource
     {
         protected Color getActiveBackground() {
             return UIManager.getColor("OptionPane.questionDialog.border.background");
         }

@@ -426,10 +432,11 @@
 
     /**
      * Border for a Warning Dialog.
      * @since 1.4
      */
+    @SuppressWarnings("serial") // Superclass is not serializable across versions
     static class WarningDialogBorder extends DialogBorder implements UIResource
     {
         protected Color getActiveBackground() {
             return UIManager.getColor("OptionPane.warningDialog.border.background");
         }

@@ -438,10 +445,11 @@
 
     /**
      * Border for a Palette.
      * @since 1.3
      */
+    @SuppressWarnings("serial") // Superclass is not serializable across versions
     public static class PaletteBorder extends AbstractBorder implements UIResource {
         int titleHeight = 0;
 
         public void paintBorder( Component c, Graphics g, int x, int y, int w, int h ) {
 

@@ -460,10 +468,11 @@
             newInsets.set(1, 1, 1, 1);
             return newInsets;
         }
     }
 
+    @SuppressWarnings("serial") // Superclass is not serializable across versions
     public static class OptionDialogBorder extends AbstractBorder implements UIResource {
         int titleHeight = 0;
 
         public void paintBorder( Component c, Graphics g, int x, int y, int w, int h ) {
 

@@ -521,11 +530,11 @@
             newInsets.set(3, 3, 3, 3);
             return newInsets;
         }
     }
 
-
+    @SuppressWarnings("serial") // Superclass is not serializable across versions
     public static class MenuBarBorder extends AbstractBorder implements UIResource {
         protected static Insets borderInsets = new Insets( 1, 0, 1, 0 );
 
         public void paintBorder( Component c, Graphics g, int x, int y, int w, int h ) {
             g.translate( x, y );

@@ -558,10 +567,11 @@
             }
             return newInsets;
         }
     }
 
+    @SuppressWarnings("serial") // Superclass is not serializable across versions
     public static class MenuItemBorder extends AbstractBorder implements UIResource {
         protected static Insets borderInsets = new Insets( 2, 2, 2, 2 );
 
         public void paintBorder( Component c, Graphics g, int x, int y, int w, int h ) {
             if (!(c instanceof JMenuItem)) {

@@ -605,10 +615,11 @@
             newInsets.set(2, 2, 2, 2);
             return newInsets;
         }
     }
 
+    @SuppressWarnings("serial") // Superclass is not serializable across versions
     public static class PopupMenuBorder extends AbstractBorder implements UIResource {
         protected static Insets borderInsets = new Insets( 3, 1, 2, 1 );
 
         public void paintBorder( Component c, Graphics g, int x, int y, int w, int h ) {
             g.translate( x, y );

@@ -629,11 +640,11 @@
             newInsets.set(3, 1, 2, 1);
             return newInsets;
         }
     }
 
-
+    @SuppressWarnings("serial") // Superclass is not serializable across versions
     public static class RolloverButtonBorder extends ButtonBorder {
 
         public void paintBorder( Component c, Graphics g, int x, int y, int w, int h ) {
             AbstractButton b = (AbstractButton) c;
             ButtonModel model = b.getModel();

@@ -650,10 +661,11 @@
      * if the margin has been explicitly set by the developer.
      *
      * Note: This is identical to the package private class
      * BasicBorders.RolloverMarginBorder and should probably be consolidated.
      */
+    @SuppressWarnings("serial") // Superclass is not serializable across versions
     static class RolloverMarginBorder extends EmptyBorder {
 
         public RolloverMarginBorder() {
             super(3,3,3,3); // hardcoded margin for JLF requirements.
         }

@@ -679,10 +691,11 @@
             }
             return insets;
         }
     }
 
+    @SuppressWarnings("serial") // Superclass is not serializable across versions
     public static class ToolBarBorder extends AbstractBorder implements UIResource, SwingConstants
     {
         protected MetalBumps bumps = new MetalBumps( 10, 10,
                                       MetalLookAndFeel.getControlHighlight(),
                                       MetalLookAndFeel.getControlDarkShadow(),

@@ -806,10 +819,11 @@
                                                    new BasicBorders.MarginBorder());
         }
         return textFieldBorder;
     }
 
+    @SuppressWarnings("serial") // Superclass is not serializable across versions
     public static class TextFieldBorder extends Flush3DBorder {
 
         public void paintBorder(Component c, Graphics g, int x, int y,
                                 int w, int h) {
 

@@ -830,10 +844,11 @@
             }
 
         }
     }
 
+    @SuppressWarnings("serial") // Superclass is not serializable across versions
     public static class ScrollPaneBorder extends AbstractBorder implements UIResource {
         public void paintBorder(Component c, Graphics g, int x, int y,
                           int w, int h) {
 
             if (!(c instanceof JScrollPane)) {

@@ -890,10 +905,11 @@
     }
 
     /**
      * @since 1.3
      */
+    @SuppressWarnings("serial") // Superclass is not serializable across versions
     public static class ToggleButtonBorder extends ButtonBorder {
         public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) {
             AbstractButton button = (AbstractButton)c;
             ButtonModel model = button.getModel();
             if (MetalLookAndFeel.usingOcean()) {

@@ -922,10 +938,11 @@
 
     /**
      * Border for a Table Header
      * @since 1.3
      */
+    @SuppressWarnings("serial") // Superclass is not serializable across versions
     public static class TableHeaderBorder extends javax.swing.border.AbstractBorder {
         protected Insets editorBorderInsets = new Insets( 2, 2, 2, 0 );
 
         public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) {
             g.translate( x, y );