source: trunk/gcc/libjava/javax/swing/JMenu.java

Last change on this file was 1389, checked in by bird, 21 years ago

Initial revision

  • Property cvs2svn:cvs-rev set to 1.1
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 14.9 KB
Line 
1/* JMenu.java --
2 Copyright (C) 2002 Free Software Foundation, Inc.
3
4This file is part of GNU Classpath.
5
6GNU Classpath is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation; either version 2, or (at your option)
9any later version.
10
11GNU Classpath is distributed in the hope that it will be useful, but
12WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with GNU Classpath; see the file COPYING. If not, write to the
18Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
1902111-1307 USA.
20
21Linking this library statically or dynamically with other modules is
22making a combined work based on this library. Thus, the terms and
23conditions of the GNU General Public License cover the whole
24combination.
25
26As a special exception, the copyright holders of this library give you
27permission to link this library with independent modules to produce an
28executable, regardless of the license terms of these independent
29modules, and to copy and distribute the resulting executable under
30terms of your choice, provided that you also meet, for each linked
31independent module, the terms and conditions of the license of that
32module. An independent module is a module which is not derived from
33or based on this library. If you modify this library, you may extend
34this exception to your version of the library, but you are not
35obligated to do so. If you do not wish to do so, delete this
36exception statement from your version. */
37
38package javax.swing;
39
40// Imports
41import java.awt.*;
42import java.awt.event.*;
43import java.beans.*;
44import java.io.*;
45import java.util.*;
46import javax.accessibility.*;
47import javax.swing.event.*;
48
49/**
50 * JMenu
51 * @author Andrew Selkirk
52 * @version 1.0
53 */
54public class JMenu extends JMenuItem implements Accessible, MenuElement {
55
56 //-------------------------------------------------------------
57 // Classes ----------------------------------------------------
58 //-------------------------------------------------------------
59
60 /**
61 * AccessibleJMenu
62 */
63 protected class AccessibleJMenu extends AccessibleJMenuItem
64 implements AccessibleSelection {
65
66 //-------------------------------------------------------------
67 // Variables --------------------------------------------------
68 //-------------------------------------------------------------
69
70
71 //-------------------------------------------------------------
72 // Initialization ---------------------------------------------
73 //-------------------------------------------------------------
74
75 /**
76 * Constructor AccessibleJMenu
77 * @param component TODO
78 */
79 protected AccessibleJMenu(JMenu component) {
80 super(component);
81 // TODO
82 } // AccessibleJMenu()
83
84
85 //-------------------------------------------------------------
86 // Methods ----------------------------------------------------
87 //-------------------------------------------------------------
88
89 /**
90 * getAccessibleChildrenCount
91 * @returns int
92 */
93 public int getAccessibleChildrenCount() {
94 return 0; // TODO
95 } // getAccessibleChildrenCount()
96
97 /**
98 * getAccessibleChild
99 * @param value0 TODO
100 * @returns Accessible
101 */
102 public Accessible getAccessibleChild(int value0) {
103 return null; // TODO
104 } // getAccessibleChild()
105
106 /**
107 * getAccessibleSelection
108 * @returns AccessibleSelection
109 */
110 public AccessibleSelection getAccessibleSelection() {
111 return null; // TODO
112 } // getAccessibleSelection()
113
114 /**
115 * getAccessibleSelection
116 * @param value0 TODO
117 * @returns Accessible
118 */
119 public Accessible getAccessibleSelection(int value0) {
120 return null; // TODO
121 } // getAccessibleSelection()
122
123 /**
124 * isAccessibleChildSelected
125 * @param value0 TODO
126 * @returns boolean
127 */
128 public boolean isAccessibleChildSelected(int value0) {
129 return false; // TODO
130 } // isAccessibleChildSelected()
131
132 /**
133 * getAccessibleRole
134 * @returns AccessibleRole
135 */
136 public AccessibleRole getAccessibleRole() {
137 return AccessibleRole.MENU;
138 } // getAccessibleRole()
139
140 /**
141 * getAccessibleSelectionCount
142 * @returns int
143 */
144 public int getAccessibleSelectionCount() {
145 return 0; // TODO
146 } // getAccessibleSelectionCount()
147
148 /**
149 * addAccessibleSelection
150 * @param value0 TODO
151 */
152 public void addAccessibleSelection(int value0) {
153 // TODO
154 } // addAccessibleSelection()
155
156 /**
157 * removeAccessibleSelection
158 * @param value0 TODO
159 */
160 public void removeAccessibleSelection(int value0) {
161 // TODO
162 } // removeAccessibleSelection()
163
164 /**
165 * clearAccessibleSelection
166 */
167 public void clearAccessibleSelection() {
168 // TODO
169 } // clearAccessibleSelection()
170
171 /**
172 * selectAllAccessibleSelection
173 */
174 public void selectAllAccessibleSelection() {
175 // TODO
176 } // selectAllAccessibleSelection()
177
178
179 } // AccessibleJMenu
180
181 /**
182 * WinListener
183 */
184 protected class WinListener extends WindowAdapter implements Serializable {
185
186 //-------------------------------------------------------------
187 // Variables --------------------------------------------------
188 //-------------------------------------------------------------
189
190 /**
191 * popupMenu
192 */
193 JPopupMenu popupMenu;
194
195
196 //-------------------------------------------------------------
197 // Initialization ---------------------------------------------
198 //-------------------------------------------------------------
199
200 /**
201 * Constructor WinListener
202 * @param value0 TODO
203 * @param value1 TODO
204 */
205 public WinListener(JMenu value0, JPopupMenu value1) {
206 // TODO
207 } // WinListener()
208
209
210 //-------------------------------------------------------------
211 // Methods ----------------------------------------------------
212 //-------------------------------------------------------------
213
214 /**
215 * windowClosing
216 * @param value0 TODO
217 */
218 public void windowClosing(WindowEvent value0) {
219 // TODO
220 } // windowClosing()
221
222
223 } // WinListener
224
225
226 //-------------------------------------------------------------
227 // Variables --------------------------------------------------
228 //-------------------------------------------------------------
229
230 /**
231 * uiClassID
232 */
233 private static final String uiClassID = "MenuUI";
234
235 /**
236 * popupMenu
237 */
238 private JPopupMenu popupMenu;
239
240 /**
241 * menuChangeListener
242 */
243 private ChangeListener menuChangeListener;
244
245 /**
246 * menuEvent
247 */
248 private MenuEvent menuEvent;
249
250 /**
251 * listenerRegistry
252 */
253 private static Hashtable listenerRegistry = null; // TODO
254
255 /**
256 * delay
257 */
258 private int delay;
259
260 /**
261 * TRACE
262 */
263 private static final boolean TRACE = false; // TODO
264
265 /**
266 * VERBOSE
267 */
268 private static final boolean VERBOSE = false; // TODO
269
270 /**
271 * DEBUG
272 */
273 private static final boolean DEBUG = false; // TODO
274
275 /**
276 * popupListener
277 */
278 protected JMenu.WinListener popupListener;
279
280
281 //-------------------------------------------------------------
282 // Initialization ---------------------------------------------
283 //-------------------------------------------------------------
284
285 /**
286 * Constructor JMenu
287 */
288 public JMenu() {
289 // TODO
290 } // JMenu()
291
292 /**
293 * Constructor JMenu
294 * @param text TODO
295 */
296 public JMenu(String text) {
297 // TODO
298 } // JMenu()
299
300 /**
301 * Constructor JMenu
302 * @param action TODO
303 */
304 public JMenu(Action action) {
305 // TODO
306 } // JMenu()
307
308 /**
309 * Constructor JMenu
310 * @param text TODO
311 * @param tearoff TODO
312 */
313 public JMenu(String text, boolean tearoff) {
314 // TODO
315 } // JMenu()
316
317
318 //-------------------------------------------------------------
319 // Methods ----------------------------------------------------
320 //-------------------------------------------------------------
321
322 /**
323 * writeObject
324 * @param stream TODO
325 * @exception IOException TODO
326 */
327 private void writeObject(ObjectOutputStream stream) throws IOException {
328 // TODO
329 } // writeObject()
330
331 /**
332 * add
333 * @param value0 TODO
334 * @returns JMenuItem
335 */
336 public JMenuItem add(JMenuItem item) {
337 return null; // TODO
338 } // add()
339
340 /**
341 * add
342 * @param component TODO
343 * @returns Component
344 */
345 public Component add(Component component) {
346 return null; // TODO
347 } // add()
348
349 /**
350 * add
351 * @param component TODO
352 * @param index TODO
353 * @returns Component
354 */
355 public Component add(Component component, int index) {
356 return null; // TODO
357 } // add()
358
359 /**
360 * add
361 * @param text TODO
362 * @returns JMenuItem
363 */
364 public JMenuItem add(String text) {
365 return null; // TODO
366 } // add()
367
368 /**
369 * add
370 * @param action TODO
371 * @returns JMenuItem
372 */
373 public JMenuItem add(Action action) {
374 return null; // TODO
375 } // add()
376
377 /**
378 * remove
379 * @param item TODO
380 */
381 public void remove(JMenuItem item) {
382 // TODO
383 } // remove()
384
385 /**
386 * remove
387 * @param index TODO
388 */
389 public void remove(int index) {
390 // TODO
391 } // remove()
392
393 /**
394 * remove
395 * @param component TODO
396 */
397 public void remove(Component component) {
398 // TODO
399 } // remove()
400
401 /**
402 * removeAll
403 */
404 public void removeAll() {
405 // TODO
406 } // removeAll()
407
408 /**
409 * insert
410 * @param text TODO
411 * @param index TODO
412 */
413 public void insert(String text, int index) {
414 // TODO
415 } // insert()
416
417 /**
418 * insert
419 * @param item TODO
420 * @param index TODO
421 * @returns JMenuItem
422 */
423 public JMenuItem insert(JMenuItem item, int index) {
424 return null; // TODO
425 } // insert()
426
427 /**
428 * insert
429 * @param action TODO
430 * @param index TODO
431 * @returns JMenuItem
432 */
433 public JMenuItem insert(Action action, int index) {
434 return null; // TODO
435 } // insert()
436
437 /**
438 * updateUI
439 */
440 public void updateUI() {
441 //setUI((MenuUI) UIManager.get(this));
442 invalidate();
443 } // updateUI()
444
445 /**
446 * getUIClassID
447 * @returns String
448 */
449 public String getUIClassID() {
450 return uiClassID;
451 } // getUIClassID()
452
453 /**
454 * setModel
455 * @param model TODO
456 */
457 public void setModel(ButtonModel model) {
458 // TODO
459 } // setModel()
460
461 /**
462 * isSelected
463 * @returns boolean
464 */
465 public boolean isSelected() {
466 return false; // TODO
467 } // isSelected()
468
469 /**
470 * setSelected
471 * @param selected TODO
472 */
473 public void setSelected(boolean selected) {
474 // TODO
475 } // setSelected()
476
477 /**
478 * isPopupMenuVisible
479 * @returns boolean
480 */
481 public boolean isPopupMenuVisible() {
482 return false; // TODO
483 } // isPopupMenuVisible()
484
485 /**
486 * setPopupMenuVisible
487 * @param popup TODO
488 */
489 public void setPopupMenuVisible(boolean popup) {
490 // TODO
491 } // setPopupMenuVisible()
492
493 /**
494 * getPopupMenuOrigin
495 * @returns Point
496 */
497 protected Point getPopupMenuOrigin() {
498 return null; // TODO
499 } // getPopupMenuOrigin()
500
501 /**
502 * getDelay
503 * @returns int
504 */
505 public int getDelay() {
506 return 0; // TODO
507 } // getDelay()
508
509 /**
510 * setDelay
511 * @param value0 TODO
512 */
513 public void setDelay(int delay) {
514 // TODO
515 } // setDelay()
516
517 /**
518 * setMenuLocation
519 * @param x TODO
520 * @param y TODO
521 */
522 public void setMenuLocation(int x, int y) {
523 // TODO
524 } // setMenuLocation()
525
526 /**
527 * createActionComponent
528 * @param action TODO
529 * @returns JMenuItem
530 */
531 protected JMenuItem createActionComponent(Action action) {
532 return null; // TODO
533 } // createActionComponent()
534
535 /**
536 * createActionChangeListener
537 * @param item TODO
538 * @returns PropertyChangeListener
539 */
540 protected PropertyChangeListener createActionChangeListener(JMenuItem item) {
541 return null; // TODO
542 } // createActionChangeListener()
543
544 /**
545 * addSeparator
546 */
547 public void addSeparator() {
548 // TODO
549 } // addSeparator()
550
551 /**
552 * insertSeparator
553 * @param index TODO
554 */
555 public void insertSeparator(int index) {
556 // TODO
557 } // insertSeparator()
558
559 /**
560 * getItem
561 * @param index TODO
562 * @returns JMenuItem
563 */
564 public JMenuItem getItem(int index) {
565 return null; // TODO
566 } // getItem()
567
568 /**
569 * getItemCount
570 * @returns int
571 */
572 public int getItemCount() {
573 return 0; // TODO
574 } // getItemCount()
575
576 /**
577 * isTearOff
578 * @returns boolean
579 */
580 public boolean isTearOff() {
581 return false; // TODO
582 } // isTearOff()
583
584 /**
585 * getMenuComponentCount
586 * @returns int
587 */
588 public int getMenuComponentCount() {
589 return 0; // TODO
590 } // getMenuComponentCount()
591
592 /**
593 * getMenuComponent
594 * @param index TODO
595 * @returns Component
596 */
597 public Component getMenuComponent(int index) {
598 return null; // TODO
599 } // getMenuComponent()
600
601 /**
602 * getMenuComponents
603 * @returns Component[]
604 */
605 public Component[] getMenuComponents() {
606 return null; // TODO
607 } // getMenuComponents()
608
609 /**
610 * isTopLevelMenu
611 * @returns boolean
612 */
613 public boolean isTopLevelMenu() {
614 return false; // TODO
615 } // isTopLevelMenu()
616
617 /**
618 * isMenuComponent
619 * @param component TODO
620 * @returns boolean
621 */
622 public boolean isMenuComponent(Component component) {
623 return false; // TODO
624 } // isMenuComponent()
625
626 /**
627 * getPopupMenu
628 * @returns JPopupMenu
629 */
630 public JPopupMenu getPopupMenu() {
631 return null; // TODO
632 } // getPopupMenu()
633
634 /**
635 * addMenuListener
636 * @param listener TODO
637 */
638 public void addMenuListener(MenuListener listener) {
639 // TODO
640 } // addMenuListener()
641
642 /**
643 * removeMenuListener
644 * @param listener TODO
645 */
646 public void removeMenuListener(MenuListener listener) {
647 // TODO
648 } // removeMenuListener()
649
650 /**
651 * fireMenuSelected
652 */
653 protected void fireMenuSelected() {
654 // TODO
655 } // fireMenuSelected()
656
657 /**
658 * fireMenuDeselected
659 */
660 protected void fireMenuDeselected() {
661 // TODO
662 } // fireMenuDeselected()
663
664 /**
665 * fireMenuCanceled
666 */
667 protected void fireMenuCanceled() {
668 // TODO
669 } // fireMenuCanceled()
670
671 /**
672 * createMenuChangeListener
673 * @returns ChangeListener
674 */
675 private ChangeListener createMenuChangeListener() {
676 return null; // TODO
677 } // createMenuChangeListener()
678
679 /**
680 * createWinListener
681 * @param popup TODO
682 * @returns JMenu.WinListener
683 */
684 protected JMenu.WinListener createWinListener(JPopupMenu popup) {
685 return null; // TODO
686 } // createWinListener()
687
688 /**
689 * menuSelectionChanged
690 * @param value0 TODO
691 */
692 public void menuSelectionChanged(boolean changed) {
693 // TODO
694 } // menuSelectionChanged()
695
696 /**
697 * getSubElements
698 * @returns MenuElement[]
699 */
700 public MenuElement[] getSubElements() {
701 return null; // TODO
702 } // getSubElements()
703
704 /**
705 * getComponent
706 * @returns Component
707 */
708 public Component getComponent() {
709 return null; // TODO
710 } // getComponent()
711
712 /**
713 * setAccelerator
714 * @param keystroke TODO
715 */
716 public void setAccelerator(KeyStroke keystroke) {
717 // TODO
718 } // setAccelerator()
719
720 /**
721 * processKeyEvent
722 * @param event TODO
723 */
724 protected void processKeyEvent(KeyEvent event) {
725 // TODO
726 } // processKeyEvent()
727
728 /**
729 * doClick
730 * @param time TODO
731 */
732 public void doClick(int time) {
733 // TODO
734 } // doClick()
735
736 /**
737 * paramString
738 * @returns String
739 */
740 protected String paramString() {
741 return null; // TODO
742 } // paramString()
743
744 /**
745 * getAccessibleContext
746 * @returns AccessibleContext
747 */
748 public AccessibleContext getAccessibleContext() {
749 if (accessibleContext == null) {
750 accessibleContext = new AccessibleJMenu(this);
751 } // if
752 return accessibleContext;
753 } // getAccessibleContext()
754
755
756} // JMenu
Note: See TracBrowser for help on using the repository browser.