Login | Register
My pages Projects Community openCollabNet

gef
Reply to message

* = Required fields
* Subject
* Body
Attachments
Send reply to
Topic
Author (directly in email)
Please type the letters in the image above.

Original message

Author bobtarling
Full name Bob Tarling
Date 2006-08-26 03:31:10 PDT
Message User: bobtarling
Date: 2006-08-26 03:31:10-0700
Log:
 Provide constructors backward compatible with CmdSelectNear

File Changes:

Directory: /gef/src/org/tigris/gef/base/
====================​====================​

File [changed]: SelectNearAction.java
Url: http://gef.tigris.or​g/source/browse/gef/​src/org/tigris/gef/b​ase/SelectNearAction​.java?r1=1.1&r2=​1.2
Delta lines: +35 -2
--------------------
--- SelectNearAction.java 2006-08-01 09:36:02-0700 1.1
+++ SelectNearAction.java 2006-08-26 03:31:08-0700 1.2
@@ -54,8 +54,41 @@
 
     private int magnitude;
 
- // ////////////////////​////////////////////​////////////////////​//
- // constructor
+ /**
+ * Creates a new SelectNearAction
+ *
+ * @param name The name of the action
+ * @param dir The direction of the selection
+ */
+ public SelectNearAction(int dir) {
+ this(dir, 1);
+ }
+
+ /**
+ * Creates a new SelectNearAction
+ *
+ * @param name The name of the action
+ * @param dir The direction of the selection
+ */
+ public SelectNearAction(int dir, int mag) {
+ super("SelectNear" + wordFor(dir)); //needs-more-work: direction
+ direction = dir;
+ magnitude = mag;
+ }
+
+ private static String wordFor(int d) {
+ switch(d) {
+ case LEFT:
+ return "Left";
+ case RIGHT:
+ return "Right";
+ case UP:
+ return "Up";
+ case DOWN:
+ return "Down";
+ }
+ return "";
+ }
 
     /**
      * Creates a new SelectNearAction