Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl
In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv28529/src/net/sourceforge/bprocessor/gl
Modified Files:
Editor.java
Log Message:
Index: Editor.java
===================================================================
RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/Editor.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** Editor.java 1 Dec 2010 10:28:04 -0000 1.17
--- Editor.java 1 Dec 2010 11:52:26 -0000 1.18
***************
*** 399,402 ****
--- 399,411 ----
*/
public Tool changeTool(int mode) {
+ return changeTool(String.valueOf(mode));
+ }
+
+ /**
+ * Change the tool used by gl
+ * @param key The new tool
+ * @return The chosen tool
+ */
+ public Tool changeTool(String key) {
tool.cleanUp();
this.repaint(true);
***************
*** 404,408 ****
glc.removeMouseMotionListener(tool);
glc.removeKeyListener(tool);
! tool = ToolFactory.getFactory(this).get(mode);
if (tool != null) {
glc.addMouseListener(tool);
--- 413,417 ----
glc.removeMouseMotionListener(tool);
glc.removeKeyListener(tool);
! tool = ToolFactory.getFactory(this).get(key);
if (tool != null) {
glc.addMouseListener(tool);
|