Search in sources :

Example 1 with PropertyInfoList

use of maspack.properties.PropertyInfoList in project artisynth_core by artisynth.

the class ComponentPropertyField method updatePropertySelector.

protected void updatePropertySelector() {
    // mask value change listeners since othewise the
    // property selector will fire one to announce the new
    // value we already know about ...
    myPropertySelector.maskValueChangeListeners(true);
    HasProperties host = getHost();
    if (myLastSelectorHost != host) {
        if (host != null) {
            PropertyInfoList list = host.getAllPropertyInfo();
            LinkedList<String> nameList = new LinkedList<String>();
            nameList.add(nullString);
            for (PropertyInfo info : list) {
                // need to prune
                if (myNumericOnly && !isNumeric(info)) {
                    continue;
                }
                if (myWidgetableOnly && !PropertyWidget.canCreate(info)) {
                    continue;
                }
                nameList.add(info.getName());
            }
            myPropertySelector.setSelections(nameList.toArray(new String[0]), nullString);
        } else {
            myPropertySelector.setSelections(new String[] { nullString }, nullString);
        }
        myLastSelectorHost = host;
    }
    myPropertySelector.setValue(getLeafPropName());
    myPropertySelector.maskValueChangeListeners(false);
}
Also used : PropertyInfoList(maspack.properties.PropertyInfoList) HasProperties(maspack.properties.HasProperties) PropertyInfo(maspack.properties.PropertyInfo) LinkedList(java.util.LinkedList)

Aggregations

LinkedList (java.util.LinkedList)1 HasProperties (maspack.properties.HasProperties)1 PropertyInfo (maspack.properties.PropertyInfo)1 PropertyInfoList (maspack.properties.PropertyInfoList)1