SceneComposer: Custom Control's properties wrongly initialized in Property Panel

Why the Enabled property from AbstractControl is not available in Panel Properties ?

[java]
public abstract class AbstractControl implements Control {

protected boolean enabled = true;

//…

public void setEnabled(boolean enabled) {
    this.enabled = enabled;
}

public boolean isEnabled() {
    return enabled;
}

[/java]

No idea.

Edit: Looks like the utility doesn’t consider the “isXXX” format for boolean properties:
https://github.com/jMonkeyEngine/jmonkeyengine/blob/master/sdk/jme3-core/src/com/jme3/gde/core/util/PropertyUtils.java

I tried to add getEnabled in a control (sub class of AbstractControl) without success (no Enabled property in Panel)

[java]

public boolean getEnabled() {
return enabled;
}
[/java]

Thanks for your help.

Fixed the recognition of “is” getters in git:

OT:

Where Can I find updated info about contribution to github’ SDK :

  • dev env setup : netbeans version, or use of the downloaded (no gradle support), settings files,…)
  • PR process

The file CONTRIBUTION.md (on github) and the site seems partial or outdated.

This is the aggregation of most info on this topic: https://wiki.jmonkeyengine.org/legacy/doku.php#contribute

Currently the SDK in git is developed against NetBeans 8.0 but should work with 7.3 as well I think. You basically just need to checkout, compile the base gradle project once and then open the SDK folder like any NetBeans platform project.

It was what I did, but The gradle plugin for nb 8.0 failed to activate, now work fine (after uninstall +install).

@david.bernard.31 said: It was what I did, but The gradle plugin for nb 8.0 failed to activate, now work fine (after uninstall +install).

Yeah, the gradle plugin still has some quirks here and there, it basically works fine though. We hope to use it for future gradle based SDK projects but its yet to be decided if that happens in the big 3.1 update or not.

About Enabled property not listed, the issue is also in :

[java]
public class JmeGenericControl extends AbstractNode implements ScenePropertyChangeListener {

protected void createFields(Class c, Sheet.Set set, Object obj) throws SecurityException {
    for (Field field : c.getDeclaredFields()) {
        PropertyDescriptor prop = PropertyUtils.getPropertyDescriptor(c, field);
        if (prop != null) {
            set.put(makeProperty(obj, prop.getPropertyType(), prop.getReadMethod().getName(), prop.getWriteMethod().getName(), prop.getDisplayName()));
        }
    }
}

[/java]

getDeclaredFields ignore superclass field. Can I can submit PR for change (use getFields and ignore “Spatial”, may be support public attribute, and fix my original issue about initial value) ?

@david.bernard.31 said: About Enabled property not listed, the issue is also in :

[java]
public class JmeGenericControl extends AbstractNode implements ScenePropertyChangeListener {

protected void createFields(Class c, Sheet.Set set, Object obj) throws SecurityException {
    for (Field field : c.getDeclaredFields()) {
        PropertyDescriptor prop = PropertyUtils.getPropertyDescriptor(c, field);
        if (prop != null) {
            set.put(makeProperty(obj, prop.getPropertyType(), prop.getReadMethod().getName(), prop.getWriteMethod().getName(), prop.getDisplayName()));
        }
    }
}

[/java]

getDeclaredFields ignore superclass field. Can I can submit PR for change (use getFields and ignore “Spatial”, may be support public attribute, and fix my original issue about initial value) ?

It should actually get the superclass fields in a different set like the manually wrapped Nodes.