jdk/src/share/classes/javax/swing/plaf/basic/BasicBorders.java
changeset 23697 e556a715949f
parent 23010 6dadb192ad81
child 25765 88051e6ecdc7
equal deleted inserted replaced
23696:7deff68428ef 23697:e556a715949f
     1 /*
     1 /*
     2  * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
   142 
   142 
   143     /**
   143     /**
   144      * Special thin border for rollover toolbar buttons.
   144      * Special thin border for rollover toolbar buttons.
   145      * @since 1.4
   145      * @since 1.4
   146      */
   146      */
       
   147     @SuppressWarnings("serial") // Superclass is not serializable across versions
   147     public static class RolloverButtonBorder extends ButtonBorder {
   148     public static class RolloverButtonBorder extends ButtonBorder {
   148 
   149 
   149         public RolloverButtonBorder(Color shadow, Color darkShadow,
   150         public RolloverButtonBorder(Color shadow, Color darkShadow,
   150                                   Color highlight, Color lightHighlight) {
   151                                   Color highlight, Color lightHighlight) {
   151             super(shadow, darkShadow, highlight, lightHighlight);
   152             super(shadow, darkShadow, highlight, lightHighlight);
   194      * if the margin has been explicitly set by the developer.
   195      * if the margin has been explicitly set by the developer.
   195      *
   196      *
   196      * Note: This is identical to the package private class
   197      * Note: This is identical to the package private class
   197      * MetalBorders.RolloverMarginBorder and should probably be consolidated.
   198      * MetalBorders.RolloverMarginBorder and should probably be consolidated.
   198      */
   199      */
       
   200     @SuppressWarnings("serial") // Superclass is not serializable across versions
   199     static class RolloverMarginBorder extends EmptyBorder {
   201     static class RolloverMarginBorder extends EmptyBorder {
   200 
   202 
   201         public RolloverMarginBorder() {
   203         public RolloverMarginBorder() {
   202             super(3,3,3,3); // hardcoded margin for JLF requirements.
   204             super(3,3,3,3); // hardcoded margin for JLF requirements.
   203         }
   205         }
   223             }
   225             }
   224             return insets;
   226             return insets;
   225         }
   227         }
   226     }
   228     }
   227 
   229 
       
   230     @SuppressWarnings("serial") // Superclass is not serializable across versions
   228    public static class ButtonBorder extends AbstractBorder implements UIResource {
   231    public static class ButtonBorder extends AbstractBorder implements UIResource {
   229         protected Color shadow;
   232         protected Color shadow;
   230         protected Color darkShadow;
   233         protected Color darkShadow;
   231         protected Color highlight;
   234         protected Color highlight;
   232         protected Color lightHighlight;
   235         protected Color lightHighlight;
   265             return insets;
   268             return insets;
   266         }
   269         }
   267 
   270 
   268     }
   271     }
   269 
   272 
       
   273     @SuppressWarnings("serial") // Superclass is not serializable across versions
   270     public static class ToggleButtonBorder extends ButtonBorder {
   274     public static class ToggleButtonBorder extends ButtonBorder {
   271 
   275 
   272         public ToggleButtonBorder(Color shadow, Color darkShadow,
   276         public ToggleButtonBorder(Color shadow, Color darkShadow,
   273                                   Color highlight, Color lightHighlight) {
   277                                   Color highlight, Color lightHighlight) {
   274             super(shadow, darkShadow, highlight, lightHighlight);
   278             super(shadow, darkShadow, highlight, lightHighlight);
   286             insets.set(2, 2, 2, 2);
   290             insets.set(2, 2, 2, 2);
   287             return insets;
   291             return insets;
   288         }
   292         }
   289     }
   293     }
   290 
   294 
       
   295     @SuppressWarnings("serial") // Superclass is not serializable across versions
   291     public static class RadioButtonBorder extends ButtonBorder {
   296     public static class RadioButtonBorder extends ButtonBorder {
   292 
   297 
   293         public RadioButtonBorder(Color shadow, Color darkShadow,
   298         public RadioButtonBorder(Color shadow, Color darkShadow,
   294                                  Color highlight, Color lightHighlight) {
   299                                  Color highlight, Color lightHighlight) {
   295             super(shadow, darkShadow, highlight, lightHighlight);
   300             super(shadow, darkShadow, highlight, lightHighlight);
   322             insets.set(2, 2, 2, 2);
   327             insets.set(2, 2, 2, 2);
   323             return insets;
   328             return insets;
   324         }
   329         }
   325     }
   330     }
   326 
   331 
       
   332     @SuppressWarnings("serial") // Superclass is not serializable across versions
   327     public static class MenuBarBorder extends AbstractBorder implements UIResource {
   333     public static class MenuBarBorder extends AbstractBorder implements UIResource {
   328         private Color shadow;
   334         private Color shadow;
   329         private Color highlight;
   335         private Color highlight;
   330 
   336 
   331         public MenuBarBorder(Color shadow, Color highlight) {
   337         public MenuBarBorder(Color shadow, Color highlight) {
   348             insets.set(0, 0, 2, 0);
   354             insets.set(0, 0, 2, 0);
   349             return insets;
   355             return insets;
   350         }
   356         }
   351     }
   357     }
   352 
   358 
       
   359     @SuppressWarnings("serial") // Superclass is not serializable across versions
   353     public static class MarginBorder extends AbstractBorder implements UIResource {
   360     public static class MarginBorder extends AbstractBorder implements UIResource {
   354         public Insets getBorderInsets(Component c, Insets insets)       {
   361         public Insets getBorderInsets(Component c, Insets insets)       {
   355             Insets margin = null;
   362             Insets margin = null;
   356             //
   363             //
   357             // Ideally we'd have an interface defined for classes which
   364             // Ideally we'd have an interface defined for classes which
   375 
   382 
   376            return insets;
   383            return insets;
   377         }
   384         }
   378     }
   385     }
   379 
   386 
       
   387     @SuppressWarnings("serial") // Superclass is not serializable across versions
   380     public static class FieldBorder extends AbstractBorder implements UIResource {
   388     public static class FieldBorder extends AbstractBorder implements UIResource {
   381         protected Color shadow;
   389         protected Color shadow;
   382         protected Color darkShadow;
   390         protected Color darkShadow;
   383         protected Color highlight;
   391         protected Color highlight;
   384         protected Color lightHighlight;
   392         protected Color lightHighlight;