Package com.spinyowl.legui.component
Class CheckBox
java.lang.Object
com.spinyowl.legui.component.Component
com.spinyowl.legui.component.AbstractTextComponent
com.spinyowl.legui.component.CheckBox
- All Implemented Interfaces:
TextComponent,Serializable
An implementation of a check box -- an item that can be selected or deselected, and which
displays its state to the user.
- See Also:
-
Field Summary
FieldsFields inherited from class com.spinyowl.legui.component.AbstractTextComponent
textState -
Constructor Summary
ConstructorsConstructorDescriptionCheckBox()Default constructor which initialize checkbox with "CheckBox" text.CheckBox(float x, float y, float width, float height) Constructor with position and size parameters.Default constructor which initialize checkbox with specified text.Constructor with position and size parameters.Constructor with position and size parameters.CheckBox(org.joml.Vector2f position, org.joml.Vector2f size) Constructor with position and size parameters. -
Method Summary
Modifier and TypeMethodDescriptionvoidUsed to add checkbox change value event listener.booleanUsed to get all event listeners for checkbox change value event.Returns checkbox icon for selected state.Returns checkbox icon for non-selected state.inthashCode()booleanReturns true if checkbox is checked.voidUsed to remove event listener for checkbox change value event.voidsetChecked(boolean checked) Used to change checked state.voidsetIconChecked(Icon iconChecked) Used to set checkbox icon for selected state.voidsetIconUnchecked(Icon iconUnchecked) Used to set checkbox icon for non-selected state.toString()Methods inherited from class com.spinyowl.legui.component.AbstractTextComponent
getTextState, setTextStateMethods inherited from class com.spinyowl.legui.component.Component
add, add, addAll, clearChildComponents, containerIterator, contains, containsAll, count, forEach, getAbsolutePosition, getChildComponents, getFocusedStyle, getFrame, getHoveredStyle, getIntersector, getLayer, getListenerMap, getMetadata, getParent, getPosition, getPressedStyle, getSize, getStyle, getTabIndex, getTooltip, indexOfChild, intersects, isEmpty, isEnabled, isFocusable, isFocused, isHovered, isPressed, isTabFocusable, isVisible, keepRendering, keepRendering, parallelStream, remove, remove, removeAll, removeIf, setEnabled, setFocusable, setFocused, setHovered, setIntersector, setListenerMap, setParent, setPosition, setPosition, setPressed, setSize, setSize, setStyle, setTabFocusable, setTabIndex, setTooltip, stream
-
Field Details
-
DEFAULT_CHECK_BOX_TEXT
Default text for checkbox.- See Also:
-
-
Constructor Details
-
CheckBox
public CheckBox()Default constructor which initialize checkbox with "CheckBox" text. -
CheckBox
public CheckBox(float x, float y, float width, float height) Constructor with position and size parameters. Initialize checkbox with "CheckBox" text.- Parameters:
x- x position position in parent component.y- y position position in parent component.width- width of component.height- height of component.
-
CheckBox
public CheckBox(org.joml.Vector2f position, org.joml.Vector2f size) Constructor with position and size parameters. Initialize checkbox with "CheckBox" text.- Parameters:
position- position position in parent component.size- size of component.
-
CheckBox
Default constructor which initialize checkbox with specified text.- Parameters:
text- specified text for checkbox.
-
CheckBox
Constructor with position and size parameters. Initialize checkbox with "CheckBox" text.- Parameters:
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.
-
CheckBox
Constructor with position and size parameters. Initialize checkbox with "CheckBox" text.- Parameters:
text- specified text for checkbox.position- position position in parent component.size- size of component.
-
-
Method Details
-
getIconUnchecked
Returns checkbox icon for non-selected state.- Returns:
- checkbox icon for non-selected state.
-
setIconUnchecked
Used to set checkbox icon for non-selected state.- Parameters:
iconUnchecked- checkbox icon for non-selected state to set.
-
getIconChecked
Returns checkbox icon for selected state.- Returns:
- checkbox icon for selected state.
-
setIconChecked
Used to set checkbox icon for selected state.- Parameters:
iconChecked- checkbox icon for selected state to set.
-
isChecked
public boolean isChecked()Returns true if checkbox is checked.- Returns:
- true if checkbox is checked.
-
setChecked
public void setChecked(boolean checked) Used to change checked state.- Parameters:
checked- new checkbox state.
-
addCheckBoxChangeValueListener
Used to add checkbox change value event listener.- Parameters:
listener- listener to add.
-
getCheckBoxChangeValueEventListeners
Used to get all event listeners for checkbox change value event.- Returns:
- all event listeners for checkbox change value event.
-
removeCheckBoxChangeValueListener
Used to remove event listener for checkbox change value event.- Parameters:
listener- listener to remove.
-
equals
-
hashCode
public int hashCode() -
toString
-