source: trunk/gcc/libjava/javax/swing/JPopupMenu.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: 13.4 KB
Line 
1/* JPopupMenu.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 javax.accessibility.*;
46import javax.swing.event.*;
47import javax.swing.plaf.*;
48
49/**
50 * JPopupMenu
51 * @author Andrew Selkirk
52 * @version 1.0
53 */
54public class JPopupMenu extends JComponent implements Accessible, MenuElement {
55
56 //-------------------------------------------------------------
57 // Classes ----------------------------------------------------
58 //-------------------------------------------------------------
59
60 /**
61 * Separator
62 */
63 public static class Separator extends JSeparator {
64
65 //-------------------------------------------------------------
66 // Initialization ---------------------------------------------
67 //-------------------------------------------------------------
68
69 /**
70 * Constructor Separator
71 */
72 public Separator() {
73 // TODO
74 } // Separator()
75
76
77 //-------------------------------------------------------------
78 // Methods ----------------------------------------------------
79 //-------------------------------------------------------------
80
81 /**
82 * getUIClassID
83 * @returns String
84 */
85 public String getUIClassID() {
86 return null; // TODO
87 } // getUIClassID()
88
89
90 } // Separator
91
92 /**
93 * AccessibleJPopupMenu
94 */
95 protected class AccessibleJPopupMenu extends AccessibleJComponent {
96
97 //-------------------------------------------------------------
98 // Variables --------------------------------------------------
99 //-------------------------------------------------------------
100
101
102 //-------------------------------------------------------------
103 // Initialization ---------------------------------------------
104 //-------------------------------------------------------------
105
106 /**
107 * Constructor AccessibleJPopupMenu
108 * @param component TODO
109 */
110 protected AccessibleJPopupMenu(JPopupMenu component) {
111 super(component);
112 // TODO
113 } // AccessibleJPopupMenu()
114
115
116 //-------------------------------------------------------------
117 // Methods ----------------------------------------------------
118 //-------------------------------------------------------------
119
120 /**
121 * getAccessibleRole
122 * @returns AccessibleRole
123 */
124 public AccessibleRole getAccessibleRole() {
125 return AccessibleRole.POPUP_MENU;
126 } // getAccessibleRole()
127
128
129 } // AccessibleJPopupMenu
130
131
132 //-------------------------------------------------------------
133 // Variables --------------------------------------------------
134 //-------------------------------------------------------------
135
136 /**
137 * uiClassID
138 */
139 private static final String uiClassID = "PopupMenuUI";
140
141 /**
142 * invoker
143 */
144 transient Component invoker;
145
146 /**
147 * desiredLocationX
148 */
149 private int desiredLocationX;
150
151 /**
152 * desiredLocationY
153 */
154 private int desiredLocationY;
155
156 /**
157 * label
158 */
159 private String label;
160
161 /**
162 * paintBorder
163 */
164 private boolean paintBorder;
165
166 /**
167 * margin
168 */
169 private Insets margin;
170
171 /**
172 * defaultLWPopupEnabledKey
173 */
174 private static final Object defaultLWPopupEnabledKey = null; // TODO
175
176 /**
177 * lightWeightPopupEnabled
178 */
179 private boolean lightWeightPopupEnabled;
180
181 /**
182 * selectionModel
183 */
184 private SingleSelectionModel selectionModel;
185
186
187 //-------------------------------------------------------------
188 // Initialization ---------------------------------------------
189 //-------------------------------------------------------------
190
191 /**
192 * Constructor JPopupMenu
193 */
194 public JPopupMenu() {
195 // TODO
196 } // JPopupMenu()
197
198 /**
199 * Constructor JPopupMenu
200 * @param label TODO
201 */
202 public JPopupMenu(String label) {
203 // TODO
204 } // JPopupMenu()
205
206
207 //-------------------------------------------------------------
208 // Methods ----------------------------------------------------
209 //-------------------------------------------------------------
210
211 /**
212 * readObject
213 * @param stream TODO
214 * @exception IOException TODO
215 * @exception ClassNotFoundException TODO
216 */
217 private void readObject(ObjectInputStream stream)
218 throws IOException, ClassNotFoundException {
219 // TODO
220 } // readObject()
221
222 /**
223 * writeObject
224 * @param stream TODO
225 * @exception IOException TODO
226 */
227 private void writeObject(ObjectOutputStream stream) throws IOException {
228 // TODO
229 } // writeObject()
230
231 /**
232 * add
233 * @param item TODO
234 * @returns JMenuItem
235 */
236 public JMenuItem add(JMenuItem item) {
237 return null; // TODO
238 } // add()
239
240 /**
241 * add
242 * @param text TODO
243 * @returns JMenuItem
244 */
245 public JMenuItem add(String text) {
246 return null; // TODO
247 } // add()
248
249 /**
250 * add
251 * @param action TODO
252 * @returns JMenuItem
253 */
254 public JMenuItem add(Action action) {
255 return null; // TODO
256 } // add()
257
258 /**
259 * remove
260 * @param index TODO
261 */
262 public void remove(int index) {
263 // TODO
264 } // remove()
265
266 /**
267 * insert
268 * @param action TODO
269 * @param index TODO
270 */
271 public void insert(Action action, int index) {
272 // TODO
273 } // insert()
274
275 /**
276 * insert
277 * @param component TODO
278 * @param index TODO
279 */
280 public void insert(Component component, int index) {
281 // TODO
282 } // insert()
283
284 /**
285 * paintBorder
286 * @param graphics TODO
287 */
288 protected void paintBorder(Graphics graphics) {
289 // TODO
290 } // paintBorder()
291
292 /**
293 * getDefaultLightWeightPopupEnabled
294 * @returns boolean
295 */
296 public static boolean getDefaultLightWeightPopupEnabled() {
297 return false; // TODO
298 } // getDefaultLightWeightPopupEnabled()
299
300 /**
301 * setDefaultLightWeightPopupEnabled
302 * @param enabled TODO
303 */
304 public static void setDefaultLightWeightPopupEnabled(boolean enabled) {
305 // TODO
306 } // setDefaultLightWeightPopupEnabled()
307
308 /**
309 * getUI
310 * @returns PopupMenuUI
311 */
312 public PopupMenuUI getUI() {
313 return (PopupMenuUI) ui;
314 } // getUI()
315
316 /**
317 * setUI
318 * @param ui TODO
319 */
320 public void setUI(PopupMenuUI ui) {
321 super.setUI(ui);
322 // TODO
323 } // setUI()
324
325 /**
326 * updateUI
327 */
328 public void updateUI() {
329 setUI((PopupMenuUI) UIManager.get(this));
330 invalidate();
331 } // updateUI()
332
333 /**
334 * getUIClassID
335 * @returns String
336 */
337 public String getUIClassID() {
338 return uiClassID;
339 } // getUIClassID()
340
341 /**
342 * getSelectionModel
343 * @returns SingleSelectionModel
344 */
345 public SingleSelectionModel getSelectionModel() {
346 return null; // TODO
347 } // getSelectionModel()
348
349 /**
350 * setSelectionModel
351 * @param model TODO
352 */
353 public void setSelectionModel(SingleSelectionModel model) {
354 // TODO
355 } // setSelectionModel()
356
357 /**
358 * createActionComponent
359 * @param action TODO
360 * @returns JMenuItem
361 */
362 protected JMenuItem createActionComponent(Action action) {
363 return null; // TODO
364 } // createActionComponent()
365
366 /**
367 * createActionChangeListener
368 * @param item TODO
369 * @returns PropertyChangeListener
370 */
371 protected PropertyChangeListener createActionChangeListener(JMenuItem item) {
372 return null; // TODO
373 } // createActionChangeListener()
374
375 /**
376 * isLightWeightPopupEnabled
377 * @returns boolean
378 */
379 public boolean isLightWeightPopupEnabled() {
380 return false; // TODO
381 } // isLightWeightPopupEnabled()
382
383 /**
384 * setLightWeightPopupEnabled
385 * @param enabled TODO
386 */
387 public void setLightWeightPopupEnabled(boolean enabled) {
388 // TODO
389 } // setLightWeightPopupEnabled()
390
391 /**
392 * getLabel
393 * @returns String
394 */
395 public String getLabel() {
396 return null; // TODO
397 } // getLabel()
398
399 /**
400 * setLabel
401 * @param label TODO
402 */
403 public void setLabel(String label) {
404 // TODO
405 } // setLabel()
406
407 /**
408 * addSeparator
409 */
410 public void addSeparator() {
411 // TODO
412 } // addSeparator()
413
414 /**
415 * addPopupMenuListener
416 * @param listener TODO
417 */
418 public void addPopupMenuListener(PopupMenuListener listener) {
419 // TODO
420 } // addPopupMenuListener()
421
422 /**
423 * removePopupMenuListener
424 * @param listener TODO
425 */
426 public void removePopupMenuListener(PopupMenuListener listener) {
427 // TODO
428 } // removePopupMenuListener()
429
430 /**
431 * firePopupMenuWillBecomeVisible
432 */
433 protected void firePopupMenuWillBecomeVisible() {
434 // TODO
435 } // firePopupMenuWillBecomeVisible()
436
437 /**
438 * firePopupMenuWillBecomeInvisible
439 */
440 protected void firePopupMenuWillBecomeInvisible() {
441 // TODO
442 } // firePopupMenuWillBecomeInvisible()
443
444 /**
445 * firePopupMenuCanceled
446 */
447 protected void firePopupMenuCanceled() {
448 // TODO
449 } // firePopupMenuCanceled()
450
451 /**
452 * pack
453 */
454 public void pack() {
455 // TODO
456 } // pack()
457
458 /**
459 * isVisible
460 * @returns boolean
461 */
462 public boolean isVisible() {
463 return false; // TODO
464 } // isVisible()
465
466 /**
467 * setVisible
468 * @param visible TODO
469 */
470 public void setVisible(boolean visible) {
471 // TODO
472 } // setVisible()
473
474 /**
475 * setLocation
476 * @param x TODO
477 * @param y TODO
478 */
479 public void setLocation(int x, int y) {
480 // TODO
481 } // setLocation()
482
483 /**
484 * isPopupMenu
485 * @returns boolean
486 */
487 private boolean isPopupMenu() {
488 return false; // TODO
489 } // isPopupMenu()
490
491 /**
492 * getInvoker
493 * @returns Component
494 */
495 public Component getInvoker() {
496 return null; // TODO
497 } // getInvoker()
498
499 /**
500 * setInvoker
501 * @param component TODO
502 */
503 public void setInvoker(Component component) {
504 // TODO
505 } // setInvoker()
506
507 /**
508 * show
509 * @param component TODO
510 * @param x TODO
511 * @param y TODO
512 */
513 public void show(Component component, int x, int y) {
514 // TODO
515 } // show()
516
517 /**
518 * getRootPopupMenu
519 * @returns JPopupMenu
520 */
521 JPopupMenu getRootPopupMenu() {
522 return null; // TODO
523 } // getRootPopupMenu()
524
525 /**
526 * getComponentAtIndex
527 * @param index TODO
528 * @returns Component
529 */
530 public Component getComponentAtIndex(int index) {
531 return null; // TODO
532 } // getComponentAtIndex()
533
534 /**
535 * getComponentIndex
536 * @param component TODO
537 * @returns int
538 */
539 public int getComponentIndex(Component component) {
540 return 0; // TODO
541 } // getComponentIndex()
542
543 /**
544 * setPopupSize
545 * @param size TODO
546 */
547 public void setPopupSize(Dimension size) {
548 // TODO
549 } // setPopupSize()
550
551 /**
552 * setPopupSize
553 * @param x TODO
554 * @param y TODO
555 */
556 public void setPopupSize(int x, int y) {
557 // TODO
558 } // setPopupSize()
559
560 /**
561 * setSelected
562 * @param selected TODO
563 */
564 public void setSelected(Component selected) {
565 // TODO
566 } // setSelected()
567
568 /**
569 * isBorderPainted
570 * @returns boolean
571 */
572 public boolean isBorderPainted() {
573 return false; // TODO
574 } // isBorderPainted()
575
576 /**
577 * setBorderPainted
578 * @param painted TODO
579 */
580 public void setBorderPainted(boolean painted) {
581 // TODO
582 } // setBorderPainted()
583
584 /**
585 * getMargin
586 * @returns Insets
587 */
588 public Insets getMargin() {
589 return null; // TODO
590 } // getMargin()
591
592 /**
593 * paramString
594 * @returns String
595 */
596 protected String paramString() {
597 return null; // TODO
598 } // paramString()
599
600 /**
601 * processMouseEvent
602 * @param event TODO
603 * @param path TODO
604 * @param manager TODO
605 */
606 public void processMouseEvent(MouseEvent event, MenuElement[] path,
607 MenuSelectionManager manager) {
608 // TODO
609 } // processMouseEvent()
610
611 /**
612 * processKeyEvent
613 * @param event TODO
614 * @param path TODO
615 * @param manager TODO
616 */
617 public void processKeyEvent(KeyEvent event, MenuElement[] path,
618 MenuSelectionManager manager) {
619 // TODO
620 } // processKeyEvent()
621
622 /**
623 * menuSelectionChanged
624 * @param changed TODO
625 */
626 public void menuSelectionChanged(boolean changed) {
627 // TODO
628 } // menuSelectionChanged()
629
630 /**
631 * getSubElements
632 * @returns MenuElement[]
633 */
634 public MenuElement[] getSubElements() {
635 return null; // TODO
636 } // getSubElements()
637
638 /**
639 * getComponent
640 * @returns Component
641 */
642 public Component getComponent() {
643 return null; // TODO
644 } // getComponent()
645
646 /**
647 * isPopupTrigger
648 * @param event TODO
649 * @returns boolean
650 */
651 public boolean isPopupTrigger(MouseEvent event) {
652 return false; // TODO
653 } // isPopupTrigger()
654
655 /**
656 * getAccessibleContext
657 * @returns AccessibleContext
658 */
659 public AccessibleContext getAccessibleContext() {
660 if (accessibleContext == null) {
661 accessibleContext = new AccessibleJPopupMenu(this);
662 } // if
663 return accessibleContext;
664 } // getAccessibleContext()
665
666
667} // JPopupMenu
Note: See TracBrowser for help on using the repository browser.