From 7b2bebbf372d6e742cf30ffdd7cc753b0ce1c361 Mon Sep 17 00:00:00 2001 From: rickard Date: Fri, 23 Aug 2024 21:34:46 +0200 Subject: [PATCH] a bit of clean up --- .../nodes/animation/JmeAnimComposer.java | 15 ++++++++++++--- .../nodes/animation/JmeAnimComposerChildren.java | 1 - .../sceneexplorer/nodes/animation/JmeJoint.java | 4 ---- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/jme3-core/src/com/jme3/gde/core/sceneexplorer/nodes/animation/JmeAnimComposer.java b/jme3-core/src/com/jme3/gde/core/sceneexplorer/nodes/animation/JmeAnimComposer.java index 130666d2..b80797af 100644 --- a/jme3-core/src/com/jme3/gde/core/sceneexplorer/nodes/animation/JmeAnimComposer.java +++ b/jme3-core/src/com/jme3/gde/core/sceneexplorer/nodes/animation/JmeAnimComposer.java @@ -34,24 +34,29 @@ import com.jme3.anim.AnimComposer; import com.jme3.gde.core.icons.IconList; import com.jme3.gde.core.scene.SceneApplication; +import com.jme3.gde.core.sceneexplorer.SceneExplorerTopComponent; import com.jme3.gde.core.sceneexplorer.nodes.JmeControl; import com.jme3.gde.core.sceneexplorer.nodes.SceneExplorerNode; import com.jme3.gde.core.sceneexplorer.nodes.actions.ControlsPopup; import com.jme3.gde.core.sceneexplorer.nodes.actions.animation.AnimClipProperty; import java.awt.Image; import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; +import java.util.Collection; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.concurrent.ExecutionException; import javax.swing.AbstractAction; import javax.swing.Action; import org.openide.actions.DeleteAction; +import org.openide.awt.Actions; +import org.openide.explorer.ExplorerManager; import org.openide.loaders.DataObject; import org.openide.nodes.Node; import org.openide.nodes.Sheet; import org.openide.util.Exceptions; import org.openide.util.actions.SystemAction; +import org.openide.windows.TopComponent; /** * Visual representation of the AnimComposer Class in the Scene Explorer @@ -61,7 +66,7 @@ @SuppressWarnings({"unchecked", "rawtypes"}) public class JmeAnimComposer extends JmeControl { private AnimComposer animComposer; - private Map playingAnimation = new HashMap<>(); + private final Map playingAnimation = new HashMap<>(); private static Image smallImage = IconList.animControl.getImage(); public JmeAnimComposer() { @@ -161,9 +166,13 @@ public void refresh(boolean immediate) { ((JmeAnimComposerChildren) jmeChildren).refreshChildren(immediate); super.refresh(immediate); } - + private class StopAllAction extends AbstractAction { + public StopAllAction() { + super("Stop animations"); + } + @Override public void actionPerformed(ActionEvent e) { for(JmeAnimClip layer: JmeAnimComposer.this.playingAnimation.values()) { diff --git a/jme3-core/src/com/jme3/gde/core/sceneexplorer/nodes/animation/JmeAnimComposerChildren.java b/jme3-core/src/com/jme3/gde/core/sceneexplorer/nodes/animation/JmeAnimComposerChildren.java index bf966d94..4511c621 100644 --- a/jme3-core/src/com/jme3/gde/core/sceneexplorer/nodes/animation/JmeAnimComposerChildren.java +++ b/jme3-core/src/com/jme3/gde/core/sceneexplorer/nodes/animation/JmeAnimComposerChildren.java @@ -40,7 +40,6 @@ import java.util.LinkedList; import java.util.List; import java.util.Set; -import java.util.TreeSet; import java.util.concurrent.ExecutionException; import org.openide.loaders.DataObject; import org.openide.nodes.Children; diff --git a/jme3-core/src/com/jme3/gde/core/sceneexplorer/nodes/animation/JmeJoint.java b/jme3-core/src/com/jme3/gde/core/sceneexplorer/nodes/animation/JmeJoint.java index be979adb..0efad42a 100644 --- a/jme3-core/src/com/jme3/gde/core/sceneexplorer/nodes/animation/JmeJoint.java +++ b/jme3-core/src/com/jme3/gde/core/sceneexplorer/nodes/animation/JmeJoint.java @@ -38,7 +38,6 @@ import com.jme3.gde.core.scene.SceneApplication; import com.jme3.gde.core.sceneexplorer.nodes.AbstractSceneExplorerNode; import com.jme3.gde.core.sceneexplorer.nodes.ClipboardSpatial; -import com.jme3.gde.core.sceneexplorer.nodes.JmeControl; import com.jme3.gde.core.sceneexplorer.nodes.SceneExplorerNode; import java.awt.Image; import java.awt.datatransfer.DataFlavor; @@ -157,12 +156,9 @@ public void actionPerformed(ActionEvent e) { composer.makeLayer(name, ArmatureMask.createMask(jmeSkinningControl.getSkinningControl().getArmature(), joint.getName())); } ); - jmeSkinningControl.fireSave(true); final JmeAnimComposer animComposer = (JmeAnimComposer) ((AbstractSceneExplorerNode)jmeSkinningControl.getParentNode()).getChildren().findChild("AnimComposer"); animComposer.refresh(true); animComposer.fireSave(true); - - } }