Preserve the event timestamp and modifiers.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3544 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -30,6 +30,7 @@ import java.awt.Graphics;
|
|||||||
import java.awt.Rectangle;
|
import java.awt.Rectangle;
|
||||||
import java.awt.Shape;
|
import java.awt.Shape;
|
||||||
|
|
||||||
|
import java.awt.event.ActionEvent;
|
||||||
import java.awt.event.MouseEvent;
|
import java.awt.event.MouseEvent;
|
||||||
|
|
||||||
import javax.swing.JComponent;
|
import javax.swing.JComponent;
|
||||||
@@ -646,15 +647,21 @@ public class MediaPanel extends JComponent
|
|||||||
|
|
||||||
if ((_activeSprite instanceof ActionSprite) &&
|
if ((_activeSprite instanceof ActionSprite) &&
|
||||||
_activeSprite.hitTest(me.getX(), me.getY())) {
|
_activeSprite.hitTest(me.getX(), me.getY())) {
|
||||||
|
ActionEvent event;
|
||||||
if (_activeSprite instanceof CommandSprite) {
|
if (_activeSprite instanceof CommandSprite) {
|
||||||
CommandSprite cs = (CommandSprite) _activeSprite;
|
CommandSprite cs = (CommandSprite) _activeSprite;
|
||||||
Controller.postAction(MediaPanel.this,
|
event = new CommandEvent(
|
||||||
cs.getActionCommand(), cs.getCommandArgument());
|
MediaPanel.this, cs.getActionCommand(),
|
||||||
|
cs.getCommandArgument(), me.getWhen(),
|
||||||
|
me.getModifiers());
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
Controller.postAction(MediaPanel.this,
|
ActionSprite as = (ActionSprite) _activeSprite;
|
||||||
((ActionSprite) _activeSprite).getActionCommand());
|
event = new ActionEvent(
|
||||||
|
MediaPanel.this, ActionEvent.ACTION_PERFORMED,
|
||||||
|
as.getActionCommand(), me.getWhen(), me.getModifiers());
|
||||||
}
|
}
|
||||||
|
Controller.postAction(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(_activeSprite instanceof HoverSprite)) {
|
if (!(_activeSprite instanceof HoverSprite)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user