/[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.16 by mkoch, Wed Dec 1 13:28:05 2004 UTC revision 1.17 by mkoch, Mon Dec 13 19:13:53 2004 UTC
# Line 122  public class JLayeredPane extends JCompo Line 122  public class JLayeredPane extends JCompo
122     * @return the layer the component is currently assigned to, in this container.     * @return the layer the component is currently assigned to, in this container.
123     * @throws IllegalArgumentException if the component is not a child of this container.     * @throws IllegalArgumentException if the component is not a child of this container.
124     */     */
125    protected Integer getLayer (Component c)    public int getLayer(Component c)
126    {    {
127      if (! componentToLayer.containsKey (c))      if (! componentToLayer.containsKey (c))
128              throw new IllegalArgumentException ();              throw new IllegalArgumentException ();
129      return (Integer) componentToLayer.get (c);      return ((Integer) componentToLayer.get(c)).intValue();
130    }    }
131    
132    /**    /**
# Line 270  public class JLayeredPane extends JCompo Line 270  public class JLayeredPane extends JCompo
270     */     */
271    public int getPosition(Component c)    public int getPosition(Component c)
272    {    {
273      Integer layer = getLayer (c);      int layer = getLayer (c);
274      int[] range = layerToRange (layer);      int[] range = layerToRange(new Integer(layer));
275      int top = range[0];      int top = range[0];
276      int bot = range[1];      int bot = range[1];
277      Component[] comps = getComponents ();      Component[] comps = getComponents ();
# Line 297  public class JLayeredPane extends JCompo Line 297  public class JLayeredPane extends JCompo
297     */     */
298    public void setPosition(Component c, int position)    public void setPosition(Component c, int position)
299    {    {
300      Integer layer = getLayer (c);      int layer = getLayer (c);
301      int[] range = layerToRange (layer);      int[] range = layerToRange(new Integer(layer));
302      if (range[0] == range[1])      if (range[0] == range[1])
303        throw new IllegalArgumentException ();        throw new IllegalArgumentException ();
304    
# Line 389  public class JLayeredPane extends JCompo Line 389  public class JLayeredPane extends JCompo
389     */     */
390    public int getIndexOf(Component c)    public int getIndexOf(Component c)
391    {    {
392      Integer layer = getLayer (c);      int layer = getLayer (c);
393      int[] range = layerToRange (layer);      int[] range = layerToRange(new Integer(layer));
394      Component[] comps = getComponents();      Component[] comps = getComponents();
395      for (int i = range[0]; i < range[1]; ++i)      for (int i = range[0]; i < range[1]; ++i)
396              {              {
# Line 475  public class JLayeredPane extends JCompo Line 475  public class JLayeredPane extends JCompo
475    public void remove (int index)    public void remove (int index)
476    {    {
477      Component c = getComponent (index);      Component c = getComponent (index);
478      Integer layer = getLayer (c);      int layer = getLayer (c);
479      decrLayer (layer);      decrLayer (new Integer(layer));
480      componentToLayer.remove (c);      componentToLayer.remove (c);
481      super.remove (index);      super.remove (index);
482      revalidate();      revalidate();

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.17

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