Package com.j3d.gen.properties
Class PropertiesUI
java.lang.Object
com.j3d.gen.properties.PropertiesUI
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static PropertyEntrybuildPanel(JPanel innerPanel) Builds aPropertyEntrypanel around an inner JPanel.private static <T extends HasProperties>
booleancommonPropertiesBool(Class<?> provider, Class<?> expected) Determines if a property provider class is considered common with an expected class.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.static <T extends HasProperties>
ArrayList<JPanel> Retrieves and merges properties from a list of objects that implementHasProperties.static <T extends HasProperties>
ArrayList<T> getFilteredObjects(HashSet<GObject> objects) Filters a list ofGObjects based on the currentselectionPropertiesFilter.private static JPanelgetSpecificPanel(ArrayList<Property<?, ?>> list) Returns a specific JPanel for displaying and editing properties of a given type.Merges a list of properties into a list of JPanels.private static <T extends HasProperties>
ArrayList<Property<?, ?>> switchFilter(ArrayList<T> objects) Filters properties based on theselectionPropertiesFilter.
-
Field Details
-
selectionPropertiesFilter
-
-
Constructor Details
-
PropertiesUI
public PropertiesUI()
-
-
Method Details
-
get
Retrieves and merges properties from a list of objects that implementHasProperties. The properties are filtered based on the currentselectionPropertiesFilter.- Type Parameters:
T- The type of objects, which must extendHasProperties.- Parameters:
objects- An ArrayList of objects implementingHasProperties.- Returns:
- An ArrayList of JPanels, each representing a merged property.
-
getFilteredObjects
Filters a list ofGObjects based on the currentselectionPropertiesFilter.- Type Parameters:
T- The type of objects to filter for, which must extendHasProperties.- Parameters:
objects- The ArrayList ofGObjects to filter.- Returns:
- A HashSet of filtered objects of type T.
-
getSpecificPanel
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 theselectionPropertiesFilter. -
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
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
Builds aPropertyEntrypanel around an inner JPanel.- Parameters:
innerPanel- The JPanel to be wrapped.- Returns:
- A
PropertyEntrycontaining the inner panel.
-