Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8264706

BevelBorderUIResource​(int, Color, Color) spec should mention that the passed colors are for highlightInner and shadowOuter props

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P3 P3
    • 17
    • client-libs
    • None
    • behavioral
    • minimal
    • No behavior change - specification only so minimal risk
    • Java API
    • SE

      Summary

      Make it clear in the specification of

       javax.swing.plaf.border.BorderUIResource.BevelBorderUIResource(int, Color, Color)
      

      and

       javax.swing.plaf.BevelBorderUIResource(int, Color, Color)
      

      the inner/outer highlight color and inner/outer shadow color is derived from same specified highlight and shadow color respectilvely.

      Problem

      The specification of

       javax.swing.plaf.border.BorderUIResource.BevelBorderUIResource(int, Color, Color)
      

      and

       javax.swing.plaf.BevelBorderUIResource(int, Color, Color)
      

      is not clear about the mapping between highlight color to inner/outer highlight color and shadow color to inner/outer shadow color.

      Solution

      Update the specification to clearly specify that inner/outer highlight color and inner/outer shadow color is derived from the specified highlight and shadow color.

      Specification

                 src/java.desktop/share/classes/javax/swing/border/BevelBorder.java
           /**
            * Creates a bevel border with the specified type, highlight and
            * shadow colors.
      +     * The bevel outer highlight color and bevel inner highlight color
      +     * will be derived from specified highlight color and
      +     * bevel outer shadow color and bevel inner shadow color
      +     * will be derived from specified shadow color.
            * @param bevelType the type of bevel for the border
            * @param highlight the color to use for the bevel highlight
            * @param shadow the color to use for the bevel shadow
            */
           public BevelBorder(int bevelType, Color highlight, Color shadow) {
      
      
                  src/java.desktop/share/classes/javax/swing/plaf/BorderUIResource.java
      
               /**
                * Constructs a {@code BevelBorderUIResource}.
      +         * The bevel outer highlight color and bevel inner highlight color
      +         * will be derived from specified highlight color and
      +         * bevel outer shadow color and bevel inner shadow color
      +         * will be derived from specified shadow color.
                * @param bevelType the type of bevel for the border
                * @param highlight the color to use for the bevel highlight
                * @param shadow the color to use for the bevel shadow
                */
               public BevelBorderUIResource(int bevelType, Color highlight, Color shadow) {

            psadhukhan Prasanta Sadhukhan
            dbessono Dmitry Bessonov
            Sergey Bylokhov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: