Class ModuleWrapperIJProperties

java.lang.Object
com.github.JianZhongBerkeley.moduleWrapperIJ.ModuleWrapperIJProperties

public class ModuleWrapperIJProperties extends Object
Class used to register properties of module, used for automatic value update from GUI and macro
Version:
1.0
Author:
jian zhong
  • Field Details

  • Constructor Details

    • ModuleWrapperIJProperties

      public ModuleWrapperIJProperties()
  • Method Details

    • addProperty

      public void addProperty(String name, int type, String cmdGUI, String cmdMacro, Object value)
      add property field to class
      Parameters:
      name - name of the property, different properties should have different names
      type - type of the property, it is defined by the PTYPE_* static value of this class
      cmdGUI - property label used for GUI input
      cmdMacro - property label used for macro input
      value - initial value of the property
    • containsProperty

      public boolean containsProperty(String name)
      check if class contains a specific property
      Parameters:
      name - name of the property to be checked
      Returns:
      boolean value indicates if property exists
    • rmProperty

      public void rmProperty(String name)
      remove a property
      Parameters:
      name - name of the property to be removed
    • getProperties

      public String[] getProperties()
      get the names for all the existing properties
      Returns:
      String array of the property names
    • getPropertyType

      public int getPropertyType(String name)
      get the type of a property
      Parameters:
      name - property name
      Returns:
      int value indicates the property value, which should be one of the public static PTYPE_* value
    • getPropertyCmdGUI

      public String getPropertyCmdGUI(String name)
      get the GUI label of a property
      Parameters:
      name - property name
      Returns:
      String of the GUI label
    • getPropertyCmdMacro

      public String getPropertyCmdMacro(String name)
      get the Macro label of a property
      Parameters:
      name - property name
      Returns:
      String of the Macro label
    • getPropertyValue

      public Object getPropertyValue(String name)
      get the value of a property
      Parameters:
      name - property name
      Returns:
      Object value of the property value, needs to casted to appropriate types
    • setPropertyValue

      public void setPropertyValue(String name, Object value)
      set the value of the property
      Parameters:
      name - property name
      value - new value of the property
    • getPropertyMode

      public int getPropertyMode(String name)
      get the mode of the property
      Parameters:
      name - name of the property
      Returns:
      int value indicates the mode of the property, it should be one of the public static PMODE_* value
    • setPropertyMode

      public void setPropertyMode(String name, int mode)
      set the mode of the property
      Parameters:
      name - name of the property
      mode - property mode, it should be one of the public static PMODE_* value
    • setPropertyChoices

      public void setPropertyChoices(String name, Object choices)
      set choices for a choice type properties
      Parameters:
      name - name of the property
      choices - choices of property
    • getPropertyChoices

      public Object getPropertyChoices(String name)
      get choices for a choice type properties
      Parameters:
      name - name of the property
      Returns:
      choices for the properties