Record Class WidgetState
java.lang.Object
java.lang.Record
dev.boze.api.gui.kit.WidgetState
- Record Components:
key- Identity of the piece that stays the same from frame to frame, for animating it (for example withSpring), or nullhovered- The mouse is over itpressed- It is hovered while the left mouse button is heldfocused- It takes typing, or is being editedselected- It is the current choice, such as the open tab or the chosen rowdisabled- It cannot be used right now
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionWidgetState(Object key, boolean hovered, boolean pressed, boolean focused, boolean selected, boolean disabled) Creates an instance of aWidgetStaterecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleandisabled()Returns the value of thedisabledrecord component.final booleanIndicates whether some other object is "equal to" this one.booleanfocused()Returns the value of thefocusedrecord component.final inthashCode()Returns a hash code value for this object.booleanhovered()Returns the value of thehoveredrecord component.key()Returns the value of thekeyrecord component.booleanpressed()Returns the value of thepressedrecord component.booleanselected()Returns the value of theselectedrecord component.final StringtoString()Returns a string representation of this record class.withDisabled(boolean disabled) withFocused(boolean focused) withSelected(boolean selected)
-
Field Details
-
IDLE
A piece nothing is happening to.
-
-
Constructor Details
-
WidgetState
public WidgetState(Object key, boolean hovered, boolean pressed, boolean focused, boolean selected, boolean disabled) Creates an instance of aWidgetStaterecord class.- Parameters:
key- the value for thekeyrecord componenthovered- the value for thehoveredrecord componentpressed- the value for thepressedrecord componentfocused- the value for thefocusedrecord componentselected- the value for theselectedrecord componentdisabled- the value for thedisabledrecord component
-
-
Method Details
-
withFocused
-
withSelected
-
withDisabled
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
key
-
hovered
-
pressed
-
focused
-
selected
-
disabled
-