Browse Source

Remove deprecation, some cleanups & formatting

Toni Helenius 5 years ago
parent
commit
6a095fe05d

+ 9 - 2
jme3-terrain-editor/src/com/jme3/gde/terraineditor/CreateTerrainWizardPanel1.java

@@ -49,6 +49,7 @@ public class CreateTerrainWizardPanel1 implements WizardDescriptor.Panel {
     // is kept separate. This can be more efficient: if the wizard is created
     // but never displayed, or not all panels are displayed, it is better to
     // create only those which really need to be visible.
+    @Override
     public Component getComponent() {
         if (component == null) {
             component = new CreateTerrainVisualPanel1();
@@ -56,6 +57,7 @@ public class CreateTerrainWizardPanel1 implements WizardDescriptor.Panel {
         return component;
     }
 
+    @Override
     public HelpCtx getHelp() {
         // Show no Help button for this panel:
         return HelpCtx.DEFAULT_HELP;
@@ -63,6 +65,7 @@ public class CreateTerrainWizardPanel1 implements WizardDescriptor.Panel {
         // return new HelpCtx(SampleWizardPanel1.class);
     }
 
+    @Override
     public boolean isValid() {
         // If it is always OK to press Next or Finish, then:
         return true;
@@ -73,9 +76,11 @@ public class CreateTerrainWizardPanel1 implements WizardDescriptor.Panel {
         // and uncomment the complicated stuff below.
     }
 
+    @Override
     public final void addChangeListener(ChangeListener l) {
     }
 
+    @Override
     public final void removeChangeListener(ChangeListener l) {
     }
     /*
@@ -106,14 +111,16 @@ public class CreateTerrainWizardPanel1 implements WizardDescriptor.Panel {
     // settings object will be the WizardDescriptor, so you can use
     // WizardDescriptor.getProperty & putProperty to store information entered
     // by the user.
+    @Override
     public void readSettings(Object settings) {
     }
 
+    @Override
     public void storeSettings(Object settings) {
         WizardDescriptor wiz = (WizardDescriptor) settings;
         CreateTerrainVisualPanel1 comp = (CreateTerrainVisualPanel1) getComponent();
-        int totalSize = new Integer(comp.getTotalSizeField().getText()) + 1;
-        int patchSize = new Integer(comp.getPatchSizeField().getText()) + 1;
+        int totalSize = Integer.parseInt(comp.getTotalSizeField().getText()) + 1;
+        int patchSize = Integer.parseInt(comp.getPatchSizeField().getText()) + 1;
         wiz.putProperty("totalSize", totalSize );
         wiz.putProperty("patchSize", patchSize );
     }

+ 8 - 1
jme3-terrain-editor/src/com/jme3/gde/terraineditor/CreateTerrainWizardPanel3.java

@@ -54,6 +54,7 @@ public class CreateTerrainWizardPanel3 implements WizardDescriptor.Panel {
     // is kept separate. This can be more efficient: if the wizard is created
     // but never displayed, or not all panels are displayed, it is better to
     // create only those which really need to be visible.
+    @Override
     public Component getComponent() {
         if (component == null) {
             component = new CreateTerrainVisualPanel3();
@@ -61,6 +62,7 @@ public class CreateTerrainWizardPanel3 implements WizardDescriptor.Panel {
         return component;
     }
 
+    @Override
     public HelpCtx getHelp() {
         // Show no Help button for this panel:
         return HelpCtx.DEFAULT_HELP;
@@ -68,6 +70,7 @@ public class CreateTerrainWizardPanel3 implements WizardDescriptor.Panel {
         // return new HelpCtx(SampleWizardPanel1.class);
     }
 
+    @Override
     public boolean isValid() {
         // If it is always OK to press Next or Finish, then:
         return true;
@@ -78,9 +81,11 @@ public class CreateTerrainWizardPanel3 implements WizardDescriptor.Panel {
         // and uncomment the complicated stuff below.
     }
 
+    @Override
     public final void addChangeListener(ChangeListener l) {
     }
 
+    @Override
     public final void removeChangeListener(ChangeListener l) {
     }
     /*
@@ -111,6 +116,7 @@ public class CreateTerrainWizardPanel3 implements WizardDescriptor.Panel {
     // settings object will be the WizardDescriptor, so you can use
     // WizardDescriptor.getProperty & putProperty to store information entered
     // by the user.
+    @Override
     public void readSettings(Object settings) {
         WizardDescriptor wiz = (WizardDescriptor) settings;
         int totalSize = (Integer) wiz.getProperty("totalSize");
@@ -118,10 +124,11 @@ public class CreateTerrainWizardPanel3 implements WizardDescriptor.Panel {
         comp.setDefaultImageSize(totalSize-1); // eg. was 257, now 256
     }
 
+    @Override
     public void storeSettings(Object settings) {
         WizardDescriptor wiz = (WizardDescriptor) settings;
         CreateTerrainVisualPanel3 comp = (CreateTerrainVisualPanel3) getComponent();
-        int textureSize = new Integer(comp.getAlphaBlendSize().getText());
+        int textureSize = Integer.parseInt(comp.getAlphaBlendSize().getText());
         wiz.putProperty("alphaTextureSize", textureSize );
     }