/[classpath]/classpath/javax/swing/JLayeredPane.java
ViewVC logotype

Diff of /classpath/javax/swing/JLayeredPane.java

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

revision 1.27 by abalkiss, Mon Sep 19 19:18:37 2005 UTC revision 1.28 by rabbit78, Tue Sep 20 19:16:03 2005 UTC
# Line 40  package javax.swing; Line 40  package javax.swing;
40    
41  import java.awt.Component;  import java.awt.Component;
42  import java.awt.Container;  import java.awt.Container;
43    import java.awt.Graphics;
44  import java.util.Hashtable;  import java.util.Hashtable;
45  import java.util.Iterator;  import java.util.Iterator;
46  import java.util.Map;  import java.util.Map;
# Line 164  public class JLayeredPane extends JCompo Line 165  public class JLayeredPane extends JCompo
165      setLayout(null);      setLayout(null);
166    }    }
167    
   
168    /**    /**
169     * Looks up the layer a child component is currently assigned to.     * Looks up the layer a child component is currently assigned to.
170     *     *
# Line 573  public class JLayeredPane extends JCompo Line 573  public class JLayeredPane extends JCompo
573     *     *
574     * @param index the index of the child component to remove.     * @param index the index of the child component to remove.
575     */     */
576    public void remove (int index)    public void remove(int index)
577    {    {
578      Component c = getComponent (index);      Component c = getComponent(index);
579      int layer = getLayer (c);      int layer = getLayer(c);
580      decrLayer (new Integer(layer));      decrLayer(new Integer(layer));
581      componentToLayer.remove (c);      componentToLayer.remove(c);
582      super.remove (index);      super.remove(index);
583      revalidate();      revalidate();
     repaint();  
   }  
   
   /**  
    * Removes a child from this container. The child is specified directly.  
    * After removal, the child no longer occupies a layer.  
    *  
    * @param comp the child to remove.  
    */  
   public void remove (Component comp)  
   {  
     remove (getIndexOf (comp));  
584    }    }
585    
586    /**    /**
# Line 681  public class JLayeredPane extends JCompo Line 669  public class JLayeredPane extends JCompo
669        accessibleContext = new AccessibleJLayeredPane();        accessibleContext = new AccessibleJLayeredPane();
670      return accessibleContext;      return accessibleContext;
671    }    }
672    
673      /**
674       * This method is overridden order to provide a reasonable painting
675       * mechanism for <code>JLayeredPane</code>. This is necessary since
676       * <code>JLayeredPane</code>'s do not have an own UI delegate.
677       *
678       * Basically this method clears the background for the
679       * <code>JLayeredPane</code> and then calls <code>super.paint(g)</code>.
680       *
681       * @param g the graphics context to use
682       */
683      public void paint(Graphics g)
684      {
685        g.setColor(getBackground());
686        g.fillRect(0, 0, getWidth(), getHeight());
687        super.paint(g);
688      }
689  }  }

Legend:
Removed from v.1.27  
changed lines
  Added in v.1.28

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