[Bprocessor-commit] gl/src/net/sourceforge/bprocessor/gl/tool SpaceTool.java, 1.68, 1.69 CreateSpac
Status: Pre-Alpha
Brought to you by:
henryml
|
From: Michael L. <he...@us...> - 2007-01-31 15:22:27
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18019/src/net/sourceforge/bprocessor/gl/tool Modified Files: SpaceTool.java CreateSpaceActionListener.java Log Message: Fixes Index: SpaceTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SpaceTool.java,v retrieving revision 1.68 retrieving revision 1.69 diff -C2 -d -r1.68 -r1.69 *** SpaceTool.java 29 Jan 2007 11:56:59 -0000 1.68 --- SpaceTool.java 31 Jan 2007 15:22:06 -0000 1.69 *************** *** 275,278 **** --- 275,280 ---- } + + JMenuItem voidItem = new JMenuItem("Void"); Space sp = Project.getInstance().getActiveSpace(); *************** *** 313,316 **** --- 315,329 ---- false); createConstItem.addActionListener(constListener); + JMenuItem selectSpaceItem = new JMenuItem("Select " + category); + selectSpaceItem.addActionListener(new SpaceMenuAction(space, "Select") { + public void actionPerformed(ActionEvent arg0) { + if (space != null) { + Selection.primary().clear(); + glv.getView().makeTarget(null); + Selection.primary().set(space); + Project.getInstance().changed(Project.getInstance()); + } + } + }); JMenuItem editSpaceItem = new JMenuItem("Edit " + category); *************** *** 383,386 **** --- 396,400 ---- constMenu.addSeparator(); constMenu.add(createConstItem); + menu.add(selectSpaceItem); menu.add(funcMenu); menu.add(constMenu); Index: CreateSpaceActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/CreateSpaceActionListener.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** CreateSpaceActionListener.java 6 Jan 2007 21:11:08 -0000 1.15 --- CreateSpaceActionListener.java 31 Jan 2007 15:22:06 -0000 1.16 *************** *** 7,20 **** package net.sourceforge.bprocessor.gl.tool; ! import net.sourceforge.bprocessor.gui.GUI; import net.sourceforge.bprocessor.gui.attrview.AttributeView; import net.sourceforge.bprocessor.gui.attrview.ClassificationTextAttribute; - import javax.swing.Box; import javax.swing.JButton; import javax.swing.JDialog; - import java.awt.Component; - import java.awt.Container; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; --- 7,17 ---- package net.sourceforge.bprocessor.gl.tool; ! 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; *************** *** 44,50 **** private boolean functional; - /** The current category */ - private String category; - /** The classification attribute */ private ClassificationTextAttribute cta; --- 41,44 ---- *************** *** 92,147 **** } ! /** ! * Action performed ! * @param e The action event ! */ ! public void oldActionPerformed(ActionEvent e) { ! String result; ! category = null; ! if (Project.getInstance().getActiveSpace().getLevel() == Space.SPACE_LEVEL) { ! category = "Space"; ! } ! if (Project.getInstance().getActiveSpace().getLevel() == Space.ELEMENT_LEVEL) { ! category = "Element"; ! } ! if (Project.getInstance().getActiveSpace().getLevel() == Space.PART_LEVEL) { ! category = "Part"; ! } ! ! ! result = ""; ! if (functional) { ! dialog = new JDialog(GUI.getInstance(), "Create Functional Space", true); ! /*cta = new ClassificationTextAttribute( ! new Attribute("Classification", Project.getInstance().getFunctionalClas(), null, 1)); ! } else { ! dialog = new JDialog(GUI.getInstance(), "Create Construction Space", true); ! cta = new ClassificationTextAttribute( ! new Attribute("Classification", Project.getInstance().getConstructionClas(), null, 1)); ! */ ! } ! Container dialogContent = dialog.getContentPane(); ! cta.addMouseListener(this); ! Box content = Box.createVerticalBox(); ! Box fr = Box.createHorizontalBox(); ! Box sr = Box.createHorizontalBox(); ! fr.add(cta); ! JButton ok = new JButton("Ok"); ! ok.addActionListener(new MyActionListener()); ! JButton cancel = new JButton("Cancel"); ! cancel.addActionListener(new MyActionListener()); ! sr.add(ok); ! sr.add(cancel); ! content.add(fr); ! content.add(sr); ! dialogContent.add(content); ! dialog.setSize(200, 80); ! dialog.setLocationRelativeTo((Component)e.getSource()); ! dialog.show(); ! ! if (log.isDebugEnabled()) { ! log.debug("Input: " + result); ! } ! } /** --- 86,90 ---- } ! /** |