[Bprocessor-commit] gl/src/net/sourceforge/bprocessor/gl/tool SpaceTool.java, 1.86, 1.87 DomainPopu
Status: Pre-Alpha
Brought to you by:
henryml
From: Michael L. <he...@us...> - 2007-10-17 09:08:16
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18041/src/net/sourceforge/bprocessor/gl/tool Modified Files: SpaceTool.java DomainPopupListener.java CreateSpaceActionListener.java Log Message: clean up Index: SpaceTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SpaceTool.java,v retrieving revision 1.86 retrieving revision 1.87 diff -C2 -d -r1.86 -r1.87 *** SpaceTool.java 3 Sep 2007 11:31:34 -0000 1.86 --- SpaceTool.java 17 Oct 2007 09:08:19 -0000 1.87 *************** *** 229,232 **** --- 229,233 ---- createFuncItem.addActionListener(funcListener); + // MARK 1 JMenuItem createConstItem = new JMenuItem("New Construction " + category); ActionListener constListener = new CreateSpaceActionListener(surface, *************** *** 234,237 **** --- 235,240 ---- false); createConstItem.addActionListener(constListener); + + JMenuItem selectSpaceItem = new JMenuItem("Select " + category); selectSpaceItem.addActionListener(new SpaceMenuAction(space, "Select") { Index: CreateSpaceActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/CreateSpaceActionListener.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** CreateSpaceActionListener.java 26 Sep 2007 08:36:34 -0000 1.20 --- CreateSpaceActionListener.java 17 Oct 2007 09:08:19 -0000 1.21 *************** *** 9,36 **** import net.sourceforge.bprocessor.gui.attrview.AttributeView; - import net.sourceforge.bprocessor.gui.attrview.ClassificationTextAttribute; - - import javax.swing.JButton; - import javax.swing.JDialog; - import java.awt.event.ActionEvent; import java.awt.event.ActionListener; - import java.awt.event.MouseAdapter; - import java.awt.event.MouseEvent; - - import net.sourceforge.bprocessor.model.Classification; import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Space; - import org.apache.log4j.Logger; - /** * The create functional space action listener for the domain popupmenu. */ ! public class CreateSpaceActionListener extends MouseAdapter implements ActionListener { ! /** The logger */ ! private static Logger log = Logger.getLogger(CreateSpaceActionListener.class); ! /** The Surface */ private Surface surface; --- 9,22 ---- import net.sourceforge.bprocessor.gui.attrview.AttributeView; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Space; /** * The create functional space action listener for the domain popupmenu. */ ! public class CreateSpaceActionListener implements ActionListener { /** The Surface */ private Surface surface; *************** *** 42,51 **** private boolean functional; - /** The classification attribute */ - private ClassificationTextAttribute cta; - - /** The dialog window */ - private JDialog dialog; - /** * CreateSpaceActionListener --- 28,31 ---- *************** *** 62,147 **** /** ! * @param e The action event */ ! public void actionPerformed(ActionEvent e) { Space owner = surface.getOwner(); ! try { ! Space space; ! if (functional) { ! space = owner.createFunctionalSpace(""); ! } else { ! space = owner.createConstructionSpace(""); ! } ! owner.add(space); ! if (front) { ! surface.assignFront(space); ! } else { ! surface.assignBack(space); ! } ! surface.changed(); ! AttributeView.instance().display(space); ! Project.getInstance().checkpoint(); ! } catch (Exception ex) { ! ex.printStackTrace(); } ! } ! ! /** ! * Start editing ! * @param event The MouseEvent ! */ ! @Override ! public void mouseClicked(MouseEvent event) { ! cta.startEditing(); ! ! } ! ! /** ! * My action listener ! */ ! class MyActionListener implements ActionListener { ! ! /** ! * the action performed event handling ! * @param e is the action event ! */ ! public void actionPerformed(ActionEvent e) { ! String name = ((JButton) e.getSource()).getText(); ! if (name.equalsIgnoreCase("Ok")) { ! if (cta.attribute().getThe2ndValue() != null) { ! Space owner = surface.getOwner(); ! ! if (cta.attribute().getThe2ndValue() != null) { ! try { ! Space space; ! if (functional) { ! space = owner.createFunctionalSpace( ! (Classification)cta.attribute().getThe2ndValue()); ! } else { ! space = owner.createConstructionSpace( ! (Classification)cta.attribute().getThe2ndValue()); ! } ! owner.add(space); ! if (front) { ! surface.assignFront(space); ! } else { ! surface.assignBack(space); ! } ! surface.changed(); ! Project.getInstance().checkpoint(); ! } catch (Exception ex) { ! ex.printStackTrace(); ! } ! } ! dialog.setVisible(false); ! } ! } ! ! if (name.equalsIgnoreCase("Cancel")) { ! dialog.setVisible(false); ! ! } } ! } } --- 42,64 ---- /** ! * @param event The action event */ ! public void actionPerformed(ActionEvent event) { Space owner = surface.getOwner(); ! Space space; ! if (functional) { ! space = owner.createFunctionalSpace(""); ! } else { ! space = owner.createConstructionSpace(""); } ! owner.add(space); ! if (front) { ! surface.assignFront(space); ! } else { ! surface.assignBack(space); } ! surface.changed(); ! AttributeView.instance().display(space); ! Project.getInstance().checkpoint(); } } Index: DomainPopupListener.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/DomainPopupListener.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** DomainPopupListener.java 26 Sep 2007 08:36:34 -0000 1.6 --- DomainPopupListener.java 17 Oct 2007 09:08:19 -0000 1.7 *************** *** 14,18 **** import net.sourceforge.bprocessor.model.Surface; - import org.apache.log4j.Logger; /** --- 14,17 ---- *************** *** 20,26 **** */ public class DomainPopupListener implements ActionListener { - /** The logger */ - private static Logger log = Logger.getLogger(DomainPopupListener.class); - /** The domain */ private Space domain; --- 19,22 ---- |