Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv13305/src/net/sourceforge/bprocessor/gui/treeview
Modified Files:
LibraryTreeView.java GenericTreeView.java
Log Message:
library and catalog shows 2 different things
Index: LibraryTreeView.java
===================================================================
RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/LibraryTreeView.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** LibraryTreeView.java 12 Nov 2007 14:15:28 -0000 1.2
--- LibraryTreeView.java 12 Nov 2007 19:20:57 -0000 1.3
***************
*** 20,24 ****
super();
root.removeAllChildren();
! root.add(new CatalogContainer("Unions", Project.getInstance().getCatalogObjects()));
model.nodeStructureChanged(root);
}
--- 20,24 ----
super();
root.removeAllChildren();
! root.add(new CatalogContainer("Unions", Project.getLibraryObjects()));
model.nodeStructureChanged(root);
}
***************
*** 27,31 ****
@Override
public void update() {
! ((GenericNode)root.getChildAt(0)).update(Project.getInstance().getCatalogObjects());
}
}
--- 27,31 ----
@Override
public void update() {
! ((GenericNode)root.getChildAt(0)).update(Project.getInstance().getLibraryObjects());
}
}
Index: GenericTreeView.java
===================================================================
RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v
retrieving revision 1.120
retrieving revision 1.121
diff -C2 -d -r1.120 -r1.121
*** GenericTreeView.java 12 Nov 2007 14:15:28 -0000 1.120
--- GenericTreeView.java 12 Nov 2007 19:21:01 -0000 1.121
***************
*** 63,67 ****
import net.sourceforge.bprocessor.gui.GUI;
import net.sourceforge.bprocessor.gui.PopupMenu;
! import net.sourceforge.bprocessor.gui.actions.GeometricMenuAction;
import net.sourceforge.bprocessor.gui.attrview.AttributeView;
--- 63,67 ----
import net.sourceforge.bprocessor.gui.GUI;
import net.sourceforge.bprocessor.gui.PopupMenu;
! import net.sourceforge.bprocessor.gui.actions.CollectionMenuAction;
import net.sourceforge.bprocessor.gui.attrview.AttributeView;
***************
*** 1167,1171 ****
* @param content the children for the node
*/
! public CatalogContainer(String name, List<LibraryObj> content) {
super(name);
for (LibraryObj l : content) {
--- 1167,1171 ----
* @param content the children for the node
*/
! public CatalogContainer(String name, Collection<LibraryObj> content) {
super(name);
for (LibraryObj l : content) {
***************
*** 1225,1237 ****
public JPopupMenu menu() {
JPopupMenu menu = new JPopupMenu();
! Collection<Space> spaces = new LinkedList<Space>();
! spaces.add(((LibraryObj)getUserObject()).getSpace());
! menu.add(new GeometricMenuAction(spaces, "Instanciate") {
public void actionPerformed(ActionEvent e) {
Project proj = Project.getInstance();
Space world = proj.getActiveSpace();
! for (Geometric g : entities) {
! Space space = (Space)g;
Space instance = new Space(space.getName() + " instance ", space.getType(), false);
instance.setProto(space);
space.setOwner(instance);
--- 1225,1239 ----
public JPopupMenu menu() {
JPopupMenu menu = new JPopupMenu();
! Collection<LibraryObj> spaces = new LinkedList<LibraryObj>();
! spaces.add((LibraryObj)getUserObject());
! menu.add(new CollectionMenuAction(spaces, "Instanciate") {
public void actionPerformed(ActionEvent e) {
Project proj = Project.getInstance();
Space world = proj.getActiveSpace();
! for (Object o : col) {
! LibraryObj lo = (LibraryObj)o;
! Space space = lo.getSpace();
Space instance = new Space(space.getName() + " instance ", space.getType(), false);
+ proj.addCalalogObject(lo);
instance.setProto(space);
space.setOwner(instance);
|