Java 8 MouseInputListener - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 MouseInputListener class.

This code example shows how to use the following methods:mouseClicked, mouseReleased
        return distance;
    } 
 
    @Override 
    public final void mouseReleased(MouseEvent e) {
        target.mouseReleased(e);
 
        if (pressed != null) {
            if (getDragDistance(e) < MAX_CLICK_DISTANCE) {
                MouseEvent clickEvent = new MouseEvent((Component) pressed.getSource(),
                        MouseEvent.MOUSE_CLICKED, e.getWhen(), pressed.getModifiers(),
                        pressed.getX(), pressed.getY(), pressed.getXOnScreen(), pressed.getYOnScreen(),
                        pressed.getClickCount(), pressed.isPopupTrigger(), pressed.getButton());
                target.mouseClicked(clickEvent);
            } 
            pressed = null;
        } 
    } 
 
    @Override 
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:mouseEntered
    public void mouseEntered(MouseEvent e) {
        clickCount = 0;
        lastTime = 0;
        lastPeer = null; 
 
        listener.mouseEntered(e);
    } 
 
    public void mouseExited(MouseEvent e) {
        clickCount = 0;
        lastTime = 0;
        lastPeer = null; 
 
        listener.mouseExited(e);
    } 
 
    public void mousePressed(MouseEvent e) {
        int x;
        int y;
 
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:mouseExited
        listener.mouseEntered(translateToGrid(e));
    } 
 
    @Override 
    public void mouseExited(MouseEvent e) {
        listener.mouseExited(translateToGrid(e));
    } 
 
    @Override 
    public void mouseDragged(MouseEvent e) {
        listener.mouseDragged(translateToGrid(e));
    } 
 
    @Override 
    public void mouseMoved(MouseEvent e) {
        listener.mouseMoved(translateToGrid(e));
    } 
} 
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:mouseDragged
            _mouseEventFilter.mouseExited(e);
        } 
 
        public void mouseDragged(MouseEvent e) {
            if (_listener != null) {
                _listener.mouseDragged(e);
            } 
        } 
 
        public void mouseMoved(MouseEvent e) {
            if (_listener != null) {
                _listener.mouseMoved(e);
            } 
        } 
    } 
 
    private static class MouseEventFilter implements MouseListener {
 
        private final int _timeout;
        private final MouseListener _listener;
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:mousePressed
        } 
    } 
 
    public void mousePressed(MouseEvent e) {
        if (_listener != null) {
            _listener.mousePressed(e);
        } 
    } 
 
    public void mouseReleased(MouseEvent e) {
        if (_listener != null) {
            _listener.mouseReleased(e);
        } 
    } 
 
    public void mouseEntered(MouseEvent e) {
        if (_listener != null) {
            _listener.mouseEntered(e);
        } 
    } 
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
See Code Examples for Java 8 MouseInputListener Methods: