java.awt.event.MouseEvent.isAltDown()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(7.4k)|赞(0)|评价(0)|浏览(290)

本文整理了Java中java.awt.event.MouseEvent.isAltDown()方法的一些代码示例,展示了MouseEvent.isAltDown()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。MouseEvent.isAltDown()方法的具体详情如下:
包路径:java.awt.event.MouseEvent
类名称:MouseEvent
方法名:isAltDown

MouseEvent.isAltDown介绍

暂无

代码示例

代码示例来源:origin: runelite/runelite

@Override
public MouseEvent mouseClicked(MouseEvent e)
{
  // Check if left click + alt
  if (e.getButton() == MouseEvent.BUTTON1 && e.isAltDown())
  {
    final MenuEntry[] menuEntries = client.getMenuEntries();
    for (final MenuEntry menuEntry : menuEntries)
    {
      if (menuEntry.getOption().equals(SEARCH_GRAND_EXCHANGE))
      {
        search(Text.removeTags(menuEntry.getTarget()));
        e.consume();
        break;
      }
    }
  }
  return super.mouseClicked(e);
}

代码示例来源: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 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 mouseClicked(MouseEvent e) {
    if (SwingUtilities.isRightMouseButton(e)) {
      // Select if not selected
      if (!card.isSelected()) {
        selectCard(card);
      }
      // Show menu
      showCardRightClickMenu(card, e);
    } else if (SwingUtilities.isLeftMouseButton(e)) {
      if (e.getClickCount() == 1) {
        cardClicked(card, e);
      } else if (e.isAltDown()) {
        eventSource.fireEvent(card, ClientEventType.ALT_DOUBLE_CLICK);
      } else {
        eventSource.fireEvent(card, 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: in.jlibs/org-netbeans-api-visual

/**
 * @see MouseEvent
 */
public boolean isAltDown() {
  return event.isAltDown();
}

代码示例来源:origin: org.tinyjee.jgraphx/jgraphx

/**
 * Note: This is not used during drag and drop operations due to limitations
 * of the underlying API. To enable this for move operations set dragEnabled
 * to false.
 * 
 * @param event
 * @return Returns true if the given event is constrained.
 */
public boolean isForceMarqueeEvent(MouseEvent event)
{
  return (event != null) ? event.isAltDown() : false;
}

代码示例来源:origin: com.github.vlsi.mxgraph/jgraphx

/**
 * Note: This is not used during drag and drop operations due to limitations
 * of the underlying API. To enable this for move operations set dragEnabled
 * to false.
 * 
 * @param event
 * @return Returns true if the given event is constrained.
 */
public boolean isForceMarqueeEvent(MouseEvent event)
{
  return (event != null) ? event.isAltDown() : false;
}

代码示例来源:origin: protegeproject/protege

public void mousePressed(MouseEvent e) {
    if (e.isPopupTrigger()) {
      showPopupMenu(e);
    }
    if (e.isAltDown()) {
      expandDescendantsOfRowAt(e.getX(), e.getY());
    }
  }
});

代码示例来源:origin: edu.stanford.protege/protege-editor-owl

public void mousePressed(MouseEvent e) {
    if (e.isPopupTrigger()) {
      showPopupMenu(e);
    }
    if (e.isAltDown()) {
      expandDescendantsOfRowAt(e.getX(), e.getY());
    }
  }
});

代码示例来源:origin: org.openimaj/demos

@Override
public void mousePressed(MouseEvent e) {
  if (e.isAltDown()) {
    pressClick = new Point2dImpl(e.getX(), e.getY());
  }
}

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

@Override public void mouseClicked(MouseEvent e) {
  super.mouseClicked(e);
  if (((e.getModifiers() & InputEvent.BUTTON1_MASK) != InputEvent.BUTTON1_MASK)
   || e.isAltDown()) {
   popupCopyRangeMenu(e.getX(), e.getY());
  }
 }
});

代码示例来源:origin: biojava/biojava

private boolean keyPressed(MouseEvent e) {
  if (e.isShiftDown() || e.isControlDown() || e.isAltDown())
    return true;
  return false;
}

代码示例来源:origin: net.sf.meka/meka

/**
  * Checks whether no modified key is pressed.
  *
  * @param e        the event
  * @return        true if no modifier key pressed
  */
 public static boolean hasNoModifierKey(MouseEvent e) {
  return (!e.isAltDown() && !e.isShiftDown() && !e.isControlDown());
 }
}

代码示例来源:origin: com.github.waikato/fcms-widgets

/**
 * Checks whether no modified key is pressed.
 *
 * @param e        the event
 * @return        true if no modifier key pressed
 */
public static boolean hasNoModifierKey(MouseEvent e) {
 return (!e.isAltDown() && !e.isShiftDown() && !e.isControlDown());
}

代码示例来源:origin: net.imagej/ij

public void mouseDragged(ImagePlus imp, MouseEvent e) {
  if (imp == null || ic == null) return;
  roi = imp.getRoi();
  if (roi == null) return;
  isImageRoi = roi instanceof ImageRoi;
  if (isImageRoi)
    ((ImageRoi)roi).setZeroTransparent(true);
  
  if ( e.isAltDown() || e.isShiftDown() )
    moveRoi(e.getX(), e.getY());
  else
    rotateRoi(e.getX(), e.getY());
}

代码示例来源:origin: Waikato/meka

@Override
  public void mouseClicked(MouseEvent e) {
    TableColumnModel columnModel = fTable.getColumnModel();
    int viewColumn = columnModel.getColumnIndexAtX(e.getX());
    int column = fTable.convertColumnIndexToModel(viewColumn);
    if (MouseUtils.isLeftClick(e) && !e.isAltDown() && !e.isControlDown() && (column != -1))
      fModel.sort(column, !e.isShiftDown());
  }
};

代码示例来源:origin: sc.fiji/TrakEM2_

@Override
public void mouseReleased(final MouseEvent me, final Layer la, final int x_p, final int y_p, final int x_d, final int y_d, final int x_r, final int y_r) {
  if (null == getActive()) return;
  if (me.isShiftDown() && me.isAltDown() && !Utils.isControlDown(me)) {
    updateViewData(getActive());
    return;
  }
  super.mouseReleased(me, la, x_p, y_p, x_d, y_d, x_r, y_r);
}

相关文章