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; |
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 |
* |
* |
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 |
/** |
/** |
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 |
} |
} |