Browse Source

jme3-examples: privatize methods

Stephen Gold 4 years ago
parent
commit
0b140b147a

+ 1 - 1
jme3-examples/src/main/java/jme3test/TestChooser.java

@@ -96,7 +96,7 @@ public class TestChooser extends JDialog {
      * @return classes vector, list of all the classes in a given package (must
      *         be found in classpath).
      */
-    protected Vector<Class> find(String pckgname, boolean recursive,
+    private Vector<Class> find(String pckgname, boolean recursive,
             Vector<Class> classes) {
         URL url;
 

+ 2 - 2
jme3-examples/src/main/java/jme3test/app/TestCloneSpatial.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 jMonkeyEngine
+ * Copyright (c) 2016-2021 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -117,7 +117,7 @@ public class TestCloneSpatial {
     /**
      *  Debug dump to check structure and identity
      */
-    public static void dump( String indent, Spatial s ) {
+    private static void dump( String indent, Spatial s ) {
         if( s instanceof Node ) {
             dump(indent, (Node)s);
         } else if( s instanceof Geometry ) {

+ 2 - 2
jme3-examples/src/main/java/jme3test/collision/TestMousePick.java

@@ -106,7 +106,7 @@ public class TestMousePick extends SimpleApplication {
     }
  
     /** A cube object for target practice */
-    protected Geometry makeCube(String name, float x, float y, float z) {
+    private Geometry makeCube(String name, float x, float y, float z) {
         Box box = new Box(1, 1, 1);
         Geometry cube = new Geometry(name, box);
         cube.setLocalTranslation(x, y, z);
@@ -117,7 +117,7 @@ public class TestMousePick extends SimpleApplication {
     }
 
     /** A floor to show that the "shot" can go through several objects. */
-    protected Geometry makeFloor() {
+    private Geometry makeFloor() {
         Box box = new Box(15, .2f, 15);
         Geometry floor = new Geometry("the Floor", box);
         floor.setLocalTranslation(0, -4, -5);

+ 3 - 3
jme3-examples/src/main/java/jme3test/games/WorldOfInception.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2020 jMonkeyEngine
+ * Copyright (c) 2009-2021 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -515,7 +515,7 @@ public class WorldOfInception extends SimpleApplication implements AnalogListene
      * @param max
      * @return the mapped value
      */
-    public static float mapValue(float x, float min, float max) {
+    private static float mapValue(float x, float min, float max) {
         return mapValue(x, 0, 1, min, max);
     }
 
@@ -529,7 +529,7 @@ public class WorldOfInception extends SimpleApplication implements AnalogListene
      * @param max
      * @return the mapped value
      */
-    public static float mapValue(float x, float inputMin, float inputMax, float min, float max) {
+    private static float mapValue(float x, float inputMin, float inputMax, float min, float max) {
         return (x - inputMin) * (max - min) / (inputMax - inputMin) + min;
     }
 }

+ 1 - 1
jme3-examples/src/main/java/jme3test/helloworld/HelloPhysics.java

@@ -180,7 +180,7 @@ public class HelloPhysics extends SimpleApplication {
   }
 
   /** This method creates one individual physical brick. */
-  public void makeBrick(Vector3f loc) {
+  private void makeBrick(Vector3f loc) {
     /** Create a brick geometry and attach to scene graph. */
     Geometry brick_geo = new Geometry("brick", box);
     brick_geo.setMaterial(wall_mat);

+ 5 - 5
jme3-examples/src/main/java/jme3test/helloworld/HelloPicking.java

@@ -125,7 +125,7 @@ public class HelloPicking extends SimpleApplication {
   };
 
   /** A cube object for target practice */
-  protected Geometry makeCube(String name, float x, float y, float z) {
+  private Geometry makeCube(String name, float x, float y, float z) {
     Box box = new Box(1, 1, 1);
     Geometry cube = new Geometry(name, box);
     cube.setLocalTranslation(x, y, z);
@@ -136,7 +136,7 @@ public class HelloPicking extends SimpleApplication {
   }
 
   /** A floor to show that the "shot" can go through several objects. */
-  protected Geometry makeFloor() {
+  private Geometry makeFloor() {
     Box box = new Box(15, .2f, 15);
     Geometry floor = new Geometry("the Floor", box);
     floor.setLocalTranslation(0, -4, -5);
@@ -147,7 +147,7 @@ public class HelloPicking extends SimpleApplication {
   }
 
   /** A red ball that marks the last spot that was "hit" by the "shot". */
-  protected void initMark() {
+  private void initMark() {
     Sphere sphere = new Sphere(30, 30, 0.2f);
     mark = new Geometry("BOOM!", sphere);
     Material mark_mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
@@ -156,7 +156,7 @@ public class HelloPicking extends SimpleApplication {
   }
 
   /** A centred plus sign to help the player aim. */
-  protected void initCrossHairs() {
+  private void initCrossHairs() {
     setDisplayStatView(false);
     guiFont = assetManager.loadFont("Interface/Fonts/Default.fnt");
     BitmapText ch = new BitmapText(guiFont, false);
@@ -167,7 +167,7 @@ public class HelloPicking extends SimpleApplication {
     guiNode.attachChild(ch);
   }
 
-  protected Spatial makeCharacter() {
+  private Spatial makeCharacter() {
     // load a character from jme3test-test-data
     Spatial golem = assetManager.loadModel("Models/Oto/Oto.mesh.xml");
     golem.scale(0.5f);