[Bprocessor-commit] gui/src/net/sourceforge/bprocessor/gui/actions AttributeMenuAction.java, NONE,
Status: Pre-Alpha
Brought to you by:
henryml
From: rimestad <rim...@us...> - 2006-09-26 09:51:04
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18226/src/net/sourceforge/bprocessor/gui/actions Modified Files: CreateFunctionalSpaceActionListener.java CreateConstructionSpaceActionListener.java Added Files: AttributeMenuAction.java EntityMenuAction.java SpaceMenuAction.java ModellorMenuAction.java EntitiesMenuAction.java Log Message: moved popup generation to a static gui class along with actions --- NEW FILE: AttributeMenuAction.java --- //--------------------------------------------------------------------------------- // $Id: AttributeMenuAction.java,v 1.1 2006/09/26 09:50:54 rimestad Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.gui.actions; import javax.swing.AbstractAction; import net.sourceforge.bprocessor.model.Attribute; /** * Actions for a attribute */ public abstract class AttributeMenuAction extends AbstractAction { /** The entity */ protected Attribute attribute; /** * The constructor * @param a the attribute * @param name the name of the action */ public AttributeMenuAction(Attribute a, String name) { super(name); this.attribute = a; } } --- NEW FILE: EntityMenuAction.java --- //--------------------------------------------------------------------------------- // $Id: EntityMenuAction.java,v 1.1 2006/09/26 09:50:54 rimestad Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.gui.actions; import javax.swing.AbstractAction; import net.sourceforge.bprocessor.model.Entity; /** * Actions for a entity */ public abstract class EntityMenuAction extends AbstractAction { /** The entity */ protected Entity entity; /** * The constructor * @param ent the entity * @param name the name of the action */ public EntityMenuAction(Entity ent, String name) { super(name); this.entity = ent; } } --- NEW FILE: EntitiesMenuAction.java --- //--------------------------------------------------------------------------------- // $Id: EntitiesMenuAction.java,v 1.1 2006/09/26 09:50:54 rimestad Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.gui.actions; import java.util.Collection; import javax.swing.AbstractAction; /** * Actions for a entity */ public abstract class EntitiesMenuAction extends AbstractAction { /** The entity */ protected Collection entities; /** * The constructor * @param ent the entity * @param name the name of the action */ public EntitiesMenuAction(Collection ent, String name) { super(name); this.entities = ent; } } --- NEW FILE: SpaceMenuAction.java --- //--------------------------------------------------------------------------------- // $Id: SpaceMenuAction.java,v 1.1 2006/09/26 09:50:54 rimestad Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.gui.actions; import javax.swing.AbstractAction; import net.sourceforge.bprocessor.model.Space; /** * Actions for a entity */ public abstract class SpaceMenuAction extends AbstractAction { /** The entity */ protected Space space; /** * The constructor * @param s the space * @param name the name of the action */ public SpaceMenuAction(Space s, String name) { super(name); this.space = s; } } Index: CreateConstructionSpaceActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/CreateConstructionSpaceActionListener.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** CreateConstructionSpaceActionListener.java 14 Sep 2006 13:38:02 -0000 1.9 --- CreateConstructionSpaceActionListener.java 26 Sep 2006 09:50:54 -0000 1.10 *************** *** 44,51 **** if (result != null && !result.trim().equals("")) { ! Space cs = Space.createConstructionSpace(result.trim()); ! Project.getInstance().getActiveSpace().add(cs); ! Project.getInstance().changed(Project.getInstance()); ! Project.getInstance().checkpoint(); } } --- 44,55 ---- if (result != null && !result.trim().equals("")) { ! try { ! Space cs = Project.getInstance().getActiveSpace().createConstructionSpace(result.trim()); ! Project.getInstance().getActiveSpace().add(cs); ! Project.getInstance().changed(Project.getInstance()); ! Project.getInstance().checkpoint(); ! } catch (Exception ex) { ! ex.printStackTrace(); ! } } } Index: CreateFunctionalSpaceActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/CreateFunctionalSpaceActionListener.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** CreateFunctionalSpaceActionListener.java 24 Jan 2006 14:10:37 -0000 1.8 --- CreateFunctionalSpaceActionListener.java 26 Sep 2006 09:50:54 -0000 1.9 *************** *** 44,49 **** if (result != null && !result.trim().equals("")) { ! Space fs = Space.createFunctionalSpace(result.trim()); ! Project.getInstance().add(fs); } } --- 44,54 ---- if (result != null && !result.trim().equals("")) { ! try { ! Space fs = Project.getInstance().getActiveSpace().createFunctionalSpace(result.trim()); ! Project.getInstance().add(fs); ! Project.getInstance().checkpoint(); ! } catch (Exception ex) { ! ex.printStackTrace(); ! } } } --- NEW FILE: ModellorMenuAction.java --- //--------------------------------------------------------------------------------- // $Id: ModellorMenuAction.java,v 1.1 2006/09/26 09:50:54 rimestad Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.gui.actions; import javax.swing.AbstractAction; import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.modellor.Modellor; /** * Actions for a entity */ public abstract class ModellorMenuAction extends AbstractAction { /** The space */ protected Space space; /** The modellor */ protected Modellor modellor; /** * The constructor * @param s the space * @param m the modellor */ public ModellorMenuAction(Space s, Modellor m) { super(m.getGeneralName()); this.space = s; this.modellor = m; } } |