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

Need an easier way for the given FX scenegraph node to un parent

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P3
    • Resolution: Won't Fix
    • Affects Version/s: fx1.2
    • Fix Version/s: fx2.0
    • Component/s: javafx
    • Labels:

      Description

      I usually try to un-parent before duplicating a scenegraph node in order to use it under other branch. An example would be:
      Note that fxsampleUI is a NB generated out of the "fasample.fxz" file.

      var scene = Scene{}
      var fxsample:fxsampleUI = fxsampleUI{}

      if(fxsample.background.parent instanceof Group) {
         delete fxsample.background from (fxsample.background.parent as Group).content;
         scene.content = fxsample.background;
      } else {
         scene.content = Duplicator.duplicate(fxsample.background);
      }

      This doesn't give good user experience. Unparenting is cumbersome whenever I want to use a node. So we need an easier way.
      If it can be completely automatic, that will be ideal. If this is not a good idea, could we add an "unparent()" function to Node.fx?

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                janvalenta Jan Valenta (Inactive)
                Reporter:
                bkimsunw Bae-chul Kim (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported: