42 |
import java.awt.FontMetrics; |
import java.awt.FontMetrics; |
43 |
import java.awt.Rectangle; |
import java.awt.Rectangle; |
44 |
|
|
45 |
|
import javax.accessibility.AccessibleContext; |
46 |
|
import javax.accessibility.AccessibleStateSet; |
47 |
import javax.swing.text.BadLocationException; |
import javax.swing.text.BadLocationException; |
48 |
import javax.swing.text.Document; |
import javax.swing.text.Document; |
49 |
import javax.swing.text.Element; |
import javax.swing.text.Element; |
94 |
public class JTextArea extends JTextComponent |
public class JTextArea extends JTextComponent |
95 |
{ |
{ |
96 |
/** |
/** |
97 |
|
* Provides accessibility support for <code>JTextArea</code>. |
98 |
|
* |
99 |
|
* @author Roman Kennke (kennke@aicas.com) |
100 |
|
*/ |
101 |
|
protected class AccessibleJTextArea extends AccessibleJTextComponent |
102 |
|
{ |
103 |
|
|
104 |
|
/** |
105 |
|
* Creates a new <code>AccessibleJTextArea</code> object. |
106 |
|
*/ |
107 |
|
protected AccessibleJTextArea() |
108 |
|
{ |
109 |
|
super(); |
110 |
|
} |
111 |
|
|
112 |
|
/** |
113 |
|
* Returns the accessible state of this <code>AccessibleJTextArea</code>. |
114 |
|
* |
115 |
|
* @return the accessible state of this <code>AccessibleJTextArea</code> |
116 |
|
*/ |
117 |
|
public AccessibleStateSet getAccessibleStateSet() |
118 |
|
{ |
119 |
|
AccessibleStateSet state = super.getAccessibleStateSet(); |
120 |
|
// TODO: Figure out what state must be added here to the super's state. |
121 |
|
return state; |
122 |
|
} |
123 |
|
} |
124 |
|
|
125 |
|
/** |
126 |
* Compatible with Sun's JDK |
* Compatible with Sun's JDK |
127 |
*/ |
*/ |
128 |
private static final long serialVersionUID = -6141680179310439825L; |
private static final long serialVersionUID = -6141680179310439825L; |
588 |
return new Dimension(Math.max(reqWidth, neededWidth), |
return new Dimension(Math.max(reqWidth, neededWidth), |
589 |
Math.max(reqHeight, neededHeight)); |
Math.max(reqHeight, neededHeight)); |
590 |
} |
} |
591 |
|
|
592 |
|
/** |
593 |
|
* Returns the accessible context associated with the <code>JTextArea</code>. |
594 |
|
* |
595 |
|
* @return the accessible context associated with the <code>JTextArea</code> |
596 |
|
*/ |
597 |
|
public AccessibleContext getAccessibleContext() |
598 |
|
{ |
599 |
|
if (accessibleContext == null) |
600 |
|
accessibleContext = new AccessibleJTextArea(); |
601 |
|
return accessibleContext; |
602 |
|
} |
603 |
} |
} |