(no commit message)
authorBill Kuker <bkuker@billkuker.com>
Thu, 4 Nov 2010 19:12:38 +0000 (19:12 +0000)
committerBill Kuker <bkuker@billkuker.com>
Thu, 4 Nov 2010 19:12:38 +0000 (19:12 +0000)
src/com/billkuker/rocketry/motorsim/grain/Star.java

index dc1d1256d729dd0795dc401566a8a47a11865fcb..655daa5c9f42ad39d8a4992dfc842c0d06602b93 100644 (file)
@@ -95,7 +95,9 @@ public class Star extends ExtrudedShapeGrain implements Validating {
                return pointCount;\r
        }\r
        \r
-       public void setPointCount(final int points){\r
+       public void setPointCount(final int points) throws PropertyVetoException{\r
+               if ( points < 2 || points > 8 )\r
+                       throw new PropertyVetoException("Invalid number of points", null);\r
                pointCount = points;\r
                generateGeometry();\r
        }\r
@@ -117,5 +119,9 @@ public class Star extends ExtrudedShapeGrain implements Validating {
                        throw new ValidationException(this, "Invalid Length");\r
                if ( iD.isGreaterThan(oD) )\r
                        throw new ValidationException(this, "iD > oD");         \r
+               if ( iD.isGreaterThan(pD) )\r
+                       throw new ValidationException(this, "iD > pD");         \r
+               if ( pD.isGreaterThan(oD) )\r
+                       throw new ValidationException(this, "pD > oD"); \r
        }\r
 }\r