1 | /* JMenuItem.java --
|
---|
2 | Copyright (C) 2002 Free Software Foundation, Inc.
|
---|
3 |
|
---|
4 | This file is part of GNU Classpath.
|
---|
5 |
|
---|
6 | GNU Classpath is free software; you can redistribute it and/or modify
|
---|
7 | it under the terms of the GNU General Public License as published by
|
---|
8 | the Free Software Foundation; either version 2, or (at your option)
|
---|
9 | any later version.
|
---|
10 |
|
---|
11 | GNU Classpath is distributed in the hope that it will be useful, but
|
---|
12 | WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
14 | General Public License for more details.
|
---|
15 |
|
---|
16 | You should have received a copy of the GNU General Public License
|
---|
17 | along with GNU Classpath; see the file COPYING. If not, write to the
|
---|
18 | Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
---|
19 | 02111-1307 USA.
|
---|
20 |
|
---|
21 | Linking this library statically or dynamically with other modules is
|
---|
22 | making a combined work based on this library. Thus, the terms and
|
---|
23 | conditions of the GNU General Public License cover the whole
|
---|
24 | combination.
|
---|
25 |
|
---|
26 | As a special exception, the copyright holders of this library give you
|
---|
27 | permission to link this library with independent modules to produce an
|
---|
28 | executable, regardless of the license terms of these independent
|
---|
29 | modules, and to copy and distribute the resulting executable under
|
---|
30 | terms of your choice, provided that you also meet, for each linked
|
---|
31 | independent module, the terms and conditions of the license of that
|
---|
32 | module. An independent module is a module which is not derived from
|
---|
33 | or based on this library. If you modify this library, you may extend
|
---|
34 | this exception to your version of the library, but you are not
|
---|
35 | obligated to do so. If you do not wish to do so, delete this
|
---|
36 | exception statement from your version. */
|
---|
37 |
|
---|
38 | package javax.swing;
|
---|
39 |
|
---|
40 | // Imports
|
---|
41 | import java.awt.*;
|
---|
42 | import java.awt.event.*;
|
---|
43 | import java.beans.*;
|
---|
44 | import java.io.*;
|
---|
45 | import javax.accessibility.*;
|
---|
46 | import javax.swing.event.*;
|
---|
47 | import javax.swing.plaf.*;
|
---|
48 |
|
---|
49 | /**
|
---|
50 | * JMenuItem
|
---|
51 | * @author Andrew Selkirk
|
---|
52 | * @version 1.0
|
---|
53 | */
|
---|
54 | public class JMenuItem extends AbstractButton implements Accessible, MenuElement {
|
---|
55 |
|
---|
56 | //-------------------------------------------------------------
|
---|
57 | // Classes ----------------------------------------------------
|
---|
58 | //-------------------------------------------------------------
|
---|
59 |
|
---|
60 | /**
|
---|
61 | * AccessibleJMenuItem
|
---|
62 | */
|
---|
63 | protected class AccessibleJMenuItem extends AccessibleAbstractButton
|
---|
64 | implements ChangeListener {
|
---|
65 |
|
---|
66 | //-------------------------------------------------------------
|
---|
67 | // Variables --------------------------------------------------
|
---|
68 | //-------------------------------------------------------------
|
---|
69 |
|
---|
70 |
|
---|
71 | //-------------------------------------------------------------
|
---|
72 | // Initialization ---------------------------------------------
|
---|
73 | //-------------------------------------------------------------
|
---|
74 |
|
---|
75 | /**
|
---|
76 | * Constructor AccessibleJMenuItem
|
---|
77 | * @param component TODO
|
---|
78 | */
|
---|
79 | AccessibleJMenuItem(JMenuItem component) {
|
---|
80 | super(component);
|
---|
81 | // TODO
|
---|
82 | } // AccessibleJMenuItem()
|
---|
83 |
|
---|
84 |
|
---|
85 | //-------------------------------------------------------------
|
---|
86 | // Methods ----------------------------------------------------
|
---|
87 | //-------------------------------------------------------------
|
---|
88 |
|
---|
89 | /**
|
---|
90 | * stateChanged
|
---|
91 | * @param event TODO
|
---|
92 | */
|
---|
93 | public void stateChanged(ChangeEvent event) {
|
---|
94 | // TODO
|
---|
95 | } // stateChanged()
|
---|
96 |
|
---|
97 | /**
|
---|
98 | * getAccessibleRole
|
---|
99 | * @returns AccessibleRole
|
---|
100 | */
|
---|
101 | public AccessibleRole getAccessibleRole() {
|
---|
102 | return AccessibleRole.MENU_ITEM;
|
---|
103 | } // getAccessibleRole()
|
---|
104 |
|
---|
105 |
|
---|
106 | } // AccessibleJMenuItem
|
---|
107 |
|
---|
108 |
|
---|
109 | //-------------------------------------------------------------
|
---|
110 | // Variables --------------------------------------------------
|
---|
111 | //-------------------------------------------------------------
|
---|
112 |
|
---|
113 | /**
|
---|
114 | * uiClassID
|
---|
115 | */
|
---|
116 | private static final String uiClassID = "MenuItemUI";
|
---|
117 |
|
---|
118 | /**
|
---|
119 | * accelerator
|
---|
120 | */
|
---|
121 | private KeyStroke accelerator;
|
---|
122 |
|
---|
123 |
|
---|
124 | //-------------------------------------------------------------
|
---|
125 | // Initialization ---------------------------------------------
|
---|
126 | //-------------------------------------------------------------
|
---|
127 |
|
---|
128 | /**
|
---|
129 | * Constructor JMenuItem
|
---|
130 | */
|
---|
131 | public JMenuItem() {
|
---|
132 | // TODO
|
---|
133 | } // JMenuItem()
|
---|
134 |
|
---|
135 | /**
|
---|
136 | * Constructor JMenuItem
|
---|
137 | * @param icon TODO
|
---|
138 | */
|
---|
139 | public JMenuItem(Icon icon) {
|
---|
140 | // TODO
|
---|
141 | } // JMenuItem()
|
---|
142 |
|
---|
143 | /**
|
---|
144 | * Constructor JMenuItem
|
---|
145 | * @param text TODO
|
---|
146 | */
|
---|
147 | public JMenuItem(String text) {
|
---|
148 | // TODO
|
---|
149 | } // JMenuItem()
|
---|
150 |
|
---|
151 | /**
|
---|
152 | * Constructor JMenuItem
|
---|
153 | * @param action TODO
|
---|
154 | */
|
---|
155 | public JMenuItem(Action action) {
|
---|
156 | // TODO
|
---|
157 | } // JMenuItem()
|
---|
158 |
|
---|
159 | /**
|
---|
160 | * Constructor JMenuItem
|
---|
161 | * @param text TODO
|
---|
162 | * @param icon TODO
|
---|
163 | */
|
---|
164 | public JMenuItem(String text, Icon icon) {
|
---|
165 | // TODO
|
---|
166 | } // JMenuItem()
|
---|
167 |
|
---|
168 | /**
|
---|
169 | * Constructor JMenuItem
|
---|
170 | * @param text TODO
|
---|
171 | * @param mnemonic TODO
|
---|
172 | */
|
---|
173 | public JMenuItem(String text, int mnemonic) {
|
---|
174 | // TODO
|
---|
175 | } // JMenuItem()
|
---|
176 |
|
---|
177 |
|
---|
178 | //-------------------------------------------------------------
|
---|
179 | // Methods ----------------------------------------------------
|
---|
180 | //-------------------------------------------------------------
|
---|
181 |
|
---|
182 | /**
|
---|
183 | * readObject
|
---|
184 | * @param stream TODO
|
---|
185 | * @exception IOException TODO
|
---|
186 | * @exception ClassNotFoundException TODO
|
---|
187 | */
|
---|
188 | private void readObject(ObjectInputStream stream)
|
---|
189 | throws IOException, ClassNotFoundException {
|
---|
190 | // TODO
|
---|
191 | } // readObject()
|
---|
192 |
|
---|
193 | /**
|
---|
194 | * writeObject
|
---|
195 | * @param stream TODO
|
---|
196 | * @exception IOException TODO
|
---|
197 | */
|
---|
198 | private void writeObject(ObjectOutputStream stream) throws IOException {
|
---|
199 | // TODO
|
---|
200 | } // writeObject()
|
---|
201 |
|
---|
202 | /**
|
---|
203 | * init
|
---|
204 | * @param text TODO
|
---|
205 | * @param icon TODO
|
---|
206 | */
|
---|
207 | protected void init(String text, Icon icon) {
|
---|
208 | // TODO
|
---|
209 | } // init()
|
---|
210 |
|
---|
211 | /**
|
---|
212 | * setUI
|
---|
213 | * @param ui TODO
|
---|
214 | */
|
---|
215 | public void setUI(MenuItemUI ui) {
|
---|
216 | super.setUI(ui);
|
---|
217 | // TODO
|
---|
218 | } // setUI()
|
---|
219 |
|
---|
220 | /**
|
---|
221 | * updateUI
|
---|
222 | */
|
---|
223 | public void updateUI() {
|
---|
224 | setUI((MenuItemUI) UIManager.get(this));
|
---|
225 | invalidate();
|
---|
226 | } // updateUI()
|
---|
227 |
|
---|
228 | /**
|
---|
229 | * getUIClassID
|
---|
230 | * @returns String
|
---|
231 | */
|
---|
232 | public String getUIClassID() {
|
---|
233 | return uiClassID;
|
---|
234 | } // getUIClassID()
|
---|
235 |
|
---|
236 | /**
|
---|
237 | * isArmed
|
---|
238 | * @returns boolean
|
---|
239 | */
|
---|
240 | public boolean isArmed() {
|
---|
241 | return false; // TODO
|
---|
242 | } // isArmed()
|
---|
243 |
|
---|
244 | /**
|
---|
245 | * setArmed
|
---|
246 | * @param armed TODO
|
---|
247 | */
|
---|
248 | public void setArmed(boolean armed) {
|
---|
249 | // TODO
|
---|
250 | } // setArmed()
|
---|
251 |
|
---|
252 | /**
|
---|
253 | * setEnabled
|
---|
254 | * @param enabled TODO
|
---|
255 | */
|
---|
256 | public void setEnabled(boolean enabled) {
|
---|
257 | // TODO
|
---|
258 | } // setEnabled()
|
---|
259 |
|
---|
260 | /**
|
---|
261 | * getAccelerator
|
---|
262 | * @returns KeyStroke
|
---|
263 | */
|
---|
264 | public KeyStroke getAccelerator() {
|
---|
265 | return null; // TODO
|
---|
266 | } // getAccelerator()
|
---|
267 |
|
---|
268 | /**
|
---|
269 | * setAccelerator
|
---|
270 | * @param keystroke TODO
|
---|
271 | */
|
---|
272 | public void setAccelerator(KeyStroke keystroke) {
|
---|
273 | // TODO
|
---|
274 | } // setAccelerator()
|
---|
275 |
|
---|
276 | /**
|
---|
277 | * configurePropertiesFromAction
|
---|
278 | * @param action TODO
|
---|
279 | */
|
---|
280 | protected void configurePropertiesFromAction(Action action) {
|
---|
281 | // TODO
|
---|
282 | } // configurePropertiesFromAction()
|
---|
283 |
|
---|
284 | /**
|
---|
285 | * createActionPropertyChangeListener
|
---|
286 | * @param action TODO
|
---|
287 | * @returns PropertyChangeListener
|
---|
288 | */
|
---|
289 | protected PropertyChangeListener createActionPropertyChangeListener(Action action) {
|
---|
290 | return null; // TODO
|
---|
291 | } // createActionPropertyChangeListener()
|
---|
292 |
|
---|
293 | /**
|
---|
294 | * processMouseEvent
|
---|
295 | * @param event TODO
|
---|
296 | * @param path TODO
|
---|
297 | * @param manager TODO
|
---|
298 | */
|
---|
299 | public void processMouseEvent(MouseEvent event, MenuElement[] path,
|
---|
300 | MenuSelectionManager manager) {
|
---|
301 | // TODO
|
---|
302 | } // processMouseEvent()
|
---|
303 |
|
---|
304 | /**
|
---|
305 | * processKeyEvent
|
---|
306 | * @param event TODO
|
---|
307 | * @param path TODO
|
---|
308 | * @param manager TODO
|
---|
309 | */
|
---|
310 | public void processKeyEvent(KeyEvent event, MenuElement[] path,
|
---|
311 | MenuSelectionManager manager) {
|
---|
312 | // TODO
|
---|
313 | } // processKeyEvent()
|
---|
314 |
|
---|
315 | /**
|
---|
316 | * processMenuDragMouseEvent
|
---|
317 | * @param event TODO
|
---|
318 | */
|
---|
319 | public void processMenuDragMouseEvent(MenuDragMouseEvent event) {
|
---|
320 | // TODO
|
---|
321 | } // processMenuDragMouseEvent()
|
---|
322 |
|
---|
323 | /**
|
---|
324 | * processMenuKeyEvent
|
---|
325 | * @param event TODO
|
---|
326 | */
|
---|
327 | public void processMenuKeyEvent(MenuKeyEvent event) {
|
---|
328 | // TODO
|
---|
329 | } // processMenuKeyEvent()
|
---|
330 |
|
---|
331 | /**
|
---|
332 | * fireMenuDragMouseEntered
|
---|
333 | * @param event TODO
|
---|
334 | */
|
---|
335 | protected void fireMenuDragMouseEntered(MenuDragMouseEvent event) {
|
---|
336 | // TODO
|
---|
337 | } // fireMenuDragMouseEntered()
|
---|
338 |
|
---|
339 | /**
|
---|
340 | * fireMenuDragMouseExited
|
---|
341 | * @param event TODO
|
---|
342 | */
|
---|
343 | protected void fireMenuDragMouseExited(MenuDragMouseEvent event) {
|
---|
344 | // TODO
|
---|
345 | } // fireMenuDragMouseExited()
|
---|
346 |
|
---|
347 | /**
|
---|
348 | * fireMenuDragMouseDragged
|
---|
349 | * @param event TODO
|
---|
350 | */
|
---|
351 | protected void fireMenuDragMouseDragged(MenuDragMouseEvent event) {
|
---|
352 | // TODO
|
---|
353 | } // fireMenuDragMouseDragged()
|
---|
354 |
|
---|
355 | /**
|
---|
356 | * fireMenuDragMouseReleased
|
---|
357 | * @param event TODO
|
---|
358 | */
|
---|
359 | protected void fireMenuDragMouseReleased(MenuDragMouseEvent event) {
|
---|
360 | // TODO
|
---|
361 | } // fireMenuDragMouseReleased()
|
---|
362 |
|
---|
363 | /**
|
---|
364 | * fireMenuKeyPressed
|
---|
365 | * @param event TODO
|
---|
366 | */
|
---|
367 | protected void fireMenuKeyPressed(MenuKeyEvent event) {
|
---|
368 | // TODO
|
---|
369 | } // fireMenuKeyPressed()
|
---|
370 |
|
---|
371 | /**
|
---|
372 | * fireMenuKeyReleased
|
---|
373 | * @param event TODO
|
---|
374 | */
|
---|
375 | protected void fireMenuKeyReleased(MenuKeyEvent event) {
|
---|
376 | // TODO
|
---|
377 | } // fireMenuKeyReleased()
|
---|
378 |
|
---|
379 | /**
|
---|
380 | * fireMenuKeyTyped
|
---|
381 | * @param event TODO
|
---|
382 | */
|
---|
383 | protected void fireMenuKeyTyped(MenuKeyEvent event) {
|
---|
384 | // TODO
|
---|
385 | } // fireMenuKeyTyped()
|
---|
386 |
|
---|
387 | /**
|
---|
388 | * menuSelectionChanged
|
---|
389 | * @param changed TODO
|
---|
390 | */
|
---|
391 | public void menuSelectionChanged(boolean changed) {
|
---|
392 | // TODO
|
---|
393 | } // menuSelectionChanged()
|
---|
394 |
|
---|
395 | /**
|
---|
396 | * getSubElements
|
---|
397 | * @returns MenuElement[]
|
---|
398 | */
|
---|
399 | public MenuElement[] getSubElements() {
|
---|
400 | return null; // TODO
|
---|
401 | } // getSubElements()
|
---|
402 |
|
---|
403 | /**
|
---|
404 | * getComponent
|
---|
405 | * @returns Component
|
---|
406 | */
|
---|
407 | public Component getComponent() {
|
---|
408 | return null; // TODO
|
---|
409 | } // getComponent()
|
---|
410 |
|
---|
411 | /**
|
---|
412 | * addMenuDragMouseListener
|
---|
413 | * @param listener TODO
|
---|
414 | */
|
---|
415 | public void addMenuDragMouseListener(MenuDragMouseListener listener) {
|
---|
416 | // TODO
|
---|
417 | } // addMenuDragMouseListener()
|
---|
418 |
|
---|
419 | /**
|
---|
420 | * removeMenuDragMouseListener
|
---|
421 | * @param listener TODO
|
---|
422 | */
|
---|
423 | public void removeMenuDragMouseListener(MenuDragMouseListener listener) {
|
---|
424 | // TODO
|
---|
425 | } // removeMenuDragMouseListener()
|
---|
426 |
|
---|
427 | /**
|
---|
428 | * addMenuKeyListener
|
---|
429 | * @param listener TODO
|
---|
430 | */
|
---|
431 | public void addMenuKeyListener(MenuKeyListener listener) {
|
---|
432 | // TODO
|
---|
433 | } // addMenuKeyListener()
|
---|
434 |
|
---|
435 | /**
|
---|
436 | * removeMenuKeyListener
|
---|
437 | * @param listener TODO
|
---|
438 | */
|
---|
439 | public void removeMenuKeyListener(MenuKeyListener listener) {
|
---|
440 | // TODO
|
---|
441 | } // removeMenuKeyListener()
|
---|
442 |
|
---|
443 | /**
|
---|
444 | * paramString
|
---|
445 | * @returns String
|
---|
446 | */
|
---|
447 | protected String paramString() {
|
---|
448 | return null; // TODO
|
---|
449 | } // paramString()
|
---|
450 |
|
---|
451 | /**
|
---|
452 | * getAccessibleContext
|
---|
453 | * @returns AccessibleContext
|
---|
454 | */
|
---|
455 | public AccessibleContext getAccessibleContext() {
|
---|
456 | if (accessibleContext == null) {
|
---|
457 | accessibleContext = new AccessibleJMenuItem(this);
|
---|
458 | } // if
|
---|
459 | return accessibleContext;
|
---|
460 | } // getAccessibleContext()
|
---|
461 |
|
---|
462 |
|
---|
463 | } // JMenuItem
|
---|