01: /*
02: * @(#)MouseInputListenerWrapper.java 3/19/2005
03: *
04: * Copyright 2002 - 2005 JIDE Software Inc. All rights reserved.
05: */
06: package com.jidesoft.swing;
07:
08: import javax.swing.event.MouseInputListener;
09: import java.awt.event.MouseEvent;
10:
11: /**
12: */
13: class MouseInputListeners implements MouseInputListener {
14: private MouseInputListener[] _mouseInputListeners;
15:
16: public MouseInputListeners(MouseInputListener[] mouseInputListeners) {
17: _mouseInputListeners = mouseInputListeners;
18: }
19:
20: public void mouseClicked(MouseEvent e) {
21: for (int i = 0; i < _mouseInputListeners.length; i++) {
22: MouseInputListener mouseInputListener = _mouseInputListeners[i];
23: if (e.isConsumed()) {
24: break;
25: }
26: mouseInputListener.mouseClicked(e);
27: }
28: }
29:
30: public void mousePressed(MouseEvent e) {
31: for (int i = 0; i < _mouseInputListeners.length; i++) {
32: MouseInputListener mouseInputListener = _mouseInputListeners[i];
33: if (e.isConsumed()) {
34: break;
35: }
36: mouseInputListener.mousePressed(e);
37: }
38: }
39:
40: public void mouseReleased(MouseEvent e) {
41: for (int i = 0; i < _mouseInputListeners.length; i++) {
42: MouseInputListener mouseInputListener = _mouseInputListeners[i];
43: if (e.isConsumed()) {
44: break;
45: }
46: mouseInputListener.mouseReleased(e);
47: }
48: }
49:
50: public void mouseEntered(MouseEvent e) {
51: for (int i = 0; i < _mouseInputListeners.length; i++) {
52: MouseInputListener mouseInputListener = _mouseInputListeners[i];
53: if (e.isConsumed()) {
54: break;
55: }
56: mouseInputListener.mouseEntered(e);
57: }
58: }
59:
60: public void mouseExited(MouseEvent e) {
61: for (int i = 0; i < _mouseInputListeners.length; i++) {
62: MouseInputListener mouseInputListener = _mouseInputListeners[i];
63: if (e.isConsumed()) {
64: break;
65: }
66: mouseInputListener.mouseExited(e);
67: }
68: }
69:
70: public void mouseDragged(MouseEvent e) {
71: for (int i = 0; i < _mouseInputListeners.length; i++) {
72: MouseInputListener mouseInputListener = _mouseInputListeners[i];
73: if (e.isConsumed()) {
74: break;
75: }
76: mouseInputListener.mouseDragged(e);
77: }
78: }
79:
80: public void mouseMoved(MouseEvent e) {
81: for (int i = 0; i < _mouseInputListeners.length; i++) {
82: MouseInputListener mouseInputListener = _mouseInputListeners[i];
83: if (e.isConsumed()) {
84: break;
85: }
86: mouseInputListener.mouseMoved(e);
87: }
88: }
89: }
|