* description: The disabled selection icon for the button.
*/
public void setDisabledSelectedIcon(Icon disabledSelectedIcon) {
Icon oldValue = this.disabledSelectedIcon;
this.disabledSelectedIcon = disabledSelectedIcon;
firePropertyChange(DISABLED_SELECTED_ICON_CHANGED_PROPERTY, oldValue, disabledSelectedIcon);
if (accessibleContext != null) {
accessibleContext.firePropertyChange(
AccessibleContext.ACCESSIBLE_VISIBLE_DATA_PROPERTY,
oldValue, disabledSelectedIcon);
}
if (disabledSelectedIcon != oldValue) {
if (disabledSelectedIcon == null || oldValue == null ||
disabledSelectedIcon.getIconWidth() != oldValue.getIconWidth() ||
disabledSelectedIcon.getIconHeight() != oldValue.getIconHeight()) {
revalidate();
}
if (!isEnabled() && isSelected()) {
repaint();
}
}
}
/**
* Returns the vertical alignment of the text and icon.
*
* @return the <code>verticalAlignment</code> property, one of the
* following values:
* <ul>
* <li>{@code SwingConstants.CENTER} (the default)
* <li>{@code SwingConstants.TOP}
* <li>{@code SwingConstants.BOTTOM}
* </ul>
*/
public int getVerticalAlignment() {
return verticalAlignment;
}
/**
* Sets the vertical alignment of the icon and text.
* @param alignment one of the following values:
* <ul>
* <li>{@code SwingConstants.CENTER} (the default)
* <li>{@code SwingConstants.TOP}
* <li>{@code SwingConstants.BOTTOM}
* </ul>
* @throws IllegalArgumentException if the alignment is not one of the legal
* values listed above
* @beaninfo
* bound: true
* enum: TOP SwingConstants.TOP
* CENTER SwingConstants.CENTER
* BOTTOM SwingConstants.BOTTOM
* attribute: visualUpdate true
* description: The vertical alignment of the icon and text.
*/
public void setVerticalAlignment(int alignment) {
if (alignment == verticalAlignment) return;
int oldValue = verticalAlignment;
verticalAlignment = checkVerticalKey(alignment, "verticalAlignment");
firePropertyChange(VERTICAL_ALIGNMENT_CHANGED_PROPERTY, oldValue, verticalAlignment); repaint();
}
/**
* Returns the horizontal alignment of the icon and text.
* {@code AbstractButton}'s default is {@code SwingConstants.CENTER},
* but subclasses such as {@code JCheckBox} may use a different default.
*
* @return the <code>horizontalAlignment</code> property,
* one of the following values:
* <ul>
* <li>{@code SwingConstants.RIGHT}
* <li>{@code SwingConstants.LEFT}
* <li>{@code SwingConstants.CENTER}
* <li>{@code SwingConstants.LEADING}
* <li>{@code SwingConstants.TRAILING}
* </ul>
*/
public int getHorizontalAlignment() {
return horizontalAlignment;
}
/**
* Sets the horizontal alignment of the icon and text.
* {@code AbstractButton}'s default is {@code SwingConstants.CENTER},
* but subclasses such as {@code JCheckBox} may use a different default.
*
* @param alignment the alignment value, one of the following values:
* <ul>
* <li>{@code SwingConstants.RIGHT}
* <li>{@code SwingConstants.LEFT}
* <li>{@code SwingConstants.CENTER}
* <li>{@code SwingConstants.LEADING}
* <li>{@code SwingConstants.TRAILING}
* </ul>
* @throws IllegalArgumentException if the alignment is not one of the
* valid values
* @beaninfo
* bound: true
* enum: LEFT SwingConstants.LEFT
=8= |