本文整理汇总了Java中com.kotcrab.vis.ui.widget.VisTree类的典型用法代码示例。如果您正苦于以下问题:Java VisTree类的具体用法?Java VisTree怎么用?Java VisTree使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
VisTree类属于com.kotcrab.vis.ui.widget包,在下文中一共展示了VisTree类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addVisWidgets
import com.kotcrab.vis.ui.widget.VisTree; //导入依赖的package包/类
private void addVisWidgets () {
VisTree tree = new VisTree();
Node item1 = new Node(new VisLabel("item 1"));
Node item2 = new Node(new VisLabel("item 2"));
Node item3 = new Node(new VisLabel("item 3"));
item1.add(new Node(new VisLabel("item 1.1")));
item1.add(new Node(new VisLabel("item 1.2")));
item1.add(new Node(new VisLabel("item 1.3")));
item2.add(new Node(new VisLabel("item 2.1")));
item2.add(new Node(new VisLabel("item 2.2")));
item2.add(new Node(new VisLabel("item 2.3")));
item3.add(new Node(new VisLabel("item 3.1")));
item3.add(new Node(new VisLabel("item 3.2")));
item3.add(new Node(new VisLabel("item 3.3")));
item1.setExpanded(true);
tree.add(item1);
tree.add(item2);
tree.add(item3);
add(tree).expand().fill();
}
示例2: getNewInstanceOfActor
import com.kotcrab.vis.ui.widget.VisTree; //导入依赖的package包/类
@Override
protected Actor getNewInstanceOfActor(final LmlActorBuilder builder) {
return new VisTree(builder.getStyleName());
}
示例3: SceneOutline
import com.kotcrab.vis.ui.widget.VisTree; //导入依赖的package包/类
public SceneOutline (SceneModuleContainer sceneMC) {
super(true);
sceneMC.injectModules(this);
scene = sceneMC.getScene();
proxyCache.addListener(this);
tree = new VisTree();
tree.getSelection().setMultiple(true);
tree.getSelection().setRequired(false);
tree.getSelection().setProgrammaticChangeEvents(false);
tree.addListener(new ClickListener() {
Node selection;
@Override
public void clicked (InputEvent event, float x, float y) {
//tree will deselect item after double click so we on first click store selection
if (getTapCount() == 1 && tree.getSelection().size() == 1) {
selection = tree.getSelection().getLastSelected();
}
if (getTapCount() == 2 && selection != null) {
if (selection instanceof ProxyNode) {
sceneMC.getSceneTab().centerAround(((ProxyNode) selection).proxy);
}
if (selection instanceof GroupNode) {
GroupNode groupNode = (GroupNode) selection;
sceneMC.getSceneTab().centerAroundGroup(groupNode.layerId, groupNode.groupId);
}
selection = null;
}
}
});
setBackground(VisUI.getSkin().getDrawable("window-bg"));
setTouchable(Touchable.enabled);
add(new VisLabel("Outline", Align.center)).expandX().fillX().top().spaceBottom(0).row();
VisScrollPane scrollPane = new VisScrollPane(tree);
scrollPane.setFadeScrollBars(false);
add(scrollPane).expand().fill();
pack();
rebuildOutline(); //do first update
}