Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18190/src/net/sourceforge/bprocessor/gui
Modified Files:
PopupMenu.java
Log Message:
Fixes
Index: PopupMenu.java
===================================================================
RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/PopupMenu.java,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -d -r1.23 -r1.24
*** PopupMenu.java 29 Jan 2007 11:57:09 -0000 1.23
--- PopupMenu.java 31 Jan 2007 15:22:19 -0000 1.24
***************
*** 14,18 ****
import java.util.LinkedList;
import java.util.Map;
- import java.util.Set;
import javax.swing.AbstractAction;
--- 14,17 ----
***************
*** 207,238 ****
};
pm.add(instantiate);
- AbstractAction makeunion = new CollectionMenuAction(s, "Make Union") {
- public void actionPerformed(ActionEvent arg0) {
- Set internal = new HashSet();
- internal.addAll(col);
-
- Set envelope = new HashSet();
- {
- Iterator iter = internal.iterator();
- while (iter.hasNext()) {
- Space current = (Space) iter.next();
- Iterator sit = current.getEnvelope().iterator();
- while (sit.hasNext()) {
- Surface surface = (Surface) sit.next();
- if (!internal.contains(surface.getBackDomain())) {
- envelope.add(surface);
- } else if (!internal.contains(surface.getFrontDomain())) {
- envelope.add(surface);
- }
- }
- }
- }
- Selection.primary().clear();
- Selection.primary().addAll(envelope);
- Project.getInstance().checkpoint();
- }
- };
- pm.add(makeunion);
-
if (s.size() == 1) {
// Some options do only apply to one space
--- 206,209 ----
***************
*** 386,400 ****
};
menu.add(allConnected);
AbstractAction makeUnion = new EntitiesMenuAction(entities, "Make Union") {
public void actionPerformed(ActionEvent e) {
Collection<Surface> surfaces = new HashSet<Surface>();
Collection<Geometric> geometrics = (Collection<Geometric>) entities;
for (Geometric geometric : geometrics) {
! if (geometric instanceof Surface) {
! surfaces.add((Surface) geometric);
}
}
! Collection<Space> spaces = new HashSet<Space>();
! Space owner = null;
for (Surface surface : surfaces) {
owner = surface.getOwner();
--- 357,379 ----
};
menu.add(allConnected);
+
AbstractAction makeUnion = new EntitiesMenuAction(entities, "Make Union") {
public void actionPerformed(ActionEvent e) {
Collection<Surface> surfaces = new HashSet<Surface>();
+ Collection<Space> interior = new HashSet<Space>();
+ Collection<Space> spaces = new HashSet<Space>();
+ Space owner = null;
+
Collection<Geometric> geometrics = (Collection<Geometric>) entities;
for (Geometric geometric : geometrics) {
! if (geometric instanceof Space) {
! interior.add((Space) geometric);
}
}
!
! for (Space space : interior) {
! surfaces.addAll(space.getEnvelope());
! }
!
for (Surface surface : surfaces) {
owner = surface.getOwner();
***************
*** 407,417 ****
}
}
! Collection<Space> interior = new HashSet<Space>();
! for (Space space : spaces) {
! interior.add(space);
! }
! for (Space space : interior) {
! surfaces.addAll(space.getEnvelope());
! }
Collection<Surface> inside = new LinkedList<Surface>();
Collection<Surface> border = new LinkedList<Surface>();
--- 386,390 ----
}
}
!
Collection<Surface> inside = new LinkedList<Surface>();
Collection<Surface> border = new LinkedList<Surface>();
***************
*** 489,492 ****
--- 462,466 ----
Selection.primary().clear();
Selection.primary().add(union);
+ Project.getInstance().checkpoint();
}
};
|