< prev index next >

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

Print this page




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


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


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          *




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


< prev index next >