summaryrefslogtreecommitdiff
path: root/src/tesseract/menuitems/PlanarPolygonMenuItem.java
diff options
context:
space:
mode:
authorSteve <steveb9@u.washington.edu>2011-02-11 02:18:07 +0000
committerSteve <steveb9@u.washington.edu>2011-02-11 02:18:07 +0000
commit3847c5b66c2c1a186af5af422ff4e03759c2ffe9 (patch)
treefdabddec2ea0037d5b86d1af3439f54ef08051d0 /src/tesseract/menuitems/PlanarPolygonMenuItem.java
parent8548d4b02b6ddfe605bd9b7e156f4345b6f3bf3d (diff)
Added menu for ellipsoid and planpolygon
changed ui slightly to display the new menu items added lava jpeg for planar texture
Diffstat (limited to 'src/tesseract/menuitems/PlanarPolygonMenuItem.java')
-rw-r--r--src/tesseract/menuitems/PlanarPolygonMenuItem.java49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/tesseract/menuitems/PlanarPolygonMenuItem.java b/src/tesseract/menuitems/PlanarPolygonMenuItem.java
new file mode 100644
index 0000000..fec7a55
--- /dev/null
+++ b/src/tesseract/menuitems/PlanarPolygonMenuItem.java
@@ -0,0 +1,49 @@
+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.PlanarPolygon;
+
+/**
+ * Planar Polygon Menu Item.
+ *
+ * @author Steve Bradshaw
+ */
+public class PlanarPolygonMenuItem extends TesseractMenuItem {
+
+ /**
+ * Serial ID.
+ */
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * Constructor for the menu item.
+ *
+ * @param theWorld The world into which we add.
+ */
+ public PlanarPolygonMenuItem(final World theWorld) {
+ super(theWorld, "Planar Polygon");
+ }
+
+ /**
+ * 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 PlanarPolygon(pos, radius));
+ }
+}