summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoman Kennke <roman@kennke.org>2006-05-04 13:28:59 +0000
committerRoman Kennke <roman@kennke.org>2006-05-04 13:28:59 +0000
commit60aad966de906eb501f467082092d5b968dcdcfc (patch)
treecd25562b379b520bc7c76d60b487167a48c7aa0b
parent6048f1c7d58bade35dc77836dd4973228c940263 (diff)
downloadclasspath-60aad966de906eb501f467082092d5b968dcdcfc.tar.gz
2006-05-04 Roman Kennke <kennke@aicas.com>
* javax/swing/JLabel.java (AccessibleJLabel.getSelectedText): Return null instead of "". (AccessibleJLabel.getSelectionStart): Added comment why return -1 is correct here. (AccessibleJLabel.getSelectionEnd): Added comment why return -1 is correct here. (AccessibleJLabel.getCharacterAttribute): Added comment about what to do here. (AccessibleJLabel.getCharCount): Added comment about what to do here. (AccessibleJLabel.getCharacterBounds): Tagged as not implemented. (AccessibleJLabel.getIndexAtPoint): Tagged as not implemented. (paramString): Return super.paramString() here, this provides a more meaningful output.
-rw-r--r--ChangeLog17
-rw-r--r--javax/swing/JLabel.java23
2 files changed, 31 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index e67f91f50..a0f06d0a0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,22 @@
2006-05-04 Roman Kennke <kennke@aicas.com>
+ * javax/swing/JLabel.java
+ (AccessibleJLabel.getSelectedText): Return null instead of "".
+ (AccessibleJLabel.getSelectionStart): Added comment why
+ return -1 is correct here.
+ (AccessibleJLabel.getSelectionEnd): Added comment why
+ return -1 is correct here.
+ (AccessibleJLabel.getCharacterAttribute): Added comment about what
+ to do here.
+ (AccessibleJLabel.getCharCount): Added comment about what
+ to do here.
+ (AccessibleJLabel.getCharacterBounds): Tagged as not implemented.
+ (AccessibleJLabel.getIndexAtPoint): Tagged as not implemented.
+ (paramString): Return super.paramString() here, this provides
+ a more meaningful output.
+
+2006-05-04 Roman Kennke <kennke@aicas.com>
+
* javax/swing/JComponent.java
(paint): Added null check to avoid NPE when clip == null.
diff --git a/javax/swing/JLabel.java b/javax/swing/JLabel.java
index 65b1e6fcd..d8e135f11 100644
--- a/javax/swing/JLabel.java
+++ b/javax/swing/JLabel.java
@@ -38,6 +38,8 @@ exception statement from your version. */
package javax.swing;
+import gnu.classpath.NotImplementedException;
+
import java.awt.Component;
import java.awt.Font;
import java.awt.Image;
@@ -67,15 +69,15 @@ public class JLabel extends JComponent implements Accessible, SwingConstants
implements AccessibleText, AccessibleExtendedComponent
{
/**
- * Returns the selected text. This is an empty string since JLabels
+ * Returns the selected text. This is null since JLabels
* are not selectable.
*
- * @return the selected text
+ * @return <code>null</code> because JLabels cannot have selected text
*/
public String getSelectedText()
{
- // We return "" here since JLabel's text is not selectable.
- return "";
+ // We return null here since JLabel's text is not selectable.
+ return null;
}
/**
@@ -85,8 +87,7 @@ public class JLabel extends JComponent implements Accessible, SwingConstants
*/
public int getSelectionStart()
{
- // TODO: Figure out what should be returned here, because JLabels don't
- // allow selection. I guess -1 for now.
+ // JLabel don't have selected text, so we return -1 here.
return -1;
}
@@ -97,8 +98,7 @@ public class JLabel extends JComponent implements Accessible, SwingConstants
*/
public int getSelectionEnd()
{
- // TODO: Figure out what should be returned here, because JLabels don't
- // allow selection. I guess -1 for now.
+ // JLabel don't have selected text, so we return -1 here.
return -1;
}
@@ -115,6 +115,8 @@ public class JLabel extends JComponent implements Accessible, SwingConstants
*/
public AttributeSet getCharacterAttribute(int index)
{
+ // FIXME: Return null here for simple labels, and query the HTML
+ // view for HTML labels.
return new SimpleAttributeSet();
}
@@ -259,6 +261,7 @@ public class JLabel extends JComponent implements Accessible, SwingConstants
*/
public int getCharCount()
{
+ // FIXME: Query HTML view for HTML labels.
return text.length();
}
@@ -271,6 +274,7 @@ public class JLabel extends JComponent implements Accessible, SwingConstants
* @return the bounding box of the character at the specified index
*/
public Rectangle getCharacterBounds(int index)
+ throws NotImplementedException
{
// FIXME: Implement this correctly.
return new Rectangle();
@@ -286,6 +290,7 @@ public class JLabel extends JComponent implements Accessible, SwingConstants
* point
*/
public int getIndexAtPoint(Point point)
+ throws NotImplementedException
{
// FIXME: Implement this correctly.
return 0;
@@ -454,7 +459,7 @@ public class JLabel extends JComponent implements Accessible, SwingConstants
*/
protected String paramString()
{
- return "JLabel";
+ return super.paramString();
}
/**