jdk/src/share/classes/javax/swing/plaf/metal/MetalRadioButtonUI.java
changeset 25178 dbab904451e9
parent 22574 7f8ce0c8c20a
equal deleted inserted replaced
25177:487a5e71f6dd 25178:dbab904451e9
    56 @SuppressWarnings("serial") // Same-version serialization only
    56 @SuppressWarnings("serial") // Same-version serialization only
    57 public class MetalRadioButtonUI extends BasicRadioButtonUI {
    57 public class MetalRadioButtonUI extends BasicRadioButtonUI {
    58 
    58 
    59     private static final Object METAL_RADIO_BUTTON_UI_KEY = new Object();
    59     private static final Object METAL_RADIO_BUTTON_UI_KEY = new Object();
    60 
    60 
       
    61     /**
       
    62      * The color of the focused radio button.
       
    63      */
    61     protected Color focusColor;
    64     protected Color focusColor;
       
    65 
       
    66     /**
       
    67      * The color of the selected radio button.
       
    68      */
    62     protected Color selectColor;
    69     protected Color selectColor;
       
    70 
       
    71     /**
       
    72      * The color of a disabled text.
       
    73      */
    63     protected Color disabledTextColor;
    74     protected Color disabledTextColor;
    64 
    75 
    65     private boolean defaults_initialized = false;
    76     private boolean defaults_initialized = false;
    66 
    77 
    67     // ********************************
    78     // ********************************
    68     //        Create PlAF
    79     //        Create PlAF
    69     // ********************************
    80     // ********************************
       
    81 
       
    82     /**
       
    83      * Returns an instance of {@code MetalRadioButtonUI}.
       
    84      *
       
    85      * @param c a component
       
    86      * @return an instance of {@code MetalRadioButtonUI}
       
    87      */
    70     public static ComponentUI createUI(JComponent c) {
    88     public static ComponentUI createUI(JComponent c) {
    71         AppContext appContext = AppContext.getAppContext();
    89         AppContext appContext = AppContext.getAppContext();
    72         MetalRadioButtonUI metalRadioButtonUI =
    90         MetalRadioButtonUI metalRadioButtonUI =
    73                 (MetalRadioButtonUI) appContext.get(METAL_RADIO_BUTTON_UI_KEY);
    91                 (MetalRadioButtonUI) appContext.get(METAL_RADIO_BUTTON_UI_KEY);
    74         if (metalRadioButtonUI == null) {
    92         if (metalRadioButtonUI == null) {
    98     }
   116     }
    99 
   117 
   100     // ********************************
   118     // ********************************
   101     //         Default Accessors
   119     //         Default Accessors
   102     // ********************************
   120     // ********************************
       
   121 
       
   122     /**
       
   123      * Returns the color of the selected {@code JRadioButton}.
       
   124      *
       
   125      * @return the color of the selected {@code JRadioButton}
       
   126      */
   103     protected Color getSelectColor() {
   127     protected Color getSelectColor() {
   104         return selectColor;
   128         return selectColor;
   105     }
   129     }
   106 
   130 
       
   131     /**
       
   132      * Returns the color of the disabled text.
       
   133      *
       
   134      * @return the color of the disabled text
       
   135      */
   107     protected Color getDisabledTextColor() {
   136     protected Color getDisabledTextColor() {
   108         return disabledTextColor;
   137         return disabledTextColor;
   109     }
   138     }
   110 
   139 
       
   140     /**
       
   141      * Returns the color of the focused {@code JRadioButton}.
       
   142      *
       
   143      * @return the color of the focused {@code JRadioButton}
       
   144      */
   111     protected Color getFocusColor() {
   145     protected Color getFocusColor() {
   112         return focusColor;
   146         return focusColor;
   113     }
   147     }
   114 
   148 
   115 
   149