The methods getBounds(), getSize() and getLocation in AccessibleAWTComponent must delegate to the Component methods, regardless of the isShowing() state of the Component.
The Monkey utility was complaining about a null pointer from the
getBounds() method, fixing it like this made this program work better
and a quick test in BeanShell shows, that this is indeed the right thing
to do.
2006-04-06 Roman Kennke <[EMAIL PROTECTED]>
* java/awt/Component.java
(AccessibleAWTComponent.getBounds): Return the component
bounds regardless of its showing state.
(AccessibleAWTComponent.getLocation): Return the component
location regardless of its showing state.
(AccessibleAWTComponent.getSize): Return the component
size regardless of its showing state.
/Roman
--
“Improvement makes straight roads, but the crooked roads, without
Improvement, are roads of Genius.” - William Blake
Index: java/awt/Component.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/awt/Component.java,v
retrieving revision 1.113
diff -u -1 -0 -r1.113 Component.java
--- java/awt/Component.java 6 Apr 2006 20:37:39 -0000 1.113
+++ java/awt/Component.java 6 Apr 2006 21:49:56 -0000
@@ -5705,21 +5705,21 @@
/**
* Returns the location of this object relative to its parent's coordinate
* system, or null if it is not showing.
*
* @return the location
* @see #getBounds()
* @see #getLocationOnScreen()
*/
public Point getLocation()
{
- return Component.this.isShowing() ? Component.this.getLocation() : null;
+ return Component.this.getLocation();
}
/**
* Sets the location of this relative to its parent's coordinate system.
*
* @param p the location
* @throws NullPointerException if p is null
* @see #getLocation()
*/
public void setLocation(Point p)
@@ -5729,21 +5729,21 @@
/**
* Gets the bounds of this component, or null if it is not on screen.
*
* @return the bounds
* @see #contains(Point)
* @see #setBounds(Rectangle)
*/
public Rectangle getBounds()
{
- return Component.this.isShowing() ? Component.this.getBounds() : null;
+ return Component.this.getBounds();
}
/**
* Sets the bounds of this component.
*
* @param r the bounds
* @throws NullPointerException if r is null
* @see #getBounds()
*/
public void setBounds(Rectangle r)
@@ -5752,21 +5752,21 @@
}
/**
* Gets the size of this component, or null if it is not showing.
*
* @return the size
* @see #setSize(Dimension)
*/
public Dimension getSize()
{
- return Component.this.isShowing() ? Component.this.getSize() : null;
+ return Component.this.getSize();
}
/**
* Sets the size of this component.
*
* @param d the size
* @throws NullPointerException if d is null
* @see #getSize()
*/
public void setSize(Dimension d)
signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil
