* Platform subclasses should include an inner class subclass of
* Surface to return from the Platform._createSurface() method
*/
* Platform subclasses should include an inner class subclass of
* Surface to return from the Platform._createSurface() method
*/
if (button == 1) new Message("_Press1", T, root);
else if (button == 2) new Message("_Press2", T, root);
else if (button == 3) {
if (button == 1) new Message("_Press1", T, root);
else if (button == 2) new Message("_Press2", T, root);
else if (button == 3) {
Platform.clipboardReadEnabled = true;
try {
root.putAndTriggerTraps(JSU.S("_Press3"), T);
} finally {
Platform.clipboardReadEnabled = false;
}
Platform.clipboardReadEnabled = true;
try {
root.putAndTriggerTraps(JSU.S("_Press3"), T);
} finally {
Platform.clipboardReadEnabled = false;
}
private final static JS MOVE = JSU.S("_Move");
/** we enqueue ourselves in the Scheduler when we have a Move message to deal with */
private final static JS MOVE = JSU.S("_Move");
/** we enqueue ourselves in the Scheduler when we have a Move message to deal with */
- private Task mover = new Task() {
- public void perform() {
- if (mousex == newmousex && mousey == newmousey) return;
+ private Callable mover = new Callable() {
+ public Object run(Object o) {
+ if (mousex == newmousex && mousey == newmousey) return null;
int oldmousex = mousex; mousex = newmousex;
int oldmousey = mousey; mousey = newmousey;
String oldcursor = cursor; cursor = "default";
int oldmousex = mousex; mousex = newmousex;
int oldmousey = mousey; mousey = newmousey;
String oldcursor = cursor; cursor = "default";
if (oldmousex != mousex || oldmousey != mousey)
root.putAndTriggerTrapsAndCatchExceptions(MOVE, T);
if (!cursor.equals(oldcursor)) syncCursor();
if (oldmousex != mousex || oldmousey != mousey)
root.putAndTriggerTrapsAndCatchExceptions(MOVE, T);
if (!cursor.equals(oldcursor)) syncCursor();
// FEATURE: can we avoid creating objects here?
protected final void PosChange(final int x, final int y) {
// FEATURE: can we avoid creating objects here?
protected final void PosChange(final int x, final int y) {
private boolean scheduled = false;
public void Refresh() { if (!scheduled) Scheduler.add(this); scheduled = true; }
private boolean scheduled = false;
public void Refresh() { if (!scheduled) Scheduler.add(this); scheduled = true; }
public final void setMaximized(boolean b) { if (b != maximized) _setMaximized(maximized = b); }
public final void setMinimized(boolean b) { if (b != minimized) _setMinimized(minimized = b); }
public final void setMaximized(boolean b) { if (b != maximized) _setMaximized(maximized = b); }
public final void setMinimized(boolean b) { if (b != minimized) _setMinimized(minimized = b); }
if (value.toLowerCase().endsWith("shift")) shift = true; else if (shift) value = value.toUpperCase();
if (value.toLowerCase().equals("alt")) alt = true; else if (alt) value = "A-" + value;
if (value.toLowerCase().endsWith("control")) control = true; else if (control) value = "C-" + value;
if (value.equals("C-v") || value.equals("A-v")) Platform.clipboardReadEnabled = true;
this.value = JSU.S(value);
} else if (name.equals("_KeyReleased")) {
if (value.toLowerCase().endsWith("shift")) shift = true; else if (shift) value = value.toUpperCase();
if (value.toLowerCase().equals("alt")) alt = true; else if (alt) value = "A-" + value;
if (value.toLowerCase().endsWith("control")) control = true; else if (control) value = "C-" + value;
if (value.equals("C-v") || value.equals("A-v")) Platform.clipboardReadEnabled = true;
this.value = JSU.S(value);
} else if (name.equals("_KeyReleased")) {
if (value.toLowerCase().equals("alt")) alt = false;
else if (value.toLowerCase().equals("control")) control = false;
else if (value.toLowerCase().equals("shift")) shift = false;
this.value = JSU.S(value);
} else if (name.equals("_HScroll") || name.equals("_VScroll")) {
// FIXME: technically points != pixels
if (value.toLowerCase().equals("alt")) alt = false;
else if (value.toLowerCase().equals("control")) control = false;
else if (value.toLowerCase().equals("shift")) shift = false;
this.value = JSU.S(value);
} else if (name.equals("_HScroll") || name.equals("_VScroll")) {
// FIXME: technically points != pixels
}
try {
boxContainingMouse.putAndTriggerTrapsAndCatchExceptions(JSU.S(name), value);
} finally {
Platform.clipboardReadEnabled = false;
}
}
try {
boxContainingMouse.putAndTriggerTrapsAndCatchExceptions(JSU.S(name), value);
} finally {
Platform.clipboardReadEnabled = false;
}