本文整理了Java中java.awt.event.MouseEvent.isShiftDown()
方法的一些代码示例,展示了MouseEvent.isShiftDown()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。MouseEvent.isShiftDown()
方法的具体详情如下:
包路径:java.awt.event.MouseEvent
类名称:MouseEvent
方法名:isShiftDown
暂无
代码示例来源:origin: libgdx/libgdx
public void mousePressed (MouseEvent event) {
movingIndex = overIndex;
moveAll = event.isControlDown();
if (moveAll) {
moveAllProportionally = event.isShiftDown();
moveAllPrevY = event.getY();
}
}
代码示例来源:origin: libgdx/libgdx
public void mousePressed (MouseEvent event) {
movingIndex = overIndex;
moveAll = event.isControlDown();
if (moveAll) {
moveAllProportionally = event.isShiftDown();
moveAllPrevY = event.getY();
}
}
代码示例来源:origin: runelite/runelite
@Override
public void mousePressed(MouseEvent e)
{
if (!e.isShiftDown())
{
clearCombinedSlots();
}
if (slot.isSelected())
{
combinedActionSlots.remove(slot);
}
else
{
combinedActionSlots.add(slot);
}
slot.setSelected(!slot.isSelected());
updateCombinedAction();
}
});
代码示例来源:origin: runelite/runelite
@Override
public MouseEvent mousePressed(MouseEvent mouseEvent)
{
if (mouseEvent.getButton() != MouseEvent.BUTTON1)
{
return mouseEvent;
}
if (isInBounds == null || !isInBounds.test(mouseEvent))
{
if (cursor != cursorEnd)
{
selectionStart = -1;
selectionEnd = -1;
cursorAt(getCharOffset.applyAsInt(mouseEvent));
}
return mouseEvent;
}
int nco = getCharOffset.applyAsInt(mouseEvent);
if (mouseEvent.isShiftDown() && selectionEnd != -1)
{
selectionEnd = nco;
cursorAt(selectionStart, selectionEnd);
}
else
{
selectionStart = nco;
cursorAt(nco);
}
return mouseEvent;
}
代码示例来源:origin: magefree/mage
@Override
public void mousePressed(MouseEvent e) {
if (SwingUtilities.isLeftMouseButton(e)) {
isDragging = true;
beginSelectionDrag(e.getX(), e.getY(), e.isShiftDown());
updateSelectionDrag(e.getX(), e.getY());
}
}
代码示例来源:origin: fossasia/neurolab-desktop
@Override
public void mousePressed(MouseEvent e)
if ((e.getButton() == 2) || (e.isShiftDown()))
代码示例来源:origin: winder/Universal-G-Code-Sender
/** Mouse Motion Listener Events **/
@Override
public void mouseDragged(MouseEvent me) {
this.current = me.getPoint();
int dx = this.current.x - this.last.x;
int dy = this.current.y - this.last.y;
if (me.isShiftDown() || me.getModifiers() == this.panMouseButton) {
if (ortho) {
// Treat dx and dy as vectors relative to the rotation angle.
this.eye.x -= ((dx * this.translationVectorH.x * this.panMultiplierX) + (dy * this.translationVectorV.x * panMultiplierY));
this.eye.y += ((dy * this.translationVectorV.y * panMultiplierY) - (dx * this.translationVectorH.y * this.panMultiplierX));
this.eye.z -= ((dx * this.translationVectorH.z * this.panMultiplierX) + (dy * this.translationVectorV.z * panMultiplierY));
} else {
this.eye.x += dx;
this.eye.y += dy;
}
} else {
this.rotation.x += dx / 2.0;
this.rotation.y -= dy / 2.0;
if (ortho) {
setHorizontalTranslationVector();
setVerticalTranslationVector();
}
}
// Now that the motion has been accumulated, reset last.
this.last = this.current;
}
代码示例来源:origin: magefree/mage
private void cardClicked(CardView targetCard, MouseEvent e) {
if (e.isShiftDown()) {
toggleSelected(targetCard);
} else {
selectCard(targetCard);
}
notifyCardsSelected();
}
代码示例来源:origin: hneemann/Digital
@Override
public boolean isClickModifier(MouseEvent e) {
return e.isShiftDown();
}
};
代码示例来源:origin: stackoverflow.com
public void mousePressed(MouseEvent me) {
if (me.isShiftDown()) {
// Do the function
}
}
代码示例来源:origin: org.netbeans.api/org-netbeans-api-visual
/**
* @see MouseEvent
*/
public boolean isShiftDown() {
return event.isShiftDown();
}
代码示例来源:origin: stackoverflow.com
JButton button = new JButton("I'm a button!");
button.addMouseListener(new MouseListener() {
public void mousePressed(MouseEvent me) {
if (me.isShiftDown()) {
// Do the function
}
}
});
代码示例来源:origin: protegeproject/protege
public void mouseReleased(MouseEvent e) {
if (e.getClickCount() == 3 && e.isControlDown() && e.isShiftDown()) {
reload();
}
if (e.isPopupTrigger()) {
showPopupMenu(e);
}
}
代码示例来源:origin: edu.stanford.protege/protege-editor-owl
public void mouseReleased(MouseEvent e) {
if (e.getClickCount() == 3 && e.isControlDown() && e.isShiftDown()) {
reload();
}
if (e.isPopupTrigger()) {
showPopupMenu(e);
}
}
代码示例来源:origin: biojava/biojava
private boolean keyPressed(MouseEvent e) {
if (e.isShiftDown() || e.isControlDown() || e.isAltDown())
return true;
return false;
}
代码示例来源:origin: biojava/biojava
private boolean keyPressed(MouseEvent e) {
if ( e.isShiftDown() || e.isControlDown() || e.isAltDown())
return true;
return false;
}
代码示例来源:origin: JetBrains/jediterm
private static int applyModifierKeys(MouseEvent event, int cb) {
if (event.isControlDown()) {
cb |= MouseButtonModifierFlags.MOUSE_BUTTON_CTRL_FLAG;
}
if (event.isShiftDown()) {
cb |= MouseButtonModifierFlags.MOUSE_BUTTON_SHIFT_FLAG;
}
if ((event.getModifiersEx() & InputEvent.META_MASK) != 0) {
cb |= MouseButtonModifierFlags.MOUSE_BUTTON_META_FLAG;
}
return cb;
}
代码示例来源: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: net.imagej/ij
public void mousePressed (MouseEvent e) {
int x=e.getX(), y=e.getY();
if (e.isPopupTrigger() || e.isMetaDown())
pm.show(e.getComponent(),x,y);
else if (e.isShiftDown())
extendSelection(x, y);
else {
select(x, y);
handleDoubleClick();
}
}
内容来源于网络,如有侵权,请联系作者删除!