コード例 #1
0
  public void removeFromSelection(Set<Entity> selection) {

    if (tree == null) return;
    Array<Node> allSceneRootNodes = tree.getNodes().get(0).getChildren();

    for (int entityId : EntityUtils.getEntityId(selection)) {
      for (Node n : allSceneRootNodes) {
        if (n.getObject().equals(entityId)) {
          tree.getSelection().remove(n);
          break;
        }
      }
    }
  }
コード例 #2
0
  public void setSelection(Set<Entity> selection) {

    if (tree == null) return;
    tree.getSelection().clear();
    if (selection == null) return;
    addToSelection(selection);
  }
コード例 #3
0
 public void init(Entity rootScene) {
   treeTable.clear();
   tree = new VisTree();
   VisScrollPane scroller = new VisScrollPane(tree);
   scroller.setFlickScroll(false);
   treeTable.add(scroller).width(166).maxHeight(570);
   //
   Node root = addTreeRoot(rootScene, null);
   root.setExpanded(true);
   tree.addListener(new TreeChangeListener());
 }
コード例 #4
0
 private Node addTreeNode(Entity item, Node parentNode) {
   Node node = new Node(new VisLabel(parentNode == null ? "root" : getItemName(item)));
   MainItemComponent mainItemComponent = ComponentRetriever.get(item, MainItemComponent.class);
   node.setObject(mainItemComponent.uniqueId);
   if (parentNode != null) {
     parentNode.add(node);
   } else {
     tree.add(node);
   }
   return node;
 }