Skip to content

Commit

Permalink
examples: add "static" qualifiers to fields
Browse files Browse the repository at this point in the history
  • Loading branch information
stephengold committed Mar 23, 2023
1 parent d60f008 commit 31ca67b
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 32 deletions.
10 changes: 5 additions & 5 deletions WesExamples/src/main/java/jme3utilities/test/wes/AppChooser.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,15 @@ final class AppChooser extends AcorusDemo {
/**
* script to execute
*/
private File script;
private static File script;
/**
* index of the selected app in the {@code mainClasses} array
*/
private int selectedAppIndex = 0;
private static int selectedAppIndex = 0;
/**
* menu overlay, displayed in the upper-left corner of the GUI node
*/
private Overlay menuOverlay;
private static Overlay menuOverlay;
// *************************************************************************
// constructors

Expand Down Expand Up @@ -153,7 +153,7 @@ public static void main(String[] arguments) {
*/
@Override
public void acorusInit() {
this.script = findScriptToExecute();
script = findScriptToExecute();
getHelpBuilder().setBackgroundColor(new ColorRGBA(0f, 0.05f, 0f, 1f));
addMenuOverlay();
super.acorusInit();
Expand Down Expand Up @@ -250,7 +250,7 @@ public void onViewPortResize(int newWidth, int newHeight) {
private void addMenuOverlay() {
float width = 40f; // in pixels
int numLines = 25;
this.menuOverlay = new Overlay("menu", width, numLines);
menuOverlay = new Overlay("menu", width, numLines);
menuOverlay.setLocationPolicy(LocationPolicy.CenterLeft);

boolean success = stateManager.attach(menuOverlay);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,11 @@ public void acorusInit() {
attachWorldAxes(1f);

// the unmodified animation in white, the modified one in yellow
this.composer = addFighter(0.7f, -0.7f, ColorRGBA.Yellow);
composer = addFighter(0.7f, -0.7f, ColorRGBA.Yellow);
AnimComposer control = addFighter(-0.7f, 0.7f, ColorRGBA.White);

// Attach status text to the GUI.
this.statusText = new BitmapText(guiFont);
statusText = new BitmapText(guiFont);
guiNode.attachChild(statusText);

super.acorusInit();
Expand Down
34 changes: 17 additions & 17 deletions WesExamples/src/main/java/jme3utilities/test/wes/FlashMobDemo.java
Original file line number Diff line number Diff line change
Expand Up @@ -101,43 +101,44 @@ class FlashMobDemo extends AcorusDemo {
/**
* Sinbad's "Dance" animation
*/
private AnimClip sinbadClip;
private static AnimClip sinbadClip;
/**
* Sinbad's Armature
*/
private Armature sinbadArmature;
private static Armature sinbadArmature;
/**
* number of frames before invoking {@link #startup2()}, or -1 if done
*/
private int untilStartup2 = 2;
private static int untilStartup2 = 2;
/**
* list of animation channels
*/
final private List<AnimChannel> allChannels = new ArrayList<>(2);
final private static List<AnimChannel> allChannels = new ArrayList<>(2);
/**
* list of composers
*/
final private List<AnimComposer> composers = new ArrayList<>(3);
final private static List<AnimComposer> composers = new ArrayList<>(3);
/**
* list of skeleton visualizers
*/
final private List<SkeletonVisualizer> visualizers = new ArrayList<>(5);
final private static List<SkeletonVisualizer> visualizers
= new ArrayList<>(5);
/**
* root node of the loaded Jaime model
*/
private Node jaime;
private static Node jaime;
/**
* root node of the loaded MhGame model
*/
private Node mhGame;
private static Node mhGame;
/**
* root node of the loaded Oto model
*/
private Node oto;
private static Node oto;
/**
* root node of the loaded Puppet model
*/
private Node puppet;
private static Node puppet;
// *************************************************************************
// new methods exposed

Expand Down Expand Up @@ -371,7 +372,7 @@ private void addBox() {
* Attach a Jaime model (with visualizer) to the root node.
*/
private void addJaime() {
this.jaime = (Node) assetManager.loadModel("Models/Jaime/Jaime.j3o");
jaime = (Node) assetManager.loadModel("Models/Jaime/Jaime.j3o");
rootNode.attachChild(jaime);

List<Spatial> list = MySpatial.listSpatials(jaime);
Expand Down Expand Up @@ -420,8 +421,7 @@ private void addLighting() {
* Attach an MhGame model to the root node.
*/
private void addMhGame() {
this.mhGame = (Node) assetManager
.loadModel("Models/MhGame/MhGame.mesh.xml");
mhGame = (Node) assetManager.loadModel("Models/MhGame/MhGame.mesh.xml");
rootNode.attachChild(mhGame);

List<Spatial> list = MySpatial.listSpatials(mhGame);
Expand All @@ -446,7 +446,7 @@ private void addMhGame() {
* Attach an Oto model to the root node.
*/
private void addOto() {
this.oto = (Node) assetManager.loadModel("Models/Oto/Oto.mesh.xml");
oto = (Node) assetManager.loadModel("Models/Oto/Oto.mesh.xml");
rootNode.attachChild(oto);

List<Spatial> list = MySpatial.listSpatials(oto);
Expand All @@ -473,7 +473,7 @@ private void addOto() {
private void addPuppet() {
Node loadedNode
= (Node) assetManager.loadModel("Models/Puppet/Puppet.j3o");
this.puppet = (Node) loadedNode.getChild(0);
puppet = (Node) loadedNode.getChild(0);
rootNode.attachChild(puppet);

List<Spatial> list = MySpatial.listSpatials(puppet);
Expand Down Expand Up @@ -513,10 +513,10 @@ private void addSinbad() {
cgModel.move(0f, 0f, 1f); // in front of the origin

AnimComposer composer = cgModel.getControl(AnimComposer.class);
this.sinbadClip = composer.getAnimClip("Dance");
sinbadClip = composer.getAnimClip("Dance");

SkinningControl sc = cgModel.getControl(SkinningControl.class);
this.sinbadArmature = sc.getArmature();
sinbadArmature = sc.getArmature();

// Add composer to the master list.
composers.add(composer);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,11 @@ class ReverseAnimation extends AcorusDemo {
/**
* root node of the loaded Sinbad model
*/
private Node sinbadModelRoot;
private static Node sinbadModelRoot;
/**
* debug visualizer for Sinbad's skeleton
*/
private SkeletonVisualizer sv;
private static SkeletonVisualizer sv;
// *************************************************************************
// new methods exposed

Expand Down Expand Up @@ -263,7 +263,7 @@ private void addLighting() {
* Attach a Sinbad model to the root node.
*/
private void addSinbad() {
this.sinbadModelRoot = (Node) assetManager.loadModel(
sinbadModelRoot = (Node) assetManager.loadModel(
"Models/Sinbad/Sinbad.mesh.xml");
rootNode.attachChild(sinbadModelRoot);

Expand All @@ -276,7 +276,7 @@ private void addSinbad() {

// Add a skeleton visualizer.
SkinningControl sc = sinbadModelRoot.getControl(SkinningControl.class);
this.sv = new SkeletonVisualizer(assetManager, sc);
sv = new SkeletonVisualizer(assetManager, sc);
rootNode.addControl(sv);
sv.setLineColor(ColorRGBA.Yellow);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,11 @@ class TrimAnimation extends AcorusDemo {
/**
* root node of the loaded Sinbad model
*/
private Node sinbadModelRoot;
private static Node sinbadModelRoot;
/**
* debug visualizer for Sinbad's skeleton
*/
private SkeletonVisualizer sv;
private static SkeletonVisualizer sv;
// *************************************************************************
// new methods exposed

Expand Down Expand Up @@ -273,7 +273,7 @@ private void addLighting() {
* Attach a Sinbad model to the root node.
*/
private void addSinbad() {
this.sinbadModelRoot = (Node) assetManager.loadModel(
sinbadModelRoot = (Node) assetManager.loadModel(
"Models/Sinbad/Sinbad.mesh.xml");
rootNode.attachChild(sinbadModelRoot);

Expand All @@ -286,7 +286,7 @@ private void addSinbad() {

// Add a skeleton visualizer.
SkinningControl sc = sinbadModelRoot.getControl(SkinningControl.class);
this.sv = new SkeletonVisualizer(assetManager, sc);
sv = new SkeletonVisualizer(assetManager, sc);
rootNode.addControl(sv);
sv.setLineColor(ColorRGBA.Yellow);
}
Expand Down

0 comments on commit 31ca67b

Please sign in to comment.