2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / libjava / javax / swing / JMenuItem.java
blobdb09f22972f045544169378d16186eab83a741a1
1 /* JMenuItem.java --
2 Copyright (C) 2002 Free Software Foundation, Inc.
4 This file is part of GNU Classpath.
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.
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.
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.
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.
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. */
39 package javax.swing;
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;
59 /**
60 * JMenuItem
61 * @author Andrew Selkirk
62 * @version 1.0
64 public class JMenuItem extends AbstractButton implements Accessible, MenuElement {
66 //-------------------------------------------------------------
67 // Classes ----------------------------------------------------
68 //-------------------------------------------------------------
70 /**
71 * AccessibleJMenuItem
73 protected class AccessibleJMenuItem extends AccessibleAbstractButton
74 implements ChangeListener {
76 //-------------------------------------------------------------
77 // Variables --------------------------------------------------
78 //-------------------------------------------------------------
81 //-------------------------------------------------------------
82 // Initialization ---------------------------------------------
83 //-------------------------------------------------------------
85 /**
86 * Constructor AccessibleJMenuItem
87 * @param component TODO
89 AccessibleJMenuItem(JMenuItem component) {
90 super(component);
91 // TODO
92 } // AccessibleJMenuItem()
95 //-------------------------------------------------------------
96 // Methods ----------------------------------------------------
97 //-------------------------------------------------------------
99 /**
100 * stateChanged
101 * @param event TODO
103 public void stateChanged(ChangeEvent event) {
104 // TODO
105 } // stateChanged()
108 * getAccessibleRole
109 * @returns AccessibleRole
111 public AccessibleRole getAccessibleRole() {
112 return AccessibleRole.MENU_ITEM;
113 } // getAccessibleRole()
116 } // AccessibleJMenuItem
119 //-------------------------------------------------------------
120 // Variables --------------------------------------------------
121 //-------------------------------------------------------------
124 * uiClassID
126 private static final String uiClassID = "MenuItemUI";
129 * accelerator
131 private KeyStroke accelerator;
134 //-------------------------------------------------------------
135 // Initialization ---------------------------------------------
136 //-------------------------------------------------------------
139 * Constructor JMenuItem
141 public JMenuItem() {
142 // TODO
143 } // JMenuItem()
146 * Constructor JMenuItem
147 * @param icon TODO
149 public JMenuItem(Icon icon) {
150 // TODO
151 } // JMenuItem()
154 * Constructor JMenuItem
155 * @param text TODO
157 public JMenuItem(String text) {
158 // TODO
159 } // JMenuItem()
162 * Constructor JMenuItem
163 * @param action TODO
165 public JMenuItem(Action action) {
166 // TODO
167 } // JMenuItem()
170 * Constructor JMenuItem
171 * @param text TODO
172 * @param icon TODO
174 public JMenuItem(String text, Icon icon) {
175 // TODO
176 } // JMenuItem()
179 * Constructor JMenuItem
180 * @param text TODO
181 * @param mnemonic TODO
183 public JMenuItem(String text, int mnemonic) {
184 // TODO
185 } // JMenuItem()
188 //-------------------------------------------------------------
189 // Methods ----------------------------------------------------
190 //-------------------------------------------------------------
193 * readObject
194 * @param stream TODO
195 * @exception IOException TODO
196 * @exception ClassNotFoundException TODO
198 private void readObject(ObjectInputStream stream)
199 throws IOException, ClassNotFoundException {
200 // TODO
201 } // readObject()
204 * writeObject
205 * @param stream TODO
206 * @exception IOException TODO
208 private void writeObject(ObjectOutputStream stream) throws IOException {
209 // TODO
210 } // writeObject()
213 * init
214 * @param text TODO
215 * @param icon TODO
217 protected void init(String text, Icon icon) {
218 // TODO
219 } // init()
222 * setUI
223 * @param ui TODO
225 public void setUI(MenuItemUI ui) {
226 super.setUI(ui);
227 // TODO
228 } // setUI()
231 * updateUI
233 public void updateUI() {
234 setUI((MenuItemUI) UIManager.get(this));
235 invalidate();
236 } // updateUI()
239 * getUIClassID
240 * @returns String
242 public String getUIClassID() {
243 return uiClassID;
244 } // getUIClassID()
247 * isArmed
248 * @returns boolean
250 public boolean isArmed() {
251 return false; // TODO
252 } // isArmed()
255 * setArmed
256 * @param armed TODO
258 public void setArmed(boolean armed) {
259 // TODO
260 } // setArmed()
263 * setEnabled
264 * @param enabled TODO
266 public void setEnabled(boolean enabled) {
267 // TODO
268 } // setEnabled()
271 * getAccelerator
272 * @returns KeyStroke
274 public KeyStroke getAccelerator() {
275 return null; // TODO
276 } // getAccelerator()
279 * setAccelerator
280 * @param keystroke TODO
282 public void setAccelerator(KeyStroke keystroke) {
283 // TODO
284 } // setAccelerator()
287 * configurePropertiesFromAction
288 * @param action TODO
290 protected void configurePropertiesFromAction(Action action) {
291 // TODO
292 } // configurePropertiesFromAction()
295 * createActionPropertyChangeListener
296 * @param action TODO
297 * @returns PropertyChangeListener
299 protected PropertyChangeListener createActionPropertyChangeListener(Action action) {
300 return null; // TODO
301 } // createActionPropertyChangeListener()
304 * processMouseEvent
305 * @param event TODO
306 * @param path TODO
307 * @param manager TODO
309 public void processMouseEvent(MouseEvent event, MenuElement[] path,
310 MenuSelectionManager manager) {
311 // TODO
312 } // processMouseEvent()
315 * processKeyEvent
316 * @param event TODO
317 * @param path TODO
318 * @param manager TODO
320 public void processKeyEvent(KeyEvent event, MenuElement[] path,
321 MenuSelectionManager manager) {
322 // TODO
323 } // processKeyEvent()
326 * processMenuDragMouseEvent
327 * @param event TODO
329 public void processMenuDragMouseEvent(MenuDragMouseEvent event) {
330 // TODO
331 } // processMenuDragMouseEvent()
334 * processMenuKeyEvent
335 * @param event TODO
337 public void processMenuKeyEvent(MenuKeyEvent event) {
338 // TODO
339 } // processMenuKeyEvent()
342 * fireMenuDragMouseEntered
343 * @param event TODO
345 protected void fireMenuDragMouseEntered(MenuDragMouseEvent event) {
346 // TODO
347 } // fireMenuDragMouseEntered()
350 * fireMenuDragMouseExited
351 * @param event TODO
353 protected void fireMenuDragMouseExited(MenuDragMouseEvent event) {
354 // TODO
355 } // fireMenuDragMouseExited()
358 * fireMenuDragMouseDragged
359 * @param event TODO
361 protected void fireMenuDragMouseDragged(MenuDragMouseEvent event) {
362 // TODO
363 } // fireMenuDragMouseDragged()
366 * fireMenuDragMouseReleased
367 * @param event TODO
369 protected void fireMenuDragMouseReleased(MenuDragMouseEvent event) {
370 // TODO
371 } // fireMenuDragMouseReleased()
374 * fireMenuKeyPressed
375 * @param event TODO
377 protected void fireMenuKeyPressed(MenuKeyEvent event) {
378 // TODO
379 } // fireMenuKeyPressed()
382 * fireMenuKeyReleased
383 * @param event TODO
385 protected void fireMenuKeyReleased(MenuKeyEvent event) {
386 // TODO
387 } // fireMenuKeyReleased()
390 * fireMenuKeyTyped
391 * @param event TODO
393 protected void fireMenuKeyTyped(MenuKeyEvent event) {
394 // TODO
395 } // fireMenuKeyTyped()
398 * menuSelectionChanged
399 * @param changed TODO
401 public void menuSelectionChanged(boolean changed) {
402 // TODO
403 } // menuSelectionChanged()
406 * getSubElements
407 * @returns MenuElement[]
409 public MenuElement[] getSubElements() {
410 return null; // TODO
411 } // getSubElements()
414 * getComponent
415 * @returns Component
417 public Component getComponent() {
418 return null; // TODO
419 } // getComponent()
422 * addMenuDragMouseListener
423 * @param listener TODO
425 public void addMenuDragMouseListener(MenuDragMouseListener listener) {
426 // TODO
427 } // addMenuDragMouseListener()
430 * removeMenuDragMouseListener
431 * @param listener TODO
433 public void removeMenuDragMouseListener(MenuDragMouseListener listener) {
434 // TODO
435 } // removeMenuDragMouseListener()
438 * addMenuKeyListener
439 * @param listener TODO
441 public void addMenuKeyListener(MenuKeyListener listener) {
442 // TODO
443 } // addMenuKeyListener()
446 * removeMenuKeyListener
447 * @param listener TODO
449 public void removeMenuKeyListener(MenuKeyListener listener) {
450 // TODO
451 } // removeMenuKeyListener()
454 * paramString
455 * @returns String
457 protected String paramString() {
458 return null; // TODO
459 } // paramString()
462 * getAccessibleContext
463 * @returns AccessibleContext
465 public AccessibleContext getAccessibleContext() {
466 if (accessibleContext == null) {
467 accessibleContext = new AccessibleJMenuItem(this);
468 } // if
469 return accessibleContext;
470 } // getAccessibleContext()
473 } // JMenuItem