public class ToggleButton extends Button
Constructor and Description |
---|
ToggleButton()
Creates toggle button with default bg color and default toggled bg color.
|
ToggleButton(float x,
float y,
float width,
float height)
Creates a button with specified position and size and default bg color and default toggled bg color.
|
ToggleButton(java.lang.String text)
Creates toggle button with default bg color, toggled bg color and specified text.
|
ToggleButton(java.lang.String text,
float x,
float y,
float width,
float height)
Creates a button with specified text and specified position and size.
|
ToggleButton(org.joml.Vector2f position,
org.joml.Vector2f size)
Creates a button with specified position and size and default bg color and default toggled bg color.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
org.joml.Vector4f |
getToggledBackgroundColor()
Returns background color which will be used as background color if button toggled.
|
Icon |
getTogglededBackgroundIcon()
Returns toggled background icon.
|
int |
hashCode() |
boolean |
isToggled()
Returns true if toggle button is toggled.
|
void |
setToggled(boolean toggled)
Used to change toggled state.
|
void |
setToggledBackgroundColor(org.joml.Vector4f toggledBackgroundColor)
Used to change background color which will be used as background color if button toggled.
|
void |
setTogglededBackgroundIcon(Icon togglededBackgroundIcon)
Used to change toggled background icon.
|
java.lang.String |
toString() |
getBackgroundIcon, getFocusedBackgroundIcon, getHoveredBackgroundIcon, getPressedBackgroundIcon, getTextState, setBackgroundIcon, setFocusedBackgroundIcon, setHoveredBackgroundIcon, setPressedBackgroundIcon
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 ToggleButton(java.lang.String text, float x, float y, float width, float height)
text
- button text.x
- x position in parent.y
- y position in parent.width
- width of component.height
- height of component.public ToggleButton()
public ToggleButton(java.lang.String text)
text
- button text.public ToggleButton(float x, float y, float width, float height)
x
- x position in parent.y
- y position in parent.width
- width of component.height
- height of component.public ToggleButton(org.joml.Vector2f position, org.joml.Vector2f size)
position
- position in parent.size
- size of component.public boolean isToggled()
public void setToggled(boolean toggled)
toggled
- new value.public org.joml.Vector4f getToggledBackgroundColor()
public void setToggledBackgroundColor(org.joml.Vector4f toggledBackgroundColor)
toggledBackgroundColor
- new value.public Icon getTogglededBackgroundIcon()
public void setTogglededBackgroundIcon(Icon togglededBackgroundIcon)
togglededBackgroundIcon
- toggled background icon.