Skip to content

Commit

Permalink
a bit of clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
neph1 committed Aug 24, 2024
1 parent 1ab296f commit 7b2bebb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -61,7 +66,7 @@
@SuppressWarnings({"unchecked", "rawtypes"})
public class JmeAnimComposer extends JmeControl {
private AnimComposer animComposer;
private Map<String, JmeAnimClip> playingAnimation = new HashMap<>();
private final Map<String, JmeAnimClip> playingAnimation = new HashMap<>();
private static Image smallImage = IconList.animControl.getImage();

public JmeAnimComposer() {
Expand Down Expand Up @@ -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()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);


}

}
Expand Down

0 comments on commit 7b2bebb

Please sign in to comment.