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

Graphic property of TreeItem is still visible after collapsing tree

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: openjfx13
    • Fix Version/s: None
    • Component/s: javafx
    • Labels:
    • Subcomponent:
    • CPU:
      x86_64
    • OS:
      windows_10

      Description

      A DESCRIPTION OF THE PROBLEM :
      This issue is similar to JDK-8157398. Code sample is slightly different: more deep tree nesting.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      To reproduce just launch samle code and collapse root tree - you will see that child treeItem graphics are still visible.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      TreeItem graphics is invisible when parent item is collapsed.
      ACTUAL -
      TreeItem graphics is still visible.

      ---------- BEGIN SOURCE ----------
      import javafx.application.Application;
      import javafx.beans.property.ReadOnlyStringWrapper;
      import javafx.scene.Scene;
      import javafx.scene.control.TreeItem;
      import javafx.scene.control.TreeTableColumn;
      import javafx.scene.control.TreeTableView;
      import javafx.scene.layout.StackPane;
      import javafx.scene.shape.Circle;
      import javafx.scene.shape.Rectangle;
      import javafx.stage.Stage;

      public class JavaFXtestUI extends Application {
          public static void main(String[] args) {
              launch(args);
          }
           
          @Override
          public void start(Stage primaryStage) {
              TreeItem<String> treeItemRoot = new TreeItem<> ("Root", new Rectangle(10, 10));
              treeItemRoot.setExpanded(true);

              for (int i = 0; i < 5; i++) {
                  TreeItem<String> nodeItemA = new TreeItem<>("Item A", new Circle(10));

                  for (int j = 0; j < 5; j++) {
                      TreeItem<String> nodeItemB = new TreeItem<>("Item B", new Rectangle(10, 10));
                      nodeItemA.getChildren().add(nodeItemB);
                  }
                  treeItemRoot.getChildren().add(nodeItemA);
              }

              TreeTableView<String> treeView = new TreeTableView<>(treeItemRoot);
              TreeTableColumn<String, String> column = new TreeTableColumn<>("Column");
              column.setCellValueFactory(pTreeItem -> new ReadOnlyStringWrapper(pTreeItem.getValue().getValue()));
              treeView.getColumns().add(column);

              StackPane root = new StackPane();
              root.getChildren().add(treeView);
              Scene scene = new Scene(root, 300, 250);
               
              primaryStage.setScene(scene);
              primaryStage.show();
          }
      }
      ---------- END SOURCE ----------

      FREQUENCY : always


        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                aghaisas Ajit Ghaisas
                Reporter:
                webbuggrp Webbug Group
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: