1 |
/* BasicButtonListener.java |
/* BasicButtonListener.java -- |
2 |
Copyright (C) 2004 Free Software Foundation, Inc. |
Copyright (C) 2004 Free Software Foundation, Inc. |
3 |
|
|
4 |
This file is part of GNU Classpath. |
This file is part of GNU Classpath. |
35 |
obligated to do so. If you do not wish to do so, delete this |
obligated to do so. If you do not wish to do so, delete this |
36 |
exception statement from your version. */ |
exception statement from your version. */ |
37 |
|
|
38 |
|
|
39 |
package javax.swing.plaf.basic; |
package javax.swing.plaf.basic; |
40 |
|
|
41 |
import java.awt.event.ActionEvent; |
import java.awt.event.ActionEvent; |
59 |
implements MouseListener, MouseMotionListener, FocusListener, |
implements MouseListener, MouseMotionListener, FocusListener, |
60 |
ChangeListener, PropertyChangeListener |
ChangeListener, PropertyChangeListener |
61 |
{ |
{ |
62 |
|
public BasicButtonListener(AbstractButton b) |
63 |
|
{ |
64 |
|
// Do nothing here. |
65 |
|
} |
66 |
|
|
67 |
public void propertyChange(PropertyChangeEvent e) |
public void propertyChange(PropertyChangeEvent e) |
68 |
{ |
{ |
69 |
} |
} |
70 |
|
|
71 |
protected void checkOpacity(AbstractButton b) |
protected void checkOpacity(AbstractButton b) |
72 |
{ |
{ |
73 |
} |
} |
74 |
|
|
75 |
public void focusGained(FocusEvent e) |
public void focusGained(FocusEvent e) |
76 |
{ |
{ |
77 |
if (e.getSource() instanceof AbstractButton) |
if (e.getSource() instanceof AbstractButton) |
94 |
button.repaint(); |
button.repaint(); |
95 |
} |
} |
96 |
} |
} |
97 |
|
|
98 |
public void installKeyboardActions(JComponent c) |
public void installKeyboardActions(JComponent c) |
99 |
{ |
{ |
100 |
c.getActionMap().put("pressed", |
c.getActionMap().put("pressed", |
123 |
} |
} |
124 |
}); |
}); |
125 |
} |
} |
126 |
|
|
127 |
public void uninstallKeyboardActions(JComponent c) |
public void uninstallKeyboardActions(JComponent c) |
128 |
{ |
{ |
129 |
c.getActionMap().put("pressed", null); |
c.getActionMap().put("pressed", null); |
130 |
c.getActionMap().put("released", null); |
c.getActionMap().put("released", null); |
131 |
} |
} |
132 |
|
|
133 |
public void stateChanged(ChangeEvent e) |
public void stateChanged(ChangeEvent e) |
134 |
{ |
{ |
135 |
} |
} |
136 |
|
|
137 |
public void mouseMoved(MouseEvent e) |
public void mouseMoved(MouseEvent e) |
138 |
{ |
{ |
139 |
} |
} |
140 |
|
|
141 |
public void mouseDragged(MouseEvent e) |
public void mouseDragged(MouseEvent e) |
142 |
{ |
{ |
143 |
} |
} |
144 |
|
|
145 |
public void mouseClicked(MouseEvent e) |
public void mouseClicked(MouseEvent e) |
146 |
{ |
{ |
147 |
} |
} |
166 |
} |
} |
167 |
} |
} |
168 |
|
|
|
|
|
169 |
/** |
/** |
170 |
* Accept a mouse release event and set the button's |
* Accept a mouse release event and set the button's |
171 |
* "pressed" property to <code>true</code>, if the model |
* "pressed" property to <code>true</code>, if the model |
188 |
} |
} |
189 |
} |
} |
190 |
|
|
|
|
|
191 |
/** |
/** |
192 |
* Accept a mouse enter event and set the button's "rollover" property to |
* Accept a mouse enter event and set the button's "rollover" property to |
193 |
* <code>true</code>, if the button's "rolloverEnabled" property is |
* <code>true</code>, if the button's "rolloverEnabled" property is |