38 |
|
|
39 |
package javax.swing; |
package javax.swing; |
40 |
|
|
41 |
|
import javax.accessibility.Accessible; |
42 |
import javax.accessibility.AccessibleContext; |
import javax.accessibility.AccessibleContext; |
43 |
|
import javax.accessibility.AccessibleRole; |
44 |
|
|
45 |
/** |
/** |
46 |
* A small box that displays a check or not, depending on it's |
* A small box that displays a check or not, depending on it's |
56 |
* |
* |
57 |
* @author Ronald Veldema (rveldema@cs.vu.nl) |
* @author Ronald Veldema (rveldema@cs.vu.nl) |
58 |
*/ |
*/ |
59 |
public class JCheckBox extends JToggleButton |
public class JCheckBox extends JToggleButton implements Accessible |
60 |
{ |
{ |
61 |
|
|
62 |
|
/** |
63 |
|
* Provides accessibility support for <code>JCheckBox</code>. |
64 |
|
*/ |
65 |
|
protected class AccessibleJCheckBox extends AccessibleJToggleButton |
66 |
|
{ |
67 |
|
/** |
68 |
|
* Creates a new instance of <code>AccessibleJCheckBox</code>. |
69 |
|
*/ |
70 |
|
public AccessibleJCheckBox() |
71 |
|
{ |
72 |
|
// Nothing to do here. |
73 |
|
} |
74 |
|
|
75 |
|
/** |
76 |
|
* Returns the accessble role of <code>JCheckBox</code>, |
77 |
|
* {@link AccessibleRole#CHECK_BOX}. |
78 |
|
*/ |
79 |
|
public AccessibleRole getAccessibleRole() |
80 |
|
{ |
81 |
|
return AccessibleRole.CHECK_BOX; |
82 |
|
} |
83 |
|
} |
84 |
|
|
85 |
private static final long serialVersionUID = -5246739313864538930L; |
private static final long serialVersionUID = -5246739313864538930L; |
86 |
|
|
87 |
public static final String BORDER_PAINTED_FLAT_CHANGED_PROPERTY = |
public static final String BORDER_PAINTED_FLAT_CHANGED_PROPERTY = |
144 |
} |
} |
145 |
|
|
146 |
/** |
/** |
|
* Gets the AccessibleContext associated with this JCheckBox. |
|
|
*/ |
|
|
public AccessibleContext getAccessibleContext() |
|
|
{ |
|
|
return null; |
|
|
} |
|
|
|
|
|
/** |
|
147 |
* Returns a string that specifies the name of the Look and Feel class |
* Returns a string that specifies the name of the Look and Feel class |
148 |
* that renders this component. |
* that renders this component. |
149 |
*/ |
*/ |
167 |
firePropertyChange("borderPaintedFlat", borderPaintedFlat, newValue); |
firePropertyChange("borderPaintedFlat", borderPaintedFlat, newValue); |
168 |
borderPaintedFlat = newValue; |
borderPaintedFlat = newValue; |
169 |
} |
} |
170 |
|
|
171 |
|
/** |
172 |
|
* Returns the accessible context for this <code>JCheckBox</code>. |
173 |
|
* |
174 |
|
* @return the accessible context for this <code>JCheckBox</code> |
175 |
|
*/ |
176 |
|
public AccessibleContext getAccessibleContext() |
177 |
|
{ |
178 |
|
if (accessibleContext == null) |
179 |
|
accessibleContext = new AccessibleJCheckBox(); |
180 |
|
return accessibleContext; |
181 |
|
} |
182 |
} |
} |