Class PropertyData.IntegerType

java.lang.Object
net.mcreator.ui.minecraft.states.PropertyData<Integer>
net.mcreator.ui.minecraft.states.PropertyData.IntegerType
Enclosing class:
PropertyData<T>

public static class PropertyData.IntegerType extends PropertyData<Integer>
A subclass for integer number type properties.
  • Constructor Details

    • IntegerType

      public IntegerType(String name)
    • IntegerType

      public IntegerType(String name, int min, int max)
  • Method Details

    • getMin

      public int getMin()
    • getMax

      public int getMax()
    • getDefaultValue

      @Nonnull public Integer getDefaultValue()
      Description copied from class: PropertyData
      Provides the default value of type of this property. This is the "null" value of this type, which means it may be outside value limits defined for a particular property.
      Specified by:
      getDefaultValue in class PropertyData<Integer>
      Returns:
      A default value of this property's type.
    • toString

      public final String toString(Object value)
      Description copied from class: PropertyData
      Converts passed value of this property to its string representation.
      Specified by:
      toString in class PropertyData<Integer>
      Parameters:
      value - A value of this property's type.
      Returns:
      Possible value of this property as a string.
    • parseObj

      public final Integer parseObj(com.google.gson.JsonElement value)
      Description copied from class: PropertyData
      Parses string representation of passed value of this property.
      Specified by:
      parseObj in class PropertyData<Integer>
      Parameters:
      value - Possible value of this property as JsonElement.
      Returns:
      A value of this property's type.
    • getComponent

      public JComponent getComponent(MCreator mcreator, @Nullable Object value)
      Description copied from class: PropertyData
      Generates a UI component accepting values of type PropertyData and sets its value to the passed one.
      Specified by:
      getComponent in class PropertyData<Integer>
      Parameters:
      mcreator - The future parent window of the component returned.
      value - Possible value of this property.
      Returns:
      A UI component that accepts values of type PropertyData.
    • getValue

      public Integer getValue(JComponent component)
      Description copied from class: PropertyData
      Extracts possible value of this property from the provided UI component.
      Specified by:
      getValue in class PropertyData<Integer>
      Parameters:
      component - A UI component that accepts values of type PropertyData.
      Returns:
      A value of this property's type.