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

Provide official API so subclasses can override layout bounds computation

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P3 P3
    • tbd
    • 8u92
    • javafx

      A DESCRIPTION OF THE REQUEST :
      As javafx.scene.Node#layoutBoundsProperty() and the related getters are all final, overriding #impl_computeLayoutBounds() currently is the only possibility a client has to adjust the layout bounds computation. I would like to request a protected computeLayoutBounds() method as official API, so that clients would not have to rely on deprecated/internal hooks.

      JUSTIFICATION :
      As a legal use case please consider the GeometryNode implementation (http://git.eclipse.org/c/gef/org.eclipse.gef4.git/tree/org.eclipse.gef4.fx/src/org/eclipse/gef4/fx/nodes/GeometryNode.java) that is provided by the Eclipse Graphical Editing Framework. It delivers some sort of resizable shape, based on a Region.

      As it needs to guarantee that the values passed in to resize() are properly reflected within the layoutBounds (and the offset between geometric bounds and layout bounds cannot be properly computed because of lacking API) overriding super.impl_computeLayoutBounds() currently is the only chance to guarantee the resize contract. Through a protected computeLayoutBounds() method that use case could be handsomely realized.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Migrate impl_computeLayoutBounds() into computeLayoutBounds() and remove the deprecation flag.
      ACTUAL -
      impl_computeLayoutBounds() is deprecated and marked as internal.

      CUSTOMER SUBMITTED WORKAROUND :
      There is no workaround. As soon as impl_computeLayoutBounds() is removed, all use cases where clients would like to adjust the layout bounds computation, are no longer realizable.

            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: