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

Complex TreeCell graphic not refreshing some controls when only clip is changed



    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Not an Issue
    • Affects Version/s: fx2.0.2
    • Fix Version/s: fx2.1
    • Component/s: javafx
    • Environment:

      Windows XP (JavaFX 2.0.1), Windows 7 (JavaFX 2.0.2)


      When a TreeCell uses a graphic where one of the components is a custom component that uses its clip to indicate its current state then this part of the cell is in some cases not properly refreshed. The same component works fine outside the TreeCell.

      Since this is rather hard to explain, I've attached a full working example where 3 trees are shown side-by-side, one of them bugged, and two of them working correctly with possible work-arounds. The example is a version of code at https://github.com/hjohn/MediaSystem stripped of everything that didn't seem relevant, although I'm sure it can be stripped down even further. See also this post: https://forums.oracle.com/forums/thread.jspa?threadID=2338943&tstart=0

      The buggy control in question is located in StarRating.java, and it has 3 modes, bugged mode, change opacity mode and listener mode. In the first mode it only attaches the proper binds to its rating property to influence the clip; in the second mode, it also binds the opacity property (to help the system detect that the graphic really changed); and in the third mode it adds 3 listeners to get the same effect.

      When running the example (run the main method in RefreshBug.java), you will see 3 trees. The left one is the bugged one. Each of these 3 has 4 items which are being refreshed in turn in spaces of 0.5 seconds. You will see that all trees refresh the Date properly (the year display changes into a date). But only the right 2 trees will also refresh the 5 stars to show the correct rating.

      This example runs in full screen mode. Note that after the fullscreen message disappears, a full refresh is triggered and after that the left tree will also display the correct star ratings.




            jgiles Jonathan Giles
            jhendrikx John Hendrikx
            0 Vote for this issue
            0 Start watching this issue