summaryrefslogtreecommitdiff
path: root/src/tesseract/menuitems
diff options
context:
space:
mode:
authorSteve <steveb9@u.washington.edu>2011-02-11 05:57:56 +0000
committerSteve <steveb9@u.washington.edu>2011-02-11 05:57:56 +0000
commit3b2aa407ba194f4a44536ac141fe5fbd2a67ad7c (patch)
treef3f511b57a8b257d2294f75f5db42a6153ee15fd /src/tesseract/menuitems
parentaa567c12b883be0872bff04d03f8b6c21f8f2e5a (diff)
added iso to menu
Diffstat (limited to 'src/tesseract/menuitems')
-rw-r--r--src/tesseract/menuitems/IcosahedronMenuItem.java51
1 files changed, 51 insertions, 0 deletions
diff --git a/src/tesseract/menuitems/IcosahedronMenuItem.java b/src/tesseract/menuitems/IcosahedronMenuItem.java
new file mode 100644
index 0000000..554e42b
--- /dev/null
+++ b/src/tesseract/menuitems/IcosahedronMenuItem.java
@@ -0,0 +1,51 @@
+package tesseract.menuitems;
+
+import java.awt.Color;
+import java.awt.event.ActionEvent;
+
+import javax.swing.JColorChooser;
+import javax.swing.JOptionPane;
+import javax.vecmath.Color3f;
+import javax.vecmath.Vector3f;
+
+import tesseract.World;
+import tesseract.objects.Icosahedron;
+import tesseract.objects.PlanarPolygon;
+
+/**
+ * Planar Polygon Menu Item.
+ *
+ * @author Steve Bradshaw
+ */
+public class IcosahedronMenuItem extends TesseractMenuItem {
+
+ /**
+ * Serial ID.
+ */
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * Constructor for the menu item.
+ *
+ * @param theWorld The world into which we add.
+ */
+ public IcosahedronMenuItem(final World theWorld) {
+ super(theWorld, "Icosahedron");
+ }
+
+ /**
+ * Action handler.
+ *
+ * @param arg0 Unused event info.
+ */
+ public void actionPerformed(final ActionEvent arg0) {
+ //Color c = JColorChooser.showDialog(null, "Planar Polygon Color", Color.RED);
+ Vector3f pos =
+ parseVector(JOptionPane.showInputDialog("Enter the position"));
+ float radius =
+ Float.parseFloat(JOptionPane.showInputDialog("Enter the radius"));
+
+ myWorld.addObject(new Icosahedron(pos, radius));
+ }
+}
+