2005-05-23 Roman Kennke <[EMAIL PROTECTED]>
* javax/swing/JLayeredPane.java
(getLayer): Added and implemented new (static) method.
/Roman
Index: javax/swing/JLayeredPane.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/JLayeredPane.java,v
retrieving revision 1.18
diff -u -r1.18 JLayeredPane.java
--- javax/swing/JLayeredPane.java 26 Jan 2005 20:57:45 -0000 1.18
+++ javax/swing/JLayeredPane.java 23 May 2005 13:36:27 -0000
@@ -130,6 +130,26 @@
}
/**
+ * Looks up the layer of <code>comp</code> in the component's nearest
+ * JLayeredPane ancestor. If <code>comp</code> is not contained
+ * in a JLayeredPane, the value 0 (default layer) is returned.
+ *
+ * @param comp the component for which the layer is looked up
+ *
+ * @return the layer of <code>comp</code> in its nearest JLayeredPane
+ * ancestor
+ */
+ public static int getLayer(JComponent comp)
+ {
+ JLayeredPane lp = (JLayeredPane) SwingUtilities.getAncestorOfClass
+ (JLayeredPane.class, comp);
+ if (lp == null)
+ return 0;
+ else
+ return lp.getLayer(comp);
+ }
+
+ /**
* <p>Returns a pair of ints representing a half-open interval
* <code>[top, bottom)</code>, which is the range of component indices
* the provided layer number corresponds to.</p>
_______________________________________________
Classpath-patches mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/classpath-patches