Imported GNU Classpath 0.19 + gcj-import-20051115.
* sources.am: Regenerated. * Makefile.in: Likewise. * scripts/makemake.tcl: Use glob -nocomplain. From-SVN: r107049
This commit is contained in:
parent
02e549bfaa
commit
8f523f3a10
1241 changed files with 97711 additions and 25284 deletions
|
@ -197,16 +197,27 @@ public abstract class InputEvent extends ComponentEvent
|
|||
private final long when;
|
||||
|
||||
/**
|
||||
* The modifiers in effect for this event. Package visible for use by
|
||||
* subclasses. The old style (bitmask 0x3f) should not be mixed with the
|
||||
* new style (bitmasks 0xffffffc0).
|
||||
* The old-style modifiers in effect for this event. Package visible
|
||||
* for use by subclasses. The old style (bitmask 0x3f) should not be
|
||||
* mixed with the new style (bitmasks 0xffffffc0).
|
||||
*
|
||||
* @see #getModifiers()
|
||||
* @see MouseEvent
|
||||
* @serial the modifier state, stored in the new style
|
||||
* @serial the modifier state, stored in the old style
|
||||
*/
|
||||
int modifiers;
|
||||
|
||||
/**
|
||||
* The new-style modifiers in effect for this event. Package visible
|
||||
* for use by subclasses. The old style (bitmask 0x3f) should not be
|
||||
* mixed with the new style (bitmasks 0xffffffc0).
|
||||
*
|
||||
* @see #getModifiersEx()
|
||||
* @see MouseEvent
|
||||
* @serial the modifier state, stored in the new style
|
||||
*/
|
||||
int modifiersEx;
|
||||
|
||||
/**
|
||||
* Initializes a new instance of <code>InputEvent</code> with the specified
|
||||
* source, id, timestamp, and modifiers. Note that an invalid id leads to
|
||||
|
@ -222,7 +233,8 @@ public abstract class InputEvent extends ComponentEvent
|
|||
{
|
||||
super(source, id);
|
||||
this.when = when;
|
||||
this.modifiers = EventModifier.extend(modifiers);
|
||||
this.modifiers = modifiers & EventModifier.OLD_MASK;
|
||||
this.modifiersEx = modifiers & EventModifier.NEW_MASK;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -232,7 +244,8 @@ public abstract class InputEvent extends ComponentEvent
|
|||
*/
|
||||
public boolean isShiftDown()
|
||||
{
|
||||
return (modifiers & SHIFT_DOWN_MASK) != 0;
|
||||
return ((modifiers & SHIFT_MASK) != 0)
|
||||
|| ((modifiersEx & SHIFT_DOWN_MASK) != 0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -243,7 +256,8 @@ public abstract class InputEvent extends ComponentEvent
|
|||
*/
|
||||
public boolean isControlDown()
|
||||
{
|
||||
return (modifiers & CTRL_DOWN_MASK) != 0;
|
||||
return ((modifiers & CTRL_MASK) != 0)
|
||||
|| ((modifiersEx & CTRL_DOWN_MASK) != 0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -253,7 +267,8 @@ public abstract class InputEvent extends ComponentEvent
|
|||
*/
|
||||
public boolean isMetaDown()
|
||||
{
|
||||
return (modifiers & META_DOWN_MASK) != 0;
|
||||
return ((modifiers & META_MASK) != 0)
|
||||
|| ((modifiersEx & META_DOWN_MASK) != 0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -263,7 +278,8 @@ public abstract class InputEvent extends ComponentEvent
|
|||
*/
|
||||
public boolean isAltDown()
|
||||
{
|
||||
return (modifiers & ALT_DOWN_MASK) != 0;
|
||||
return ((modifiers & ALT_MASK) != 0)
|
||||
|| ((modifiersEx & ALT_DOWN_MASK) != 0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -274,7 +290,8 @@ public abstract class InputEvent extends ComponentEvent
|
|||
*/
|
||||
public boolean isAltGraphDown()
|
||||
{
|
||||
return (modifiers & ALT_GRAPH_DOWN_MASK) != 0;
|
||||
return ((modifiers & ALT_GRAPH_MASK) != 0)
|
||||
|| ((modifiersEx & ALT_GRAPH_DOWN_MASK) != 0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -300,7 +317,7 @@ public abstract class InputEvent extends ComponentEvent
|
|||
*/
|
||||
public int getModifiers()
|
||||
{
|
||||
return EventModifier.revert(modifiers);
|
||||
return modifiers;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -321,7 +338,7 @@ public abstract class InputEvent extends ComponentEvent
|
|||
*/
|
||||
public int getModifiersEx()
|
||||
{
|
||||
return modifiers;
|
||||
return modifiersEx;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -106,6 +106,13 @@ public class InvocationEvent extends AWTEvent implements ActiveEvent
|
|||
*/
|
||||
private Exception exception;
|
||||
|
||||
/**
|
||||
* This is the caught Throwable thrown in the <code>run()</code> method.
|
||||
* It is null if throwables are ignored, the run method hasn't completed,
|
||||
* or there were no throwables thrown.
|
||||
*/
|
||||
private Throwable throwable;
|
||||
|
||||
/**
|
||||
* The timestamp when this event was created.
|
||||
*
|
||||
|
@ -183,9 +190,11 @@ public class InvocationEvent extends AWTEvent implements ActiveEvent
|
|||
{
|
||||
runnable.run();
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (Throwable t)
|
||||
{
|
||||
exception = e;
|
||||
throwable = t;
|
||||
if (t instanceof Exception)
|
||||
exception = (Exception)t;
|
||||
}
|
||||
else
|
||||
runnable.run();
|
||||
|
@ -210,6 +219,18 @@ public class InvocationEvent extends AWTEvent implements ActiveEvent
|
|||
return exception;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a throwable caught while executing the Runnable's run() method.
|
||||
* Null if none was thrown or if this InvocationEvent doesn't catch
|
||||
* throwables.
|
||||
* @return the caught Throwable
|
||||
* @since 1.5
|
||||
*/
|
||||
public Throwable getThrowable()
|
||||
{
|
||||
return throwable;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the timestamp of when this event was created.
|
||||
*
|
||||
|
|
|
@ -1735,6 +1735,6 @@ public class KeyEvent extends InputEvent
|
|||
throws IOException, ClassNotFoundException
|
||||
{
|
||||
s.defaultReadObject();
|
||||
modifiers = EventModifier.extend(modifiers);
|
||||
modifiersEx = EventModifier.extend(modifiers) & EventModifier.NEW_MASK;
|
||||
}
|
||||
} // class KeyEvent
|
||||
|
|
|
@ -42,6 +42,7 @@ import gnu.java.awt.EventModifier;
|
|||
|
||||
import java.awt.Component;
|
||||
import java.awt.Point;
|
||||
import java.awt.PopupMenu;
|
||||
import java.io.IOException;
|
||||
import java.io.ObjectInputStream;
|
||||
|
||||
|
@ -227,6 +228,12 @@ public class MouseEvent extends InputEvent
|
|||
else if ((modifiers & BUTTON3_MASK) != 0)
|
||||
this.button = BUTTON3;
|
||||
}
|
||||
// clear the mouse button modifier masks if this is a button
|
||||
// release event.
|
||||
if (id == MOUSE_RELEASED)
|
||||
this.modifiersEx &= ~(BUTTON1_DOWN_MASK
|
||||
| BUTTON2_DOWN_MASK
|
||||
| BUTTON3_DOWN_MASK);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -392,17 +399,9 @@ public class MouseEvent extends InputEvent
|
|||
s.append("unknown type,(");
|
||||
}
|
||||
s.append(x).append(',').append(y).append("),button=").append(button);
|
||||
if ((modifiers & EventModifier.NEW_MASK) != 0)
|
||||
{
|
||||
int mod = modifiers;
|
||||
if ((mod & (ALT_DOWN_MASK | BUTTON2_DOWN_MASK)) != 0)
|
||||
mod |= ALT_DOWN_MASK | BUTTON2_DOWN_MASK;
|
||||
if ((mod & (META_DOWN_MASK | BUTTON3_DOWN_MASK)) != 0)
|
||||
mod |= META_DOWN_MASK | BUTTON3_DOWN_MASK;
|
||||
s.append(",modifiers=").append(getModifiersExText(mod));
|
||||
}
|
||||
if (modifiers != 0)
|
||||
s.append(",extModifiers=").append(getModifiersExText(modifiers));
|
||||
// FIXME: need a mauve test for this method
|
||||
if (modifiersEx != 0)
|
||||
s.append(",extModifiers=").append(getModifiersExText(modifiersEx));
|
||||
return s.append(",clickCount=").append(clickCount).toString();
|
||||
}
|
||||
|
||||
|
@ -426,7 +425,7 @@ public class MouseEvent extends InputEvent
|
|||
button = BUTTON2;
|
||||
else if ((modifiers & BUTTON3_MASK) != 0)
|
||||
button = BUTTON3;
|
||||
modifiers = EventModifier.extend(modifiers);
|
||||
modifiersEx = EventModifier.extend(modifiers) & EventModifier.NEW_MASK;
|
||||
}
|
||||
}
|
||||
} // class MouseEvent
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue