/** * Returns the DragRecognitionSupport for the caller's AppContext. */ private static DragRecognitionSupport getDragRecognitionSupport() { // DragRecognitionSupport support = // (DragRecognitionSupport)AppContext.getAppContext(). // get(DragRecognitionSupport.class); // // if (support == null) { // support = new DragRecognitionSupport(); // AppContext.getAppContext().put(DragRecognitionSupport.class, support); // } DragRecognitionSupport support = (DragRecognitionSupport) UIManager.get("sharedInstance.dragRecognitionSupport"); if (support == null) { support = new DragRecognitionSupport(); UIManager.put("sharedInstance.dragRecognitionSupport", support); } return support; }
/** * If a dnd recognition has been going on, return the MouseEvent * that started the recognition. Otherwise, return null. */ private MouseEvent mouseReleasedImpl(MouseEvent me) { /* no recognition has been going on */ if (dndArmedEvent == null) { return null; } MouseEvent retEvent = null; if (me.getSource() == component) { retEvent = dndArmedEvent; } // else component has changed unexpectedly, so return null clearState(); return retEvent; }
/** * If a dnd recognition has been going on, return the MouseEvent * that started the recognition. Otherwise, return null. */ public static MouseEvent mouseReleased(MouseEvent me) { return ((DragRecognitionSupport)getDragRecognitionSupport()). mouseReleasedImpl(me); }
/** * Returns whether or not the event is potentially part of a drag sequence. */ public static boolean mousePressed(MouseEvent me) { return ((DragRecognitionSupport)getDragRecognitionSupport()). mousePressedImpl(me); }
/** * Returns whether or not a drag gesture recognition is ongoing. */ public static boolean mouseDragged(MouseEvent me, BeforeDrag bd) { return ((DragRecognitionSupport)getDragRecognitionSupport()). mouseDraggedImpl(me, bd); }
/** * Returns whether or not the event is potentially part of a drag sequence. */ private boolean mousePressedImpl(MouseEvent me) { component = (JComponent)me.getSource(); if (mapDragOperationFromModifiers(me, component.getTransferHandler()) != TransferHandler.NONE) { motionThreshold = DragSource.getDragThreshold(); dndArmedEvent = me; return true; } clearState(); return false; }
public void mouseReleased(MouseEvent e) { if (SwingXUtilities.shouldIgnore(e, list)) { return; } if (list.getDragEnabled()) { MouseEvent me = DragRecognitionSupport.mouseReleased(e); if (me != null) { SwingXUtilities.adjustFocus(list); if (!dragPressDidSelection) { adjustSelection(me); } } } else { list.setValueIsAdjusting(false); } }
public void mouseDragged(MouseEvent e) { if (SwingXUtilities.shouldIgnore(e, list)) { return; } if (list.getDragEnabled()) { DragRecognitionSupport.mouseDragged(e, this); return; } if (e.isShiftDown() || e.isControlDown()) { return; } int row = locationToIndex(list, e.getPoint()); if (row != -1) { // 4835633. Dragging onto a File should not select it. if (isFileList) { return; } Rectangle cellBounds = getCellBounds(list, row, row); if (cellBounds != null) { list.scrollRectToVisible(cellBounds); list.setSelectionInterval(row, row); } } }
if (row != -1 && DragRecognitionSupport.mousePressed(e)) { dragPressDidSelection = false;
/** * Returns whether or not the event is potentially part of a drag sequence. */ private boolean mousePressedImpl(MouseEvent me) { component = (JComponent)me.getSource(); if (mapDragOperationFromModifiers(me, component.getTransferHandler()) != TransferHandler.NONE) { motionThreshold = DragSource.getDragThreshold(); dndArmedEvent = me; return true; } clearState(); return false; }
/** * Returns whether or not the event is potentially part of a drag sequence. */ public static boolean mousePressed(MouseEvent me) { return ((DragRecognitionSupport)getDragRecognitionSupport()). mousePressedImpl(me); }
/** * Returns whether or not a drag gesture recognition is ongoing. */ public static boolean mouseDragged(MouseEvent me, BeforeDrag bd) { return ((DragRecognitionSupport)getDragRecognitionSupport()). mouseDraggedImpl(me, bd); }
public void mouseReleased(MouseEvent e) { if (SwingXUtilities.shouldIgnore(e, list)) { return; } if (list.getDragEnabled()) { MouseEvent me = DragRecognitionSupport.mouseReleased(e); if (me != null) { SwingXUtilities.adjustFocus(list); if (!dragPressDidSelection) { adjustSelection(me); } } } else { list.setValueIsAdjusting(false); } }
public void mouseDragged(MouseEvent e) { if (SwingXUtilities.shouldIgnore(e, list)) { return; } if (list.getDragEnabled()) { DragRecognitionSupport.mouseDragged(e, this); return; } if (e.isShiftDown() || e.isControlDown()) { return; } int row = locationToIndex(list, e.getPoint()); if (row != -1) { // 4835633. Dragging onto a File should not select it. if (isFileList) { return; } Rectangle cellBounds = getCellBounds(list, row, row); if (cellBounds != null) { list.scrollRectToVisible(cellBounds); list.setSelectionInterval(row, row); } } }
if (row != -1 && DragRecognitionSupport.mousePressed(e)) { dragPressDidSelection = false;
/** * Returns whether or not the event is potentially part of a drag sequence. */ private boolean mousePressedImpl(MouseEvent me) { component = (JComponent)me.getSource(); if (mapDragOperationFromModifiers(me, component.getTransferHandler()) != TransferHandler.NONE) { motionThreshold = DragSource.getDragThreshold(); dndArmedEvent = me; return true; } clearState(); return false; }
/** * If a dnd recognition has been going on, return the MouseEvent * that started the recognition. Otherwise, return null. */ public static MouseEvent mouseReleased(MouseEvent me) { return ((DragRecognitionSupport)getDragRecognitionSupport()). mouseReleasedImpl(me); }
/** * Returns whether or not the event is potentially part of a drag sequence. */ public static boolean mousePressed(MouseEvent me) { return ((DragRecognitionSupport)getDragRecognitionSupport()). mousePressedImpl(me); }
/** * Returns whether or not a drag gesture recognition is ongoing. */ public static boolean mouseDragged(MouseEvent me, BeforeDrag bd) { return ((DragRecognitionSupport)getDragRecognitionSupport()). mouseDraggedImpl(me, bd); }
/** * If a dnd recognition has been going on, return the MouseEvent * that started the recognition. Otherwise, return null. */ private MouseEvent mouseReleasedImpl(MouseEvent me) { /* no recognition has been going on */ if (dndArmedEvent == null) { return null; } MouseEvent retEvent = null; if (me.getSource() == component) { retEvent = dndArmedEvent; } // else component has changed unexpectedly, so return null clearState(); return retEvent; }