From 4245f4ac7475345162e484b79341cdff3b1710f4 Mon Sep 17 00:00:00 2001 From: Phillip Date: Wed, 23 Feb 2011 22:25:49 +0000 Subject: Corrected issue causing Default Shape, Enter, and Color buttons multiple times to a parameter window. --- src/tesseract/newmenu/MenuItem.java | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'src/tesseract/newmenu/MenuItem.java') diff --git a/src/tesseract/newmenu/MenuItem.java b/src/tesseract/newmenu/MenuItem.java index da3cb54..c47aa2c 100644 --- a/src/tesseract/newmenu/MenuItem.java +++ b/src/tesseract/newmenu/MenuItem.java @@ -95,11 +95,6 @@ public abstract class MenuItem extends JMenuItem implements ActionListener { private boolean useColorButton; - /** - * Default constructor. - */ - public MenuItem() { } - /** * Constructor. * @param theWorld world parameter. @@ -129,9 +124,10 @@ public abstract class MenuItem extends JMenuItem implements ActionListener { * @param theLabel for menu item. * @param theColor use color button. */ - public MenuItem(final World theWorld, final String theLabel, boolean theColor) { + public MenuItem(final World theWorld, final String theLabel, + boolean theColorButton) { this(theWorld, theLabel); - useColorButton = theColor; + useColorButton = theColorButton; } /** @@ -158,14 +154,14 @@ public abstract class MenuItem extends JMenuItem implements ActionListener { protected void createParameterMenu() { - myColorButton.addActionListener(new ActionListener(){ + myColorButton.addActionListener(new ActionListener() { @Override - public void actionPerformed(ActionEvent arg0) { + public void actionPerformed(final ActionEvent arg0) { myColor = JColorChooser.showDialog(null, "Particle Color", Color.RED); - }}); + } }); Toolkit tk = Toolkit.getDefaultToolkit(); Dimension screenSize = tk.getScreenSize(); int screenHeight = screenSize.height; @@ -204,8 +200,8 @@ public abstract class MenuItem extends JMenuItem implements ActionListener { myParamFrame.setAlwaysOnTop(true); - myParamFrame.pack(); - myParamFrame.setVisible(isVisible()); + //myParamFrame.pack(); + //myParamFrame.setVisible(isVisible()); } /** -- cgit v1.2.3