Package net.mcreator.preferences.entries
Class IntegerEntry
-
Field Summary
FieldsFields inherited from class net.mcreator.preferences.PreferencesEntry
value -
Constructor Summary
ConstructorsConstructorDescriptionIntegerEntry(String id, int value) IntegerEntry(String id, int value, int min, int max) -
Method Summary
Modifier and TypeMethodDescriptiongetComponent(Window parent, Consumer<EventObject> fct) Generate aJComponentfor thePreferencesDialog, so users can change the value.com.google.gson.JsonElementvoidsetValueFromComponent(JComponent component) voidsetValueFromJsonElement(com.google.gson.JsonElement object) Methods inherited from class net.mcreator.preferences.PreferencesEntry
get, getID, getSection, getSectionKey, reset, set, toString
-
Field Details
-
min
protected final transient int min -
max
protected final transient int max
-
-
Constructor Details
-
IntegerEntry
-
IntegerEntry
-
-
Method Details
-
getComponent
Description copied from class:PreferencesEntryGenerate a
JComponentfor thePreferencesDialog, so users can change the value.- Specified by:
getComponentin classPreferencesEntry<Integer>- Parameters:
parent-The component's parent, which is the opened
PreferencesDialog.fct-This is the
Consumerused to enable the apply button when the value of theJComponentis changed.- Returns:
The
JComponentto use inside thePreferencesDialogfor all preference entries using the same type.
-
setValueFromComponent
- Specified by:
setValueFromComponentin classPreferencesEntry<Integer>
-
setValueFromJsonElement
public void setValueFromJsonElement(com.google.gson.JsonElement object) - Specified by:
setValueFromJsonElementin classPreferencesEntry<Integer>
-
getSerializedValue
public com.google.gson.JsonElement getSerializedValue()- Specified by:
getSerializedValuein classPreferencesEntry<Integer>
-