Class UICheckButton
public class UICheckButton extends UIButton
{
// Constructors
public UICheckButton();
public UICheckButton(String name);
public UICheckButton(String name, int style);
public UICheckButton(IUIComponent comp);
public UICheckButton(IUIComponent comp, int style);
// Methods
public synchronized void addItemListener(IUIItemListener l);
public int getCheckImageSize();
public Insets getInsets();
public Dimension getMinimumSize();
public Dimension getPreferredSize();
public int getRoleCode();
public void paint(FxGraphics g);
public void paintCheck(FxGraphics g);
protected void processEvent(UIEvent e);
protected void processItemEvent(UIItemEvent e);
public synchronized void removeItemListener(IUIItemListener l);
public void setChecked(boolean on);
public void setCheckImageSize(int imageSize);
public void setHot(boolean on);
public void setID(int id);
public void setIndeterminate(boolean on);
public void setName(String name);
public void setPressed(boolean on);
public void setSelected(boolean on);
}
This class implements a check box button control. By default, UICheckButton uses the system-defined check box image.
For more information about buttons, see the UIButton overview.
Note The behavior of the action method is not identical to the behavior of AWT components. for more information, see the overview information in UIButton.
Note The hot-track color is the same color as the button text color. As a result, hot-tracking does not appear to be functional.
UIComponent
|
+--UIContainer
|
+--UIStateContainer
|
+--UISingleContainer
|
+--UIButton
|
+--UICheckButton
public UICheckButton();
Creates a check box button control with no content.
Remarks:
By default, the button's style is set to TOGGLE.
public UICheckButton(String name);
Creates a check box button control with the specified text.
Parameter | Description |
name
| The text to be displayed with the check box image.
|
Remarks:
By default, the button is hot-tracked and its style is set to TOGGLE. To create a button that is not hot-tracked, pass a UIText object instead of a String. For more information about hot-tracking, see the UIButton overview.
public UICheckButton(String name, int style);
Creates a check box button control with the specified text and style.
Parameter | Description |
name
| The text to be displayed with the check box image.
|
style
| The style of the button. Possible values include TOGGLE or TRITOGGLE.
|
Remarks:
By default, the button is hot-tracked. To create a button that is not hot-tracked, pass a UIText object instead of a String. For more information about hot-tracking, see the UIButton overview.
Exceptions:
IllegalArgumentException
if an undefined style was specified.
public UICheckButton(IUIComponent comp);
Creates a check box button control with the specified component.
Parameter | Description |
comp
| The component to be displayed with the check box image.
|
Remarks:
Typically, you'll pass a UIText, a UIGraphic, or a UIItem object for the component. By default, the button's style is set to TOGGLE. For examples of how to construct buttons, see the UIButton overview.
public UICheckButton(IUIComponent comp, int style);
Creates a check box button control with the specified component and style.
Parameter | Description |
comp
| The component to be displayed with the check box image.
|
style
| The style of the button. Possible values include TOGGLE or TRITOGGLE.
|
Remarks:
Typically, you'll pass a UIText, a UIGraphic, or a UIItem object for the component. For examples of constructing buttons, see the UIButton overview.
Exceptions:
IllegalArgumentException
if an undefined style was specified.
public synchronized void addItemListener(IUIItemListener l);
Adds the specified item listener. The listener receives all item events generated for the control. (Item events are generated when the state of an item changes.)
Return Value:
No return value.
Parameter | Description |
l
| The item listener to be added.
|
See Also: removeItemListener
public int getCheckImageSize();
Retrieves the square dimensions of the check box image that is associated with the button control.
Return Value:
Returns the square dimensions (in pixels) of the check box's image.
See Also: setCheckImageSize
public Insets getInsets();
Retrieves the button control's insets (in pixels), which identify the non-client area of the control.
Return Value:
Returns an Insets object that contains the control's insets.
Remarks:
The left inset value includes the size of the check box image plus two pixels for the space between the check box image and the content component.
public Dimension getMinimumSize();
Retrieves the minimum size of the check box button control. The minimum size specifies the smallest dimensions (in pixels) that will allow the button's content component and check box image to be displayed.
Return Value:
Returns a Dimension object containing the minimum size.
See Also: getPreferredSize
public Dimension getPreferredSize();
Retrieves the preferred size (in pixels) of the check box button control.
Return Value:
Returns a Dimension object containing the preferred size.
Remarks:
By default, this method returns the minimum size, as determined by getMinimumSize.
public int getRoleCode();
Retrieves the ROLE_SYSTEM code that best describes the role of the check box button.
Return Value:
Returns the ROLE_SYSTEM_CHECKBUTTON code.
public void paint(FxGraphics g);
Draws the check box button control.
Return Value:
No return value.
Parameter | Description |
g
| The graphics context.
|
Remarks:
This method draws the button's content component, and calls paintCheck to draw the check box image.
public void paintCheck(FxGraphics g);
Draws the check box image, according to the button control's current state.
Return Value:
No return value.
Parameter | Description |
g
| The graphics context.
|
Remarks:
This method is called by paint.
protected void processEvent(UIEvent e);
Processes the specified event.
Return Value:
No return value.
Parameter | Description |
e
| The event.
|
Remarks:
This method is automatically invoked if a listener has been registered through a call to addXXXListener. Depending on the type of event, processEvent calls one of the following methods.
When overriding processEvent, call the super event processEvent to ensure the default event processing continues normally.
Overrides:
processEvent(UIEvent) in UIButton.
protected void processItemEvent(UIItemEvent e);
Processes item events.
Return Value:
No return value.
Parameter | Description |
e
| The item event.
|
Remarks:
This method is called by processEvent and dispatches the event to a registered item listener. When overriding this method, call the super method processItemEvent to ensure the default event processing continues normally.
See Also: addItemListener
public synchronized void removeItemListener(IUIItemListener l);
Removes the specified item listener. The listener no longer receives the control's item events.
Return Value:
No return value.
Parameter | Description |
l
| The item listener to be removed.
|
See Also: addItemListener
public void setChecked(boolean on);
Sets or clears the checked state of the button.
Return Value:
No return value.
Parameter | Description |
on
| If true, the checked state is set; otherwise, it is cleared.
|
Remarks:
This method redraws the check box's image to display the new state. For more information about states, see the UIStateContainer overview.
See Also: getPreferredSize
public void setCheckImageSize(int imageSize);
Sets the square dimensions of the check box image that is associated with the button control.
Return Value:
No return value.
Parameter | Description |
imageSize
| The square dimensions (in pixels) of the check box's image.
|
Remarks:
This method provides the ability to control the size of the check box's or radio button's image.
See Also: getCheckImageSize
public void setHot(boolean on);
Sets or clears the hot-tracked state of the button.
Return Value:
No return value.
Parameter | Description |
on
| If true, the hot-tracked state is set; otherwise, it is cleared.
|
Remarks:
This method redraws the check box image to display the new state. For more information about states, see the UIStateContainer overview.
Overrides:
setHot(boolean) in UIButton.
public void setID(int id);
Sets the container's identifier.
Return Value:
No return value.
Parameter | Description |
id
| The value to be associated with the container.
|
See Also: setName
public void setIndeterminate(boolean on);
Sets or clears the indeterminate state of the button.
Return Value:
No return value.
Parameter | Description |
on
| If true, the indeterminate state is set; otherwise, it is cleared.
|
Remarks:
This method redraws the check box image to display the new state. For more information about states, see the UIStateContainer overview.
public void setName(String name);
Sets the container's name.
Return Value:
No return value.
Parameter | Description |
name
| The name to be associated with the container.
|
See Also: setID
public void setPressed(boolean on);
Sets or clears the pressed state of the button.
Return Value:
No return value.
Parameter | Description |
on
| If true, the pressed state is set; otherwise, it is cleared.
|
Remarks:
This method redraws the check box image to display the new state. For more information about states, see the UIStateContainer overview.
public void setSelected(boolean on);
Sets or clears the selected state of the button.
Return Value:
No return value.
Parameter | Description |
on
| If true, the selected state is set; otherwise, it is cleared.
|
Remarks:
For more information about states, see the UIStateContainer overview.