/[classpath]/classpath/javax/swing/plaf/basic/BasicPopupMenuUI.java
ViewVC logotype

Diff of /classpath/javax/swing/plaf/basic/BasicPopupMenuUI.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by mark, Sat Jul 31 22:56:54 2004 UTC revision 1.5 by mark, Sun Sep 5 11:31:06 2004 UTC
# Line 163  public class BasicPopupMenuUI extends Po Line 163  public class BasicPopupMenuUI extends Po
163      popupMenu.setBorder(defaults.getBorder("PopupMenu.border"));      popupMenu.setBorder(defaults.getBorder("PopupMenu.border"));
164      popupMenu.setFont(defaults.getFont("PopupMenu.font"));      popupMenu.setFont(defaults.getFont("PopupMenu.font"));
165      popupMenu.setForeground(defaults.getColor("PopupMenu.foreground"));      popupMenu.setForeground(defaults.getColor("PopupMenu.foreground"));
166        popupMenu.setOpaque(true);
167    }    }
168    
169    /**    /**
# Line 228  public class BasicPopupMenuUI extends Po Line 229  public class BasicPopupMenuUI extends Po
229    }    }
230    
231    /**    /**
232    * This method returns the minimum size of the JPopupMenu.     * This method returns the minimum size of the JPopupMenu.
233    *     *
234    * @param c The JComponent to find a size for.     * @param c The JComponent to find a size for.
235    *     *
236    * @return The minimum size.     * @return The minimum size.
237    */     */
238    public Dimension getMinimumSize(JComponent c)    public Dimension getMinimumSize(JComponent c)
239    {    {
240      return null;      return null;
# Line 264  public class BasicPopupMenuUI extends Po Line 265  public class BasicPopupMenuUI extends Po
265    }    }
266    
267    /**    /**
268     * Return true if given mouse event is a platform popup trigger,     * Return true if given mouse event is a platform popup trigger, and false
269     * and false otherwise     * otherwise
270     *     *
271     * @param e MouseEvent that is to be checked for popup trigger event     * @param e MouseEvent that is to be checked for popup trigger event
272     *     *
273     * @return true if given mouse event is a platform popup trigger,     * @return true if given mouse event is a platform popup trigger, and false
274     * and false otherwise     *         otherwise
275     */     */
276    public boolean isPopupTrigger(MouseEvent e)    public boolean isPopupTrigger(MouseEvent e)
277    {    {
# Line 334  public class BasicPopupMenuUI extends Po Line 335  public class BasicPopupMenuUI extends Po
335            path[0] = popupMenu;            path[0] = popupMenu;
336            Component[] comps = popupMenu.getComponents();            Component[] comps = popupMenu.getComponents();
337            if (comps.length != 0 && comps[0] instanceof MenuElement)            if (comps.length != 0 && comps[0] instanceof MenuElement)
338              path[1] = (MenuElement) comps[0];              {
339            manager.setSelectedPath(path);                path[1] = (MenuElement) comps[0];
340                  manager.setSelectedPath(path);
341                }
342          }          }
343      }      }
344    }    }
345    
346    /**    /**
347     * ComponentListener that listens to Component Events fired by the     * ComponentListener that listens to Component Events fired by the top -
348     * top - level window to which popup menu belongs. If top-level     * level window to which popup menu belongs. If top-level window was
349     * window was resized, moved or hidded then popup menu will     * resized, moved or hidded then popup menu will be hidded and selected
350     * be hidded and selected path of current menu hierarchy will be set     * path of current menu hierarchy will be set to null.
    * to null.  
    *  
351     */     */
352    private class TopWindowListener implements ComponentListener    private class TopWindowListener implements ComponentListener
353    {    {
354      /**      /**
355       * This method is invoked when top-level window is resized.       * This method is invoked when top-level window is resized. This method
356       * This method closes current menu hierarchy.       * closes current menu hierarchy.
357       *       *
358       * @param e The ComponentEvent       * @param e The ComponentEvent
359       */       */
# Line 363  public class BasicPopupMenuUI extends Po Line 364  public class BasicPopupMenuUI extends Po
364      }      }
365    
366      /**      /**
367       * This method is invoked when top-level window is moved.       * This method is invoked when top-level window is moved. This method
368       * This method closes current menu hierarchy.       * closes current menu hierarchy.
369       *       *
370       * @param e The ComponentEvent       * @param e The ComponentEvent
371       */       */
# Line 375  public class BasicPopupMenuUI extends Po Line 376  public class BasicPopupMenuUI extends Po
376      }      }
377    
378      /**      /**
379       * This method is invoked when top-level window is shown       * This method is invoked when top-level window is shown This method does
380       * This method does nothing by default.       * nothing by default.
381       *       *
382       * @param e The ComponentEvent       * @param e The ComponentEvent
383       */       */
# Line 387  public class BasicPopupMenuUI extends Po Line 388  public class BasicPopupMenuUI extends Po
388      }      }
389    
390      /**      /**
391       * This method is invoked when top-level window is hidden       * This method is invoked when top-level window is hidden This method
392       * This method closes current menu hierarchy.       * closes current menu hierarchy.
393       *       *
394       * @param e The ComponentEvent       * @param e The ComponentEvent
395       */       */

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26