-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathRadioButtonIcon.java
More file actions
58 lines (54 loc) · 2.03 KB
/
RadioButtonIcon.java
File metadata and controls
58 lines (54 loc) · 2.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/**
* @(#)RadioButtonIcon.java 1.0 03/18/09
*/
package darrylbu.renderer;
import javax.swing.Icon;
import javax.swing.JRadioButton;
import javax.swing.UIManager;
public class RadioButtonIcon extends ToggleButtonIcon {
/**
* Creates a <CODE>RadioButtonIcon</CODE> for a JRadioButton with the
* horizontal and vertical positioning derived from the horizontal and
* vertical positions of the radio button's text relative to its icon.
*
* @param radioButton the radio button
* @param customIcon the icon
*/
public RadioButtonIcon(JRadioButton radioButton, Icon customIcon) {
this(radioButton, customIcon,
ToggleButtonIcon.getHorizontalPosition(radioButton),
radioButton.getVerticalTextPosition());
}
/**
* Creates a <CODE>RadioButtonIcon</CODE> for a JRadioButton with the
* specified horizontal and vertical positioning.
*
* @param radioButton the radio button
* @param customIcon the icon
* @param horizontalPosition the horizontal position of the custom icon
* relative to the default icon. 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>
* LEADING and TRAILING will be interpreted in the context of the radio
* button's ComponentOrientation.
* <P>
* @param verticalPosition the vertical position of the custom icon
* relative to the default icon
* One of the following values:
* <ul>
* <li>{@code SwingConstants.CENTER}
* <li>{@code SwingConstants.TOP}
* <li>{@code SwingConstants.BOTTOM}
* </ul>
*/
public RadioButtonIcon(JRadioButton radioButton, Icon customIcon,
int horizontalPosition, int verticalPosition) {
super(radioButton, customIcon, UIManager.getIcon("RadioButton.icon"),
horizontalPosition, verticalPosition);
}
}