1 /*****************************************************/
\r
2 /* This java file is a part of the */
\r
4 /* - Plouf's Java IRC Client - */
\r
6 /* Copyright (C) 2002 - 2004 Philippe Detournay */
\r
8 /* All contacts : theplouf@yahoo.com */
\r
10 /* PJIRC is free software; you can redistribute */
\r
11 /* it and/or modify it under the terms of the GNU */
\r
12 /* General Public License as published by the */
\r
13 /* Free Software Foundation; version 2 or later of */
\r
16 /* PJIRC is distributed in the hope that it will */
\r
17 /* be useful, but WITHOUT ANY WARRANTY; without */
\r
18 /* even the implied warranty of MERCHANTABILITY or */
\r
19 /* FITNESS FOR A PARTICULAR PURPOSE. See the GNU */
\r
20 /* General Public License for more details. */
\r
22 /* You should have received a copy of the GNU */
\r
23 /* General Public License along with PJIRC; if */
\r
24 /* not, write to the Free Software Foundation, */
\r
25 /* Inc., 59 Temple Place, Suite 330, Boston, */
\r
26 /* MA 02111-1307 USA */
\r
28 /*****************************************************/
\r
30 package irc.gui.prv;
\r
32 import irc.ListenerGroup;
\r
33 import irc.gui.common.MouseWheelPanelListener;
\r
35 import java.awt.GridLayout;
\r
36 import java.awt.Panel;
\r
37 import java.awt.event.MouseWheelEvent;
\r
38 import java.awt.event.MouseWheelListener;
\r
41 * MouseWheelPanel. Should be compiled using java jdk1.4.
\r
43 public class MouseWheelPanel extends Panel implements MouseWheelListener {
\r
44 private ListenerGroup _listeners;
\r
47 * Create a new MouseWheelPanel.
\r
49 public MouseWheelPanel() {
\r
51 _listeners = new ListenerGroup();
\r
52 addMouseWheelListener(this);
\r
53 setLayout(new GridLayout(1, 1));
\r
62 public void addMouseWheelPanelListener(MouseWheelPanelListener lis) {
\r
63 _listeners.addListener(lis);
\r
67 * Remove a listener.
\r
70 * listener to remove.
\r
72 public void removeMouseWheelPanelListener(MouseWheelPanelListener lis) {
\r
73 _listeners.removeListener(lis);
\r
77 public void mouseWheelMoved(MouseWheelEvent e) {
\r
78 _listeners.sendEventAsync("mouseWheelMoved", new Integer(e.getWheelRotation()));
\r