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

Specification of BasicSplitPaneDivider::getMinimumSize,getPreferredSize doesn't match with its behavior.

    XMLWordPrintable

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P2
    • Resolution: Approved
    • Fix Version/s: 17
    • Component/s: client-libs
    • Labels:
      None
    • Subcomponent:
    • Compatibility Kind:
      behavioral
    • Compatibility Risk:
      minimal
    • Compatibility Risk Description:
      No behavior change - specification only so minimal risk
    • Interface Kind:
      Java API
    • Scope:
      SE

      Description

      Summary

      The current specification of

      api/java.desktop/javax/swing/plaf/basic/BasicSplitPaneDivider.html#getPreferredSize().

      and

      api/java.desktop/javax/swing/plaf/basic/BasicSplitPaneDivider.html#getMinimumSize()

      does not match with the current implementation.

      Problem

      api/java.desktop/javax/swing/plaf/basic/BasicSplitPaneDivider.html#getPreferredSize()

      and

      api/java.desktop/javax/swing/plaf/basic/BasicSplitPaneDivider.html#getMinimumSize() specifies that these methods returns dividerSize x dividerSize value but in reality it returns dividerSize x 1 or 1 x dividerSize depending on the splitpanedivider's orientation

      Solution

      Rectified the specification of these methods to specify correct returned values.

      Specification

           /**
      -     * Returns dividerSize x dividerSize
      +     * Returns the preferred size of the divider.
      +     * @implNote In current implementation,
      +     * if the splitpane is HORIZONTAL_SPLIT, the preferred size is obtained from
      +     * width of {@code getDividerSize} pixels and height of 1 pixel
      +     * If the splitpane is VERTICAL_SPLIT, the preferred size is obtained from
      +     * height of {@code getDividerSize} pixels and width of 1 pixel
      +     *
      +     * @return a {@code Dimension} object containing the preferred size of
      +     *         {@code BasicSplitPaneDivider}
            */
           public Dimension getPreferredSize() {
      
            /**
      -     * Returns dividerSize x dividerSize
      +     * Returns the minimum size of the divider.
      +     * @implNote In current implementation,
      +     * if the splitpane is HORIZONTAL_SPLIT, the minimum size is obtained from
      +     * width of {@code getDividerSize} pixels and height of 1 pixel
      +     * If the splitpane is VERTICAL_SPLIT, the minimum size is obtained from
      +     * height of {@code getDividerSize} pixels and width of 1 pixel
      +     *
      +     * @return a {@code Dimension} object containing the minimum size of
      +     *         {@code BasicSplitPaneDivider}
            */
           public Dimension getMinimumSize() {

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              psadhukhan Prasanta Sadhukhan
              Reporter:
              amadgundi Asha Madgundi
              Reviewed By:
              Alexander Zuev
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: