< prev index next >

src/java.desktop/share/classes/javax/swing/JPopupMenu.java

Print this page




1368 
1369     /**
1370      * This method is required to conform to the
1371      * <code>MenuElement</code> interface, but it not implemented.
1372      * @see MenuElement#processMouseEvent(MouseEvent, MenuElement[], MenuSelectionManager)
1373      */
1374     public void processMouseEvent(MouseEvent event,MenuElement path[],MenuSelectionManager manager) {}
1375 
1376     /**
1377      * Processes a key event forwarded from the
1378      * <code>MenuSelectionManager</code> and changes the menu selection,
1379      * if necessary, by using <code>MenuSelectionManager</code>'s API.
1380      * <p>
1381      * Note: you do not have to forward the event to sub-components.
1382      * This is done automatically by the <code>MenuSelectionManager</code>.
1383      *
1384      * @param e  a <code>KeyEvent</code>
1385      * @param path the <code>MenuElement</code> path array
1386      * @param manager   the <code>MenuSelectionManager</code>
1387      */

1388     public void processKeyEvent(KeyEvent e, MenuElement path[],
1389                                 MenuSelectionManager manager) {
1390         MenuKeyEvent mke = new MenuKeyEvent(e.getComponent(), e.getID(),
1391                                              e.getWhen(), e.getModifiers(),
1392                                              e.getKeyCode(), e.getKeyChar(),
1393                                              path, manager);
1394         processMenuKeyEvent(mke);
1395 
1396         if (mke.isConsumed())  {
1397             e.consume();
1398     }
1399     }
1400 
1401     /**
1402      * Handles a keystroke in a menu.
1403      *
1404      * @param e  a <code>MenuKeyEvent</code> object
1405      * @since 1.5
1406      */
1407     private void processMenuKeyEvent(MenuKeyEvent e) {




1368 
1369     /**
1370      * This method is required to conform to the
1371      * <code>MenuElement</code> interface, but it not implemented.
1372      * @see MenuElement#processMouseEvent(MouseEvent, MenuElement[], MenuSelectionManager)
1373      */
1374     public void processMouseEvent(MouseEvent event,MenuElement path[],MenuSelectionManager manager) {}
1375 
1376     /**
1377      * Processes a key event forwarded from the
1378      * <code>MenuSelectionManager</code> and changes the menu selection,
1379      * if necessary, by using <code>MenuSelectionManager</code>'s API.
1380      * <p>
1381      * Note: you do not have to forward the event to sub-components.
1382      * This is done automatically by the <code>MenuSelectionManager</code>.
1383      *
1384      * @param e  a <code>KeyEvent</code>
1385      * @param path the <code>MenuElement</code> path array
1386      * @param manager   the <code>MenuSelectionManager</code>
1387      */
1388     @SuppressWarnings("deprecation")
1389     public void processKeyEvent(KeyEvent e, MenuElement path[],
1390                                 MenuSelectionManager manager) {
1391         MenuKeyEvent mke = new MenuKeyEvent(e.getComponent(), e.getID(),
1392                                              e.getWhen(), e.getModifiers(),
1393                                              e.getKeyCode(), e.getKeyChar(),
1394                                              path, manager);
1395         processMenuKeyEvent(mke);
1396 
1397         if (mke.isConsumed())  {
1398             e.consume();
1399     }
1400     }
1401 
1402     /**
1403      * Handles a keystroke in a menu.
1404      *
1405      * @param e  a <code>MenuKeyEvent</code> object
1406      * @since 1.5
1407      */
1408     private void processMenuKeyEvent(MenuKeyEvent e) {


< prev index next >