Idea: How about introducing a JmeProperty annotation in the engine

@pspeed said: First, Savable is something else and has to do with serialization. Serialization has to avoid any java.beans.* dependencies, I think. My recollection is that android has no java.beans.* at all... I could be wrong.

I guessed so, therefore the BeanInfo classes should not be implemented in the runtime of the game but rather in the SDK plugins that accompany the game. Especially when providing information on property editors which should definetely not be part of the runtime.

As the generic approach offered by Introspector will not generate the required information as to which property editor to use, at least from my understanding and when looking at

http://www.docjar.com/html/api/com/sun/beans/finder/InstanceFinder.java.html

I still believe that the SDK Plugin Developer will have to provide custom implementations of the BeanInfo interface in order to provide the SDK with the required information.

@axnsoftware said: I guessed so, therefore the BeanInfo classes should not be implemented in the runtime of the game but rather in the SDK plugins that accompany the game.

Yes, in those rare cases where they would be required.

Can we take a step back for a moment and talk about the use-case you have in mind that wasn’t handled by default introspection?

@pspeed said: Yes, in those rare cases where they would be required.

Can we take a step back for a moment and talk about the use-case you have in mind that wasn’t handled by default introspection?

Well, my personal use case is as follows:

A custom control that has a field called behaviour, or even a list of behaviours.

Each of these behaviours would then have to be configured in the scene composer, unless provided via external resources such as configuration scripts and so on.

For this, I need a property editor that will allow me to select from a list of available behaviour classes so that I can add them to the list.

The behaviours themselves are Savables that have either none or multiple properties.

As such, the behaviour classes represent components and the control itself is a composite of these components.

And for each of these behaviour classes I need either a generic editor or a specialized editor, for example one that is able to select nodes from the currently edited scene and so on.

While the control itself is responsible for handling the events emitted by these behavioural components and thus for updating the presentation based on the state information purported by these events, the behavioural components would operate on the game model alone.

As I do not want to put that information into the code, I looked for a way of making this information editable via the scene composer as either user data or in form of savables such as controls. Therefore I require the SDK to support more property editors than what is currently available, and to also support different property editors for the same type in different contexts.

I still do not know whether BeanInfo will suffice for meeting my “different context, different property editor” requirement, but I guess that if I use it carefully, it may suffice. In the worst case, I will end up with random property editors if I define the BeanInfo classes ambiguously, e.g. having multiple BeanInfo classes for the same type but in different packages. I guess that I will have to use subclasses and dedicated BeanInfo classes in order to make this happen.

The proposed annotation, as I see now, will not be able to save me from this dilemma. But I guess that subclassing and specialized BeanInfo classes might do the trick.

nehon said: Actually we would have code in the engine that is only useful for the SDK and that's something we want to avoid absolutely.

Is this a bad time to bring up cloneForSpatial? :wink:

2 Likes