< prev index next >

src/java.desktop/share/classes/java/awt/event/MouseAdapter.java

Print this page


   1 /*
   2  * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


  51  * or {@code MouseWheelEvent}  is passed to it in following cases:
  52  * <ul>
  53  * <li>when a mouse button is pressed, released, or clicked (pressed and  released)
  54  * <li>when the mouse cursor enters or exits the component
  55  * <li>when the mouse wheel rotated, or mouse moved or dragged
  56  * </ul>
  57  *
  58  * @author Carl Quinn
  59  * @author Andrei Dmitriev
  60  *
  61  * @see MouseEvent
  62  * @see MouseWheelEvent
  63  * @see MouseListener
  64  * @see MouseMotionListener
  65  * @see MouseWheelListener
  66  * @see <a href="https://docs.oracle.com/javase/tutorial/uiswing/events/mouselistener.html">Tutorial: Writing a Mouse Listener</a>
  67  *
  68  * @since 1.1
  69  */
  70 public abstract class MouseAdapter implements MouseListener, MouseWheelListener, MouseMotionListener {






  71     /**
  72      * {@inheritDoc}
  73      */
  74     public void mouseClicked(MouseEvent e) {}
  75 
  76     /**
  77      * {@inheritDoc}
  78      */
  79     public void mousePressed(MouseEvent e) {}
  80 
  81     /**
  82      * {@inheritDoc}
  83      */
  84     public void mouseReleased(MouseEvent e) {}
  85 
  86     /**
  87      * {@inheritDoc}
  88      */
  89     public void mouseEntered(MouseEvent e) {}
  90 


   1 /*
   2  * Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


  51  * or {@code MouseWheelEvent}  is passed to it in following cases:
  52  * <ul>
  53  * <li>when a mouse button is pressed, released, or clicked (pressed and  released)
  54  * <li>when the mouse cursor enters or exits the component
  55  * <li>when the mouse wheel rotated, or mouse moved or dragged
  56  * </ul>
  57  *
  58  * @author Carl Quinn
  59  * @author Andrei Dmitriev
  60  *
  61  * @see MouseEvent
  62  * @see MouseWheelEvent
  63  * @see MouseListener
  64  * @see MouseMotionListener
  65  * @see MouseWheelListener
  66  * @see <a href="https://docs.oracle.com/javase/tutorial/uiswing/events/mouselistener.html">Tutorial: Writing a Mouse Listener</a>
  67  *
  68  * @since 1.1
  69  */
  70 public abstract class MouseAdapter implements MouseListener, MouseWheelListener, MouseMotionListener {
  71 
  72     /**
  73      * Constructs a {@code MouseAdapter}.
  74      */
  75     protected MouseAdapter() {}
  76 
  77     /**
  78      * {@inheritDoc}
  79      */
  80     public void mouseClicked(MouseEvent e) {}
  81 
  82     /**
  83      * {@inheritDoc}
  84      */
  85     public void mousePressed(MouseEvent e) {}
  86 
  87     /**
  88      * {@inheritDoc}
  89      */
  90     public void mouseReleased(MouseEvent e) {}
  91 
  92     /**
  93      * {@inheritDoc}
  94      */
  95     public void mouseEntered(MouseEvent e) {}
  96 


< prev index next >