1. /*
  2. * @(#)AccessibleContext.java 1.43 04/04/02
  3. *
  4. * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package javax.accessibility;
  8. import java.util.Locale;
  9. import java.beans.PropertyChangeListener;
  10. import java.beans.PropertyChangeSupport;
  11. import java.beans.PropertyChangeEvent;
  12. import java.awt.IllegalComponentStateException;
  13. /**
  14. * AccessibleContext represents the minimum information all accessible objects
  15. * return. This information includes the accessible name, description, role,
  16. * and state of the object, as well as information about its parent and
  17. * children. AccessibleContext also contains methods for
  18. * obtaining more specific accessibility information about a component.
  19. * If the component supports them, these methods will return an object that
  20. * implements one or more of the following interfaces:
  21. * <P><ul>
  22. * <li>{@link AccessibleAction} - the object can perform one or more actions.
  23. * This interface provides the standard mechanism for an assistive
  24. * technology to determine what those actions are and tell the object
  25. * to perform them. Any object that can be manipulated should
  26. * support this interface.
  27. * <li>{@link AccessibleComponent} - the object has a graphical representation.
  28. * This interface provides the standard mechanism for an assistive
  29. * technology to determine and set the graphical representation of the
  30. * object. Any object that is rendered on the screen should support
  31. * this interface.
  32. * <li>{@link AccessibleSelection} - the object allows its children to be
  33. * selected. This interface provides the standard mechanism for an
  34. * assistive technology to determine the currently selected children of the object
  35. * as well as modify its selection set. Any object that has children
  36. * that can be selected should support this interface.
  37. * <li>{@link AccessibleText} - the object presents editable textual information
  38. * on the display. This interface provides the standard mechanism for
  39. * an assistive technology to access that text via its content, attributes,
  40. * and spatial location. Any object that contains editable text should
  41. * support this interface.
  42. * <li>{@link AccessibleValue} - the object supports a numerical value. This
  43. * interface provides the standard mechanism for an assistive technology
  44. * to determine and set the current value of the object, as well as obtain its
  45. * minimum and maximum values. Any object that supports a numerical value
  46. * should support this interface.</ul>
  47. *
  48. *
  49. * @beaninfo
  50. * attribute: isContainer false
  51. * description: Minimal information that all accessible objects return
  52. *
  53. * @version 1.43 04/02/04
  54. * @author Peter Korn
  55. * @author Hans Muller
  56. * @author Willie Walker
  57. * @author Lynn Monsanto
  58. */
  59. public abstract class AccessibleContext {
  60. /**
  61. * Constant used to determine when the accessibleName property has
  62. * changed. The old value in the PropertyChangeEvent will be the old
  63. * accessibleName and the new value will be the new accessibleName.
  64. *
  65. * @see #getAccessibleName
  66. * @see #addPropertyChangeListener
  67. */
  68. public static final String ACCESSIBLE_NAME_PROPERTY = "AccessibleName";
  69. /**
  70. * Constant used to determine when the accessibleDescription property has
  71. * changed. The old value in the PropertyChangeEvent will be the
  72. * old accessibleDescription and the new value will be the new
  73. * accessibleDescription.
  74. *
  75. * @see #getAccessibleDescription
  76. * @see #addPropertyChangeListener
  77. */
  78. public static final String ACCESSIBLE_DESCRIPTION_PROPERTY = "AccessibleDescription";
  79. /**
  80. * Constant used to determine when the accessibleStateSet property has
  81. * changed. The old value will be the old AccessibleState and the new
  82. * value will be the new AccessibleState in the accessibleStateSet.
  83. * For example, if a component that supports the vertical and horizontal
  84. * states changes its orientation from vertical to horizontal, the old
  85. * value will be AccessibleState.VERTICAL and the new value will be
  86. * AccessibleState.HORIZONTAL. Please note that either value can also
  87. * be null. For example, when a component changes from being enabled
  88. * to disabled, the old value will be AccessibleState.ENABLED
  89. * and the new value will be null.
  90. *
  91. * @see #getAccessibleStateSet
  92. * @see AccessibleState
  93. * @see AccessibleStateSet
  94. * @see #addPropertyChangeListener
  95. */
  96. public static final String ACCESSIBLE_STATE_PROPERTY = "AccessibleState";
  97. /**
  98. * Constant used to determine when the accessibleValue property has
  99. * changed. The old value in the PropertyChangeEvent will be a Number
  100. * representing the old value and the new value will be a Number
  101. * representing the new value
  102. *
  103. * @see #getAccessibleValue
  104. * @see #addPropertyChangeListener
  105. */
  106. public static final String ACCESSIBLE_VALUE_PROPERTY = "AccessibleValue";
  107. /**
  108. * Constant used to determine when the accessibleSelection has changed.
  109. * The old and new values in the PropertyChangeEvent are currently
  110. * reserved for future use.
  111. *
  112. * @see #getAccessibleSelection
  113. * @see #addPropertyChangeListener
  114. */
  115. public static final String ACCESSIBLE_SELECTION_PROPERTY = "AccessibleSelection";
  116. /**
  117. * Constant used to determine when the accessibleText caret has changed.
  118. * The old value in the PropertyChangeEvent will be an
  119. * integer representing the old caret position, and the new value will
  120. * be an integer representing the new/current caret position.
  121. *
  122. * @see #addPropertyChangeListener
  123. */
  124. public static final String ACCESSIBLE_CARET_PROPERTY = "AccessibleCaret";
  125. /**
  126. * Constant used to determine when the visual appearance of the object
  127. * has changed. The old and new values in the PropertyChangeEvent are
  128. * currently reserved for future use.
  129. *
  130. * @see #addPropertyChangeListener
  131. */
  132. public static final String ACCESSIBLE_VISIBLE_DATA_PROPERTY = "AccessibleVisibleData";
  133. /**
  134. * Constant used to determine when Accessible children are added/removed
  135. * from the object. If an Accessible child is being added, the old
  136. * value will be null and the new value will be the Accessible child. If an
  137. * Accessible child is being removed, the old value will be the Accessible
  138. * child, and the new value will be null.
  139. *
  140. * @see #addPropertyChangeListener
  141. */
  142. public static final String ACCESSIBLE_CHILD_PROPERTY = "AccessibleChild";
  143. /**
  144. * Constant used to determine when the active descendant of a component
  145. * has changed. The active descendant is used for objects such as
  146. * list, tree, and table, which may have transient children. When the
  147. * active descendant has changed, the old value of the property change
  148. * event will be the Accessible representing the previous active child, and
  149. * the new value will be the Accessible representing the current active
  150. * child.
  151. *
  152. * @see #addPropertyChangeListener
  153. */
  154. public static final String ACCESSIBLE_ACTIVE_DESCENDANT_PROPERTY = "AccessibleActiveDescendant";
  155. /**
  156. * Constant used to indicate that the table caption has changed
  157. * The old value in the PropertyChangeEvent will be an Accessible
  158. * representing the previous table caption and the new value will
  159. * be an Accessible representing the new table caption.
  160. * @see Accessible
  161. * @see AccessibleTable
  162. */
  163. public static final String ACCESSIBLE_TABLE_CAPTION_CHANGED =
  164. "accessibleTableCaptionChanged";
  165. /**
  166. * Constant used to indicate that the table summary has changed
  167. * The old value in the PropertyChangeEvent will be an Accessible
  168. * representing the previous table summary and the new value will
  169. * be an Accessible representing the new table summary.
  170. * @see Accessible
  171. * @see AccessibleTable
  172. */
  173. public static final String ACCESSIBLE_TABLE_SUMMARY_CHANGED =
  174. "accessibleTableSummaryChanged";
  175. /**
  176. * Constant used to indicate that table data has changed.
  177. * The old value in the PropertyChangeEvent will be null and the
  178. * new value will be an AccessibleTableModelChange representing
  179. * the table change.
  180. * @see AccessibleTable
  181. * @see AccessibleTableModelChange
  182. */
  183. public static final String ACCESSIBLE_TABLE_MODEL_CHANGED =
  184. "accessibleTableModelChanged";
  185. /**
  186. * Constant used to indicate that the row header has changed
  187. * The old value in the PropertyChangeEvent will be null and the
  188. * new value will be an AccessibleTableModelChange representing
  189. * the header change.
  190. * @see AccessibleTable
  191. * @see AccessibleTableModelChange
  192. */
  193. public static final String ACCESSIBLE_TABLE_ROW_HEADER_CHANGED =
  194. "accessibleTableRowHeaderChanged";
  195. /**
  196. * Constant used to indicate that the row description has changed
  197. * The old value in the PropertyChangeEvent will be null and the
  198. * new value will be an Integer representing the row index.
  199. * @see AccessibleTable
  200. */
  201. public static final String ACCESSIBLE_TABLE_ROW_DESCRIPTION_CHANGED =
  202. "accessibleTableRowDescriptionChanged";
  203. /**
  204. * Constant used to indicate that the column header has changed
  205. * The old value in the PropertyChangeEvent will be null and the
  206. * new value will be an AccessibleTableModelChange representing
  207. * the header change.
  208. * @see AccessibleTable
  209. * @see AccessibleTableModelChange
  210. */
  211. public static final String ACCESSIBLE_TABLE_COLUMN_HEADER_CHANGED =
  212. "accessibleTableColumnHeaderChanged";
  213. /**
  214. * Constant used to indicate that the column description has changed
  215. * The old value in the PropertyChangeEvent will be null and the
  216. * new value will be an Integer representing the column index.
  217. * @see AccessibleTable
  218. */
  219. public static final String ACCESSIBLE_TABLE_COLUMN_DESCRIPTION_CHANGED =
  220. "accessibleTableColumnDescriptionChanged";
  221. /**
  222. * Constant used to indicate that the supported set of actions
  223. * has changed. The old value in the PropertyChangeEvent will
  224. * be an Integer representing the old number of actions supported
  225. * and the new value will be an Integer representing the new
  226. * number of actions supported.
  227. * @see AccessibleAction
  228. */
  229. public static final String ACCESSIBLE_ACTION_PROPERTY =
  230. "accessibleActionProperty";
  231. /**
  232. * Constant used to indicate that a hypertext element has received focus.
  233. * The old value in the PropertyChangeEvent will be an Integer
  234. * representing the start index in the document of the previous element
  235. * that had focus and the new value will be an Integer representing
  236. * the start index in the document of the current element that has
  237. * focus. A value of -1 indicates that an element does not or did
  238. * not have focus.
  239. * @see AccessibleHyperlink
  240. */
  241. public static final String ACCESSIBLE_HYPERTEXT_OFFSET =
  242. "AccessibleHypertextOffset";
  243. /**
  244. * PropertyChangeEvent which indicates that text has changed.
  245. * <br>
  246. * For text insertion, the oldValue is null and the newValue
  247. * is an AccessibleTextSequence specifying the text that was
  248. * inserted.
  249. * <br>
  250. * For text deletion, the oldValue is an AccessibleTextSequence
  251. * specifying the text that was deleted and the newValue is null.
  252. * <br>
  253. * For text replacement, the oldValue is an AccessibleTextSequence
  254. * specifying the old text and the newValue is an AccessibleTextSequence
  255. * specifying the new text.
  256. *
  257. * @see #getAccessibleText
  258. * @see #addPropertyChangeListener
  259. * @see #AccessibleText.AccessibleTextSequence
  260. */
  261. public static final String ACCESSIBLE_TEXT_PROPERTY
  262. = "AccessibleText";
  263. /**
  264. * PropertyChangeEvent which indicates that a significant change
  265. * has occurred to the children of a component like a tree or text.
  266. * This change notifies the event listener that it needs to
  267. * reacquire the state of the subcomponents. The oldValue is
  268. * null and the newValue is the component whose children have
  269. * become invalid.
  270. *
  271. * @see #getAccessibleText
  272. * @see #addPropertyChangeListener
  273. * @see #AccessibleText.AccessibleTextSequence
  274. *
  275. * @since 1.5
  276. */
  277. public static final String ACCESSIBLE_INVALIDATE_CHILDREN =
  278. "accessibleInvalidateChildren";
  279. /**
  280. * PropertyChangeEvent which indicates that text attributes have changed.
  281. * <br>
  282. * For attribute insertion, the oldValue is null and the newValue
  283. * is an AccessibleAttributeSequence specifying the attributes that were
  284. * inserted.
  285. * <br>
  286. * For attribute deletion, the oldValue is an AccessibleAttributeSequence
  287. * specifying the attributes that were deleted and the newValue is null.
  288. * <br>
  289. * For attribute replacement, the oldValue is an AccessibleAttributeSequence
  290. * specifying the old attributes and the newValue is an
  291. * AccessibleAttributeSequence specifying the new attributes.
  292. *
  293. * @see #getAccessibleText
  294. * @see #addPropertyChangeListener
  295. * @see #AccessibleText.AccessibleAttributeSequence
  296. *
  297. * @since 1.5
  298. */
  299. public static final String ACCESSIBLE_TEXT_ATTRIBUTES_CHANGED =
  300. "accessibleTextAttributesChanged";
  301. /**
  302. * PropertyChangeEvent which indicates that a change has occurred
  303. * in a component's bounds.
  304. * The oldValue is the old component bounds and the newValue is
  305. * the new component bounds.
  306. *
  307. * @see #addPropertyChangeListener
  308. *
  309. * @since 1.5
  310. */
  311. public static final String ACCESSIBLE_COMPONENT_BOUNDS_CHANGED =
  312. "accessibleComponentBoundsChanged";
  313. /**
  314. * The accessible parent of this object.
  315. *
  316. * @see #getAccessibleParent
  317. * @see #setAccessibleParent
  318. */
  319. protected Accessible accessibleParent = null;
  320. /**
  321. * A localized String containing the name of the object.
  322. *
  323. * @see #getAccessibleName
  324. * @see #setAccessibleName
  325. */
  326. protected String accessibleName = null;
  327. /**
  328. * A localized String containing the description of the object.
  329. *
  330. * @see #getAccessibleDescription
  331. * @see #setAccessibleDescription
  332. */
  333. protected String accessibleDescription = null;
  334. /**
  335. * Used to handle the listener list for property change events.
  336. *
  337. * @see #addPropertyChangeListener
  338. * @see #removePropertyChangeListener
  339. * @see #firePropertyChangeListener
  340. */
  341. private PropertyChangeSupport accessibleChangeSupport = null;
  342. /**
  343. * Used to represent the context's relation set
  344. * @see #getAccessibleRelationSet
  345. */
  346. private AccessibleRelationSet relationSet
  347. = new AccessibleRelationSet();
  348. /**
  349. * Gets the accessibleName property of this object. The accessibleName
  350. * property of an object is a localized String that designates the purpose
  351. * of the object. For example, the accessibleName property of a label
  352. * or button might be the text of the label or button itself. In the
  353. * case of an object that doesn't display its name, the accessibleName
  354. * should still be set. For example, in the case of a text field used
  355. * to enter the name of a city, the accessibleName for the en_US locale
  356. * could be 'city.'
  357. *
  358. * @return the localized name of the object; null if this
  359. * object does not have a name
  360. *
  361. * @see #setAccessibleName
  362. */
  363. public String getAccessibleName() {
  364. return accessibleName;
  365. }
  366. /**
  367. * Sets the localized accessible name of this object. Changing the
  368. * name will cause a PropertyChangeEvent to be fired for the
  369. * ACCESSIBLE_NAME_PROPERTY property.
  370. *
  371. * @param s the new localized name of the object.
  372. *
  373. * @see #getAccessibleName
  374. * @see #addPropertyChangeListener
  375. *
  376. * @beaninfo
  377. * preferred: true
  378. * description: Sets the accessible name for the component.
  379. */
  380. public void setAccessibleName(String s) {
  381. String oldName = accessibleName;
  382. accessibleName = s;
  383. firePropertyChange(ACCESSIBLE_NAME_PROPERTY,oldName,accessibleName);
  384. }
  385. /**
  386. * Gets the accessibleDescription property of this object. The
  387. * accessibleDescription property of this object is a short localized
  388. * phrase describing the purpose of the object. For example, in the
  389. * case of a 'Cancel' button, the accessibleDescription could be
  390. * 'Ignore changes and close dialog box.'
  391. *
  392. * @return the localized description of the object; null if
  393. * this object does not have a description
  394. *
  395. * @see #setAccessibleDescription
  396. */
  397. public String getAccessibleDescription() {
  398. return accessibleDescription;
  399. }
  400. /**
  401. * Sets the accessible description of this object. Changing the
  402. * name will cause a PropertyChangeEvent to be fired for the
  403. * ACCESSIBLE_DESCRIPTION_PROPERTY property.
  404. *
  405. * @param s the new localized description of the object
  406. *
  407. * @see #setAccessibleName
  408. * @see #addPropertyChangeListener
  409. *
  410. * @beaninfo
  411. * preferred: true
  412. * description: Sets the accessible description for the component.
  413. */
  414. public void setAccessibleDescription(String s) {
  415. String oldDescription = accessibleDescription;
  416. accessibleDescription = s;
  417. firePropertyChange(ACCESSIBLE_DESCRIPTION_PROPERTY,
  418. oldDescription,accessibleDescription);
  419. }
  420. /**
  421. * Gets the role of this object. The role of the object is the generic
  422. * purpose or use of the class of this object. For example, the role
  423. * of a push button is AccessibleRole.PUSH_BUTTON. The roles in
  424. * AccessibleRole are provided so component developers can pick from
  425. * a set of predefined roles. This enables assistive technologies to
  426. * provide a consistent interface to various tweaked subclasses of
  427. * components (e.g., use AccessibleRole.PUSH_BUTTON for all components
  428. * that act like a push button) as well as distinguish between sublasses
  429. * that behave differently (e.g., AccessibleRole.CHECK_BOX for check boxes
  430. * and AccessibleRole.RADIO_BUTTON for radio buttons).
  431. * <p>Note that the AccessibleRole class is also extensible, so
  432. * custom component developers can define their own AccessibleRole's
  433. * if the set of predefined roles is inadequate.
  434. *
  435. * @return an instance of AccessibleRole describing the role of the object
  436. * @see AccessibleRole
  437. */
  438. public abstract AccessibleRole getAccessibleRole();
  439. /**
  440. * Gets the state set of this object. The AccessibleStateSet of an object
  441. * is composed of a set of unique AccessibleStates. A change in the
  442. * AccessibleStateSet of an object will cause a PropertyChangeEvent to
  443. * be fired for the ACCESSIBLE_STATE_PROPERTY property.
  444. *
  445. * @return an instance of AccessibleStateSet containing the
  446. * current state set of the object
  447. * @see AccessibleStateSet
  448. * @see AccessibleState
  449. * @see #addPropertyChangeListener
  450. */
  451. public abstract AccessibleStateSet getAccessibleStateSet();
  452. /**
  453. * Gets the Accessible parent of this object.
  454. *
  455. * @return the Accessible parent of this object; null if this
  456. * object does not have an Accessible parent
  457. */
  458. public Accessible getAccessibleParent() {
  459. return accessibleParent;
  460. }
  461. /**
  462. * Sets the Accessible parent of this object. This is meant to be used
  463. * only in the situations where the actual component's parent should
  464. * not be treated as the component's accessible parent and is a method
  465. * that should only be called by the parent of the accessible child.
  466. *
  467. * @param a - Accessible to be set as the parent
  468. */
  469. public void setAccessibleParent(Accessible a) {
  470. accessibleParent = a;
  471. }
  472. /**
  473. * Gets the 0-based index of this object in its accessible parent.
  474. *
  475. * @return the 0-based index of this object in its parent; -1 if this
  476. * object does not have an accessible parent.
  477. *
  478. * @see #getAccessibleParent
  479. * @see #getAccessibleChildrenCount
  480. * @see #getAccessibleChild
  481. */
  482. public abstract int getAccessibleIndexInParent();
  483. /**
  484. * Returns the number of accessible children of the object.
  485. *
  486. * @return the number of accessible children of the object.
  487. */
  488. public abstract int getAccessibleChildrenCount();
  489. /**
  490. * Returns the specified Accessible child of the object. The Accessible
  491. * children of an Accessible object are zero-based, so the first child
  492. * of an Accessible child is at index 0, the second child is at index 1,
  493. * and so on.
  494. *
  495. * @param i zero-based index of child
  496. * @return the Accessible child of the object
  497. * @see #getAccessibleChildrenCount
  498. */
  499. public abstract Accessible getAccessibleChild(int i);
  500. /**
  501. * Gets the locale of the component. If the component does not have a
  502. * locale, then the locale of its parent is returned.
  503. *
  504. * @return this component's locale. If this component does not have
  505. * a locale, the locale of its parent is returned.
  506. *
  507. * @exception IllegalComponentStateException
  508. * If the Component does not have its own locale and has not yet been
  509. * added to a containment hierarchy such that the locale can be
  510. * determined from the containing parent.
  511. */
  512. public abstract Locale getLocale() throws IllegalComponentStateException;
  513. /**
  514. * Adds a PropertyChangeListener to the listener list.
  515. * The listener is registered for all Accessible properties and will
  516. * be called when those properties change.
  517. *
  518. * @see #ACCESSIBLE_NAME_PROPERTY
  519. * @see #ACCESSIBLE_DESCRIPTION_PROPERTY
  520. * @see #ACCESSIBLE_STATE_PROPERTY
  521. * @see #ACCESSIBLE_VALUE_PROPERTY
  522. * @see #ACCESSIBLE_SELECTION_PROPERTY
  523. * @see #ACCESSIBLE_TEXT_PROPERTY
  524. * @see #ACCESSIBLE_VISIBLE_DATA_PROPERTY
  525. *
  526. * @param listener The PropertyChangeListener to be added
  527. */
  528. public void addPropertyChangeListener(PropertyChangeListener listener) {
  529. if (accessibleChangeSupport == null) {
  530. accessibleChangeSupport = new PropertyChangeSupport(this);
  531. }
  532. accessibleChangeSupport.addPropertyChangeListener(listener);
  533. }
  534. /**
  535. * Removes a PropertyChangeListener from the listener list.
  536. * This removes a PropertyChangeListener that was registered
  537. * for all properties.
  538. *
  539. * @param listener The PropertyChangeListener to be removed
  540. */
  541. public void removePropertyChangeListener(PropertyChangeListener listener) {
  542. if (accessibleChangeSupport != null) {
  543. accessibleChangeSupport.removePropertyChangeListener(listener);
  544. }
  545. }
  546. /**
  547. * Gets the AccessibleAction associated with this object that supports
  548. * one or more actions.
  549. *
  550. * @return AccessibleAction if supported by object; else return null
  551. * @see AccessibleAction
  552. */
  553. public AccessibleAction getAccessibleAction() {
  554. return null;
  555. }
  556. /**
  557. * Gets the AccessibleComponent associated with this object that has a
  558. * graphical representation.
  559. *
  560. * @return AccessibleComponent if supported by object; else return null
  561. * @see AccessibleComponent
  562. */
  563. public AccessibleComponent getAccessibleComponent() {
  564. return null;
  565. }
  566. /**
  567. * Gets the AccessibleSelection associated with this object which allows its
  568. * Accessible children to be selected.
  569. *
  570. * @return AccessibleSelection if supported by object; else return null
  571. * @see AccessibleSelection
  572. */
  573. public AccessibleSelection getAccessibleSelection() {
  574. return null;
  575. }
  576. /**
  577. * Gets the AccessibleText associated with this object presenting
  578. * text on the display.
  579. *
  580. * @return AccessibleText if supported by object; else return null
  581. * @see AccessibleText
  582. */
  583. public AccessibleText getAccessibleText() {
  584. return null;
  585. }
  586. /**
  587. * Gets the AccessibleEditableText associated with this object
  588. * presenting editable text on the display.
  589. *
  590. * @return AccessibleEditableText if supported by object; else return null
  591. * @see AccessibleEditableText
  592. */
  593. public AccessibleEditableText getAccessibleEditableText() {
  594. return null;
  595. }
  596. /**
  597. * Gets the AccessibleValue associated with this object that supports a
  598. * Numerical value.
  599. *
  600. * @return AccessibleValue if supported by object; else return null
  601. * @see AccessibleValue
  602. */
  603. public AccessibleValue getAccessibleValue() {
  604. return null;
  605. }
  606. /**
  607. * Gets the AccessibleIcons associated with an object that has
  608. * one or more associated icons
  609. *
  610. * @return an array of AccessibleIcon if supported by object;
  611. * otherwise return null
  612. * @see AccessibleIcon
  613. */
  614. public AccessibleIcon [] getAccessibleIcon() {
  615. return null;
  616. }
  617. /**
  618. * Gets the AccessibleRelationSet associated with an object
  619. *
  620. * @return an AccessibleRelationSet if supported by object;
  621. * otherwise return null
  622. * @see AccessibleRelationSet
  623. */
  624. public AccessibleRelationSet getAccessibleRelationSet() {
  625. return relationSet;
  626. }
  627. /**
  628. * Gets the AccessibleTable associated with an object
  629. *
  630. * @return an AccessibleTable if supported by object;
  631. * otherwise return null
  632. * @see AccessibleTable
  633. */
  634. public AccessibleTable getAccessibleTable() {
  635. return null;
  636. }
  637. /**
  638. * Support for reporting bound property changes. If oldValue and
  639. * newValue are not equal and the PropertyChangeEvent listener list
  640. * is not empty, then fire a PropertyChange event to each listener.
  641. * In general, this is for use by the Accessible objects themselves
  642. * and should not be called by an application program.
  643. * @param propertyName The programmatic name of the property that
  644. * was changed.
  645. * @param oldValue The old value of the property.
  646. * @param newValue The new value of the property.
  647. * @see java.beans.PropertyChangeSupport
  648. * @see #addPropertyChangeListener
  649. * @see #removePropertyChangeListener
  650. * @see #ACCESSIBLE_NAME_PROPERTY
  651. * @see #ACCESSIBLE_DESCRIPTION_PROPERTY
  652. * @see #ACCESSIBLE_STATE_PROPERTY
  653. * @see #ACCESSIBLE_VALUE_PROPERTY
  654. * @see #ACCESSIBLE_SELECTION_PROPERTY
  655. * @see #ACCESSIBLE_TEXT_PROPERTY
  656. * @see #ACCESSIBLE_VISIBLE_DATA_PROPERTY
  657. */
  658. public void firePropertyChange(String propertyName,
  659. Object oldValue,
  660. Object newValue) {
  661. if (accessibleChangeSupport != null) {
  662. if (newValue instanceof PropertyChangeEvent) {
  663. PropertyChangeEvent pce = (PropertyChangeEvent)newValue;
  664. accessibleChangeSupport.firePropertyChange(pce);
  665. } else {
  666. accessibleChangeSupport.firePropertyChange(propertyName,
  667. oldValue,
  668. newValue);
  669. }
  670. }
  671. }
  672. }