[Bprocessor-commit] /gui/src/net/sourceforge/bprocessor/gui/actions ModellorMenuAction.java, 1.1, 1
Status: Pre-Alpha
Brought to you by:
henryml
|
From: rimestad <rim...@us...> - 2007-04-10 21:01:11
|
Update of /cvsroot/bprocessor//gui/src/net/sourceforge/bprocessor/gui/actions In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28385/src/net/sourceforge/bprocessor/gui/actions Modified Files: ModellorMenuAction.java Log Message: moved the action to from popupmenu to this class Index: ModellorMenuAction.java =================================================================== RCS file: /cvsroot/bprocessor//gui/src/net/sourceforge/bprocessor/gui/actions/ModellorMenuAction.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ModellorMenuAction.java 26 Sep 2006 09:50:54 -0000 1.1 --- ModellorMenuAction.java 10 Apr 2007 21:01:10 -0000 1.2 *************** *** 7,12 **** --- 7,17 ---- package net.sourceforge.bprocessor.gui.actions; + import java.awt.event.ActionEvent; + import javax.swing.AbstractAction; + import javax.swing.JOptionPane; + import net.sourceforge.bprocessor.gui.attrview.AttributeView; + import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.modellor.Modellor; *************** *** 16,20 **** * Actions for a entity */ ! public abstract class ModellorMenuAction extends AbstractAction { /** The space */ protected Space space; --- 21,28 ---- * Actions for a entity */ ! public class ModellorMenuAction extends AbstractAction { ! /** */ ! private static final long serialVersionUID = 1L; ! /** The space */ protected Space space; *************** *** 33,35 **** --- 41,62 ---- this.modellor = m; } + + /** + * The action when the menu point is selected + * @param e The actionEvent + */ + public void actionPerformed(ActionEvent e) { + Modellor created = modellor.newInstance(space); + if (created != null) { + space.setModellor(created); + AttributeView.instance().display(created); + space.changed(); + Project.getInstance().checkpoint(); + } else { + JOptionPane.showMessageDialog( + null, + "The chosen space havn't been assigned to any surface", + "No envolope surface error", JOptionPane.ERROR_MESSAGE); + } + } } |