public void mousePressed (MouseEvent event) { movingIndex = overIndex; moveAll = event.isControlDown(); if (moveAll) { moveAllProportionally = event.isShiftDown(); moveAllPrevY = event.getY(); } }
public void mousePressed (MouseEvent event) { movingIndex = overIndex; moveAll = event.isControlDown(); if (moveAll) { moveAllProportionally = event.isShiftDown(); moveAllPrevY = event.getY(); } }
@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(); } });
@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; }
@Override public void mousePressed(MouseEvent e) { if (SwingUtilities.isLeftMouseButton(e)) { isDragging = true; beginSelectionDrag(e.getX(), e.getY(), e.isShiftDown()); updateSelectionDrag(e.getX(), e.getY()); } }
@Override public void mousePressed(MouseEvent e) if ((e.getButton() == 2) || (e.isShiftDown()))
/** 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; }
private void cardClicked(CardView targetCard, MouseEvent e) { if (e.isShiftDown()) { toggleSelected(targetCard); } else { selectCard(targetCard); } notifyCardsSelected(); }
@Override public boolean isClickModifier(MouseEvent e) { return e.isShiftDown(); } };
public void mousePressed(MouseEvent me) { if (me.isShiftDown()) { // Do the function } }
/** * @see MouseEvent */ public boolean isShiftDown() { return event.isShiftDown(); }
JButton button = new JButton("I'm a button!"); button.addMouseListener(new MouseListener() { public void mousePressed(MouseEvent me) { if (me.isShiftDown()) { // Do the function } } });
public void mouseReleased(MouseEvent e) { if (e.getClickCount() == 3 && e.isControlDown() && e.isShiftDown()) { reload(); } if (e.isPopupTrigger()) { showPopupMenu(e); } }
public void mouseReleased(MouseEvent e) { if (e.getClickCount() == 3 && e.isControlDown() && e.isShiftDown()) { reload(); } if (e.isPopupTrigger()) { showPopupMenu(e); } }
private boolean keyPressed(MouseEvent e) { if (e.isShiftDown() || e.isControlDown() || e.isAltDown()) return true; return false; }
private boolean keyPressed(MouseEvent e) { if ( e.isShiftDown() || e.isControlDown() || e.isAltDown()) return true; return false; }
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; }
/** * 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()); }
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()); }
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(); } }