OSDN Git Service

2004-01-28 Michael Koch <konqueror@gmx.de>
[pf3gnuchains/gcc-fork.git] / libjava / javax / swing / JMenuItem.java
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
39 package javax.swing;
40
41 import java.awt.Component;
42 import java.awt.event.KeyEvent;
43 import java.awt.event.MouseEvent;
44 import java.beans.PropertyChangeListener;
45 import java.io.IOException;
46 import java.io.ObjectInputStream;
47 import java.io.ObjectOutputStream;
48 import javax.accessibility.Accessible;
49 import javax.accessibility.AccessibleContext;
50 import javax.accessibility.AccessibleRole;
51 import javax.swing.event.ChangeEvent;
52 import javax.swing.event.ChangeListener;
53 import javax.swing.event.MenuDragMouseEvent;
54 import javax.swing.event.MenuDragMouseListener;
55 import javax.swing.event.MenuKeyEvent;
56 import javax.swing.event.MenuKeyListener;
57 import javax.swing.plaf.MenuItemUI;
58
59 /**
60  * JMenuItem
61  * @author      Andrew Selkirk
62  * @version     1.0
63  */
64 public class JMenuItem extends AbstractButton implements Accessible, MenuElement {
65
66         //-------------------------------------------------------------
67         // Classes ----------------------------------------------------
68         //-------------------------------------------------------------
69
70         /**
71          * AccessibleJMenuItem
72          */
73         protected class AccessibleJMenuItem extends AccessibleAbstractButton 
74                         implements ChangeListener {
75
76                 //-------------------------------------------------------------
77                 // Variables --------------------------------------------------
78                 //-------------------------------------------------------------
79
80
81                 //-------------------------------------------------------------
82                 // Initialization ---------------------------------------------
83                 //-------------------------------------------------------------
84
85                 /**
86                  * Constructor AccessibleJMenuItem
87                  * @param component TODO
88                  */
89                 AccessibleJMenuItem(JMenuItem component) {
90                         super(component);
91                         // TODO
92                 } // AccessibleJMenuItem()
93
94
95                 //-------------------------------------------------------------
96                 // Methods ----------------------------------------------------
97                 //-------------------------------------------------------------
98
99                 /**
100                  * stateChanged
101                  * @param event TODO
102                  */
103                 public void stateChanged(ChangeEvent event) {
104                         // TODO
105                 } // stateChanged()
106
107                 /**
108                  * getAccessibleRole
109                  * @returns AccessibleRole
110                  */
111                 public AccessibleRole getAccessibleRole() {
112                         return AccessibleRole.MENU_ITEM;
113                 } // getAccessibleRole()
114
115
116         } // AccessibleJMenuItem
117
118
119         //-------------------------------------------------------------
120         // Variables --------------------------------------------------
121         //-------------------------------------------------------------
122
123         /**
124          * uiClassID
125          */
126         private static final String uiClassID = "MenuItemUI";
127
128         /**
129          * accelerator
130          */
131         private KeyStroke accelerator;
132
133
134         //-------------------------------------------------------------
135         // Initialization ---------------------------------------------
136         //-------------------------------------------------------------
137
138         /**
139          * Constructor JMenuItem
140          */
141         public JMenuItem() {
142                 // TODO
143         } // JMenuItem()
144
145         /**
146          * Constructor JMenuItem
147          * @param icon TODO
148          */
149         public JMenuItem(Icon icon) {
150                 // TODO
151         } // JMenuItem()
152
153         /**
154          * Constructor JMenuItem
155          * @param text TODO
156          */
157         public JMenuItem(String text) {
158                 // TODO
159         } // JMenuItem()
160
161         /**
162          * Constructor JMenuItem
163          * @param action TODO
164          */
165         public JMenuItem(Action action) {
166                 // TODO
167         } // JMenuItem()
168
169         /**
170          * Constructor JMenuItem
171          * @param text TODO
172          * @param icon TODO
173          */
174         public JMenuItem(String text, Icon icon) {
175                 // TODO
176         } // JMenuItem()
177
178         /**
179          * Constructor JMenuItem
180          * @param text TODO
181          * @param mnemonic TODO
182          */
183         public JMenuItem(String text, int mnemonic) {
184                 // TODO
185         } // JMenuItem()
186
187
188         //-------------------------------------------------------------
189         // Methods ----------------------------------------------------
190         //-------------------------------------------------------------
191
192         /**
193          * readObject
194          * @param stream TODO
195          * @exception IOException TODO
196          * @exception ClassNotFoundException TODO
197          */
198         private void readObject(ObjectInputStream stream) 
199                         throws IOException, ClassNotFoundException {
200                 // TODO
201         } // readObject()
202
203         /**
204          * writeObject
205          * @param stream TODO
206          * @exception IOException TODO
207          */
208         private void writeObject(ObjectOutputStream stream) throws IOException {
209                 // TODO
210         } // writeObject()
211
212         /**
213          * init
214          * @param text TODO
215          * @param icon TODO
216          */
217         protected void init(String text, Icon icon) {
218                 // TODO
219         } // init()
220
221         /**
222          * setUI
223          * @param ui TODO
224          */
225         public void setUI(MenuItemUI ui) {
226                 super.setUI(ui);
227                 // TODO
228         } // setUI()
229
230         /**
231          * updateUI
232          */
233         public void updateUI() {
234                 setUI((MenuItemUI) UIManager.get(this));
235                 invalidate();
236         } // updateUI()
237
238         /**
239          * getUIClassID
240          * @returns String
241          */
242         public String getUIClassID() {
243                 return uiClassID;
244         } // getUIClassID()
245
246         /**
247          * isArmed
248          * @returns boolean
249          */
250         public boolean isArmed() {
251                 return false; // TODO
252         } // isArmed()
253
254         /**
255          * setArmed
256          * @param armed TODO
257          */
258         public void setArmed(boolean armed) {
259                 // TODO
260         } // setArmed()
261
262         /**
263          * setEnabled
264          * @param enabled TODO
265          */
266         public void setEnabled(boolean enabled) {
267                 // TODO
268         } // setEnabled()
269
270         /**
271          * getAccelerator
272          * @returns KeyStroke
273          */
274         public KeyStroke getAccelerator() {
275                 return null; // TODO
276         } // getAccelerator()
277
278         /**
279          * setAccelerator
280          * @param keystroke TODO
281          */
282         public void setAccelerator(KeyStroke keystroke) {
283                 // TODO
284         } // setAccelerator()
285
286         /**
287          * configurePropertiesFromAction
288          * @param action TODO
289          */
290         protected void configurePropertiesFromAction(Action action) {
291                 // TODO
292         } // configurePropertiesFromAction()
293
294         /**
295          * createActionPropertyChangeListener
296          * @param action TODO
297          * @returns PropertyChangeListener
298          */
299         protected PropertyChangeListener createActionPropertyChangeListener(Action action) {
300                 return null; // TODO
301         } // createActionPropertyChangeListener()
302
303         /**
304          * processMouseEvent
305          * @param event TODO
306          * @param path TODO
307          * @param manager TODO
308          */
309         public void processMouseEvent(MouseEvent event, MenuElement[] path,
310                         MenuSelectionManager manager) {
311                 // TODO
312         } // processMouseEvent()
313
314         /**
315          * processKeyEvent
316          * @param event TODO
317          * @param path TODO
318          * @param manager TODO
319          */
320         public void processKeyEvent(KeyEvent event, MenuElement[] path,
321                         MenuSelectionManager manager) {
322                 // TODO
323         } // processKeyEvent()
324
325         /**
326          * processMenuDragMouseEvent
327          * @param event TODO
328          */
329         public void processMenuDragMouseEvent(MenuDragMouseEvent event) {
330                 // TODO
331         } // processMenuDragMouseEvent()
332
333         /**
334          * processMenuKeyEvent
335          * @param event TODO
336          */
337         public void processMenuKeyEvent(MenuKeyEvent event) {
338                 // TODO
339         } // processMenuKeyEvent()
340
341         /**
342          * fireMenuDragMouseEntered
343          * @param event TODO
344          */
345         protected void fireMenuDragMouseEntered(MenuDragMouseEvent event) {
346                 // TODO
347         } // fireMenuDragMouseEntered()
348
349         /**
350          * fireMenuDragMouseExited
351          * @param event TODO
352          */
353         protected void fireMenuDragMouseExited(MenuDragMouseEvent event) {
354                 // TODO
355         } // fireMenuDragMouseExited()
356
357         /**
358          * fireMenuDragMouseDragged
359          * @param event TODO
360          */
361         protected void fireMenuDragMouseDragged(MenuDragMouseEvent event) {
362                 // TODO
363         } // fireMenuDragMouseDragged()
364
365         /**
366          * fireMenuDragMouseReleased
367          * @param event TODO
368          */
369         protected void fireMenuDragMouseReleased(MenuDragMouseEvent event) {
370                 // TODO
371         } // fireMenuDragMouseReleased()
372
373         /**
374          * fireMenuKeyPressed
375          * @param event TODO
376          */
377         protected void fireMenuKeyPressed(MenuKeyEvent event) {
378                 // TODO
379         } // fireMenuKeyPressed()
380
381         /**
382          * fireMenuKeyReleased
383          * @param event TODO
384          */
385         protected void fireMenuKeyReleased(MenuKeyEvent event) {
386                 // TODO
387         } // fireMenuKeyReleased()
388
389         /**
390          * fireMenuKeyTyped
391          * @param event TODO
392          */
393         protected void fireMenuKeyTyped(MenuKeyEvent event) {
394                 // TODO
395         } // fireMenuKeyTyped()
396
397         /**
398          * menuSelectionChanged
399          * @param changed TODO
400          */
401         public void menuSelectionChanged(boolean changed) {
402                 // TODO
403         } // menuSelectionChanged()
404
405         /**
406          * getSubElements
407          * @returns MenuElement[]
408          */
409         public MenuElement[] getSubElements() {
410                 return null; // TODO
411         } // getSubElements()
412
413         /**
414          * getComponent
415          * @returns Component
416          */
417         public Component getComponent() {
418                 return null; // TODO
419         } // getComponent()
420
421         /**
422          * addMenuDragMouseListener
423          * @param listener TODO
424          */
425         public void addMenuDragMouseListener(MenuDragMouseListener listener) {
426                 // TODO
427         } // addMenuDragMouseListener()
428
429         /**
430          * removeMenuDragMouseListener
431          * @param listener TODO
432          */
433         public void removeMenuDragMouseListener(MenuDragMouseListener listener) {
434                 // TODO
435         } // removeMenuDragMouseListener()
436
437         /**
438          * addMenuKeyListener
439          * @param listener TODO
440          */
441         public void addMenuKeyListener(MenuKeyListener listener) {
442                 // TODO
443         } // addMenuKeyListener()
444
445         /**
446          * removeMenuKeyListener
447          * @param listener TODO
448          */
449         public void removeMenuKeyListener(MenuKeyListener listener) {
450                 // TODO
451         } // removeMenuKeyListener()
452
453         /**
454          * paramString
455          * @returns String
456          */
457         protected String paramString() {
458                 return null; // TODO
459         } // paramString()
460
461         /**
462          * getAccessibleContext
463          * @returns AccessibleContext
464          */
465         public AccessibleContext getAccessibleContext() {
466                 if (accessibleContext == null) {
467                         accessibleContext = new AccessibleJMenuItem(this);
468                 } // if
469                 return accessibleContext;
470         } // getAccessibleContext()
471
472
473 } // JMenuItem