fixes for host gcc 4.6.1
[zpugcc/jano.git] / toolchain / gcc / libjava / javax / swing / JPopupMenu.java
blob1a7c7c680c2d1dd7a4f162c87c4875b492dd64a8
1 /* JPopupMenu.java --
2 Copyright (C) 2002, 2004 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. */
38 package javax.swing;
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;
56 /**
57 * JPopupMenu
58 * @author Andrew Selkirk
59 * @version 1.0
61 public class JPopupMenu extends JComponent implements Accessible, MenuElement
64 //-------------------------------------------------------------
65 // Classes ----------------------------------------------------
66 //-------------------------------------------------------------
68 /**
69 * Separator
71 public static class Separator extends JSeparator {
73 //-------------------------------------------------------------
74 // Initialization ---------------------------------------------
75 //-------------------------------------------------------------
77 /**
78 * Constructor Separator
80 public Separator() {
81 // TODO
82 } // Separator()
85 //-------------------------------------------------------------
86 // Methods ----------------------------------------------------
87 //-------------------------------------------------------------
89 /**
90 * getUIClassID
91 * @returns String
93 public String getUIClassID() {
94 return null; // TODO
95 } // getUIClassID()
98 } // Separator
101 * AccessibleJPopupMenu
103 protected class AccessibleJPopupMenu extends AccessibleJComponent {
105 //-------------------------------------------------------------
106 // Variables --------------------------------------------------
107 //-------------------------------------------------------------
110 //-------------------------------------------------------------
111 // Initialization ---------------------------------------------
112 //-------------------------------------------------------------
115 * Constructor AccessibleJPopupMenu
116 * @param component TODO
118 protected AccessibleJPopupMenu(JPopupMenu component) {
119 super(component);
120 // TODO
121 } // AccessibleJPopupMenu()
124 //-------------------------------------------------------------
125 // Methods ----------------------------------------------------
126 //-------------------------------------------------------------
129 * getAccessibleRole
130 * @returns AccessibleRole
132 public AccessibleRole getAccessibleRole() {
133 return AccessibleRole.POPUP_MENU;
134 } // getAccessibleRole()
137 } // AccessibleJPopupMenu
140 //-------------------------------------------------------------
141 // Variables --------------------------------------------------
142 //-------------------------------------------------------------
145 * uiClassID
147 private static final String uiClassID = "PopupMenuUI";
150 * invoker
152 transient Component invoker;
155 * desiredLocationX
157 private int desiredLocationX;
160 * desiredLocationY
162 private int desiredLocationY;
165 * label
167 private String label;
170 * paintBorder
172 private boolean paintBorder;
175 * margin
177 private Insets margin;
180 * defaultLWPopupEnabledKey
182 private static final Object defaultLWPopupEnabledKey = null; // TODO
185 * lightWeightPopupEnabled
187 private boolean lightWeightPopupEnabled;
190 * selectionModel
192 private SingleSelectionModel selectionModel;
195 //-------------------------------------------------------------
196 // Initialization ---------------------------------------------
197 //-------------------------------------------------------------
200 * Constructor JPopupMenu
202 public JPopupMenu() {
203 // TODO
204 } // JPopupMenu()
207 * Constructor JPopupMenu
208 * @param label TODO
210 public JPopupMenu(String label) {
211 // TODO
212 } // JPopupMenu()
215 //-------------------------------------------------------------
216 // Methods ----------------------------------------------------
217 //-------------------------------------------------------------
220 * readObject
221 * @param stream TODO
222 * @exception IOException TODO
223 * @exception ClassNotFoundException TODO
225 private void readObject(ObjectInputStream stream)
226 throws IOException, ClassNotFoundException {
227 // TODO
228 } // readObject()
231 * writeObject
232 * @param stream TODO
233 * @exception IOException TODO
235 private void writeObject(ObjectOutputStream stream) throws IOException {
236 // TODO
237 } // writeObject()
240 * add
241 * @param item TODO
242 * @returns JMenuItem
244 public JMenuItem add(JMenuItem item) {
245 return null; // TODO
246 } // add()
249 * add
250 * @param text TODO
251 * @returns JMenuItem
253 public JMenuItem add(String text) {
254 return null; // TODO
255 } // add()
258 * add
259 * @param action TODO
260 * @returns JMenuItem
262 public JMenuItem add(Action action) {
263 return null; // TODO
264 } // add()
267 * remove
268 * @param index TODO
270 public void remove(int index) {
271 // TODO
272 } // remove()
275 * insert
276 * @param action TODO
277 * @param index TODO
279 public void insert(Action action, int index) {
280 // TODO
281 } // insert()
284 * insert
285 * @param component TODO
286 * @param index TODO
288 public void insert(Component component, int index) {
289 // TODO
290 } // insert()
293 * paintBorder
294 * @param graphics TODO
296 protected void paintBorder(Graphics graphics) {
297 // TODO
298 } // paintBorder()
301 * getDefaultLightWeightPopupEnabled
302 * @returns boolean
304 public static boolean getDefaultLightWeightPopupEnabled() {
305 return false; // TODO
306 } // getDefaultLightWeightPopupEnabled()
309 * setDefaultLightWeightPopupEnabled
310 * @param enabled TODO
312 public static void setDefaultLightWeightPopupEnabled(boolean enabled) {
313 // TODO
314 } // setDefaultLightWeightPopupEnabled()
317 * getUI
318 * @returns PopupMenuUI
320 public PopupMenuUI getUI() {
321 return (PopupMenuUI) ui;
322 } // getUI()
325 * setUI
326 * @param ui TODO
328 public void setUI(PopupMenuUI ui) {
329 super.setUI(ui);
330 // TODO
331 } // setUI()
334 * updateUI
336 public void updateUI() {
337 setUI((PopupMenuUI) UIManager.get(this));
338 invalidate();
339 } // updateUI()
342 * getUIClassID
343 * @returns String
345 public String getUIClassID() {
346 return uiClassID;
347 } // getUIClassID()
350 * getSelectionModel
351 * @returns SingleSelectionModel
353 public SingleSelectionModel getSelectionModel() {
354 return null; // TODO
355 } // getSelectionModel()
358 * setSelectionModel
359 * @param model TODO
361 public void setSelectionModel(SingleSelectionModel model) {
362 // TODO
363 } // setSelectionModel()
366 * createActionComponent
367 * @param action TODO
368 * @returns JMenuItem
370 protected JMenuItem createActionComponent(Action action) {
371 return null; // TODO
372 } // createActionComponent()
375 * createActionChangeListener
376 * @param item TODO
377 * @returns PropertyChangeListener
379 protected PropertyChangeListener createActionChangeListener(JMenuItem item) {
380 return null; // TODO
381 } // createActionChangeListener()
384 * isLightWeightPopupEnabled
385 * @returns boolean
387 public boolean isLightWeightPopupEnabled() {
388 return false; // TODO
389 } // isLightWeightPopupEnabled()
392 * setLightWeightPopupEnabled
393 * @param enabled TODO
395 public void setLightWeightPopupEnabled(boolean enabled) {
396 // TODO
397 } // setLightWeightPopupEnabled()
400 * getLabel
401 * @returns String
403 public String getLabel() {
404 return null; // TODO
405 } // getLabel()
408 * setLabel
409 * @param label TODO
411 public void setLabel(String label) {
412 // TODO
413 } // setLabel()
416 * addSeparator
418 public void addSeparator() {
419 // TODO
420 } // addSeparator()
423 * addPopupMenuListener
424 * @param listener TODO
426 public void addPopupMenuListener(PopupMenuListener listener) {
427 // TODO
428 } // addPopupMenuListener()
431 * removePopupMenuListener
432 * @param listener TODO
434 public void removePopupMenuListener(PopupMenuListener listener) {
435 // TODO
436 } // removePopupMenuListener()
439 * firePopupMenuWillBecomeVisible
441 protected void firePopupMenuWillBecomeVisible() {
442 // TODO
443 } // firePopupMenuWillBecomeVisible()
446 * firePopupMenuWillBecomeInvisible
448 protected void firePopupMenuWillBecomeInvisible() {
449 // TODO
450 } // firePopupMenuWillBecomeInvisible()
453 * firePopupMenuCanceled
455 protected void firePopupMenuCanceled() {
456 // TODO
457 } // firePopupMenuCanceled()
460 * pack
462 public void pack() {
463 // TODO
464 } // pack()
467 * isVisible
468 * @returns boolean
470 public boolean isVisible() {
471 return false; // TODO
472 } // isVisible()
475 * setVisible
476 * @param visible TODO
478 public void setVisible(boolean visible) {
479 // TODO
480 } // setVisible()
483 * setLocation
484 * @param x TODO
485 * @param y TODO
487 public void setLocation(int x, int y) {
488 // TODO
489 } // setLocation()
492 * isPopupMenu
493 * @returns boolean
495 private boolean isPopupMenu() {
496 return false; // TODO
497 } // isPopupMenu()
500 * getInvoker
501 * @returns Component
503 public Component getInvoker() {
504 return null; // TODO
505 } // getInvoker()
508 * setInvoker
509 * @param component TODO
511 public void setInvoker(Component component) {
512 // TODO
513 } // setInvoker()
516 * show
517 * @param component TODO
518 * @param x TODO
519 * @param y TODO
521 public void show(Component component, int x, int y) {
522 // TODO
523 } // show()
526 * getRootPopupMenu
527 * @returns JPopupMenu
529 JPopupMenu getRootPopupMenu() {
530 return null; // TODO
531 } // getRootPopupMenu()
534 * getComponentAtIndex
535 * @param index TODO
536 * @returns Component
538 public Component getComponentAtIndex(int index) {
539 return null; // TODO
540 } // getComponentAtIndex()
543 * getComponentIndex
544 * @param component TODO
545 * @returns int
547 public int getComponentIndex(Component component) {
548 return 0; // TODO
549 } // getComponentIndex()
552 * setPopupSize
553 * @param size TODO
555 public void setPopupSize(Dimension size) {
556 // TODO
557 } // setPopupSize()
560 * setPopupSize
561 * @param x TODO
562 * @param y TODO
564 public void setPopupSize(int x, int y) {
565 // TODO
566 } // setPopupSize()
569 * setSelected
570 * @param selected TODO
572 public void setSelected(Component selected) {
573 // TODO
574 } // setSelected()
577 * isBorderPainted
578 * @returns boolean
580 public boolean isBorderPainted() {
581 return false; // TODO
582 } // isBorderPainted()
585 * setBorderPainted
586 * @param painted TODO
588 public void setBorderPainted(boolean painted) {
589 // TODO
590 } // setBorderPainted()
593 * getMargin
594 * @returns Insets
596 public Insets getMargin() {
597 return null; // TODO
598 } // getMargin()
601 * paramString
602 * @returns String
604 protected String paramString() {
605 return null; // TODO
606 } // paramString()
609 * processMouseEvent
610 * @param event TODO
611 * @param path TODO
612 * @param manager TODO
614 public void processMouseEvent(MouseEvent event, MenuElement[] path,
615 MenuSelectionManager manager) {
616 // TODO
617 } // processMouseEvent()
620 * processKeyEvent
621 * @param event TODO
622 * @param path TODO
623 * @param manager TODO
625 public void processKeyEvent(KeyEvent event, MenuElement[] path,
626 MenuSelectionManager manager) {
627 // TODO
628 } // processKeyEvent()
631 * menuSelectionChanged
632 * @param changed TODO
634 public void menuSelectionChanged(boolean changed) {
635 // TODO
636 } // menuSelectionChanged()
639 * getSubElements
640 * @returns MenuElement[]
642 public MenuElement[] getSubElements() {
643 return null; // TODO
644 } // getSubElements()
647 * getComponent
648 * @returns Component
650 public Component getComponent() {
651 return null; // TODO
652 } // getComponent()
655 * isPopupTrigger
656 * @param event TODO
657 * @returns boolean
659 public boolean isPopupTrigger(MouseEvent event) {
660 return false; // TODO
661 } // isPopupTrigger()
664 * getAccessibleContext
665 * @returns AccessibleContext
667 public AccessibleContext getAccessibleContext() {
668 if (accessibleContext == null) {
669 accessibleContext = new AccessibleJPopupMenu(this);
670 } // if
671 return accessibleContext;
672 } // getAccessibleContext()
675 } // JPopupMenu