< prev index next >

src/java.desktop/share/classes/javax/swing/plaf/metal/MetalLookAndFeel.java

Print this page




 278                "TabbedPaneUI", metalPackageName + "MetalTabbedPaneUI",
 279                 "TextFieldUI", metalPackageName + "MetalTextFieldUI",
 280              "ToggleButtonUI", metalPackageName + "MetalToggleButtonUI",
 281                   "ToolBarUI", metalPackageName + "MetalToolBarUI",
 282                   "ToolTipUI", metalPackageName + "MetalToolTipUI",
 283                      "TreeUI", metalPackageName + "MetalTreeUI",
 284                  "RootPaneUI", metalPackageName + "MetalRootPaneUI",
 285         };
 286 
 287         table.putDefaults(uiDefaults);
 288     }
 289 
 290     /**
 291      * Populates {@code table} with system colors. The following values are
 292      * added to {@code table}:
 293      *
 294      * <table class="striped">
 295      * <caption>Metal's system color mapping</caption>
 296      * <thead>
 297      *  <tr>
 298      *    <th>Key
 299      *    <th>Value
 300      * </thead>
 301      * <tbody>
 302      *  <tr valign="top" style="text-align:left">
 303      *    <td>"desktop"
 304      *    <td>{@code theme.getDesktopColor()}
 305      *  <tr valign="top" style="text-align:left">
 306      *    <td>"activeCaption"
 307      *    <td>{@code theme.getWindowTitleBackground()}
 308      *  <tr valign="top" style="text-align:left">
 309      *    <td>"activeCaptionText"
 310      *    <td>{@code theme.getWindowTitleForeground()}
 311      *  <tr valign="top" style="text-align:left">
 312      *    <td>"activeCaptionBorder"
 313      *    <td>{@code theme.getPrimaryControlShadow()}
 314      *  <tr valign="top" style="text-align:left">
 315      *    <td>"inactiveCaption"
 316      *    <td>{@code theme.getWindowTitleInactiveBackground()}
 317      *  <tr valign="top" style="text-align:left">
 318      *    <td>"inactiveCaptionText"
 319      *    <td>{@code theme.getWindowTitleInactiveForeground()}
 320      *  <tr valign="top" style="text-align:left">
 321      *    <td>"inactiveCaptionBorder"
 322      *    <td>{@code theme.getControlShadow()}
 323      *  <tr valign="top" style="text-align:left">
 324      *    <td>"window"
 325      *    <td>{@code theme.getWindowBackground()}
 326      *  <tr valign="top" style="text-align:left">
 327      *    <td>"windowBorder"
 328      *    <td>{@code theme.getControl()}
 329      *  <tr valign="top" style="text-align:left">
 330      *    <td>"windowText"
 331      *    <td>{@code theme.getUserTextColor()}
 332      *  <tr valign="top" style="text-align:left">
 333      *    <td>"menu"
 334      *    <td>{@code theme.getMenuBackground()}
 335      *  <tr valign="top" style="text-align:left">
 336      *    <td>"menuText"
 337      *    <td>{@code theme.getMenuForeground()}
 338      *  <tr valign="top" style="text-align:left">
 339      *    <td>"text"
 340      *    <td>{@code theme.getWindowBackground()}
 341      *  <tr valign="top" style="text-align:left">
 342      *    <td>"textText"
 343      *    <td>{@code theme.getUserTextColor()}
 344      *  <tr valign="top" style="text-align:left">
 345      *    <td>"textHighlight"
 346      *    <td>{@code theme.getTextHighlightColor()}
 347      *  <tr valign="top" style="text-align:left">
 348      *    <td>"textHighlightText"
 349      *    <td>{@code theme.getHighlightedTextColor()}
 350      *  <tr valign="top" style="text-align:left">
 351      *    <td>"textInactiveText"
 352      *    <td>{@code theme.getInactiveSystemTextColor()}
 353      *  <tr valign="top" style="text-align:left">
 354      *    <td>"control"
 355      *    <td>{@code theme.getControl()}
 356      *  <tr valign="top" style="text-align:left">
 357      *    <td>"controlText"
 358      *    <td>{@code theme.getControlTextColor()}
 359      *  <tr valign="top" style="text-align:left">
 360      *    <td>"controlHighlight"
 361      *    <td>{@code theme.getControlHighlight()}
 362      *  <tr valign="top" style="text-align:left">
 363      *    <td>"controlLtHighlight"
 364      *    <td>{@code theme.getControlHighlight()}
 365      *  <tr valign="top" style="text-align:left">
 366      *    <td>"controlShadow"
 367      *    <td>{@code theme.getControlShadow()}
 368      *  <tr valign="top" style="text-align:left">
 369      *    <td>"controlDkShadow"
 370      *    <td>{@code theme.getControlDarkShadow()}
 371      *  <tr valign="top" style="text-align:left">
 372      *    <td>"scrollbar"
 373      *    <td>{@code theme.getControl()}
 374      *  <tr valign="top" style="text-align:left">
 375      *    <td>"info"
 376      *    <td>{@code theme.getPrimaryControl()}
 377      *  <tr valign="top" style="text-align:left">
 378      *    <td>"infoText"
 379      *    <td>{@code theme.getPrimaryControlInfo()}
 380      * </tbody>
 381      * </table>
 382      * The value {@code theme} corresponds to the current {@code MetalTheme}.
 383      *
 384      * @param table the {@code UIDefaults} object the values are added to
 385      * @throws NullPointerException if {@code table} is {@code null}
 386      */
 387     protected void initSystemColorDefaults(UIDefaults table)
 388     {
 389         MetalTheme theme = getCurrentTheme();
 390         Color control = theme.getControl();
 391         Object[] systemColors = {
 392                 "desktop", theme.getDesktopColor(), /* Color of the desktop background */
 393           "activeCaption", theme.getWindowTitleBackground(), /* Color for captions (title bars) when they are active. */
 394       "activeCaptionText", theme.getWindowTitleForeground(), /* Text color for text in captions (title bars). */
 395     "activeCaptionBorder", theme.getPrimaryControlShadow(), /* Border color for caption (title bar) window borders. */
 396         "inactiveCaption", theme.getWindowTitleInactiveBackground(), /* Color for captions (title bars) when not active. */
 397     "inactiveCaptionText", theme.getWindowTitleInactiveForeground(), /* Text color for text in inactive captions (title bars). */
 398   "inactiveCaptionBorder", theme.getControlShadow(), /* Border color for inactive caption (title bar) window borders. */




 278                "TabbedPaneUI", metalPackageName + "MetalTabbedPaneUI",
 279                 "TextFieldUI", metalPackageName + "MetalTextFieldUI",
 280              "ToggleButtonUI", metalPackageName + "MetalToggleButtonUI",
 281                   "ToolBarUI", metalPackageName + "MetalToolBarUI",
 282                   "ToolTipUI", metalPackageName + "MetalToolTipUI",
 283                      "TreeUI", metalPackageName + "MetalTreeUI",
 284                  "RootPaneUI", metalPackageName + "MetalRootPaneUI",
 285         };
 286 
 287         table.putDefaults(uiDefaults);
 288     }
 289 
 290     /**
 291      * Populates {@code table} with system colors. The following values are
 292      * added to {@code table}:
 293      *
 294      * <table class="striped">
 295      * <caption>Metal's system color mapping</caption>
 296      * <thead>
 297      *  <tr>
 298      *    <th scope="col">Key
 299      *    <th scope="col">Value
 300      * </thead>
 301      * <tbody>
 302      *  <tr>
 303      *    <th scope="row">"desktop"
 304      *    <td>{@code theme.getDesktopColor()}
 305      *  <tr>
 306      *    <th scope="row">"activeCaption"
 307      *    <td>{@code theme.getWindowTitleBackground()}
 308      *  <tr>
 309      *    <th scope="row">"activeCaptionText"
 310      *    <td>{@code theme.getWindowTitleForeground()}
 311      *  <tr>
 312      *    <th scope="row">"activeCaptionBorder"
 313      *    <td>{@code theme.getPrimaryControlShadow()}
 314      *  <tr>
 315      *    <th scope="row">"inactiveCaption"
 316      *    <td>{@code theme.getWindowTitleInactiveBackground()}
 317      *  <tr>
 318      *    <th scope="row">"inactiveCaptionText"
 319      *    <td>{@code theme.getWindowTitleInactiveForeground()}
 320      *  <tr>
 321      *    <th scope="row">"inactiveCaptionBorder"
 322      *    <td>{@code theme.getControlShadow()}
 323      *  <tr>
 324      *    <th scope="row">"window"
 325      *    <td>{@code theme.getWindowBackground()}
 326      *  <tr>
 327      *    <th scope="row">"windowBorder"
 328      *    <td>{@code theme.getControl()}
 329      *  <tr>
 330      *    <th scope="row">"windowText"
 331      *    <td>{@code theme.getUserTextColor()}
 332      *  <tr>
 333      *    <th scope="row">"menu"
 334      *    <td>{@code theme.getMenuBackground()}
 335      *  <tr>
 336      *    <th scope="row">"menuText"
 337      *    <td>{@code theme.getMenuForeground()}
 338      *  <tr>
 339      *    <th scope="row">"text"
 340      *    <td>{@code theme.getWindowBackground()}
 341      *  <tr>
 342      *    <th scope="row">"textText"
 343      *    <td>{@code theme.getUserTextColor()}
 344      *  <tr>
 345      *    <th scope="row">"textHighlight"
 346      *    <td>{@code theme.getTextHighlightColor()}
 347      *  <tr>
 348      *    <th scope="row">"textHighlightText"
 349      *    <td>{@code theme.getHighlightedTextColor()}
 350      *  <tr>
 351      *    <th scope="row">"textInactiveText"
 352      *    <td>{@code theme.getInactiveSystemTextColor()}
 353      *  <tr>
 354      *    <th scope="row">"control"
 355      *    <td>{@code theme.getControl()}
 356      *  <tr>
 357      *    <th scope="row">"controlText"
 358      *    <td>{@code theme.getControlTextColor()}
 359      *  <tr>
 360      *    <th scope="row">"controlHighlight"
 361      *    <td>{@code theme.getControlHighlight()}
 362      *  <tr>
 363      *    <th scope="row">"controlLtHighlight"
 364      *    <td>{@code theme.getControlHighlight()}
 365      *  <tr>
 366      *    <th scope="row">"controlShadow"
 367      *    <td>{@code theme.getControlShadow()}
 368      *  <tr>
 369      *    <th scope="row">"controlDkShadow"
 370      *    <td>{@code theme.getControlDarkShadow()}
 371      *  <tr>
 372      *    <th scope="row">"scrollbar"
 373      *    <td>{@code theme.getControl()}
 374      *  <tr>
 375      *    <th scope="row">"info"
 376      *    <td>{@code theme.getPrimaryControl()}
 377      *  <tr>
 378      *    <th scope="row">"infoText"
 379      *    <td>{@code theme.getPrimaryControlInfo()}
 380      * </tbody>
 381      * </table>
 382      * The value {@code theme} corresponds to the current {@code MetalTheme}.
 383      *
 384      * @param table the {@code UIDefaults} object the values are added to
 385      * @throws NullPointerException if {@code table} is {@code null}
 386      */
 387     protected void initSystemColorDefaults(UIDefaults table)
 388     {
 389         MetalTheme theme = getCurrentTheme();
 390         Color control = theme.getControl();
 391         Object[] systemColors = {
 392                 "desktop", theme.getDesktopColor(), /* Color of the desktop background */
 393           "activeCaption", theme.getWindowTitleBackground(), /* Color for captions (title bars) when they are active. */
 394       "activeCaptionText", theme.getWindowTitleForeground(), /* Text color for text in captions (title bars). */
 395     "activeCaptionBorder", theme.getPrimaryControlShadow(), /* Border color for caption (title bar) window borders. */
 396         "inactiveCaption", theme.getWindowTitleInactiveBackground(), /* Color for captions (title bars) when not active. */
 397     "inactiveCaptionText", theme.getWindowTitleInactiveForeground(), /* Text color for text in inactive captions (title bars). */
 398   "inactiveCaptionBorder", theme.getControlShadow(), /* Border color for inactive caption (title bar) window borders. */


< prev index next >