Java Code Examples for com.badlogic.gdx.scenes.scene2d.utils.Selection

The following examples show how to use com.badlogic.gdx.scenes.scene2d.utils.Selection. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: talos   Source File: FilteredTree.java    License: Apache License 2.0 6 votes vote down vote up
public FilteredTree (TreeStyle style) {
    selection = new Selection<Node<T>>() {
        protected void changed () {
            switch (size()) {
                case 0:
                    rangeStart = null;
                    break;
                case 1:
                    rangeStart = first();
                    break;
            }
        }
    };
    selection.setActor(this);
    selection.setMultiple(false);
    selection.setToggle(true);
    setStyle(style);
    initialize();
}
 
Example 2
Source Project: bladecoder-adventure-engine   Source File: EditTree.java    License: Apache License 2.0 5 votes vote down vote up
public Array<Node> getSiblings() {
	Selection<Node> selection = tree.getSelection();
	Node nodeSel = selection.first();
	
	int level = nodeSel.getLevel();
	Array<Node> siblings = (level == 1) ? tree.getRootNodes(): nodeSel.getParent().getChildren(); 
	
	return siblings;
}
 
Example 3
Source Project: talos   Source File: FilteredTree.java    License: Apache License 2.0 4 votes vote down vote up
public Selection<Node<T>> getSelection () {
    return selection;
}