ActionEvent e = null; // Process the listeners last to first, notifying // those that are interested in this event for (int i = listeners.length-2; i>=0; i-=2) { if (listeners[i]==ActionListener.class) { // Lazily create the event: if (e == null) { String actionCommand = event.getActionCommand(); if(actionCommand == null) { actionCommand = getActionCommand(); } e = new ActionEvent(AbstractButton.this, ActionEvent.ACTION_PERFORMED, actionCommand, event.getWhen(), event.getModifiers()); } ((ActionListener)listeners[i+1]).actionPerformed(e); } } } /** * Notifies all listeners that have registered interest for * notification on this event type. The event instance * is lazily created using the <code>event</code> parameter. * * @param event the <code>ItemEvent</code> object * @see EventListenerList */ protected void fireItemStateChanged(ItemEvent event) { // Guaranteed to return a non-null array Object[] listeners = listenerList.getListenerList(); ItemEvent e = null; // Process the listeners last to first, notifying // those that are interested in this event for (int i = listeners.length-2; i>=0; i-=2) { if (listeners[i]==ItemListener.class) { // Lazily create the event: if (e == null) { e = new ItemEvent(AbstractButton.this, ItemEvent.ITEM_STATE_CHANGED, AbstractButton.this, event.getStateChange()); } ((ItemListener)listeners[i+1]).itemStateChanged(e); } } if (accessibleContext != null) { if (event.getStateChange() == ItemEvent.SELECTED) { accessibleContext.firePropertyChange( AccessibleContext.ACCESSIBLE_STATE_PROPERTY, null, AccessibleState.SELECTED); accessibleContext.firePropertyChange( AccessibleContext.ACCESSIBLE_VALUE_PROPERTY, Integer.valueOf(0), Integer.valueOf(1)); } else { accessibleContext.firePropertyChange( AccessibleContext.ACCESSIBLE_STATE_PROPERTY, AccessibleState.SELECTED, null); accessibleContext.firePropertyChange( AccessibleContext.ACCESSIBLE_VALUE_PROPERTY, Integer.valueOf(1), Integer.valueOf(0)); } } } protected ActionListener createActionListener() { return getHandler(); } protected ItemListener createItemListener() { return getHandler(); } /** * Enables (or disables) the button. * @param b true to enable the button, otherwise false */ public void setEnabled(boolean b) { if (!b && model.isRollover()) { model.setRollover(false); } super.setEnabled(b); model.setEnabled(b); } // *** Deprecated java.awt.Button APIs below *** // /** * Returns the label text. * * @return a <code>String</code> containing the label * @deprecated - Replaced by <code>getText</code> */ @Deprecated public String getLabel() { return getText(); } /** * Sets the label text. * * @param label a <code>String</code> containing the text * @deprecated - Replaced by <code>setText(text)</code> * @beaninfo * bound: true * description: Replace by setText(text) */ @Deprecated public void setLabel(String label) { setText(label); } /** * Adds an <code>ItemListener</code> to the <code>checkbox</code>. * @param l the <code>ItemListener</code> to be added */ public void addItemListener(ItemListener l) { listenerList.add(ItemListener.class, l); } /** * Removes an <code>ItemListener</code> from the button. * @param l the <code>ItemListener</code> to be removed */ public void removeItemListener(ItemListener l) { listenerList.remove(ItemListener.class, l); } /** * Returns an array of all the <code>ItemListener</code>s added * to this AbstractButton with addItemListener(). * * @return all of the <code>ItemListener</code>s added or an empty * array if no listeners have been added * @since 1.4 */ public ItemListener[] getItemListeners() { return listenerList.getListeners(ItemListener.class); } /** * Returns an array (length 1) containing the label or * <code>null</code> if the button is not selected. * * @return an array containing 1 Object: the text of the button, * if the item is selected; otherwise <code>null</code> */ public Object[] getSelectedObjects() { if (isSelected() == false) { return null; } Object[] selectedObjects = new Object[1]; selectedObjects[0] = getText(); return selectedObjects; } protected void init(String text, Icon icon) { if(text != null) { setText(text); } if(icon != null) { setIcon(icon); } // Set the UI updateUI(); setAlignmentX(LEFT_ALIGNMENT); setAlignmentY(CENTER_ALIGNMENT); } /** * This is overridden to return false if the current <code>Icon</code>'s * <code>Image</code> is not equal to the * passed in <code>Image</code> <code>img</code>. * * @param img the <code>Image</code> to be compared * @param infoflags flags used to repaint the button when the image * is updated and which determine how much is to be painted * @param x the x coordinate * @param y the y coordinate * @param w the width * @param h the height * @see java.awt.image.ImageObserver * @see java.awt.Component#imageUpdate(java.awt.Image, int, int, int, int, int) */ public boolean imageUpdate(Image img, int infoflags, int x, int y, int w, int h) { Icon iconDisplayed = getIcon(); if (iconDisplayed == null) { return false; } if (!model.isEnabled()) { if (model.isSelected()) { iconDisplayed = getDisabledSelectedIcon(); } else { iconDisplayed = getDisabledIcon(); } } else if (model.isPressed() && model.isArmed()) { iconDisplayed = getPressedIcon(); } else if (isRolloverEnabled() && model.isRollover()) { if (model.isSelected()) { iconDisplayed = getRolloverSelectedIcon(); } else { iconDisplayed = getRolloverIcon(); } } else if (model.isSelected()) { iconDisplayed = getSelectedIcon(); } if (!SwingUtilities.doesIconReferenceImage(iconDisplayed, img)) { // We don't know about this image, disable the notification so // we don't keep repainting. return false; } return super.imageUpdate(img, infoflags, x, y, w, h); } void setUIProperty(String propertyName, Object value) { if (propertyName == "borderPainted") { if (!borderPaintedSet) { setBorderPainted(((Boolean)value).booleanValue()); borderPaintedSet = false; } } else if (propertyName == "rolloverEnabled") { if (!rolloverEnabledSet) { setRolloverEnabled(((Boolean)value).booleanValue()); rolloverEnabledSet = false; } } else if (propertyName == "iconTextGap") { if (!iconTextGapSet) { setIconTextGap(((Number)value).intValue()); iconTextGapSet = false; } } else if (propertyName == "contentAreaFilled") { if (!contentAreaFilledSet) { setContentAreaFilled(((Boolean)value).booleanValue()); contentAreaFilledSet = false; } } else { super.setUIProperty(propertyName, value); } } /** * Returns a string representation of this <code>AbstractButton</code>. * This method * is intended to be used only for debugging purposes, and the * content and format of the returned string may vary between * implementations. The returned string may be empty but may not * be <code>null</code>. * <P> * Overriding <code>paramString</code> to provide information about the * specific new aspects of the JFC components. * * @return a string representation of this <code>AbstractButton</code> */ protected String paramString() { String defaultIconString = ((defaultIcon != null) && (defaultIcon != this) ? defaultIcon.toString() : ""); String pressedIconString = ((pressedIcon != null) && (pressedIcon != this) ? pressedIcon.toString() : ""); String disabledIconString = ((disabledIcon != null) && (disabledIcon != this) ? disabledIcon.toString() : ""); String selectedIconString = ((selectedIcon != null) && (selectedIcon != this) ? selectedIcon.toString() : ""); String disabledSelectedIconString = ((disabledSelectedIcon != null) && (disabledSelectedIcon != this) ? disabledSelectedIcon.toString() : ""); String rolloverIconString = ((rolloverIcon != null) && (rolloverIcon != this) ? rolloverIcon.toString() : ""); String rolloverSelectedIconString = ((rolloverSelectedIcon != null) && (rolloverSelectedIcon != this) ? rolloverSelectedIcon.toString() : ""); String paintBorderString = (paintBorder ? "true" : "false"); String paintFocusString = (paintFocus ? "true" : "false"); String rolloverEnabledString = (rolloverEnabled ? "true" : "false"); return super.paramString() + ",defaultIcon=" + defaultIconString + ",disabledIcon=" + disabledIconString + ",disabledSelectedIcon=" + disabledSelectedIconString + ",margin=" + margin + ",paintBorder=" + paintBorderString + ",paintFocus=" + paintFocusString + ",pressedIcon=" + pressedIconString + ",rolloverEnabled=" + rolloverEnabledString + ",rolloverIcon=" + rolloverIconString + ",rolloverSelectedIcon=" + rolloverSelectedIconString + ",selectedIcon=" + selectedIconString + ",text=" + text; } private Handler getHandler() { if (handler == null) { handler = new Handler(); } return handler; } // // Listeners that are added to model // class Handler implements ActionListener, ChangeListener, ItemListener, Serializable { // // ChangeListener // public void stateChanged(ChangeEvent e) { Object source = e.getSource(); updateMnemonicProperties(); if (isEnabled() != model.isEnabled()) { setEnabled(model.isEnabled()); } fireStateChanged(); repaint(); } // // ActionListener // public void actionPerformed(ActionEvent event) { fireActionPerformed(event); } // // ItemListener // public void itemStateChanged(ItemEvent event) { fireItemStateChanged(event); if (shouldUpdateSelectedStateFromAction()) { Action action = getAction(); if (action != null && AbstractAction.hasSelectedKey(action)) { boolean selected = isSelected(); boolean isActionSelected = AbstractAction.isSelected( action); if (isActionSelected != selected) { action.putValue(Action.SELECTED_KEY, selected); } } } } } ///////////////////// Accessibility support/////////////////// /** * This class implements accessibility support for the * <code>AbstractButton</code> class. It provides an implementation of the * Java Accessibility API appropriate to button and menu item * user-interface elements. * <p> * <strong>Warning:</strong> * Serialized objects of this class will not be compatible with * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage * of all JavaBeans<sup><font size="-2">TM</font></sup> * has been added to the <code>java.beans</code> package. * Please see {@link java.beans.XMLEncoder}. * @since 1.4 */ protected abstract class AccessibleAbstractButton extends AccessibleJComponent implements AccessibleAction, AccessibleValue, AccessibleText, AccessibleExtendedComponent { /** * Returns the accessible name of this object. * * @return the localized name of the object -- can be * <code>null</code> if this * object does not have a name */ public String getAccessibleName() { String name = accessibleName; if (name == null) { name = (String)getClientProperty(AccessibleContext.ACCESSIBLE_NAME_PROPERTY); } if (name == null) { name = AbstractButton.this.getText(); } if (name == null) { name = super.getAccessibleName(); } return name; } /** * Get the AccessibleIcons associated with this object if one * or more exist. Otherwise return null. * @since 1.3 */ public AccessibleIcon [] getAccessibleIcon() { Icon defaultIcon = getIcon(); if (defaultIcon instanceof Accessible) { AccessibleContext ac = ((Accessible)defaultIcon).getAccessibleContext(); if (ac != null && ac instanceof AccessibleIcon) { return new AccessibleIcon[] { (AccessibleIcon)ac }; } } return null; } /** * Get the state set of this object. * * @return an instance of AccessibleState containing the current state * of the object * @see AccessibleState */ public AccessibleStateSet getAccessibleStateSet() { AccessibleStateSet states = super.getAccessibleStateSet(); if (getModel().isArmed()) { states.add(AccessibleState.ARMED); } if (isFocusOwner()) { states.add(AccessibleState.FOCUSED); } if (getModel().isPressed()) { states.add(AccessibleState.PRESSED); } if (isSelected()) { states.add(AccessibleState.CHECKED); } return states; } /** * Get the AccessibleRelationSet associated with this object if one * exists. Otherwise return null. * @see AccessibleRelation * @since 1.3 */ public AccessibleRelationSet getAccessibleRelationSet() { // Check where the AccessibleContext's relation // set already contains a MEMBER_OF relation. AccessibleRelationSet relationSet = super.getAccessibleRelationSet(); if (!relationSet.contains(AccessibleRelation.MEMBER_OF)) { // get the members of the button group if one exists ButtonModel model = getModel(); if (model != null && model instanceof DefaultButtonModel) { ButtonGroup group = ((DefaultButtonModel)model).getGroup(); if (group != null) { // set the target of the MEMBER_OF relation to be // the members of the button group. int len = group.getButtonCount(); Object [] target = new Object[len]; Enumeration elem = group.getElements(); for (int i = 0; i < len; i++) { if (elem.hasMoreElements()) { target[i] = elem.nextElement(); } } AccessibleRelation relation = new AccessibleRelation(AccessibleRelation.MEMBER_OF); relation.setTarget(target); relationSet.add(relation); } } } return relationSet; } /** * Get the AccessibleAction associated with this object. In the * implementation of the Java Accessibility API for this class, * return this object, which is responsible for implementing the * AccessibleAction interface on behalf of itself. * * @return this object */ public AccessibleAction getAccessibleAction() { return this; } Lines 2001–2500 of 3101. Previous lines Load more
ActionEvent e = null; // Process the listeners last to first, notifying // those that are interested in this event for (int i = listeners.length-2; i>=0; i-=2) { if (listeners[i]==ActionListener.class) { // Lazily create the event: if (e == null) { String actionCommand = event.getActionCommand(); if(actionCommand == null) { actionCommand = getActionCommand(); } e = new ActionEvent(AbstractButton.this, ActionEvent.ACTION_PERFORMED, actionCommand, event.getWhen(), event.getModifiers()); } ((ActionListener)listeners[i+1]).actionPerformed(e); } } } /** * Notifies all listeners that have registered interest for * notification on this event type. The event instance * is lazily created using the <code>event</code> parameter. * * @param event the <code>ItemEvent</code> object * @see EventListenerList */ protected void fireItemStateChanged(ItemEvent event) { // Guaranteed to return a non-null array Object[] listeners = listenerList.getListenerList(); ItemEvent e = null; // Process the listeners last to first, notifying // those that are interested in this event for (int i = listeners.length-2; i>=0; i-=2) { if (listeners[i]==ItemListener.class) { // Lazily create the event: if (e == null) { e = new ItemEvent(AbstractButton.this, ItemEvent.ITEM_STATE_CHANGED, AbstractButton.this, event.getStateChange()); } ((ItemListener)listeners[i+1]).itemStateChanged(e); } } if (accessibleContext != null) { if (event.getStateChange() == ItemEvent.SELECTED) { accessibleContext.firePropertyChange( AccessibleContext.ACCESSIBLE_STATE_PROPERTY, null, AccessibleState.SELECTED); accessibleContext.firePropertyChange( AccessibleContext.ACCESSIBLE_VALUE_PROPERTY, Integer.valueOf(0), Integer.valueOf(1)); } else { accessibleContext.firePropertyChange( AccessibleContext.ACCESSIBLE_STATE_PROPERTY, AccessibleState.SELECTED, null); accessibleContext.firePropertyChange( AccessibleContext.ACCESSIBLE_VALUE_PROPERTY, Integer.valueOf(1), Integer.valueOf(0)); } } } protected ActionListener createActionListener() { return getHandler(); } protected ItemListener createItemListener() { return getHandler(); } /** * Enables (or disables) the button. * @param b true to enable the button, otherwise false */ public void setEnabled(boolean b) { if (!b && model.isRollover()) { model.setRollover(false); } super.setEnabled(b); model.setEnabled(b); } // *** Deprecated java.awt.Button APIs below *** // /** * Returns the label text. * * @return a <code>String</code> containing the label * @deprecated - Replaced by <code>getText</code> */ @Deprecated public String getLabel() { return getText(); } /** * Sets the label text. * * @param label a <code>String</code> containing the text * @deprecated - Replaced by <code>setText(text)</code> * @beaninfo * bound: true * description: Replace by setText(text) */ @Deprecated public void setLabel(String label) { setText(label); } /** * Adds an <code>ItemListener</code> to the <code>checkbox</code>. * @param l the <code>ItemListener</code> to be added */ public void addItemListener(ItemListener l) { listenerList.add(ItemListener.class, l); } /** * Removes an <code>ItemListener</code> from the button. * @param l the <code>ItemListener</code> to be removed */ public void removeItemListener(ItemListener l) { listenerList.remove(ItemListener.class, l); } /** * Returns an array of all the <code>ItemListener</code>s added * to this AbstractButton with addItemListener(). * * @return all of the <code>ItemListener</code>s added or an empty * array if no listeners have been added * @since 1.4 */ public ItemListener[] getItemListeners() { return listenerList.getListeners(ItemListener.class); } /** * Returns an array (length 1) containing the label or * <code>null</code> if the button is not selected. * * @return an array containing 1 Object: the text of the button, * if the item is selected; otherwise <code>null</code> */ public Object[] getSelectedObjects() { if (isSelected() == false) { return null; } Object[] selectedObjects = new Object[1]; selectedObjects[0] = getText(); return selectedObjects; } protected void init(String text, Icon icon) { if(text != null) { setText(text); } if(icon != null) { setIcon(icon); } // Set the UI updateUI(); setAlignmentX(LEFT_ALIGNMENT); setAlignmentY(CENTER_ALIGNMENT); } /** * This is overridden to return false if the current <code>Icon</code>'s * <code>Image</code> is not equal to the * passed in <code>Image</code> <code>img</code>. * * @param img the <code>Image</code> to be compared * @param infoflags flags used to repaint the button when the image * is updated and which determine how much is to be painted * @param x the x coordinate * @param y the y coordinate * @param w the width * @param h the height * @see java.awt.image.ImageObserver * @see java.awt.Component#imageUpdate(java.awt.Image, int, int, int, int, int) */ public boolean imageUpdate(Image img, int infoflags, int x, int y, int w, int h) { Icon iconDisplayed = getIcon(); if (iconDisplayed == null) { return false; } if (!model.isEnabled()) { if (model.isSelected()) { iconDisplayed = getDisabledSelectedIcon(); } else { iconDisplayed = getDisabledIcon(); } } else if (model.isPressed() && model.isArmed()) { iconDisplayed = getPressedIcon(); } else if (isRolloverEnabled() && model.isRollover()) { if (model.isSelected()) { iconDisplayed = getRolloverSelectedIcon(); } else { iconDisplayed = getRolloverIcon(); } } else if (model.isSelected()) { iconDisplayed = getSelectedIcon(); } if (!SwingUtilities.doesIconReferenceImage(iconDisplayed, img)) { // We don't know about this image, disable the notification so // we don't keep repainting. return false; } return super.imageUpdate(img, infoflags, x, y, w, h); } void setUIProperty(String propertyName, Object value) { if (propertyName == "borderPainted") { if (!borderPaintedSet) { setBorderPainted(((Boolean)value).booleanValue()); borderPaintedSet = false; } } else if (propertyName == "rolloverEnabled") { if (!rolloverEnabledSet) { setRolloverEnabled(((Boolean)value).booleanValue()); rolloverEnabledSet = false; } } else if (propertyName == "iconTextGap") { if (!iconTextGapSet) { setIconTextGap(((Number)value).intValue()); iconTextGapSet = false; } } else if (propertyName == "contentAreaFilled") { if (!contentAreaFilledSet) { setContentAreaFilled(((Boolean)value).booleanValue()); contentAreaFilledSet = false; } } else { super.setUIProperty(propertyName, value); } } /** * Returns a string representation of this <code>AbstractButton</code>. * This method * is intended to be used only for debugging purposes, and the * content and format of the returned string may vary between * implementations. The returned string may be empty but may not * be <code>null</code>. * <P> * Overriding <code>paramString</code> to provide information about the * specific new aspects of the JFC components. * * @return a string representation of this <code>AbstractButton</code> */ protected String paramString() { String defaultIconString = ((defaultIcon != null) && (defaultIcon != this) ? defaultIcon.toString() : ""); String pressedIconString = ((pressedIcon != null) && (pressedIcon != this) ? pressedIcon.toString() : ""); String disabledIconString = ((disabledIcon != null) && (disabledIcon != this) ? disabledIcon.toString() : ""); String selectedIconString = ((selectedIcon != null) && (selectedIcon != this) ? selectedIcon.toString() : ""); String disabledSelectedIconString = ((disabledSelectedIcon != null) && (disabledSelectedIcon != this) ? disabledSelectedIcon.toString() : ""); String rolloverIconString = ((rolloverIcon != null) && (rolloverIcon != this) ? rolloverIcon.toString() : ""); String rolloverSelectedIconString = ((rolloverSelectedIcon != null) && (rolloverSelectedIcon != this) ? rolloverSelectedIcon.toString() : ""); String paintBorderString = (paintBorder ? "true" : "false"); String paintFocusString = (paintFocus ? "true" : "false"); String rolloverEnabledString = (rolloverEnabled ? "true" : "false"); return super.paramString() + ",defaultIcon=" + defaultIconString + ",disabledIcon=" + disabledIconString + ",disabledSelectedIcon=" + disabledSelectedIconString + ",margin=" + margin + ",paintBorder=" + paintBorderString + ",paintFocus=" + paintFocusString + ",pressedIcon=" + pressedIconString + ",rolloverEnabled=" + rolloverEnabledString + ",rolloverIcon=" + rolloverIconString + ",rolloverSelectedIcon=" + rolloverSelectedIconString + ",selectedIcon=" + selectedIconString + ",text=" + text; } private Handler getHandler() { if (handler == null) { handler = new Handler(); } return handler; } // // Listeners that are added to model // class Handler implements ActionListener, ChangeListener, ItemListener, Serializable { // // ChangeListener // public void stateChanged(ChangeEvent e) { Object source = e.getSource(); updateMnemonicProperties(); if (isEnabled() != model.isEnabled()) { setEnabled(model.isEnabled()); } fireStateChanged(); repaint(); } // // ActionListener // public void actionPerformed(ActionEvent event) { fireActionPerformed(event); } // // ItemListener // public void itemStateChanged(ItemEvent event) { fireItemStateChanged(event); if (shouldUpdateSelectedStateFromAction()) { Action action = getAction(); if (action != null && AbstractAction.hasSelectedKey(action)) { boolean selected = isSelected(); boolean isActionSelected = AbstractAction.isSelected( action); if (isActionSelected != selected) { action.putValue(Action.SELECTED_KEY, selected); } } } } } /////////////////// // Accessibility support /////////////////// /** * This class implements accessibility support for the * <code>AbstractButton</code> class. It provides an implementation of the * Java Accessibility API appropriate to button and menu item * user-interface elements. * <p> * <strong>Warning:</strong> * Serialized objects of this class will not be compatible with * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage * of all JavaBeans<sup><font size="-2">TM</font></sup> * has been added to the <code>java.beans</code> package. * Please see {@link java.beans.XMLEncoder}. * @since 1.4 */ protected abstract class AccessibleAbstractButton extends AccessibleJComponent implements AccessibleAction, AccessibleValue, AccessibleText, AccessibleExtendedComponent { /** * Returns the accessible name of this object. * * @return the localized name of the object -- can be * <code>null</code> if this * object does not have a name */ public String getAccessibleName() { String name = accessibleName; if (name == null) { name = (String)getClientProperty(AccessibleContext.ACCESSIBLE_NAME_PROPERTY); } if (name == null) { name = AbstractButton.this.getText(); } if (name == null) { name = super.getAccessibleName(); } return name; } /** * Get the AccessibleIcons associated with this object if one * or more exist. Otherwise return null. * @since 1.3 */ public AccessibleIcon [] getAccessibleIcon() { Icon defaultIcon = getIcon(); if (defaultIcon instanceof Accessible) { AccessibleContext ac = ((Accessible)defaultIcon).getAccessibleContext(); if (ac != null && ac instanceof AccessibleIcon) { return new AccessibleIcon[] { (AccessibleIcon)ac }; } } return null; } /** * Get the state set of this object. * * @return an instance of AccessibleState containing the current state * of the object * @see AccessibleState */ public AccessibleStateSet getAccessibleStateSet() { AccessibleStateSet states = super.getAccessibleStateSet(); if (getModel().isArmed()) { states.add(AccessibleState.ARMED); } if (isFocusOwner()) { states.add(AccessibleState.FOCUSED); } if (getModel().isPressed()) { states.add(AccessibleState.PRESSED); } if (isSelected()) { states.add(AccessibleState.CHECKED); } return states; } /** * Get the AccessibleRelationSet associated with this object if one * exists. Otherwise return null. * @see AccessibleRelation * @since 1.3 */ public AccessibleRelationSet getAccessibleRelationSet() { // Check where the AccessibleContext's relation // set already contains a MEMBER_OF relation. AccessibleRelationSet relationSet = super.getAccessibleRelationSet(); if (!relationSet.contains(AccessibleRelation.MEMBER_OF)) { // get the members of the button group if one exists ButtonModel model = getModel(); if (model != null && model instanceof DefaultButtonModel) { ButtonGroup group = ((DefaultButtonModel)model).getGroup(); if (group != null) { // set the target of the MEMBER_OF relation to be // the members of the button group. int len = group.getButtonCount(); Object [] target = new Object[len]; Enumeration elem = group.getElements(); for (int i = 0; i < len; i++) { if (elem.hasMoreElements()) { target[i] = elem.nextElement(); } } AccessibleRelation relation = new AccessibleRelation(AccessibleRelation.MEMBER_OF); relation.setTarget(target); relationSet.add(relation); } } } return relationSet; } /** * Get the AccessibleAction associated with this object. In the * implementation of the Java Accessibility API for this class, * return this object, which is responsible for implementing the * AccessibleAction interface on behalf of itself. * * @return this object */ public AccessibleAction getAccessibleAction() { return this; }