44 |
import java.awt.event.MouseEvent; |
import java.awt.event.MouseEvent; |
45 |
import java.beans.PropertyChangeEvent; |
import java.beans.PropertyChangeEvent; |
46 |
import java.beans.PropertyChangeListener; |
import java.beans.PropertyChangeListener; |
|
import java.io.IOException; |
|
|
import java.io.ObjectInputStream; |
|
|
import java.io.ObjectOutputStream; |
|
47 |
import java.util.EventListener; |
import java.util.EventListener; |
48 |
|
|
49 |
import javax.accessibility.Accessible; |
import javax.accessibility.Accessible; |
81 |
public JMenuItem() |
public JMenuItem() |
82 |
{ |
{ |
83 |
super(); |
super(); |
84 |
|
init(null, null); |
85 |
} |
} |
86 |
|
|
87 |
/** |
/** |
116 |
{ |
{ |
117 |
super(); |
super(); |
118 |
super.setAction(action); |
super.setAction(action); |
119 |
|
init(null, null); |
120 |
} |
} |
121 |
|
|
122 |
/** |
/** |
146 |
setMnemonic(mnemonic); |
setMnemonic(mnemonic); |
147 |
} |
} |
148 |
|
|
|
private void readObject(ObjectInputStream stream) |
|
|
throws IOException, ClassNotFoundException |
|
|
{ |
|
|
} |
|
|
|
|
|
private void writeObject(ObjectOutputStream stream) throws IOException |
|
|
{ |
|
|
} |
|
|
|
|
149 |
/** |
/** |
150 |
* Initializes this menu item |
* Initializes this menu item |
151 |
* |
* |
166 |
//borderPainted = false; |
//borderPainted = false; |
167 |
focusPainted = false; |
focusPainted = false; |
168 |
horizontalAlignment = JButton.LEFT; |
horizontalAlignment = JButton.LEFT; |
169 |
horizontalTextPosition = JButton.LEFT; |
horizontalTextPosition = JButton.TRAILING; |
170 |
} |
} |
171 |
|
|
172 |
/** |
/** |
179 |
{ |
{ |
180 |
super.setUI(ui); |
super.setUI(ui); |
181 |
} |
} |
182 |
|
|
183 |
/** |
/** |
184 |
* This method sets this menuItem's UI to the UIManager's default for the |
* This method sets this menuItem's UI to the UIManager's default for the |
185 |
* current look and feel. |
* current look and feel. |
245 |
} |
} |
246 |
|
|
247 |
/** |
/** |
248 |
* Sets accelerator for this menu item. |
* Sets the key combination which invokes the menu item's action |
249 |
* |
* listeners without navigating the menu hierarchy. Note that when the |
250 |
|
* keyboard accelerator is typed, it will work whether or not the |
251 |
|
* menu is currently displayed. |
252 |
|
* |
253 |
* @param keystroke accelerator for this menu item. |
* @param keystroke accelerator for this menu item. |
254 |
*/ |
*/ |
255 |
public void setAccelerator(KeyStroke keystroke) |
public void setAccelerator(KeyStroke keystroke) |
269 |
super.configurePropertiesFromAction(action); |
super.configurePropertiesFromAction(action); |
270 |
|
|
271 |
if (! (this instanceof JMenu) && action != null) |
if (! (this instanceof JMenu) && action != null) |
272 |
setAccelerator((KeyStroke) (action.getValue(Action.ACCELERATOR_KEY))); |
{ |
273 |
|
setAccelerator((KeyStroke) (action.getValue(Action.ACCELERATOR_KEY))); |
274 |
|
super.registerKeyboardAction(action, accelerator, |
275 |
|
JComponent.WHEN_IN_FOCUSED_WINDOW); |
276 |
|
} |
277 |
} |
} |
278 |
|
|
279 |
/** |
/** |
664 |
|
|
665 |
public void stateChanged(ChangeEvent event) |
public void stateChanged(ChangeEvent event) |
666 |
{ |
{ |
667 |
|
// TODO: What should be done here, if anything? |
668 |
} |
} |
669 |
|
|
670 |
public AccessibleRole getAccessibleRole() |
public AccessibleRole getAccessibleRole() |