Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv29796/src/net/sourceforge/bprocessor/gl/tool
Modified Files:
FinalMoveTool.java
Log Message:
Now a length can be typed in with the move tool
Index: FinalMoveTool.java
===================================================================
RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/FinalMoveTool.java,v
retrieving revision 1.43
retrieving revision 1.44
diff -C2 -d -r1.43 -r1.44
*** FinalMoveTool.java 13 Dec 2007 12:00:49 -0000 1.43
--- FinalMoveTool.java 17 Dec 2007 08:44:17 -0000 1.44
***************
*** 407,412 ****
@Override
public void onVertex() {
! // TODO Auto-generated method stub
!
}
--- 407,412 ----
@Override
public void onVertex() {
! move();
! finish();
}
***************
*** 489,492 ****
--- 489,494 ----
geometrics = mesh.geometrics();
Project.getInstance().getActiveSpace().addProtected(geometrics);
+ } else {
+ mesh = null;
}
***************
*** 521,533 ****
}
} else {
! if (copy) {
! owner.removeProtected(geometrics);
! owner.insert(mesh);
! geometrics = null;
! }
! owner.simplify();
! Project.getInstance().checkpoint();
! start = null;
! cleanUp();
moved(e);
}
--- 523,527 ----
}
} else {
! finish();
moved(e);
}
***************
*** 535,538 ****
--- 529,547 ----
/**
+ * Finish the tool action
+ */
+ private void finish() {
+ if (copy) {
+ owner.removeProtected(geometrics);
+ owner.insert(mesh);
+ geometrics = null;
+ }
+ owner.simplify();
+ Project.getInstance().checkpoint();
+ start = null;
+ cleanUp();
+ }
+
+ /**
* {@inheritDoc}
*/
***************
*** 541,565 ****
if (value.length() > 0) {
char token = value.charAt(0);
! if (token == '*' || token == '/') {
! String expression = value.substring(1);
! Stack result = evaluateString("echo " + expression);
! if (result.size() == 1) {
! Object top = result.pop();
! if (top instanceof Double) {
! Double d = (Double) top;
! int n = d.intValue();
! if (token == '*') {
! for (int i = 1; i < n - 1; i++) {
! multiply(i);
! }
! } else if (token == '/') {
! for (int i = 1; i < n - 1; i++) {
! divide(i, n);
}
}
-
- Project.getInstance().checkpoint();
}
}
}
}
--- 550,580 ----
if (value.length() > 0) {
char token = value.charAt(0);
! if ((token == '*' || token == '/')) {
! if (mesh != null) {
! String expression = value.substring(1);
! Stack result = evaluateString("echo " + expression);
! if (result.size() == 1) {
! Object top = result.pop();
! if (top instanceof Double) {
! Double d = (Double) top;
! int n = d.intValue();
! if (token == '*') {
! for (int i = 1; i < n - 1; i++) {
! multiply(i);
! }
! } else if (token == '/') {
! for (int i = 1; i < n - 1; i++) {
! divide(i, n);
! }
}
+
+ Project.getInstance().checkpoint();
}
}
+ } else {
+ GUI.getInstance().alert("No copy to repeat");
}
+ } else {
+ super.evaluate(value);
}
}
|