Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv2353/src/net/sourceforge/bprocessor/gl/tool
Modified Files:
SelectStrategy.java
Log Message:
Made the active coordinatesystem unselectable when using multiselection.
Made multiselection sensitive to the direction in which the box was dragged.
Index: SelectStrategy.java
===================================================================
RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SelectStrategy.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** SelectStrategy.java 19 Jun 2007 16:11:06 -0000 1.14
--- SelectStrategy.java 28 Jun 2007 00:37:48 -0000 1.15
***************
*** 12,15 ****
--- 12,16 ----
import java.util.Iterator;
import java.util.List;
+ import java.util.Set;
import org.apache.log4j.Logger;
***************
*** 52,56 ****
/** The drag box */
! protected HashSet box;
/** The target */
--- 53,57 ----
/** The drag box */
! protected HashSet<Edge> box;
/** The target */
***************
*** 82,86 ****
e4.setStrippled(true);
! box = new HashSet();
box.add(e1);
box.add(e2);
--- 83,87 ----
e4.setStrippled(true);
! box = new HashSet<Edge>();
box.add(e1);
box.add(e2);
***************
*** 223,228 ****
--- 224,244 ----
glv.getView().removeTempEdge(constructor);
}
+ int newX = e.getX();
List l = glv.getView().getObjectInArea(x, y,
e.getX(), e.getY());
+ l.remove(Project.getInstance().getActiveCoordinateSystem());
+ if (newX > x) {
+ Set<Geometric> remove = new HashSet<Geometric>();
+ for (Object o : l) {
+ if (o instanceof Geometric) {
+ Geometric geo = (Geometric)o;
+ Set<Vertex> vertices = geo.collect();
+ if (!l.containsAll(vertices)) {
+ remove.add(geo);
+ }
+ }
+ }
+ l.removeAll(remove);
+ }
glv.getView().makeTarget(null);
selection.addAll(l);
|