Class PropertySheetFactory

java.lang.Object
madkit.gui.PropertySheetFactory

public class PropertySheetFactory extends Object
This class is used to create a property sheet from an object's fields.

It uses the UIProperty annotation to specify which fields should be displayed.

It also uses the SliderProperty annotation to specify which fields should be displayed as sliders.

  • Method Details

    • getSheet

      public static PropertySheet getSheet(Object... objects)
      Get a parameters sheet made of the objects' properties annotated with UIProperty or SliderProperty annotations.
      Parameters:
      objects - the objects from which to take fields as properties to display in the sheet
      Returns:
      the property sheet containing the objects properties
    • getTitledPaneSheet

      public static TitledPane getTitledPaneSheet(String title, Object... objects)
      Returns a titled pane containing the objects' properties annotated with UIProperty or SliderProperty annotations.
      Parameters:
      title - the title of the titled pane
      objects - the objects from which to take fields as properties to display
      Returns:
      a titled pane containing the objects' properties, or null if the property sheet is empty
    • getTitledPaneSheet

      public static TitledPane getTitledPaneSheet(Object object)
      Returns a titled pane containing the object's properties annotated with UIProperty or SliderProperty annotations. The title is automatically set to the agent's name if the object is an agent, to the class's simple name if the object is a class, or to the object's string representation otherwise.
      Parameters:
      object - the object from which to take fields as properties to display
      Returns:
      a titled pane containing the object's properties
    • getVBoxProperties

      public static VBox getVBoxProperties(Object... objects)
      Get a VBox containing the object's parameters annotated with UIProperty or SliderProperty annotations.
      Parameters:
      objects - the objects from which to take fields as properties to display in the VBox
      Returns:
      a VBox containing the object's parameters