From 06c4dcd7f78955aa435739fa33352e2666472db2 Mon Sep 17 00:00:00 2001 From: "ShA..Rd" Date: Fri, 19 Apr 2013 18:01:17 +0000 Subject: [PATCH] * 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 --- engine/src/core/com/jme3/scene/shape/Sphere.java | 6 ++++++ engine/src/desktop/com/jme3/app/SettingsDialog.java | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/engine/src/core/com/jme3/scene/shape/Sphere.java b/engine/src/core/com/jme3/scene/shape/Sphere.java index f8d5e75fa..89db073a7 100644 --- a/engine/src/core/com/jme3/scene/shape/Sphere.java +++ b/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; diff --git a/engine/src/desktop/com/jme3/app/SettingsDialog.java b/engine/src/desktop/com/jme3/app/SettingsDialog.java index 3ad02a69d..1b364bc39 100644 --- a/engine/src/desktop/com/jme3/app/SettingsDialog.java +++ b/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);