Bladeren bron

* Fix issue 574 (by extending JFrame instead of JDialog)
* Fix issue 561 by throwing exception on invalid values

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10570 75d07b2b-3a1a-0410-a2c5-0572b91ccdca

ShA..Rd 12 jaren geleden
bovenliggende
commit
06c4dcd7f7

+ 6 - 0
engine/src/core/com/jme3/scene/shape/Sphere.java

@@ -383,10 +383,16 @@ public class Sphere extends Mesh {
      * @param radius the radius of the sphere.
      */
     public void updateGeometry(int zSamples, int radialSamples, float radius) {
+        if (zSamples < 3) {
+            throw new IllegalArgumentException("zSamples cannot be smaller than 3");
+        }
         updateGeometry(zSamples, radialSamples, radius, false, false);
     }
 
     public void updateGeometry(int zSamples, int radialSamples, float radius, boolean useEvenSlices, boolean interior) {
+        if (zSamples < 3) {
+            throw new IllegalArgumentException("zSamples cannot be smaller than 3");
+        }
         this.zSamples = zSamples;
         this.radialSamples = radialSamples;
         this.radius = radius;

+ 2 - 2
engine/src/desktop/com/jme3/app/SettingsDialog.java

@@ -59,7 +59,7 @@ import javax.swing.*;
  * @author Eric Woroshow
  * @author Joshua Slack - reworked for proper use of GL commands.
  */
-public final class SettingsDialog extends JDialog {
+public final class SettingsDialog extends JFrame {
 
     public static interface SelectionListener {
 
@@ -141,7 +141,7 @@ public final class SettingsDialog extends JDialog {
         this.source = source;
         this.imageFile = imageFile;
 
-        setModal(true);
+        //setModal(true);
         setAlwaysOnTop(true);
         setResizable(false);