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

Request layout does not perform a 'complete' layout

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • P4
    • 8
    • 7u6
    • javafx
    • Win 7

    Description

      There are times when portions of the scene graph are not properly re-calculated on a layout request, leading to inaccurate and frustrating UI behavior. This occurs with dynamic changes to the scene graph, as when emulating Swing-style card layouts. For example, I have a TabPane, with a tab selected. I alter the scene graph of the selected tab content, by adding a new panel in my case. No matter where I request layout, even at the root, the size of the TabPane will not change to accommodate the changes in the graph, because computePrefWidth/Height is never called on the sub-tree. However, if I alter the width or height of the window in which the scene resides, everything re-computes and the layout adjusts correctly.

      The problem is I have no access within the API to whatever function initiated the 'complete' recalculation. I have requestLayout(), which does not exhibit the behavior I'm looking for. And I should not have to artificially adjust the window's dimensions in order to get that behavior (currently I expand the window by 1 pixel, and then shrink it back down in a runLater()). Either requestLayout() should be changed to actually do a full layout, or a parameter added allowing me to tell the system to do that, or the hierarchy properly set dirty when a node is added/set/removed, or a method added granting access to the complete layout... something.

      Attachments

        Activity

          People

            ekrejcir Eva Krejčířová (Inactive)
            dberkmanjfx David Berkman (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported: