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

Group doc should clarify when onMousePressed etc are called

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Won't Fix
    • Affects Version/s: fx1.0
    • Fix Version/s: None
    • Component/s: javafx
    • Labels:

      Description

      The attached program creates a Group that is a 60 x 60 array of Rectangles. The Rectangles are 10 x 10, and are 5 apart with a margin of 5 on top, bottom, left, and right.

      The layoutBounds of the Group are
          minX = 5, minY = 5, maxX =900, maxY = 900

      Regarding onMousePressed (et. al.), the doc says
           Defines a function to be called when a mouse button is pressed on this Node.

      The question is, what does 'on this Node' mean?
      - On the one hand, that could mean if a button is pressed within the above bounds. In this case, onMousePressed should be called
        if a button is pressed anywhere in the above bounds.

      - On the other hand, the Group doc also says
            A Group will take on the collective bounds of its children
        which sounds like it means that the bounds of a group is actually a sequence of the bounds of its children.
        This could mean that onMousePressed is only called if the location is inside the bounds of a child.

      The latter is what happens. I think the doc should be clarified.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              jholmlundjfx Jim Holmlund (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported: