Package com.j3d.gen.properties
This is a FloatingPanel meaning it's UI lives within com.j3d.ui.engine.floating.properties
Properties
"properties" are defined by any GObject., Thing
or Layer.
They are different from fields as they are not used by code and are purely a way for the user to "see" a
object's internal property and possibly edit it. The object itself defines what is a property within its constructor
how the UI can access said property and any other semantics for property intersection logic.
Properties themselves aren't difficult, in that they can just be thought of as a user-friendly accessor to
whatever the object defines the property as. However, for a something like GObject which
has concrete extendors, e.g. GTri, those extendors may inherit properties
from the base class and add extra properties special to this child class. (See Property and
PropertyKey)
Unlike other stuff within com.j3d.gen, the generated property panels don't persist and are always regenerated
when the user makes a new selection. The Property instance may be the exact same
that the object instance defines, but the panel itself might now hold a single property, then later multiple
as the user's selection grows.
Classes
-
HasProperties, an interfaces which allows an object's instance to have properties associated with it. These generally need to be objects that the user cna interact with and not some random class -
Property, represents a singular property definition. With the following:-
Property.getName(): The label for the property -
Property.setDescription(java.lang.String): The description of this property to show to the user. -
Property.getValueSupplier(): The supplier which fetches the current value of the field -
Property.isConstant(): Whether this property should only be a view and cannot be changed -
Property.getPropertyProvider(): The provider class of this property. Used when multiple objects have been selected and only properties of the same property provider get shown. -
Property.holds(java.lang.Class): The type the property holds. This is exactly identical to the types that the Command Parser can intake. (SeeCommandParser)
com.j3d.ui.engine.floating.properties.panels -
-
PropertyKey, a record that encapsulates the identifying characteristics of aProperty. This is primarily used for comparing properties across multiple selected objects to determine which properties are common and can be displayed/edited together. (SeePropertyKeyfor#equalsand#hashCodesemantics) -
SelectionPropertiesFilter, an enum representing the options for a combo box with options such as to allow the user to target the properties of a specific object. e.g. instead of targetingSelectionPropertiesFilter.DEFAULTwhich tries to finder all common properties fromGObjects, it can be changed to target only specificallySelectionPropertiesFilter.TRIand likewise. -
PropertiesUI, the main class that orchestrates the generation and display of property panels for selected objects.This class handles:
- Collecting all properties based on the filter
- Merging similar properties into a singular panel that can be bulk edited
- Finding the correct panel subclass that correctly identifies this property
- Displaying this property.
-
ClassDescriptionAn interface for objects that have a collection of properties.Property<T,
G extends HasProperties> Defines a singular property of some object which implementsHasProperties.PropertyKey<T,G> Represents a key for a property, defining its name, description, expected type, the class that provides the property, and whether it's a constant.