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

Can not lookup node in CustomNode scene graph

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • None
    • fx1.2.1
    • javafx
    • None

      The code sample underneath demonstrates the issue. Subnodes of a CustomNode can not be looked up.

      --------------------------------------------------------------------------------------------------------------------
      Product Version: NetBeans IDE 6.8 (Build 200912041610)
      Java: 1.6.0_17; Java HotSpot(TM) 64-Bit Server VM 14.3-b01
      System: Linux version 2.6.31-16-generic running on amd64; UTF-8; en_US (nb)
      --------------------------------------------------------------------------------------------------------------------

      import javafx.scene.CustomNode;
      import javafx.scene.Node;
      import javafx.scene.text.Text;
      import javafx.scene.Group;

      class Test extends CustomNode {

          def one = Text {
              id: "one"
          }

          def two = Text {
              id: "two"
          }

          def three = Text {
              id: "three"
          }


          def group = Group {
              content: [ one, two, three ]
          }

          override protected function create () : Node {
              group;
          }
      }

      def node = Test{};

      // returns null
      def lu = node.lookup("two");

      println("Looked up object {lu}");

            kcr Kevin Rushforth
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: