Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv27024/src/net/sourceforge/bprocessor/gl/tool
Modified Files:
RelationTool.java
Log Message:
Removed unnecessary code
Index: RelationTool.java
===================================================================
RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/RelationTool.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** RelationTool.java 12 Mar 2007 08:32:43 -0000 1.3
--- RelationTool.java 13 Mar 2007 14:37:37 -0000 1.4
***************
*** 19,23 ****
import net.sourceforge.bprocessor.gl.GLView;
- import net.sourceforge.bprocessor.gui.GUI;
import net.sourceforge.bprocessor.model.Constructor;
import net.sourceforge.bprocessor.model.CoordinateSystem;
--- 19,22 ----
***************
*** 32,36 ****
public class RelationTool extends AbstractPencil {
private Geometric source;
- private Constructor constructor;
private Edge edge;
--- 31,34 ----
***************
*** 58,62 ****
edge.setTo(current.vertex());
} else {
- // make new feedback
edge = new Edge(source.center(), current.vertex());
edge.setStrippled(true);
--- 56,59 ----
***************
*** 72,78 ****
*/
protected void moved(MouseEvent e) {
- //First find intersection
current = findIntersection(e);
- //Then find targer object
findTarget(e, elements);
glv.getView().makeTarget(target);
--- 69,73 ----
***************
*** 97,101 ****
super.cleanUp();
edge = null;
- constructor = null;
source = null;
}
--- 92,95 ----
***************
*** 108,146 ****
if (source == null) {
if (target != null) {
! if (target instanceof Geometric) {
! source = (Geometric) target;
! start = current;
! active = true;
! } else {
! GUI.getInstance().alert("Have to start by selecting a Constructor");
! }
! } else {
! GUI.getInstance().alert("Have to start by selecting a Constructor");
}
} else {
if (target != null && target != source) {
! if (target instanceof Geometric) {
! Geometric geometric = (Geometric) target;
! if (source instanceof Constructor) {
! constructor = (Constructor) source;
! if (metaPressed) {
! // remove the connection
! constructor.disconnect(geometric);
! } else {
! // add a connection
! constructor.connect(geometric);
! }
! } else {
! Collection<Geometric> geometrics = new LinkedList();
! geometrics.add(source);
! geometrics.add(geometric);
! CoordinateSystem.relate(geometrics);
! }
! Project.getInstance().changed(source);
! Project.getInstance().checkpoint();
! cleanUp();
} else {
! GUI.getInstance().alert("The socondly chosen object were not a geometric object");
}
}
}
--- 102,124 ----
if (source == null) {
if (target != null) {
! source = (Geometric) target;
! start = current;
! active = true;
}
} else {
if (target != null && target != source) {
! Geometric geometric = (Geometric) target;
! if (source instanceof Constructor) {
! Constructor constructor = (Constructor) source;
! constructor.connect(geometric);
} else {
! Collection<Geometric> geometrics = new LinkedList();
! geometrics.add(source);
! geometrics.add(geometric);
! CoordinateSystem.relate(geometrics);
}
+ Project.getInstance().changed(source);
+ Project.getInstance().checkpoint();
+ cleanUp();
}
}
|