jdk/src/share/classes/javax/swing/plaf/synth/SynthComboBoxUI.java
changeset 4848 ffcc849b9351
parent 4394 92a8ec883f5d
child 5506 202f599c92aa
equal deleted inserted replaced
4847:22fbbcbcab1d 4848:ffcc849b9351
   303 
   303 
   304     //=================================
   304     //=================================
   305     // begin ComponentUI Implementation
   305     // begin ComponentUI Implementation
   306 
   306 
   307     /**
   307     /**
   308      * @inheritDoc
   308      * Notifies this UI delegate to repaint the specified component.
       
   309      * This method paints the component background, then calls
       
   310      * the {@link #paint(SynthContext,Graphics)} method.
       
   311      *
       
   312      * <p>In general, this method does not need to be overridden by subclasses.
       
   313      * All Look and Feel rendering code should reside in the {@code paint} method.
       
   314      *
       
   315      * @param g the {@code Graphics} object used for painting
       
   316      * @param c the component being painted
       
   317      * @see #paint(SynthContext,Graphics)
   309      */
   318      */
   310     @Override
   319     @Override
   311     public void update(Graphics g, JComponent c) {
   320     public void update(Graphics g, JComponent c) {
   312         SynthContext context = getContext(c);
   321         SynthContext context = getContext(c);
   313 
   322 
   317         paint(context, g);
   326         paint(context, g);
   318         context.dispose();
   327         context.dispose();
   319     }
   328     }
   320 
   329 
   321     /**
   330     /**
   322      * @inheritDoc
   331      * Paints the specified component according to the Look and Feel.
       
   332      * <p>This method is not used by Synth Look and Feel.
       
   333      * Painting is handled by the {@link #paint(SynthContext,Graphics)} method.
       
   334      *
       
   335      * @param g the {@code Graphics} object used for painting
       
   336      * @param c the component being painted
       
   337      * @see #paint(SynthContext,Graphics)
   323      */
   338      */
   324     @Override
   339     @Override
   325     public void paint(Graphics g, JComponent c) {
   340     public void paint(Graphics g, JComponent c) {
   326         SynthContext context = getContext(c);
   341         SynthContext context = getContext(c);
   327 
   342 
   331 
   346 
   332     /**
   347     /**
   333      * Paints the specified component.
   348      * Paints the specified component.
   334      *
   349      *
   335      * @param context context for the component being painted
   350      * @param context context for the component being painted
   336      * @param g {@code Graphics} object used for painting
   351      * @param g the {@code Graphics} object used for painting
       
   352      * @see #update(Graphics,JComponent)
   337      */
   353      */
   338     protected void paint(SynthContext context, Graphics g) {
   354     protected void paint(SynthContext context, Graphics g) {
   339         hasFocus = comboBox.hasFocus();
   355         hasFocus = comboBox.hasFocus();
   340         if ( !comboBox.isEditable() ) {
   356         if ( !comboBox.isEditable() ) {
   341             Rectangle r = rectangleForCurrentValue();
   357             Rectangle r = rectangleForCurrentValue();