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

Node.setTranslateX is final

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Fix
    • Icon: P4 P4
    • fx2.0
    • fx2.0
    • javafx
    • None

      The method setTranslateX is declared final. This means I cannot override the method to take special action when the position of my node changes. I have several places where a node needs to update itself when the user or my program moves it arround. For instance i have a node which has an anchor point which is centered on the screen. When the node is moved, I need to relocate the anchor point to ensure it is still centered on screen. One obvious way of doing this is by overriding setTranslateX as follows

      void setTranslateX(double x) {
        super(setTranslateX);
        //then do what is necessary
        //...
      }

      If there is no special reason why setTranslateX is final, I suggest declaring it non-final.

            rbair Richard Bair (Inactive)
            risaksen Randahl Isaksen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: