当前位置: 首页>>代码示例>>Java>>正文


Java Tree.Node方法代码示例

本文整理汇总了Java中com.badlogic.gdx.scenes.scene2d.ui.Tree.Node方法的典型用法代码示例。如果您正苦于以下问题:Java Tree.Node方法的具体用法?Java Tree.Node怎么用?Java Tree.Node使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.badlogic.gdx.scenes.scene2d.ui.Tree的用法示例。


在下文中一共展示了Tree.Node方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addActor

import com.badlogic.gdx.scenes.scene2d.ui.Tree; //导入方法依赖的package包/类
@Override
public void addActor(ActorAddEvent event) {

    Actor actor = event.actor;
    StringBuilder item_name = new StringBuilder();
    item_name.append(actor.getName()==null?"":actor.getName());
    item_name.append("[");

    item_name.append(EditorManager.getInstance()
            .getActorType(actor).getSimpleName());
    item_name.append("]");
    Tree.Node item = createNodeItem(actor,item_name.toString());
    item.setIcon(new TextureRegionDrawable(new TextureRegion(new Texture(
            Gdx.files.internal("icon/Label_16.png")))));
    item.getActor().setTouchable(Touchable.disabled);
    if (actor.getParent() instanceof MainWindow){
        stageNode.add(item);
    }else {
        Tree.Node parentNode = stageNode.findNode(actor.getParent());
        if (parentNode!=null) parentNode.add(item);
    }
    tree.getSelection().choose(item);

}
 
开发者ID:whitecostume,项目名称:libgdx_ui_editor,代码行数:25,代码来源:TreeWindow.java

示例2: touchDown

import com.badlogic.gdx.scenes.scene2d.ui.Tree; //导入方法依赖的package包/类
@Override
public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {
    if (tree.getStage().hit(x, y, true) == tree && tree.getNodeAt(y) != null){
        tree.getClickListener().clicked(event,x,y);
        tree.getClickListener().cancel();
        Array<Actor> actors = new Array<>();
        for (Tree.Node node:tree.getSelection().items() ) {
            actors.add((Actor) node.getObject());
        }
        if (actors.size>0){
            EditorManager.getInstance().getEventBus().post(new TreeSelectedActroEvent(actors));
        }else {
            EditorManager.getInstance().getEventBus().post(new TreeCancelEvent());
        }

    }
    return false;
}
 
开发者ID:whitecostume,项目名称:libgdx_ui_editor,代码行数:19,代码来源:TreeWindow.java

示例3: fillNode

import com.badlogic.gdx.scenes.scene2d.ui.Tree; //导入方法依赖的package包/类
private void fillNode(Tree.Node node, String samplerId) {
	AbstractSampler sampler = loader.getSampler(samplerId);
	SamplerNode subNode = createNode(samplerId);
	if (subNode != null) {
		node.add(subNode);

		if (expansionMemory.containsKey(subNode.nodeId)) {
			subNode.setExpanded(expansionMemory.get(subNode.nodeId));
		}

		if (sampler.getConfig() instanceof AbstractSamplerContainerConfig) {
			AbstractSamplerContainerConfig c = (AbstractSamplerContainerConfig) sampler.getConfig();
			for (ChildSamplerConfig child : c.getChildSamplerConfigs()) {
				fillNode(subNode, child.samplerReferenceId);
			}
		}
	}

}
 
开发者ID:aphex-,项目名称:Opus-Prototype,代码行数:20,代码来源:ProjectWindow.java

示例4: addChild

import com.badlogic.gdx.scenes.scene2d.ui.Tree; //导入方法依赖的package包/类
/** @param child will be added to the actor casted to a Group or a Table. */
protected void addChild(final Actor child) {
    final Actor actor = getActor();
    if (actor instanceof Tree) {
        final Tree.Node node = LmlUtilities.getTreeNode(child);
        if (node != null) {
            ((Tree) actor).add(node);
        } else {
            ((Tree) actor).add(new Tree.Node(child));
        }
    } else if (actor instanceof Table) {
        LmlUtilities.getCell(child, (Table) actor);
    } else {
        ((Group) actor).addActor(child);
    }
}
 
开发者ID:czyzby,项目名称:gdx-lml,代码行数:17,代码来源:NewTagLmlMacroTag.java

示例5: handleDataBetweenTags

import com.badlogic.gdx.scenes.scene2d.ui.Tree; //导入方法依赖的package包/类
@Override
public final void handleDataBetweenTags(final CharSequence rawData) {
    if (Strings.isWhitespace(rawData)) {
        return;
    }
    final String[] lines = Strings.split(rawData, '\n');
    final Tree.Node node = LmlUtilities.getTreeNode(actor);
    if (node != null) {
        appendTreeNodes(lines, node);
        return;
    }
    for (String line : lines) {
        if (Strings.isNotWhitespace(line)) {
            line = line.trim();
            handlePlainTextLine(line);
        }
    }
}
 
开发者ID:czyzby,项目名称:gdx-lml,代码行数:19,代码来源:AbstractActorLmlTag.java

示例6: handleChild

import com.badlogic.gdx.scenes.scene2d.ui.Tree; //导入方法依赖的package包/类
@Override
public void handleChild(final LmlTag childTag) {
    if (childTag.isAttachable()) {
        // Child tag is an attachable object that can be appended to any widget, even if it is not prepared to
        // handle children. For example, tooltip tag can be nested inside a label and will be properly attached,
        // even though label wouldn't know how to handle a normal child, like a button or another label.
        if (actor != null) {
            childTag.attachTo(this);
        }
    } else if (childTag.getActor() != null) {
        final Tree.Node node = LmlUtilities.getTreeNode(actor);
        if (node != null) {
            // This actor is a tree node. Adding its child as a leaf.
            Tree.Node childNode = LmlUtilities.getTreeNode(childTag.getActor());
            if (childNode == null) {
                childNode = new Tree.Node(childTag.getActor());
            }
            node.add(childNode);
        } else {
            handleValidChild(childTag);
        }
    }
}
 
开发者ID:czyzby,项目名称:gdx-lml,代码行数:24,代码来源:AbstractActorLmlTag.java

示例7: createNodeItem

import com.badlogic.gdx.scenes.scene2d.ui.Tree; //导入方法依赖的package包/类
private Tree.Node createNodeItem(Object object, String title){
    VisLabel label = new VisLabel(title);

    Tree.Node node = new Tree.Node(label);
    node.setObject(object);
    return node;
}
 
开发者ID:whitecostume,项目名称:libgdx_ui_editor,代码行数:8,代码来源:TreeWindow.java

示例8: sureActor

import com.badlogic.gdx.scenes.scene2d.ui.Tree; //导入方法依赖的package包/类
@Override
public void sureActor(SureActorEvent sureActorEvent) {
    Tree.Node selectedNode = tree.findNode(sureActorEvent.actor);
    if (selectedNode !=null && !tree.getSelection().contains(selectedNode)){
        tree.getSelection().choose(selectedNode);
    }

}
 
开发者ID:whitecostume,项目名称:libgdx_ui_editor,代码行数:9,代码来源:TreeWindow.java

示例9: setActorName

import com.badlogic.gdx.scenes.scene2d.ui.Tree; //导入方法依赖的package包/类
@Override
public void setActorName(ActorNameEvent event) {
    Tree.Node item = tree.getSelection().getLastSelected();
    if (item!=null){
        Actor actor = (Actor) item.getObject();
        StringBuilder item_name = new StringBuilder();
        item_name.append(event.name);
        item_name.append("[");
        item_name.append(EditorManager.getInstance()
                .getActorType(actor).getSimpleName());
        item_name.append("]");
        ((Label)item.getActor()).setText(item_name.toString());
    }
}
 
开发者ID:whitecostume,项目名称:libgdx_ui_editor,代码行数:15,代码来源:TreeWindow.java

示例10: keyDel

import com.badlogic.gdx.scenes.scene2d.ui.Tree; //导入方法依赖的package包/类
@Override
public void keyDel(KeyDelEvent event) {
    if (tree.getSelection().size()>0){
        for (Tree.Node node : tree.getSelection().items()){
            if (node.getObject() instanceof Actor){
                ((Actor) node.getObject()).remove();
            }
            tree.remove(node);
        }
        tree.getSelection().clear();
    }
}
 
开发者ID:whitecostume,项目名称:libgdx_ui_editor,代码行数:13,代码来源:TreeWindow.java

示例11: visitData

import com.badlogic.gdx.scenes.scene2d.ui.Tree; //导入方法依赖的package包/类
@Override
public void visitData(Visitable<GDXComponentBuilder.AttributeWrapper> visitable, GDXComponentBuilder.AttributeWrapper data) {
    if(true) return;
    if(data.attr != null) {
        Object compObj = GDXComponentBuilder.instance().buildComponent(data.attr);
        if(compObj instanceof Actor) {
            Tree.Node node = new Tree.Node((Actor)compObj);
            this.node.add(node);
            float compWidth = tree.getWidth() - 192;
            ((Actor) compObj).setWidth(compWidth-30);
        }
    }
    cat = data.name+": "+data.path;
}
 
开发者ID:ncguy2,项目名称:Argent,代码行数:15,代码来源:GDXSetBuilderVisitor.java

示例12: memory

import com.badlogic.gdx.scenes.scene2d.ui.Tree; //导入方法依赖的package包/类
public void memory(Tree.Node node) {
	if (node instanceof SamplerNode) {
		SamplerNode sn = (SamplerNode) node;
		if (expansionMemory.containsKey(sn.nodeId)) {
			expansionMemory.remove(sn.nodeId);
		}
		expansionMemory.put(sn.nodeId, sn.isExpanded());
	}

	for (Tree.Node n : node.getChildren()) {
		memory(n);
	}
}
 
开发者ID:aphex-,项目名称:Opus-Prototype,代码行数:14,代码来源:ProjectWindow.java

示例13: loadTree

import com.badlogic.gdx.scenes.scene2d.ui.Tree; //导入方法依赖的package包/类
private void loadTree(Opus opus, Samplers loader) {
	if (tree.getNodes() != null) {
		for (Tree.Node n : tree.getNodes()) {
			memory(n);
		}
	}
	tree.clearChildren();
	for (Layer l : opus.getLayers()) {
		addLayer(l);
	}
	tree.pack();
	expansionMemory.clear();
	pack();
	Editor.post(new CommandLimitWindowSizes());
}
 
开发者ID:aphex-,项目名称:Opus-Prototype,代码行数:16,代码来源:ProjectWindow.java

示例14: addChild

import com.badlogic.gdx.scenes.scene2d.ui.Tree; //导入方法依赖的package包/类
private void addChild(final Actor child) {
    final Tree.Node node = LmlUtilities.getTreeNode(child);
    if (node != null) {
        getTree().add(node);
    } else {
        getTree().add(new Tree.Node(child));
    }
}
 
开发者ID:czyzby,项目名称:gdx-lml,代码行数:9,代码来源:TreeLmlTag.java

示例15: appendTreeNodes

import com.badlogic.gdx.scenes.scene2d.ui.Tree; //导入方法依赖的package包/类
private void appendTreeNodes(final String[] lines, final Tree.Node node) {
    for (String line : lines) {
        if (Strings.isNotWhitespace(line)) {
            line = line.trim();
            node.add(new Tree.Node(toLabel(line)));
        }
    }
}
 
开发者ID:czyzby,项目名称:gdx-lml,代码行数:9,代码来源:AbstractActorLmlTag.java


注:本文中的com.badlogic.gdx.scenes.scene2d.ui.Tree.Node方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。