本文整理了Java中java.awt.event.MouseEvent.isConsumed()
方法的一些代码示例,展示了MouseEvent.isConsumed()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。MouseEvent.isConsumed()
方法的具体详情如下:
包路径:java.awt.event.MouseEvent
类名称:MouseEvent
方法名:isConsumed
暂无
代码示例来源:origin: skylot/jadx
@Override
public void mouseClicked(MouseEvent evt) {
if (evt.getClickCount() % 2 == 0 && !evt.isConsumed()) {
evt.consume();
String str = getSelectedText();
if (str != null) {
highlightAllMatches(str);
}
} else {
highlightAllMatches(null);
}
}
});
代码示例来源:origin: runelite/runelite
@Override
@Replace("mouseClicked")
public void mouseClicked(MouseEvent event)
{
event = client.getCallbacks().mouseClicked(event);
if (!event.isConsumed())
{
rs$mouseClicked(event);
}
}
代码示例来源:origin: runelite/runelite
@Override
@Replace("mouseEntered")
public synchronized void mouseEntered(MouseEvent mouseEvent)
{
if (isInEvent == 0)
{
mouseEvent = client.getCallbacks().mouseEntered(mouseEvent);
}
if (!mouseEvent.isConsumed())
{
isInEvent++;
try
{
rs$mouseEntered(mouseEvent);
}
finally
{
isInEvent--;
}
}
}
代码示例来源:origin: runelite/runelite
@Override
@Replace("mouseReleased")
public synchronized void mouseReleased(MouseEvent mouseEvent)
{
if (isInEvent == 0)
{
mouseEvent = client.getCallbacks().mouseReleased(mouseEvent);
}
if (!mouseEvent.isConsumed())
{
isInEvent++;
try
{
rs$mouseReleased(mouseEvent);
}
finally
{
isInEvent--;
}
}
}
代码示例来源:origin: runelite/runelite
@Override
@Replace("mouseExited")
public synchronized void mouseExited(MouseEvent mouseEvent)
{
if (isInEvent == 0)
{
mouseEvent = client.getCallbacks().mouseExited(mouseEvent);
}
if (!mouseEvent.isConsumed())
{
isInEvent++;
try
{
rs$mouseExited(mouseEvent);
}
finally
{
isInEvent--;
}
}
}
代码示例来源:origin: runelite/runelite
@Override
@Replace("mouseDragged")
public synchronized void mouseDragged(MouseEvent mouseEvent)
{
if (isInEvent == 0)
{
mouseEvent = client.getCallbacks().mouseDragged(mouseEvent);
}
if (!mouseEvent.isConsumed())
{
isInEvent++;
try
{
rs$mouseDragged(mouseEvent);
}
finally
{
isInEvent--;
}
}
}
代码示例来源:origin: runelite/runelite
@Override
@Replace("mouseMoved")
public synchronized void mouseMoved(MouseEvent mouseEvent)
{
if (isInEvent == 0)
{
mouseEvent = client.getCallbacks().mouseMoved(mouseEvent);
}
if (!mouseEvent.isConsumed())
{
isInEvent++;
try
{
rs$mouseMoved(mouseEvent);
}
finally
{
isInEvent--;
}
}
}
}
代码示例来源:origin: runelite/runelite
@Override
@Replace("mousePressed")
public synchronized void mousePressed(MouseEvent mouseEvent)
{
if (isInEvent == 0)
{
mouseEvent = client.getCallbacks().mousePressed(mouseEvent);
}
if (!mouseEvent.isConsumed())
{
isInEvent++;
try
{
rs$mousePressed(mouseEvent);
}
finally
{
isInEvent--;
}
}
}
代码示例来源:origin: magefree/mage
@Override
public void mousePressed(MouseEvent e) {
if ((e.getClickCount() & 1) == 0 && (e.getClickCount() > 0) && !e.isConsumed()) { // double clicks and repeated double clicks
e.consume();
if (e.isAltDown()) {
jButtonAddToSideboardActionPerformed(null);
} else {
jButtonAddToMainActionPerformed(null);
}
}
}
});
代码示例来源:origin: magefree/mage
@Override
public void mousePressed(MouseEvent e) {
if ((e.getClickCount() & 1) == 0 && (e.getClickCount() > 0) && !e.isConsumed()) { // double clicks and repeated double clicks
e.consume();
if (e.isAltDown()) {
handleAltDoubleClick();
} else {
handleDoubleClick();
}
}
}
});
代码示例来源:origin: magefree/mage
@Override
public void mouseReleased(MouseEvent e) {
if (!e.isConsumed()) {
Object obj = e.getSource();
if (obj instanceof MageCard) {
checkMenu(e, ((MageCard) obj).getOriginal());
} else {
checkMenu(e, null);
}
}
}
代码示例来源:origin: magefree/mage
@Override
public void mouseReleased(MouseEvent e) {
if (!e.isConsumed()) {
Object obj = e.getSource();
if (obj instanceof MageCard) {
checkMenu(e, ((MageCard) obj).getOriginal());
} else {
checkMenu(e, null);
}
} else {
cardEventSource.fireEvent(ClientEventType.ACTION_CONSUMED);
}
}
代码示例来源:origin: magefree/mage
@Override
public void mouseClicked(MouseEvent e) {
if ((e.getClickCount() & 1) == 0 && (e.getClickCount() > 0) && !e.isConsumed()) { // double clicks and repeated double clicks
e.consume();
Object obj = e.getSource();
if (obj instanceof Card) {
if (e.isAltDown()) {
cardEventSource.fireEvent(((Card) obj).getOriginal(), ClientEventType.ALT_DOUBLE_CLICK);
} else {
cardEventSource.fireEvent(((Card) obj).getOriginal(), ClientEventType.DOUBLE_CLICK);
}
} else if (obj instanceof MageCard) {
if (e.isAltDown()) {
cardEventSource.fireEvent(((MageCard) obj).getOriginal(), ClientEventType.ALT_DOUBLE_CLICK);
} else {
cardEventSource.fireEvent(((MageCard) obj).getOriginal(), ClientEventType.DOUBLE_CLICK);
}
}
}
}
代码示例来源:origin: magefree/mage
@Override
public void mousePressed(MouseEvent e) {
if (e.getClickCount() >= 1 && !e.isConsumed()) {
Object obj = e.getSource();
if ((e.getClickCount() & 1) == 0 && (e.getClickCount() > 0)) { // double clicks and repeated double clicks
e.consume();
if (obj instanceof Card) {
if (e.isAltDown()) {
cardEventSource.fireEvent(((Card) obj).getOriginal(), ClientEventType.ALT_DOUBLE_CLICK);
} else {
cardEventSource.fireEvent(((Card) obj).getOriginal(), ClientEventType.DOUBLE_CLICK);
}
} else if (obj instanceof MageCard) {
if (e.isAltDown()) {
cardEventSource.fireEvent(((MageCard) obj).getOriginal(), ClientEventType.ALT_DOUBLE_CLICK);
} else {
cardEventSource.fireEvent(((MageCard) obj).getOriginal(),ClientEventType.DOUBLE_CLICK);
}
}
}
if (obj instanceof MageCard) {
checkMenu(e, ((MageCard) obj).getOriginal());
} else {
checkMenu(e, null);
}
}
}
代码示例来源:origin: magefree/mage
@Override
public void mousePressed(MouseEvent e) {
if (e.getClickCount() >= 1 && !e.isConsumed()) {
Object obj = e.getSource();
if ((e.getClickCount() & 1) == 0 && (e.getClickCount() > 0)) { // double clicks and repeated double clicks
e.consume();
if (obj instanceof Card) {
if (e.isAltDown()) {
cardEventSource.fireEvent(((Card) obj).getOriginal(), ClientEventType.ALT_DOUBLE_CLICK);
} else {
cardEventSource.fireEvent(((Card) obj).getOriginal(), ClientEventType.DOUBLE_CLICK);
}
} else if (obj instanceof MageCard) {
if (e.isAltDown()) {
cardEventSource.fireEvent(((MageCard) obj).getOriginal(), ClientEventType.ALT_DOUBLE_CLICK);
} else {
cardEventSource.fireEvent(((MageCard) obj).getOriginal(), ClientEventType.DOUBLE_CLICK);
}
}
}
if (obj instanceof MageCard) {
checkMenu(e, ((MageCard) obj).getOriginal());
} else {
checkMenu(e, null);
}
}
}
代码示例来源:origin: bobbylight/RSyntaxTextArea
/**
* Overridden to also focus the text component on right mouse clicks.
*
* @param e The mouse event.
*/
@Override
public void mousePressed(MouseEvent e) {
super.mousePressed(e);
if (!e.isConsumed() && SwingUtilities.isRightMouseButton(e)) {
JTextComponent c = getComponent();
if (c!=null && c.isEnabled() && c.isRequestFocusEnabled()) {
c.requestFocusInWindow();
}
}
}
代码示例来源:origin: bobbylight/RSyntaxTextArea
public void mouseClicked(MouseEvent e) {
if (! e.isConsumed()) {
代码示例来源:origin: JetBrains/jediterm
private void _processMouseMotionEvent(MouseEvent e) {
MouseEvent event = getTargetEvent(e);
if (event == null) {
return;
}
processMouseMotionEvent(event);
if (event.isConsumed()) {
e.consume();
}
}
代码示例来源:origin: tinyMediaManager/tinyMediaManager
@Override
public void mouseClicked(MouseEvent e) {
if (e.getClickCount() >= 2 && !e.isConsumed() && e.getButton() == MouseEvent.BUTTON1) {
Action editAction = new MovieEditAction(false);
editAction.actionPerformed(null);
}
}
代码示例来源:origin: net.imagej/ij
public void mouseExited(MouseEvent e) {
PlugInTool tool = Toolbar.getPlugInTool();
if (tool!=null) {
tool.mouseExited(imp, e);
if (e.isConsumed()) return;
}
ImageWindow win = imp.getWindow();
if (win!=null)
setCursor(defaultCursor);
IJ.showStatus("");
mouseExited = true;
}
内容来源于网络,如有侵权,请联系作者删除!