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(), |
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 |
|
|
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); |