Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19256/src/net/sourceforge/bprocessor/model
Modified Files:
Line.java Constructor.java
Log Message:
Added editable boolean to constructor which remove the drawing of handles and arrows, to be used when constructors are to resemble computed directions and placements. It is still moveable though.
Index: Constructor.java
===================================================================
RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Constructor.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** Constructor.java 20 Jul 2006 13:00:40 -0000 1.5
--- Constructor.java 27 Jul 2006 10:27:02 -0000 1.6
***************
*** 20,23 ****
--- 20,25 ----
private boolean active;
+ /** Specify wether the constructor is changable */
+ private boolean editable;
/**
* True if the constructor is active
***************
*** 42,45 ****
--- 44,60 ----
this.origin = origin;
this.active = false;
+ this.editable = true;
+ }
+
+ /**
+ * The constructor method
+ * @param origin The origin of the constructor
+ * @param active Is the constructor active
+ * @param editable Is it editable
+ */
+ public Constructor(Vertex origin, boolean active, boolean editable) {
+ this.origin = origin;
+ this.active = active;
+ this.editable = editable;
}
***************
*** 75,77 ****
--- 90,115 ----
public abstract void delete();
+ /**
+ * @return Returns the editable.
+ */
+ public boolean isEditable() {
+ return editable;
+ }
+
+ /**
+ * @param editable The editable to set.
+ */
+ public void setEditable(boolean editable) {
+ this.editable = editable;
+ }
+
+ /**
+ * Move the constructor
+ * @param x the movement in x
+ * @param y the movement in y
+ * @param z the movement in z
+ */
+ public void move(double x, double y, double z) {
+ getOrigin().add(new Vertex(x, y, z));
+ }
}
Index: Line.java
===================================================================
RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Line.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** Line.java 27 Jul 2006 08:05:21 -0000 1.15
--- Line.java 27 Jul 2006 10:27:02 -0000 1.16
***************
*** 50,53 ****
--- 50,66 ----
/**
+ * Constructor of the Line with orgin and three angles
+ * @param origin The origin
+ * @param dir The vector of direction
+ * @param active If the constructor is active
+ * @param editable If the constructor is editable
+ */
+ public Line(Vertex origin, Vertex dir, boolean active, boolean editable) {
+ super(origin, active, editable);
+ dir.normalize();
+ this.dir = dir;
+ }
+
+ /**
* Get a direction vector for the line
* @return A non stored vertex that points in the direction of the line and are of length 1
***************
*** 110,113 ****
--- 123,127 ----
}
setActive(((Boolean)(((Attribute)attributes.get(10)).getValue())).booleanValue());
+ setEditable(((Boolean)(((Attribute)attributes.get(11)).getValue())).booleanValue());
}
***************
*** 132,135 ****
--- 146,154 ----
res.add(new Attribute("Active", Boolean.FALSE));
}
+ if (isEditable()) {
+ res.add(new Attribute("Editable", Boolean.TRUE));
+ } else {
+ res.add(new Attribute("Editable", Boolean.FALSE));
+ }
return res;
}
***************
*** 196,200 ****
Vertex to = origin.add(direction);
Edge constructor = new Guide(from, to);
- constructor.setConstructor(true);
return constructor;
}
--- 215,218 ----
|