OSDN Git Service

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