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

Group doc should clarify when onMousePressed etc are called

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: P4 P4
    • None
    • fx1.0
    • javafx

      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.

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

              Created:
              Updated:
              Resolved:
              Imported: