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

PaginationSkin navigation control improvements

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Open
    • Priority: P5
    • Resolution: Unresolved
    • Affects Version/s: 8u40
    • Fix Version/s: tbd
    • Component/s: javafx
    • Environment:

      All

      Description

      Hi there.
      There are two issues with the current pagination skin at
      http://hg.openjdk.java.net/openjfx/8u-dev/rt/file/3cc103a35bee/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/PaginationSkin.java

      First - The indicator buttons are being recreated every time the page set is changed, causing a noticable flicker of the control.
      To fix this, I modified the code so that the indicator button's page index and text is changed if the buttons were created before (and if the maximum amount of page indicators didn't change).

      Second - The current page set handling is very unintuitive. Instead of changing the set only when the start or end of the current set is reached, the currently selected button should always be kept in the center (unless it's near the start or end of the pages).
      I rewrote the changePageSet() method to achieve this behavior. The resource consumption outside of this method now is higher (because the page set is changed more frequently), but the first mentioned change makes up for that.

      I tested the changes with my local skin implementation (which is slightly different from the one linked above), but I only changed what's necessary so it should be fine.
      Link to the diff file:
      https://my.owndrive.com/public.php?service=files&t=b6540b7cc4111d318ca45b84ef151239

      Have fun,

      Addi

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            duke J. Duke (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Imported: