public class CheckBox extends Component implements TextComponent
Constructor and Description |
---|
CheckBox()
Default constructor which initialize checkbox with "CheckBox" text.
|
CheckBox(float x,
float y,
float width,
float height)
Constructor with position and size parameters.
|
CheckBox(java.lang.String text)
Default constructor which initialize checkbox with specified text.
|
CheckBox(java.lang.String text,
float x,
float y,
float width,
float height)
Constructor with position and size parameters.
|
CheckBox(java.lang.String text,
org.joml.Vector2f position,
org.joml.Vector2f size)
Constructor with position and size parameters.
|
CheckBox(org.joml.Vector2f position,
org.joml.Vector2f size)
Constructor with position and size parameters.
|
Modifier and Type | Method and Description |
---|---|
void |
addCheckBoxChangeValueListener(EventListener<CheckBoxChangeValueEvent> listener)
Used to add checkbox change value event listener.
|
boolean |
equals(java.lang.Object o) |
java.util.List<EventListener<CheckBoxChangeValueEvent>> |
getCheckBoxChangeValueEventListeners()
Used to get all event listeners for checkbox change value event.
|
Icon |
getIconChecked()
Returns checkbox icon for selected state.
|
Icon |
getIconUnchecked()
Returns checkbox icon for non-selected state.
|
TextState |
getTextState()
Returns current text state.
|
int |
hashCode() |
boolean |
isChecked()
Returns true if checkbox is checked.
|
void |
removeCheckBoxChangeValueListener(EventListener<CheckBoxChangeValueEvent> listener)
Used to remove event listener for checkbox change value event.
|
void |
setChecked(boolean checked)
Used to change checked state.
|
void |
setIconChecked(Icon iconChecked)
Used to set checkbox icon for selected state.
|
void |
setIconUnchecked(Icon iconUnchecked)
Used to set checkbox icon for non-selected state.
|
java.lang.String |
toString() |
add, addAll, clearChilds, containerIterator, contains, containsAll, count, forEach, getAbsolutePosition, getBackgroundColor, getBorder, getChilds, getCornerRadius, getFocusedStrokeColor, getIntersector, getListenerMap, getMetadata, getParent, getPosition, getSize, getTooltip, intersects, isEmpty, isEnabled, isFocused, isHovered, isPressed, isVisible, parallelStream, remove, removeAll, removeIf, setBackgroundColor, setBackgroundColor, setBorder, setCornerRadius, setEnabled, setFocused, setFocusedStrokeColor, setFocusedStrokeColor, setHovered, setIntersector, setListenerMap, setParent, setPosition, setPosition, setPressed, setSize, setSize, setTooltip, setVisible, stream
public CheckBox()
public CheckBox(float x, float y, float width, float height)
x
- x position position in parent component.y
- y position position in parent component.width
- width of component.height
- height of component.public CheckBox(org.joml.Vector2f position, org.joml.Vector2f size)
position
- position position in parent component.size
- size of component.public CheckBox(java.lang.String text)
text
- specified text for checkbox.public CheckBox(java.lang.String text, float x, float y, float width, float height)
text
- specified text for checkbox.x
- x position position in parent component.y
- y position position in parent component.width
- width of component.height
- height of component.public CheckBox(java.lang.String text, org.joml.Vector2f position, org.joml.Vector2f size)
text
- specified text for checkbox.position
- position position in parent component.size
- size of component.public Icon getIconUnchecked()
public void setIconUnchecked(Icon iconUnchecked)
iconUnchecked
- checkbox icon for non-selected state to set.public Icon getIconChecked()
public void setIconChecked(Icon iconChecked)
iconChecked
- checkbox icon for selected state to set.public TextState getTextState()
getTextState
in interface TextComponent
public boolean isChecked()
public void setChecked(boolean checked)
checked
- new checkbox state.public void addCheckBoxChangeValueListener(EventListener<CheckBoxChangeValueEvent> listener)
listener
- listener to add.public java.util.List<EventListener<CheckBoxChangeValueEvent>> getCheckBoxChangeValueEventListeners()
public void removeCheckBoxChangeValueListener(EventListener<CheckBoxChangeValueEvent> listener)