本文整理汇总了Java中com.jme3.gde.core.sceneexplorer.nodes.AbstractSceneExplorerNode类的典型用法代码示例。如果您正苦于以下问题:Java AbstractSceneExplorerNode类的具体用法?Java AbstractSceneExplorerNode怎么用?Java AbstractSceneExplorerNode使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AbstractSceneExplorerNode类属于com.jme3.gde.core.sceneexplorer.nodes包,在下文中一共展示了AbstractSceneExplorerNode类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: select
import com.jme3.gde.core.sceneexplorer.nodes.AbstractSceneExplorerNode; //导入依赖的package包/类
private boolean select(AbstractSceneExplorerNode node) {
if (editorController != null) {
editorController.setSelectedExplorerNode(node);
}
if (node instanceof JmeSpatial) {
selectSpatial(((JmeSpatial) node).getLookup().lookup(Spatial.class));
SceneViewerTopComponent.findInstance().setActivatedNodes(new org.openide.nodes.Node[]{node});
SceneExplorerTopComponent.findInstance().setSelectedNode(node);
return true;
} else if (toolController != null) {
Spatial selectedGizmo = toolController.getMarker(node);
if (selectedGizmo != null) {
selectSpatial(selectedGizmo);
SceneViewerTopComponent.findInstance().setActivatedNodes(new org.openide.nodes.Node[]{node});
SceneExplorerTopComponent.findInstance().setSelectedNode(node);
return true;
}
}
return false;
}
示例2: actionSecondary
import com.jme3.gde.core.sceneexplorer.nodes.AbstractSceneExplorerNode; //导入依赖的package包/类
@Override
public void actionSecondary(Vector3f point, int textureIndex, AbstractSceneExplorerNode rootNode, DataObject dataObject) {
if (leftCtrl) {
point2 = new Vector3f(point);
if (markerThird.getParent() == null)
parent.attachChild(markerThird);
markerThird.setLocalTranslation(point);
} else {
point1 = new Vector3f(point);
if (markerSecondary.getParent() == null)
parent.attachChild(markerSecondary);
markerSecondary.setLocalTranslation(point);
}
if (point1 != null && point2 != null)
updateAngle();
else
if (line != null)
line.removeFromParent();
}
示例3: resultChanged
import com.jme3.gde.core.sceneexplorer.nodes.AbstractSceneExplorerNode; //导入依赖的package包/类
public void resultChanged(LookupEvent ev) {
Collection collection = nodeSelectionResult.allInstances();
for (Iterator it = collection.iterator(); it.hasNext();) {
Object obj = it.next();
if (obj instanceof AbstractSceneExplorerNode) {
AbstractSceneExplorerNode node = (AbstractSceneExplorerNode) obj;
if (node != null) {
if (selectedNode != null) {
selectedNode = null;
}
selectedNode = node;
return;
}
}
}
if (selectedNode != null) {
selectedNode = null;
}
}
示例4: doApplyTool
import com.jme3.gde.core.sceneexplorer.nodes.AbstractSceneExplorerNode; //导入依赖的package包/类
@Override
protected Object doApplyTool(AbstractSceneExplorerNode rootNode, Object settings) {
if (settings == null) {
return null;
}
WizardDescriptor wiz = (WizardDescriptor)settings;
AtlasResolution res = (AtlasResolution)wiz.getProperty("size");
Node parent = rootNode.getLookup().lookup(Node.class);
AssetManager mgr = rootNode.getLookup().lookup(ProjectAssetManager.class);
if (parent == null || mgr == null) {
return null;
}
Geometry batch = TextureAtlas.makeAtlasBatch(parent, mgr, res.resX);
batch.setName(parent.getName() + " - batched");
List<Spatial> currentChildren = new ArrayList<Spatial>();
if (parent != null && batch != null) {
currentChildren.addAll(parent.getChildren());
parent.detachAllChildren();
parent.attachChild(batch);
}
return new OldNew(batch, currentChildren);
}
示例5: doUndoTool
import com.jme3.gde.core.sceneexplorer.nodes.AbstractSceneExplorerNode; //导入依赖的package包/类
@Override
protected void doUndoTool(AbstractSceneExplorerNode rootNode, Object undoObject) {
if (undoObject == null) {
return;
}
Node parent = rootNode.getLookup().lookup(Node.class);
OldNew undo = (OldNew) undoObject;
if (parent == null || undo == null) {
return;
}
parent.detachChild(undo.newSpat);
for (Iterator<Spatial> it = undo.oldChildren.iterator(); it.hasNext();) {
Spatial spatial = it.next();
parent.attachChild(spatial);
}
}
示例6: doApplyTool
import com.jme3.gde.core.sceneexplorer.nodes.AbstractSceneExplorerNode; //导入依赖的package包/类
@Override
protected Object doApplyTool(AbstractSceneExplorerNode rootNode, Object settings) {
WizardDescriptor wiz = (WizardDescriptor)settings;
Geometry geom = rootNode.getLookup().lookup(Geometry.class);
boolean splitMirrored = (Boolean)wiz.getProperties().get("splitMirrored");
Mesh mesh = geom.getMesh();
Mesh keptMesh = null;
if (mesh != null) {
if(splitMirrored){
keptMesh = mesh.deepClone();
}
TangentBinormalGenerator.generate(geom, splitMirrored);
}
if(keptMesh == null){
return splitMirrored;
}else{
return keptMesh;
}
}
示例7: getAddAction
import com.jme3.gde.core.sceneexplorer.nodes.AbstractSceneExplorerNode; //导入依赖的package包/类
/**
* This is the Add Waypoint Action. It resides in this Popup Class, however
* it's not added to the Debug Shapes Popup. Instead it is added as a seperate action
* @return
*/
public AbstractAction getAddAction() {
return new AbstractAction("Add Waypoint") {
@Override
public void actionPerformed(ActionEvent e) {
Vector3f pos;
SceneToolController controller = SceneApplication.getApplication().getStateManager().getState(SceneToolController.class);
if (controller != null && (!controller.getCursorLocation().equals(Vector3f.ZERO))) { // Vector3f.ZERO means not yet clicked
pos = controller.getCursorLocation().clone().addLocal(0, jmeMotionPath.getDebugBoxExtents() * 3f, 0); // Shifting up so a) Netbeans isn't merging Waypoints and b) it's visible
} else {
AbstractSceneExplorerNode node = SceneExplorerTopComponent.findInstance().getLastSelected();
if (node instanceof JmeVector3f) { // null instanceof JmeVector3f == false
pos = ((JmeVector3f)node).getVector3f().clone().addLocal(0, jmeMotionPath.getDebugBoxExtents() * 3f, 0);
} else {
pos = new Vector3f(0f, 1.0f, 0f); // Default is a bit over the Center
}
}
JmeVector3fChildren children = (JmeVector3fChildren)jmeMotionPath.getChildren();
JmeVector3f jme = new JmeVector3f(children, jmeMotionPath, pos);
children.add(new Node[] {jme});
jmeMotionPath.refreshChildren();
}
};
}
示例8: setSelectedNode
import com.jme3.gde.core.sceneexplorer.nodes.AbstractSceneExplorerNode; //导入依赖的package包/类
public void setSelectedNode(AbstractSceneExplorerNode node) {
selectedSpatial = node;
if (node != null) {
lastSelected = node;
}
try {
if (node != null) {
explorerManager.setSelectedNodes(new Node[]{node});
// setActivatedNodes(new Node[]{node});
} else {
explorerManager.setSelectedNodes(new Node[]{});
// setActivatedNodes(new Node[]{});
}
} catch (Exception ex) {
Exceptions.printStackTrace(ex);
}
}
示例9: doMoveSpatial
import com.jme3.gde.core.sceneexplorer.nodes.AbstractSceneExplorerNode; //导入依赖的package包/类
public void doMoveSpatial(Spatial selected, Vector3f translation) {
Vector3f localTranslation = selected.getLocalTranslation();
Vector3f before = new Vector3f(localTranslation);
Node parent = selected.getParent();
if (parent != null) {
localTranslation.set(translation).subtractLocal(parent.getWorldTranslation());
localTranslation.divideLocal(parent.getWorldScale());
//TODO: reuse quaternion..
new Quaternion().set(parent.getWorldRotation()).inverseLocal().multLocal(localTranslation);
} else {
localTranslation.set(translation);
}
Vector3f after = new Vector3f(localTranslation);
selected.setLocalTranslation(localTranslation);
AbstractSceneExplorerNode selectedSpat = this.selectedSpat;
moveUndo(selected, before, after, selectedSpat);
}
示例10: moveUndo
import com.jme3.gde.core.sceneexplorer.nodes.AbstractSceneExplorerNode; //导入依赖的package包/类
private void moveUndo(final Spatial spatial, final Vector3f before, final Vector3f after, final AbstractSceneExplorerNode parentNode) {
if (spatial != null && before != null) {
Lookup.getDefault().lookup(SceneUndoRedoManager.class).addEdit(this, new AbstractUndoableSceneEdit() {
@Override
public void sceneUndo() throws CannotUndoException {
//undo stuff here
spatial.setLocalTranslation(before);
}
@Override
public void sceneRedo() throws CannotRedoException {
//redo stuff here
spatial.setLocalTranslation(after);
}
});
}
}
示例11: nudgeUndo
import com.jme3.gde.core.sceneexplorer.nodes.AbstractSceneExplorerNode; //导入依赖的package包/类
private void nudgeUndo(final Spatial spatial, final Vector3f before, final Vector3f after, final AbstractSceneExplorerNode parentNode) {
if (spatial != null && before != null) {
Lookup.getDefault().lookup(SceneUndoRedoManager.class).addEdit(this, new AbstractUndoableSceneEdit() {
@Override
public void sceneUndo() throws CannotUndoException {
//undo stuff here
spatial.setLocalTranslation(before);
}
@Override
public void sceneRedo() throws CannotRedoException {
//redo stuff here
spatial.setLocalTranslation(after);
}
});
}
}
示例12: rotateUndo
import com.jme3.gde.core.sceneexplorer.nodes.AbstractSceneExplorerNode; //导入依赖的package包/类
private void rotateUndo(final Spatial spatial, final Quaternion before, final Quaternion after, final AbstractSceneExplorerNode parentNode) {
if (spatial != null && before != null) {
Lookup.getDefault().lookup(SceneUndoRedoManager.class).addEdit(this, new AbstractUndoableSceneEdit() {
@Override
public void sceneUndo() throws CannotUndoException {
//undo stuff here
spatial.setLocalRotation(before);
}
@Override
public void sceneRedo() throws CannotRedoException {
//redo stuff here
spatial.setLocalRotation(after);
}
});
}
}
示例13: setSelectedExplorerNode
import com.jme3.gde.core.sceneexplorer.nodes.AbstractSceneExplorerNode; //导入依赖的package包/类
public void setSelectedExplorerNode(AbstractSceneExplorerNode node) {
if (selectedExplorerNode != null) {
selectedExplorerNode.removePropertyChangeListener(this);
selectedExplorerNode.removeNodeListener(this);
}
selectedExplorerNode = node;
if (selectedExplorerNode != null) {
selectedExplorerNode.addPropertyChangeListener(this);
selectedExplorerNode.addNodeListener(this);
}
}
示例14: addSpatialUndo
import com.jme3.gde.core.sceneexplorer.nodes.AbstractSceneExplorerNode; //导入依赖的package包/类
private void addSpatialUndo(final Node undoParent, final Spatial undoSpatial, final Light undoLight, final AbstractSceneExplorerNode parentNode) {
//add undo
if (undoParent != null && undoSpatial != null) {
Lookup.getDefault().lookup(SceneUndoRedoManager.class).addEdit(this, new AbstractUndoableSceneEdit() {
@Override
public void sceneUndo() throws CannotUndoException {
//undo stuff here
undoSpatial.removeFromParent();
}
@Override
public void sceneRedo() throws CannotRedoException {
//redo stuff here
undoParent.attachChild(undoSpatial);
}
@Override
public void awtRedo() {
if (parentNode != null) {
parentNode.refresh(true);
}
}
@Override
public void awtUndo() {
if (parentNode != null) {
parentNode.refresh(true);
}
}
});
}
}
示例15: addControlUndo
import com.jme3.gde.core.sceneexplorer.nodes.AbstractSceneExplorerNode; //导入依赖的package包/类
private void addControlUndo(final Node undoParent, final Control undoControl, final AbstractSceneExplorerNode parentNode) {
if (undoParent != null && undoControl != null) {
Lookup.getDefault().lookup(SceneUndoRedoManager.class).addEdit(this, new AbstractUndoableSceneEdit() {
@Override
public void sceneUndo() throws CannotUndoException {
//undo stuff here
undoParent.removeControl(undoControl);
}
@Override
public void sceneRedo() throws CannotRedoException {
//redo stuff here
undoParent.addControl(undoControl);
}
@Override
public void awtRedo() {
if (parentNode != null) {
parentNode.refresh(true);
}
}
@Override
public void awtUndo() {
if (parentNode != null) {
parentNode.refresh(true);
}
}
});
}
}