jdk/src/share/classes/java/awt/SystemColor.java
changeset 16734 da1901d79073
parent 12813 c10ab96dcf41
child 21957 97758de70fbd
equal deleted inserted replaced
16733:9267ec7004a1 16734:da1901d79073
     1 /*
     1 /*
     2  * Copyright (c) 1996, 2007, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1996, 2013, 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
    24  */
    24  */
    25 package java.awt;
    25 package java.awt;
    26 
    26 
    27 import java.io.ObjectStreamException;
    27 import java.io.ObjectStreamException;
    28 
    28 
    29 import javax.tools.annotation.GenerateNativeHeader;
    29 import java.lang.annotation.Native;
    30 
    30 
    31 /**
    31 /**
    32  * A class to encapsulate symbolic colors representing the color of
    32  * A class to encapsulate symbolic colors representing the color of
    33  * native GUI objects on a system.  For systems which support the dynamic
    33  * native GUI objects on a system.  For systems which support the dynamic
    34  * update of the system colors (when the user changes the colors)
    34  * update of the system colors (when the user changes the colors)
    47  * @see Toolkit#getDesktopProperty
    47  * @see Toolkit#getDesktopProperty
    48  *
    48  *
    49  * @author      Carl Quinn
    49  * @author      Carl Quinn
    50  * @author      Amy Fowler
    50  * @author      Amy Fowler
    51  */
    51  */
    52 /* No native methods here, but the constants are needed in the supporting JNI code */
       
    53 @GenerateNativeHeader
       
    54 public final class SystemColor extends Color implements java.io.Serializable {
    52 public final class SystemColor extends Color implements java.io.Serializable {
    55 
    53 
    56    /**
    54    /**
    57      * The array index for the
    55      * The array index for the
    58      * {@link #desktop} system color.
    56      * {@link #desktop} system color.
    59      * @see SystemColor#desktop
    57      * @see SystemColor#desktop
    60      */
    58      */
    61     public final static int DESKTOP = 0;
    59     @Native public final static int DESKTOP = 0;
    62 
    60 
    63     /**
    61     /**
    64      * The array index for the
    62      * The array index for the
    65      * {@link #activeCaption} system color.
    63      * {@link #activeCaption} system color.
    66      * @see SystemColor#activeCaption
    64      * @see SystemColor#activeCaption
    67      */
    65      */
    68     public final static int ACTIVE_CAPTION = 1;
    66     @Native public final static int ACTIVE_CAPTION = 1;
    69 
    67 
    70     /**
    68     /**
    71      * The array index for the
    69      * The array index for the
    72      * {@link #activeCaptionText} system color.
    70      * {@link #activeCaptionText} system color.
    73      * @see SystemColor#activeCaptionText
    71      * @see SystemColor#activeCaptionText
    74      */
    72      */
    75     public final static int ACTIVE_CAPTION_TEXT = 2;
    73     @Native public final static int ACTIVE_CAPTION_TEXT = 2;
    76 
    74 
    77     /**
    75     /**
    78      * The array index for the
    76      * The array index for the
    79      * {@link #activeCaptionBorder} system color.
    77      * {@link #activeCaptionBorder} system color.
    80      * @see SystemColor#activeCaptionBorder
    78      * @see SystemColor#activeCaptionBorder
    81      */
    79      */
    82     public final static int ACTIVE_CAPTION_BORDER = 3;
    80     @Native public final static int ACTIVE_CAPTION_BORDER = 3;
    83 
    81 
    84     /**
    82     /**
    85      * The array index for the
    83      * The array index for the
    86      * {@link #inactiveCaption} system color.
    84      * {@link #inactiveCaption} system color.
    87      * @see SystemColor#inactiveCaption
    85      * @see SystemColor#inactiveCaption
    88      */
    86      */
    89     public final static int INACTIVE_CAPTION = 4;
    87     @Native public final static int INACTIVE_CAPTION = 4;
    90 
    88 
    91     /**
    89     /**
    92      * The array index for the
    90      * The array index for the
    93      * {@link #inactiveCaptionText} system color.
    91      * {@link #inactiveCaptionText} system color.
    94      * @see SystemColor#inactiveCaptionText
    92      * @see SystemColor#inactiveCaptionText
    95      */
    93      */
    96     public final static int INACTIVE_CAPTION_TEXT = 5;
    94     @Native public final static int INACTIVE_CAPTION_TEXT = 5;
    97 
    95 
    98     /**
    96     /**
    99      * The array index for the
    97      * The array index for the
   100      * {@link #inactiveCaptionBorder} system color.
    98      * {@link #inactiveCaptionBorder} system color.
   101      * @see SystemColor#inactiveCaptionBorder
    99      * @see SystemColor#inactiveCaptionBorder
   102      */
   100      */
   103     public final static int INACTIVE_CAPTION_BORDER = 6;
   101     @Native public final static int INACTIVE_CAPTION_BORDER = 6;
   104 
   102 
   105     /**
   103     /**
   106      * The array index for the
   104      * The array index for the
   107      * {@link #window} system color.
   105      * {@link #window} system color.
   108      * @see SystemColor#window
   106      * @see SystemColor#window
   109      */
   107      */
   110     public final static int WINDOW = 7;
   108     @Native public final static int WINDOW = 7;
   111 
   109 
   112     /**
   110     /**
   113      * The array index for the
   111      * The array index for the
   114      * {@link #windowBorder} system color.
   112      * {@link #windowBorder} system color.
   115      * @see SystemColor#windowBorder
   113      * @see SystemColor#windowBorder
   116      */
   114      */
   117     public final static int WINDOW_BORDER = 8;
   115     @Native public final static int WINDOW_BORDER = 8;
   118 
   116 
   119     /**
   117     /**
   120      * The array index for the
   118      * The array index for the
   121      * {@link #windowText} system color.
   119      * {@link #windowText} system color.
   122      * @see SystemColor#windowText
   120      * @see SystemColor#windowText
   123      */
   121      */
   124     public final static int WINDOW_TEXT = 9;
   122     @Native public final static int WINDOW_TEXT = 9;
   125 
   123 
   126     /**
   124     /**
   127      * The array index for the
   125      * The array index for the
   128      * {@link #menu} system color.
   126      * {@link #menu} system color.
   129      * @see SystemColor#menu
   127      * @see SystemColor#menu
   130      */
   128      */
   131     public final static int MENU = 10;
   129     @Native public final static int MENU = 10;
   132 
   130 
   133     /**
   131     /**
   134      * The array index for the
   132      * The array index for the
   135      * {@link #menuText} system color.
   133      * {@link #menuText} system color.
   136      * @see SystemColor#menuText
   134      * @see SystemColor#menuText
   137      */
   135      */
   138     public final static int MENU_TEXT = 11;
   136     @Native public final static int MENU_TEXT = 11;
   139 
   137 
   140     /**
   138     /**
   141      * The array index for the
   139      * The array index for the
   142      * {@link #text} system color.
   140      * {@link #text} system color.
   143      * @see SystemColor#text
   141      * @see SystemColor#text
   144      */
   142      */
   145     public final static int TEXT = 12;
   143     @Native public final static int TEXT = 12;
   146 
   144 
   147     /**
   145     /**
   148      * The array index for the
   146      * The array index for the
   149      * {@link #textText} system color.
   147      * {@link #textText} system color.
   150      * @see SystemColor#textText
   148      * @see SystemColor#textText
   151      */
   149      */
   152     public final static int TEXT_TEXT = 13;
   150     @Native public final static int TEXT_TEXT = 13;
   153 
   151 
   154     /**
   152     /**
   155      * The array index for the
   153      * The array index for the
   156      * {@link #textHighlight} system color.
   154      * {@link #textHighlight} system color.
   157      * @see SystemColor#textHighlight
   155      * @see SystemColor#textHighlight
   158      */
   156      */
   159     public final static int TEXT_HIGHLIGHT = 14;
   157     @Native public final static int TEXT_HIGHLIGHT = 14;
   160 
   158 
   161     /**
   159     /**
   162      * The array index for the
   160      * The array index for the
   163      * {@link #textHighlightText} system color.
   161      * {@link #textHighlightText} system color.
   164      * @see SystemColor#textHighlightText
   162      * @see SystemColor#textHighlightText
   165      */
   163      */
   166     public final static int TEXT_HIGHLIGHT_TEXT = 15;
   164     @Native public final static int TEXT_HIGHLIGHT_TEXT = 15;
   167 
   165 
   168     /**
   166     /**
   169      * The array index for the
   167      * The array index for the
   170      * {@link #textInactiveText} system color.
   168      * {@link #textInactiveText} system color.
   171      * @see SystemColor#textInactiveText
   169      * @see SystemColor#textInactiveText
   172      */
   170      */
   173     public final static int TEXT_INACTIVE_TEXT = 16;
   171     @Native public final static int TEXT_INACTIVE_TEXT = 16;
   174 
   172 
   175     /**
   173     /**
   176      * The array index for the
   174      * The array index for the
   177      * {@link #control} system color.
   175      * {@link #control} system color.
   178      * @see SystemColor#control
   176      * @see SystemColor#control
   179      */
   177      */
   180     public final static int CONTROL = 17;
   178     @Native public final static int CONTROL = 17;
   181 
   179 
   182     /**
   180     /**
   183      * The array index for the
   181      * The array index for the
   184      * {@link #controlText} system color.
   182      * {@link #controlText} system color.
   185      * @see SystemColor#controlText
   183      * @see SystemColor#controlText
   186      */
   184      */
   187     public final static int CONTROL_TEXT = 18;
   185     @Native public final static int CONTROL_TEXT = 18;
   188 
   186 
   189     /**
   187     /**
   190      * The array index for the
   188      * The array index for the
   191      * {@link #controlHighlight} system color.
   189      * {@link #controlHighlight} system color.
   192      * @see SystemColor#controlHighlight
   190      * @see SystemColor#controlHighlight
   193      */
   191      */
   194     public final static int CONTROL_HIGHLIGHT = 19;
   192     @Native public final static int CONTROL_HIGHLIGHT = 19;
   195 
   193 
   196     /**
   194     /**
   197      * The array index for the
   195      * The array index for the
   198      * {@link #controlLtHighlight} system color.
   196      * {@link #controlLtHighlight} system color.
   199      * @see SystemColor#controlLtHighlight
   197      * @see SystemColor#controlLtHighlight
   200      */
   198      */
   201     public final static int CONTROL_LT_HIGHLIGHT = 20;
   199     @Native public final static int CONTROL_LT_HIGHLIGHT = 20;
   202 
   200 
   203     /**
   201     /**
   204      * The array index for the
   202      * The array index for the
   205      * {@link #controlShadow} system color.
   203      * {@link #controlShadow} system color.
   206      * @see SystemColor#controlShadow
   204      * @see SystemColor#controlShadow
   207      */
   205      */
   208     public final static int CONTROL_SHADOW = 21;
   206     @Native public final static int CONTROL_SHADOW = 21;
   209 
   207 
   210     /**
   208     /**
   211      * The array index for the
   209      * The array index for the
   212      * {@link #controlDkShadow} system color.
   210      * {@link #controlDkShadow} system color.
   213      * @see SystemColor#controlDkShadow
   211      * @see SystemColor#controlDkShadow
   214      */
   212      */
   215     public final static int CONTROL_DK_SHADOW = 22;
   213     @Native public final static int CONTROL_DK_SHADOW = 22;
   216 
   214 
   217     /**
   215     /**
   218      * The array index for the
   216      * The array index for the
   219      * {@link #scrollbar} system color.
   217      * {@link #scrollbar} system color.
   220      * @see SystemColor#scrollbar
   218      * @see SystemColor#scrollbar
   221      */
   219      */
   222     public final static int SCROLLBAR = 23;
   220     @Native public final static int SCROLLBAR = 23;
   223 
   221 
   224     /**
   222     /**
   225      * The array index for the
   223      * The array index for the
   226      * {@link #info} system color.
   224      * {@link #info} system color.
   227      * @see SystemColor#info
   225      * @see SystemColor#info
   228      */
   226      */
   229     public final static int INFO = 24;
   227     @Native public final static int INFO = 24;
   230 
   228 
   231     /**
   229     /**
   232      * The array index for the
   230      * The array index for the
   233      * {@link #infoText} system color.
   231      * {@link #infoText} system color.
   234      * @see SystemColor#infoText
   232      * @see SystemColor#infoText
   235      */
   233      */
   236     public final static int INFO_TEXT = 25;
   234     @Native public final static int INFO_TEXT = 25;
   237 
   235 
   238     /**
   236     /**
   239      * The number of system colors in the array.
   237      * The number of system colors in the array.
   240      */
   238      */
   241     public final static int NUM_COLORS = 26;
   239     @Native public final static int NUM_COLORS = 26;
   242 
   240 
   243     /******************************************************************************************/
   241     /******************************************************************************************/
   244 
   242 
   245     /*
   243     /*
   246      * System colors with default initial values, overwritten by toolkit if
   244      * System colors with default initial values, overwritten by toolkit if