Icons | |
The following icons are stored because JToggleButton is only capable of keeping track of a single pressed icon, whereas we need two: one for when the button is selected, and one for when it is not. | |
Icon | pressedIcon |
The icon that should be used for this button when it is pressed, but not selected. | |
Icon | pressedSelectedIcon |
The icon that should be used for this button when it is both pressed and selected. | |
IconToggleButton (ImageIcon icon, ImageIcon selectedIcon) | |
Constructs an icon toggle button, initially unselected, with no action. | |
IconToggleButton (ImageIcon icon, ImageIcon pressedIcon, ImageIcon selectedIcon) | |
Constructs an icon toggle button, initially unselected, with no action. | |
IconToggleButton (ImageIcon icon, ImageIcon rolloverIcon, ImageIcon pressedIcon, ImageIcon selectedIcon) | |
Constructs an icon toggle button, initially unselected, with no action. | |
IconToggleButton (ImageIcon icon, ImageIcon rolloverIcon, ImageIcon pressedIcon, ImageIcon selectedIcon, ImageIcon selectedRolloverIcon, ImageIcon selectedPressedIcon) | |
Constructs an icon toggle button, initially unselected, with no action. | |
IconToggleButton (ImageIcon icon, ImageIcon rolloverIcon, ImageIcon pressedIcon, ImageIcon selectedIcon, ImageIcon selectedRolloverIcon, ImageIcon selectedPressedIcon, Action a) | |
Constructs an icon toggle button, initially unselected, with the given action. | |
IconToggleButton (ImageIcon icon) | |
Constructs an icon toggle button, initially unselected, with no action. | |
Dimension | getPreferredSize () |
Returns the preferred size of this button. | |
Icon | getPressedSelectedIcon () |
Returns the pressed selected icon for the button. | |
Icon | getPressedUnselectedIcon () |
Returns the pressed unselected icon for the button. | |
void | setPressedSelectedIcon (Icon pressedSelectedIcon) |
Sets the pressed selected icon for the button. | |
void | setPressedUnselectedIcon (Icon pressedIcon) |
Sets the pressed unselected icon for the button. | |
void | setSelectedToolTipText (String selectedToolTipText) |
Sets the text that should be shown on the tooltip for this button when it is selected. | |
void | setUnselectedToolTipText (String unselectedToolTipText) |
Sets the text that should be shown on the tooltip for this button when it is selected. | |
String | getSelectedToolTipText () |
Returns the text that will be shown on the tooltip for this button when it is selected. | |
String | getUnselectedToolTipText () |
Returns the text that will be shown on the tooltip for this button when it is not selected. | |
void | fireStateChanged () |
Fires the state changed event for this button. | |
void | setup (ImageIcon icon, ImageIcon rolloverIcon, ImageIcon pressedIcon, ImageIcon selectedIcon, ImageIcon rolloverSelectedIcon, ImageIcon pressedSelectedIcon) |
Sets up the visual appearance of this view. | |
Private Attributes | |
String | unselectedToolTipText |
The text that should be shown in the tooltip for this button when it is unselected. | |
String | selectedToolTipText |
The text that should be shown in the tooltip for this button when it is selected. |
edu.cmu.hcii.calo.view.IconToggleButton.IconToggleButton | ( | ImageIcon | icon, | |
ImageIcon | selectedIcon | |||
) |
Constructs an icon toggle button, initially unselected, with no action.
The button has a normal icon for its unselected state, and a normal icon for its selected state. The button will generate icons for its rollover and pressed icons using the unselected icon when unselected, and using its selected icon when selected.
icon | the icon to use when the button is not selected | |
selectedIcon | the icon to use when the button is selected |
edu.cmu.hcii.calo.view.IconToggleButton.IconToggleButton | ( | ImageIcon | icon, | |
ImageIcon | pressedIcon, | |||
ImageIcon | selectedIcon | |||
) |
Constructs an icon toggle button, initially unselected, with no action.
The button has a normal icon for its unselected state, a normal icon for its selected state, and a pressed icon that is used in either state. The button will generate mouseover states using its unselected icon when unselected, and its selected icon when selected.
icon | the icon to use when the button is not selected | |
selectedIcon | the icon to use when the button is selected | |
pressedIcon | the icon to use when the button is pressed and either selected or unselected |
edu.cmu.hcii.calo.view.IconToggleButton.IconToggleButton | ( | ImageIcon | icon, | |
ImageIcon | rolloverIcon, | |||
ImageIcon | pressedIcon, | |||
ImageIcon | selectedIcon | |||
) |
Constructs an icon toggle button, initially unselected, with no action.
The button has a normal, rollover, and pressed icon for its unselected state, and a normal icon for its selected state. The button will use the unselected state rollover and pressed icons even when in the selected state.
icon | the icon to use when the button is unselected | |
rolloverIcon | the icon to use when the button is in its mouseover state, whether selected or not | |
pressedIcon | the icon to use when the button is pressed, whether selected or not | |
selectedIcon | the icon to use when the button is selected |
edu.cmu.hcii.calo.view.IconToggleButton.IconToggleButton | ( | ImageIcon | icon, | |
ImageIcon | rolloverIcon, | |||
ImageIcon | pressedIcon, | |||
ImageIcon | selectedIcon, | |||
ImageIcon | selectedRolloverIcon, | |||
ImageIcon | selectedPressedIcon | |||
) |
Constructs an icon toggle button, initially unselected, with no action.
The button has a normal, rollover, and pressed icon for both of its states (selected and unselected).
null
for any of these arguments except icon
. The button will use the normal icon to intelligently generate states for any whose icons are null.icon | the normal icon | |
rolloverIcon | the mouseover icon, or null to automatically generate one | |
pressedIcon | the pressed icon, or null to automatically generate one | |
selectedIcon | the selected icon, or null to automatically generate one | |
selectedRolloverIcon | the selected mouseover icon, or null to automatically generate one | |
selectedPressedIcon | the selected pressed icon, or null to automatically generate one |
edu.cmu.hcii.calo.view.IconToggleButton.IconToggleButton | ( | ImageIcon | icon, | |
ImageIcon | rolloverIcon, | |||
ImageIcon | pressedIcon, | |||
ImageIcon | selectedIcon, | |||
ImageIcon | selectedRolloverIcon, | |||
ImageIcon | selectedPressedIcon, | |||
Action | a | |||
) |
Constructs an icon toggle button, initially unselected, with the given action.
The button has a normal, rollover, and pressed icon for both of its states (selected and unselected).
null
for any of the icon arguments except icon
. The button will use the normal icon to intelligently generate states for any whose icons are null.icon | the normal icon | |
rolloverIcon | the mouseover icon, or null to automatically generate one | |
pressedIcon | the pressed icon, or null to automatically generate one | |
selectedIcon | the selected icon, or null to automatically generate one | |
selectedRolloverIcon | the selected mouseover icon, or null to automatically generate one | |
selectedPressedIcon | the selected pressed icon, or null to automatically generate one | |
a | the Action to set |
edu.cmu.hcii.calo.view.IconToggleButton.IconToggleButton | ( | ImageIcon | icon | ) |
Constructs an icon toggle button, initially unselected, with no action.
The button has a normal icon for its unselected state. The button will generate icons for all other states using this icon.
icon | the icon to use when the button is not selected |
Dimension edu.cmu.hcii.calo.view.IconToggleButton.getPreferredSize | ( | ) |
Returns the preferred size of this button.
It is always the size of the icon, unless its preferred size has been explicitly set, in which case that value is returned instead.
Icon edu.cmu.hcii.calo.view.IconToggleButton.getPressedSelectedIcon | ( | ) |
Returns the pressed selected icon for the button.
Icon edu.cmu.hcii.calo.view.IconToggleButton.getPressedUnselectedIcon | ( | ) |
Returns the pressed unselected icon for the button.
Use this instead of AbstractButton.getPressedIcon() to ensure that you always get the unselected state (getPressedIcon() will return whichever icon corresponds to the current selection state of the button).
void edu.cmu.hcii.calo.view.IconToggleButton.setPressedSelectedIcon | ( | Icon | pressedSelectedIcon | ) |
Sets the pressed selected icon for the button.
pressedSelectedIcon | the pressed selected icon |
void edu.cmu.hcii.calo.view.IconToggleButton.setPressedUnselectedIcon | ( | Icon | pressedIcon | ) |
Sets the pressed unselected icon for the button.
Use this instead of AbstractButton.setPressedIcon() to avoid having your icon overwritten when the selected state changes.
pressedIcon | the pressed icon |
void edu.cmu.hcii.calo.view.IconToggleButton.setSelectedToolTipText | ( | String | selectedToolTipText | ) |
Sets the text that should be shown on the tooltip for this button when it is selected.
selectedToolTipText | the selected tooltip text |
void edu.cmu.hcii.calo.view.IconToggleButton.setUnselectedToolTipText | ( | String | unselectedToolTipText | ) |
Sets the text that should be shown on the tooltip for this button when it is selected.
unselectedToolTipText | the unselected tooltip text |
void edu.cmu.hcii.calo.view.IconToggleButton.fireStateChanged | ( | ) | [protected] |
Fires the state changed event for this button.
Overridden to also set the pressed icon and tooltip text correctly.
String edu.cmu.hcii.calo.view.IconToggleButton.getSelectedToolTipText | ( | ) |
Returns the text that will be shown on the tooltip for this button when it is selected.
String edu.cmu.hcii.calo.view.IconToggleButton.getUnselectedToolTipText | ( | ) |
Returns the text that will be shown on the tooltip for this button when it is not selected.
Use this instead of JComponent.getTooltipText() to ensure that you always get the unselected tooltip text (getTooltipText() will return the text of whatever tooltip would be shown if the mouse were to hover over the control right now).
void edu.cmu.hcii.calo.view.IconToggleButton.setup | ( | ImageIcon | icon, | |
ImageIcon | rolloverIcon, | |||
ImageIcon | pressedIcon, | |||
ImageIcon | selectedIcon, | |||
ImageIcon | rolloverSelectedIcon, | |||
ImageIcon | pressedSelectedIcon | |||
) | [private] |
Sets up the visual appearance of this view.
icon | the normal icon | |
rolloverIcon | the mouseover icon, or null to automatically generate one | |
pressedIcon | the pressed icon, or null to automatically generate one | |
selectedIcon | the selected icon, or null to automatically generate one | |
rolloverSelectedIcon | the selected mouseover icon, or null to automatically generate one | |
pressedSelectedIcon | the selected pressed icon, or null to automatically generate one |
String edu.cmu.hcii.calo.view.IconToggleButton.unselectedToolTipText [private] |
The text that should be shown in the tooltip for this button when it is unselected.
String edu.cmu.hcii.calo.view.IconToggleButton.selectedToolTipText [private] |
The text that should be shown in the tooltip for this button when it is selected.
Icon edu.cmu.hcii.calo.view.IconToggleButton.pressedIcon [private] |
The icon that should be used for this button when it is pressed, but not selected.
Icon edu.cmu.hcii.calo.view.IconToggleButton.pressedSelectedIcon [private] |
The icon that should be used for this button when it is both pressed and selected.