Class PropertiesUI

java.lang.Object
com.j3d.gen.properties.PropertiesUI

public class PropertiesUI extends Object
  • Field Details

  • Constructor Details

    • PropertiesUI

      public PropertiesUI()
  • Method Details

    • get

      public static <T extends HasProperties> ArrayList<JPanel> get(ArrayList<T> objects)
      Retrieves and merges properties from a list of objects that implement HasProperties. The properties are filtered based on the current selectionPropertiesFilter.
      Type Parameters:
      T - The type of objects, which must extend HasProperties.
      Parameters:
      objects - An ArrayList of objects implementing HasProperties.
      Returns:
      An ArrayList of JPanels, each representing a merged property.
    • getFilteredObjects

      public static <T extends HasProperties> ArrayList<T> getFilteredObjects(HashSet<GObject> objects)
      Filters a list of GObjects based on the current selectionPropertiesFilter.
      Type Parameters:
      T - The type of objects to filter for, which must extend HasProperties.
      Parameters:
      objects - The ArrayList of GObjects to filter.
      Returns:
      A HashSet of filtered objects of type T.
    • getSpecificPanel

      private static JPanel getSpecificPanel(ArrayList<Property<?,?>> list) throws Exception
      Returns a specific JPanel for displaying and editing properties of a given type.
      Parameters:
      list - An ArrayList of Property objects of the same type.
      Returns:
      A JPanel tailored to the property type.
      Throws:
      Exception - If no specific panel is found for the given property type.
    • switchFilter

      private static <T extends HasProperties> ArrayList<Property<?,?>> switchFilter(ArrayList<T> objects)
      Filters properties based on the selectionPropertiesFilter.
    • filterCommonProperties

      private static <T extends HasProperties> ArrayList<Property<?,?>> filterCommonProperties(ArrayList<T> objects, Class<?> clazz)
      Filters properties from a list of objects, keeping only those that are common to the specified class.
      Parameters:
      objects - The list of objects to filter properties from.
      clazz - The class to filter properties by.
      Returns:
      An ArrayList of common properties.
    • commonPropertiesBool

      private static <T extends HasProperties> boolean commonPropertiesBool(Class<?> provider, Class<?> expected)
      Determines if a property provider class is considered common with an expected class.
      Parameters:
      provider - The class that provides the property.
      expected - The expected class for common properties.
      Returns:
      True if the provider is considered common, false otherwise.
    • merge

      private static ArrayList<JPanel> merge(ArrayList<Property<?,?>> properties)
      Merges a list of properties into a list of JPanels. Properties with the same key are grouped together.
      Parameters:
      properties - The ArrayList of properties to merge.
      Returns:
      An ArrayList of JPanels, each representing a merged property.
    • buildPanel

      private static PropertyEntry buildPanel(JPanel innerPanel)
      Builds a PropertyEntry panel around an inner JPanel.
      Parameters:
      innerPanel - The JPanel to be wrapped.
      Returns:
      A PropertyEntry containing the inner panel.