/[fenfire]/fenfire/org/fenfire/util/ControlBinding.java
ViewVC logotype

Diff of /fenfire/org/fenfire/util/ControlBinding.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by mudyc, Sun Jun 22 16:14:02 2003 UTC revision 1.4 by mudyc, Sun Jun 22 18:18:14 2003 UTC
# Line 15  public class ControlBinding { Line 15  public class ControlBinding {
15       *  associated with a controller.       *  associated with a controller.
16       *  This is a typesafe enumeration.       *  This is a typesafe enumeration.
17       */       */
18      public static final class Type {      public static final class Type { private Type() {} }
         private Type() {}  
     }  
   
19      public static final Type      public static final Type
20          CLICK = new Type(),          CLICK = new Type(),
21          DRAG = new Type(),          DRAG = new Type(),
# Line 35  public class ControlBinding { Line 32  public class ControlBinding {
32    
33      static private boolean FAST = true;      static private boolean FAST = true;
34      static private boolean ANIMATE = false;      static private boolean ANIMATE = false;
35        public boolean replaceVS = true;
36            
37      // -- Methods to handle events wisely.      // -- Methods to handle events wisely.
38    
# Line 211  public class ControlBinding { Line 208  public class ControlBinding {
208          }          }
209      }          }    
210    
211    
212        public boolean hasBinding(MouseEvent event) {
213            if (event.getID() == event.MOUSE_PRESSED)
214                return true;
215            else if (event.getID() == event.MOUSE_WHEEL) {
216                for (int i=0; i<wheels.size(); i++)
217                    return true;
218            }
219            else if (event.getID() == event.MOUSE_CLICKED) {
220                for (int i=0; i<clicks.size(); i++) {
221                    Event e = (Event)clicks.get(i);
222                    if (event.getModifiers() == e.mask)
223                        return true;
224                }
225            }
226            else if (event.getID() == event.MOUSE_DRAGGED) {
227                for (int i=0; i<drags.size(); i++) {
228                    Event e = (Event)drags.get(i);
229                    if (event.getModifiers() == e.mask)
230                        return true;
231                }
232            }
233            return false;
234        }
235    
236    
237    
238      public interface Controller {      public interface Controller {
239          boolean isChangeable();          boolean isChangeable();
240          void change(float x, float y);          void change(float x, float y);

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26