< prev index next >

src/java.desktop/share/classes/java/awt/Component.java

Print this page




9288          */
9289         private transient volatile int propertyListenersCount = 0;
9290 
9291         /**
9292          * A component listener to track show/hide/resize events
9293          * and convert them to PropertyChange events.
9294          */
9295         protected ComponentListener accessibleAWTComponentHandler = null;
9296 
9297         /**
9298          * A listener to track focus events
9299          * and convert them to PropertyChange events.
9300          */
9301         protected FocusListener accessibleAWTFocusHandler = null;
9302 
9303         /**
9304          * Fire PropertyChange listener, if one is registered,
9305          * when shown/hidden..
9306          * @since 1.3
9307          */
9308         protected class AccessibleAWTComponentHandler implements ComponentListener {


9309             public void componentHidden(ComponentEvent e)  {
9310                 if (accessibleContext != null) {
9311                     accessibleContext.firePropertyChange(
9312                                                          AccessibleContext.ACCESSIBLE_STATE_PROPERTY,
9313                                                          AccessibleState.VISIBLE, null);
9314                 }
9315             }
9316 
9317             public void componentShown(ComponentEvent e)  {
9318                 if (accessibleContext != null) {
9319                     accessibleContext.firePropertyChange(
9320                                                          AccessibleContext.ACCESSIBLE_STATE_PROPERTY,
9321                                                          null, AccessibleState.VISIBLE);
9322                 }
9323             }
9324 
9325             public void componentMoved(ComponentEvent e)  {
9326             }
9327 
9328             public void componentResized(ComponentEvent e)  {
9329             }
9330         } // inner class AccessibleAWTComponentHandler
9331 
9332 
9333         /**
9334          * Fire PropertyChange listener, if one is registered,
9335          * when focus events happen
9336          * @since 1.3
9337          */
9338         protected class AccessibleAWTFocusHandler implements FocusListener {


9339             public void focusGained(FocusEvent event) {
9340                 if (accessibleContext != null) {
9341                     accessibleContext.firePropertyChange(
9342                                                          AccessibleContext.ACCESSIBLE_STATE_PROPERTY,
9343                                                          null, AccessibleState.FOCUSED);
9344                 }
9345             }
9346             public void focusLost(FocusEvent event) {
9347                 if (accessibleContext != null) {
9348                     accessibleContext.firePropertyChange(
9349                                                          AccessibleContext.ACCESSIBLE_STATE_PROPERTY,
9350                                                          AccessibleState.FOCUSED, null);
9351                 }
9352             }
9353         }  // inner class AccessibleAWTFocusHandler
9354 
9355 
9356         /**
9357          * Adds a {@code PropertyChangeListener} to the listener list.
9358          *




9288          */
9289         private transient volatile int propertyListenersCount = 0;
9290 
9291         /**
9292          * A component listener to track show/hide/resize events
9293          * and convert them to PropertyChange events.
9294          */
9295         protected ComponentListener accessibleAWTComponentHandler = null;
9296 
9297         /**
9298          * A listener to track focus events
9299          * and convert them to PropertyChange events.
9300          */
9301         protected FocusListener accessibleAWTFocusHandler = null;
9302 
9303         /**
9304          * Fire PropertyChange listener, if one is registered,
9305          * when shown/hidden..
9306          * @since 1.3
9307          */
9308         protected class AccessibleAWTComponentHandler implements ComponentListener, Serializable {
9309             private static final long serialVersionUID = -1009684107426231869L;
9310 
9311             public void componentHidden(ComponentEvent e)  {
9312                 if (accessibleContext != null) {
9313                     accessibleContext.firePropertyChange(
9314                                                          AccessibleContext.ACCESSIBLE_STATE_PROPERTY,
9315                                                          AccessibleState.VISIBLE, null);
9316                 }
9317             }
9318 
9319             public void componentShown(ComponentEvent e)  {
9320                 if (accessibleContext != null) {
9321                     accessibleContext.firePropertyChange(
9322                                                          AccessibleContext.ACCESSIBLE_STATE_PROPERTY,
9323                                                          null, AccessibleState.VISIBLE);
9324                 }
9325             }
9326 
9327             public void componentMoved(ComponentEvent e)  {
9328             }
9329 
9330             public void componentResized(ComponentEvent e)  {
9331             }
9332         } // inner class AccessibleAWTComponentHandler
9333 
9334 
9335         /**
9336          * Fire PropertyChange listener, if one is registered,
9337          * when focus events happen
9338          * @since 1.3
9339          */
9340         protected class AccessibleAWTFocusHandler implements FocusListener, Serializable {
9341             private static final long serialVersionUID = 3150908257351582233L;
9342 
9343             public void focusGained(FocusEvent event) {
9344                 if (accessibleContext != null) {
9345                     accessibleContext.firePropertyChange(
9346                                                          AccessibleContext.ACCESSIBLE_STATE_PROPERTY,
9347                                                          null, AccessibleState.FOCUSED);
9348                 }
9349             }
9350             public void focusLost(FocusEvent event) {
9351                 if (accessibleContext != null) {
9352                     accessibleContext.firePropertyChange(
9353                                                          AccessibleContext.ACCESSIBLE_STATE_PROPERTY,
9354                                                          AccessibleState.FOCUSED, null);
9355                 }
9356             }
9357         }  // inner class AccessibleAWTFocusHandler
9358 
9359 
9360         /**
9361          * Adds a {@code PropertyChangeListener} to the listener list.
9362          *


< prev index next >