Package com.simsilica.lemur
Class DefaultCheckboxModel
java.lang.Object
com.simsilica.lemur.DefaultCheckboxModel
- All Implemented Interfaces:
CheckboxModel
,VersionedObject<Boolean>
- Direct Known Subclasses:
RollupPanel.OpenCheckboxModel
A default implementation of the CheckboxModel interface
that simply stores a boolean state and increments the version
when the state is changed.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreates a new VersionedReference that can be used to monitor when this object changes.Returns the object that is being versioned.long
Returns the current version of the versioned object.boolean
void
setChecked
(boolean state) toString()
-
Constructor Details
-
DefaultCheckboxModel
public DefaultCheckboxModel() -
DefaultCheckboxModel
public DefaultCheckboxModel(boolean initialState)
-
-
Method Details
-
setChecked
public void setChecked(boolean state) - Specified by:
setChecked
in interfaceCheckboxModel
-
isChecked
public boolean isChecked()- Specified by:
isChecked
in interfaceCheckboxModel
-
getVersion
public long getVersion()Description copied from interface:VersionedObject
Returns the current version of the versioned object.- Specified by:
getVersion
in interfaceVersionedObject<Boolean>
-
getObject
Description copied from interface:VersionedObject
Returns the object that is being versioned.- Specified by:
getObject
in interfaceVersionedObject<Boolean>
-
createReference
Description copied from interface:VersionedObject
Creates a new VersionedReference that can be used to monitor when this object changes.- Specified by:
createReference
in interfaceVersionedObject<Boolean>
-
toString
-