From c7c748a296a61103493279ac62a3844e6efd9802 Mon Sep 17 00:00:00 2001 From: Phillip Date: Mon, 21 Feb 2011 00:29:15 +0000 Subject: Fixed checkstyle warnings. All add object menu items are now NewMenu items, deprecated the rest of the menuitems package. --- src/tesseract/newmenu/NewChainLinkMenuItem.java | 6 +-- src/tesseract/newmenu/NewEllipsoidMenuItem.java | 3 +- src/tesseract/newmenu/NewIcosahedronMenuItem.java | 3 +- .../newmenu/NewParticleEmitterMenuItem.java | 3 +- src/tesseract/newmenu/NewParticleMenuItem.java | 5 +-- .../newmenu/NewPlanarPolygonMenuItem.java | 2 +- src/tesseract/newmenu/NewSurfBoardMenuItem.java | 51 ++++++++++++++++++++++ src/tesseract/newmenu/NewToroidMenuItem.java | 4 +- 8 files changed, 59 insertions(+), 18 deletions(-) create mode 100644 src/tesseract/newmenu/NewSurfBoardMenuItem.java (limited to 'src/tesseract/newmenu') diff --git a/src/tesseract/newmenu/NewChainLinkMenuItem.java b/src/tesseract/newmenu/NewChainLinkMenuItem.java index 65e7395..1011822 100644 --- a/src/tesseract/newmenu/NewChainLinkMenuItem.java +++ b/src/tesseract/newmenu/NewChainLinkMenuItem.java @@ -5,16 +5,14 @@ import java.awt.event.ActionListener; import java.util.Set; import javax.swing.JButton; -import javax.swing.JCheckBox; import javax.swing.JFrame; import javax.vecmath.Vector3f; import tesseract.World; import tesseract.objects.ChainLink2; -import tesseract.objects.Icosahedron; /** - * NewIcosahedronMenutItem + * NewChainLinkMenuItem * * Defines a menu item to add an ChainLink to the world. * Code recycled from TesseractMenuItem by Steve Bradshaw and Jessie Morgan @@ -34,7 +32,7 @@ public class NewChainLinkMenuItem extends MenuItem { * @param theWorld to add objects to. */ public NewChainLinkMenuItem(final World theWorld) { - super(theWorld, "ChainLink(NEW)"); + super(theWorld, "Chain Link"); buildParams(); } diff --git a/src/tesseract/newmenu/NewEllipsoidMenuItem.java b/src/tesseract/newmenu/NewEllipsoidMenuItem.java index ae5885a..2261c73 100644 --- a/src/tesseract/newmenu/NewEllipsoidMenuItem.java +++ b/src/tesseract/newmenu/NewEllipsoidMenuItem.java @@ -5,7 +5,6 @@ import java.awt.event.ActionListener; import java.util.Set; import javax.swing.JButton; -import javax.swing.JCheckBox; import javax.swing.JFrame; import javax.vecmath.Vector3f; @@ -37,7 +36,7 @@ public class NewEllipsoidMenuItem extends MenuItem { * @param theWorld to add objects to. */ public NewEllipsoidMenuItem(final World theWorld) { - super(theWorld, "Ellipsoid(NEW)"); + super(theWorld, "Ellipsoid"); buildParams(); } diff --git a/src/tesseract/newmenu/NewIcosahedronMenuItem.java b/src/tesseract/newmenu/NewIcosahedronMenuItem.java index 8a96ee0..e2c8e76 100644 --- a/src/tesseract/newmenu/NewIcosahedronMenuItem.java +++ b/src/tesseract/newmenu/NewIcosahedronMenuItem.java @@ -5,7 +5,6 @@ import java.awt.event.ActionListener; import java.util.Set; import javax.swing.JButton; -import javax.swing.JCheckBox; import javax.swing.JFrame; import javax.vecmath.Vector3f; @@ -33,7 +32,7 @@ public class NewIcosahedronMenuItem extends MenuItem { * @param theWorld to add objects to. */ public NewIcosahedronMenuItem(final World theWorld) { - super(theWorld, "Icosahedron(NEW)"); + super(theWorld, "Icosahedron"); buildParams(); diff --git a/src/tesseract/newmenu/NewParticleEmitterMenuItem.java b/src/tesseract/newmenu/NewParticleEmitterMenuItem.java index 9f67ba8..dc0b1fc 100644 --- a/src/tesseract/newmenu/NewParticleEmitterMenuItem.java +++ b/src/tesseract/newmenu/NewParticleEmitterMenuItem.java @@ -6,7 +6,6 @@ import java.awt.event.ActionListener; import java.util.Set; import javax.swing.JButton; -import javax.swing.JCheckBox; import javax.swing.JColorChooser; import javax.swing.JFrame; import javax.vecmath.Color3f; @@ -41,7 +40,7 @@ public class NewParticleEmitterMenuItem extends MenuItem { * @param theWorld to add objects to. */ public NewParticleEmitterMenuItem(final World theWorld) { - super(theWorld, "Particle Emitter(NEW)"); + super(theWorld, "Particle Emitter"); buildParams(); diff --git a/src/tesseract/newmenu/NewParticleMenuItem.java b/src/tesseract/newmenu/NewParticleMenuItem.java index 36bf502..4b87852 100644 --- a/src/tesseract/newmenu/NewParticleMenuItem.java +++ b/src/tesseract/newmenu/NewParticleMenuItem.java @@ -6,16 +6,13 @@ import java.awt.event.ActionListener; import java.util.Set; import javax.swing.JButton; -import javax.swing.JCheckBox; import javax.swing.JColorChooser; import javax.swing.JFrame; import javax.vecmath.Color3f; import javax.vecmath.Vector3f; import tesseract.World; -import tesseract.objects.Icosahedron; import tesseract.objects.Particle; -import tesseract.objects.emitters.ParticleEmitter; /** * NewIcosahedronMenutItem @@ -42,7 +39,7 @@ public class NewParticleMenuItem extends MenuItem { * @param theWorld to add objects to. */ public NewParticleMenuItem(final World theWorld) { - super(theWorld, "Particle(NEW)"); + super(theWorld, "Particle"); this.makePanel(); diff --git a/src/tesseract/newmenu/NewPlanarPolygonMenuItem.java b/src/tesseract/newmenu/NewPlanarPolygonMenuItem.java index 95a4b92..c2ea659 100644 --- a/src/tesseract/newmenu/NewPlanarPolygonMenuItem.java +++ b/src/tesseract/newmenu/NewPlanarPolygonMenuItem.java @@ -33,7 +33,7 @@ public class NewPlanarPolygonMenuItem extends MenuItem { * @param theWorld to add objects to. */ public NewPlanarPolygonMenuItem(final World theWorld) { - super(theWorld, "Planar Polygon(NEW)"); + super(theWorld, "Planar Polygon"); buildParams(); diff --git a/src/tesseract/newmenu/NewSurfBoardMenuItem.java b/src/tesseract/newmenu/NewSurfBoardMenuItem.java new file mode 100644 index 0000000..4346012 --- /dev/null +++ b/src/tesseract/newmenu/NewSurfBoardMenuItem.java @@ -0,0 +1,51 @@ +package tesseract.newmenu; + +import java.awt.event.ActionEvent; + +import javax.media.j3d.Appearance; +import javax.media.j3d.ColoringAttributes; +import javax.media.j3d.Material; + +import tesseract.World; +import tesseract.objects.Ellipsoid; + +import com.sun.j3d.utils.geometry.Sphere; + +/** + * SurfBoard Menu Item. + * + * @author Steve Bradshaw + * @author Phillip cardon + */ +public class NewSurfBoardMenuItem extends MenuItem { + + /** + * Serial ID. + */ + private static final long serialVersionUID = 1L; + + /** + * Constructor for the menu item. + * + * @param theWorld The world into which we add. + */ + public NewSurfBoardMenuItem(final World theWorld) { + super(theWorld, "Surf Board"); + } + + /** + * Action handler. + * + * @param arg0 Unused event info. + */ + public void actionPerformed(final ActionEvent arg0) { + Appearance eApp = new Appearance(); + Material eggMat = new Material(); + eggMat.setDiffuseColor(0f, .5f, 1f); + eApp.setMaterial(eggMat); + eApp.setColoringAttributes(new ColoringAttributes( + 0f, 1f, 1f, ColoringAttributes.ALLOW_COLOR_WRITE)); + myWorld.addObject(new Ellipsoid(getPosition(), 1, 0.05f, + new Sphere().getPrimitiveFlags(), 40, eApp, 0.2f, 4.0f)); + } +} diff --git a/src/tesseract/newmenu/NewToroidMenuItem.java b/src/tesseract/newmenu/NewToroidMenuItem.java index 7bfde78..59f07e8 100644 --- a/src/tesseract/newmenu/NewToroidMenuItem.java +++ b/src/tesseract/newmenu/NewToroidMenuItem.java @@ -5,12 +5,10 @@ import java.awt.event.ActionListener; import java.util.Set; import javax.swing.JButton; -import javax.swing.JCheckBox; import javax.swing.JFrame; import javax.vecmath.Vector3f; import tesseract.World; -import tesseract.objects.Icosahedron; import tesseract.objects.Toroid; /** @@ -34,7 +32,7 @@ public class NewToroidMenuItem extends MenuItem { * @param theWorld to add objects to. */ public NewToroidMenuItem(final World theWorld) { - super(theWorld, "Toroid(NEW)"); + super(theWorld, "Toroid"); buildParams(); -- cgit v1.2.3