Exemplo n.º 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;
        }
      }
    }
  }
Exemplo n.º 2
0
  public void setSelection(Set<Entity> selection) {

    if (tree == null) return;
    tree.getSelection().clear();
    if (selection == null) return;
    addToSelection(selection);
  }
Exemplo n.º 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());
 }
Exemplo n.º 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;
 }