Nifty Editor-Devlog #3

Hi guys!
Sorry I’m bit in late but, as I said, I’m busy . In these days I’ve looked for implementing properties editing and nodes selection . I’ve reached a good state, the Navigator works correctly and you can already edit the properties , it needs only some further synchronization with the gui model but it’s almost done. Unfortunally selecting in the Visual tab needs more works and I should find sameway to synchronize the nodes there with the navigator ones. This is a bit hard since the gui to loading needs a nifty instance and it’s only available in the Visual tab level ,no in the dataObject one. Well I think something about that .

In the next days I’ll be even more busy but for the next devlog I should provide the new version to download and test.

Cris :slight_smile:

Hi,

I’ve read through what you descible your problem with the reference of Nifty unreachable in Netbean. If i can give an advice about it, well, I think you should consider your design again one more time carefully. I think you are not very familira with Netbean API yet.

I assume your did scan my code before and notice what i intend to do: with multiviews which instantiate Nifty at its openComponent moment. Now what i want it to make the Editor work with all the GUI libraries we have in JME community. So first thing is to let Nifty and other GUI service (Lemur, Tonegod … ) a Service of what we trying to provide to our user.

I let the Editor instance hold that View services.

Editor instance are not bound with Document’s TopComponent, it may bound with an persisted EditorTopComponent which can be a Toolbar of common actions just like what SceneComposer is.

Editor instance and later View references should be reachable by DataObject via Service locate, singleton, Netbean module locate (via Global lookup) or … AppState locate. Remember we are in an JME3Desktop app enviroment we can use that utilities too…

So what you should do is in the start up of your module is to register it with the global lookup, the EditorTopComponent lookup, or make it singleton, your choice.

When will the Gosc finish? I think we should corporate to make the General GUIEditor as i said above?

First of all thank you for your comment :slight_smile:

@atomix said: Hi,

I’ve read through what you descible your problem with the reference of Nifty unreachable in Netbean. If i can give an advice about it, well, I think you should consider your design again one more time carefully. I think you are not very familira with Netbean API yet.

Yes I’m not yet very familiar with Netbean api , I think it’s not so simple and also I don’t think it’s well documented , most of because the documentation it locates in different places and there’s also different version of it. About review my design I’m always open to suggestions :slight_smile: .

I assume your did scan my code before and notice what i intend to do: with multiviews which instantiate Nifty at its openComponent moment. Now what i want it to make the Editor work with all the GUI libraries we have in JME community. So first thing is to let Nifty and other GUI service (Lemur, Tonegod … ) a Service of what we trying to provide to our user.

Actually my implementation it’s a bit different , I used annotation to register multiviews elements and it made the integration so fast and clean that I don’t think I gonna change it so much. About make a “global” GUI editor I’m totally in! And register instance as a service it’s ok .

I let the Editor instance hold that View services.

Editor instance are not bound with Document’s TopComponent, it may bound with an persisted EditorTopComponent which can be a Toolbar of common actions just like what SceneComposer is.

Editor instance and later View references should be reachable by DataObject via Service locate, singleton, Netbean module locate (via Global lookup) or … AppState locate. Remember we are in an JME3Desktop app enviroment we can use that utilities too…

So what you should do is in the start up of your module is to register it with the global lookup, the EditorTopComponent lookup, or make it singleton, your choice.

When will the Gosc finish? I think we should corporate to make the General GUIEditor as i said above?

About the editor I’m gonna change a bit my class hierarchy to make do/undo support easier. This consists in to split the editor in commands and handle multi gui instance at model level. The model could be also more abstract to simple switch from Nifty /Tonegod /Lemur Gui tree making the editing really simple. We could also let the Netbeans do the rest , why bound the editor with the topcomponet when we can have different dataobject for each “gui type” ? I mean using different dataobject it implies different Multiview elements registration that will be switch automatically when the node file is selected. Each view will have the right Gui model as instance and can render it . What do you think about this approach ?

The Soc will end at 22 of August , I love the multieditor idea and I’m here to help as I can!

Cris :slight_smile:

I think a combined gui editor for multiple gui libs is a silly idea. I never saw such a thing and I don’t think its possible while keeping the development time reasonable.

@relucri
I may interprete your idea right: you want to convert your GModel to serveral Views at once. That’s in one tab is XML, beside is Nifty, other tab is Tonegod, … That’s what i also trying to do.

DataObject is a facade of Data, which in turn can be seen as Model in MVC (actually DCI). If you link your Data directly with a View (NiftyView or Nifty), you basicly not doing MVC the right way. There should be a Mediator called Controller somewhere, do you agree?
http://wiki.apidesign.org/wiki/DCI

DataObject linked with Nifty can also be seen as ViewModel, which is a special case of MVC but you lose a lot of control over this coupled things, its internal interactions, its event mechanism… Remember later you may want to intercept some basic Event for testing or to do wiring on Element.

[If you don’t know what Wiring mean] Did you ever use Matisse, the Netbean GUI editor, which is a standard of GUI tool in Java world. It has a feature: when you click a Button, a dialog open and ask for a control method, that kind of direct code and data inteprop is call wiring. Some GUI prototyping program also has this feature and other interaction declare in design time. I think you may later want this feature in NiftyEditor also [I can help of course :)].

Edit: If you talking about the connection between the DataObject->MimeType->TopComponent through XML declaration or annotations… I don’t see a solid link to Nifty instance yet. Remember you TopComponent can contain Nifty, Tonegod or other decided at its active moment. You may also notice that the MultiviewElement is actually a proxy for TopComponent which is actually a embed view with TopComponent as its parent.
http://bits.netbeans.org/dev/javadoc/org-netbeans-core-multiview/org/netbeans/core/spi/multiview/MultiViewElement.html

@normen said: I think a combined gui editor for multiple gui libs is a silly idea. I never saw such a thing and I don't think its possible while keeping the development time reasonable.

It’s not silly at all. And Java devs actually do it for years in enterprise system. I don’t want to talk big and unrealistic which out of gamedev purpose but that’s a fact. At least abstract out the concept of the GUI model and its editor will help @relucri to understand the DCI architecture of Netbean API more in his way to making the editor.

GUI libraries are quite similar to each other. OF COURSE, Making one interface for various implemented GUI libraries are quite imposible if there are too much internal constrainsts and conner case designs… But thank for the clean and popular of the specification of those libraries i want to support (Swing, SWT, HTML, Nifty, Tonegod…), I can map them with my model and use code generation to make Java or XML file. For the mean time, I just consider making a “base” - not a library to work with all the libs. The base it’s a bunch of classes generic enough to be copied to other Netbean module if need. So beside of just support NiftyGUI, I can also copy them to make Tonegod Editor for example.

The most important reason to have multi GUI libs is the different usages and requirement:
Nifty is quite inefficient enough for Android but good enough for desktop, has XML support which later can be translate to quite a bunch of other things (Swing, HTML, JavaFX…). Nifty can also put services for extension like JME3, LibGDX…

Tonegod is native to JME3 and has quite impressive performance which can work in both desktop, Android and later can become embed GUI to replace Swing components for editing enviroment.

What i want is to draw one GUI model, then the implemented code and XML, etc are generated for me. I can make it immediately work as ingame editor GUI in the SceneComposer for example. Unity for example rely in this feature a lot to expand their framework.

Hope you may see my point.

Imo the point of a GUI editor is to be able to edit the specifics of the GUI system in question. Thats why no IDE tries to shoehorn the JavaFX editor into a swing editor, they make a new editor for JavaFX GUIs. If you even plan to go through a separate definition file you give up that premise from the start and in turn bring all GUI systems and the “editability” down to the least common denominator. As an example, I think it would work no better than importing models from different file formats directly to your game. Of course you can do it and you get a mesh and maybe a texture but as soon as its about animation or any advanced features you get big issues.

If at all, different “personalities” for the editor would make more sense than trying to formulate a “generic” GUI format that can be output to different GUI systems, that would give at least a chance to highlight the single libraries features.

Anyway, my only stake in here is a good Nifty editor which I see floating away on the horizon when I hear about these plans. You can do whatever you like of course, I don’t want anyone to think I’m angry, agitated, confronting, antagonizing or insisting or even blame me in the end for whatever results come out of this or not.

@normen said: Imo the point of a GUI editor is to be able to edit the specifics of the GUI system in question. Thats why no IDE tries to shoehorn the JavaFX editor into a swing editor, they make a new editor for JavaFX GUIs. If you even plan to go through a separate definition file you give up that premise from the start and in turn bring all GUI systems and the "editability" down to the least common denominator. As an example, I think it would work no better than importing models from different file formats directly to your game. Of course you can do it and you get a mesh and maybe a texture but as soon as its about animation or any advanced features you get big issues.

If at all, different “personalities” for the editor would make more sense than trying to formulate a “generic” GUI format that can be output to different GUI systems, that would give at least a chance to highlight the single libraries features.

Anyway, my only stake in here is a good Nifty editor which I see floating away on the horizon when I hear about these plans. You can do whatever you like of course, I don’t want anyone to think I’m angry, agitated, confronting, antagonizing or insisting or even blame me in the end for whatever results come out of this or not.

Uhm… Is it just me or does that entire message completely contradict the last 2 lines? (Well, 1 line wrapped to 2)

@fabsterpal said: Uhm.. Is it just me or does that entire message completely contradict the last 2 lines? (Well, 1 line wrapped to 2)

Is it just me or did you just say “shut the fuck up no matter what your intentions are”?

@normen said: Is it just me or did you just say "shut the fuck up no matter what your intentions are"?

My point wasn’t about the specifics, I was pointing out that the message was pushy and antagonizing, and then you end it basically by saying that you aren’t trying to sound pushy and antagonizing.

@fabsterpal said: My point wasn't about the specifics, I was pointing out that the message was pushy and antagonizing, and then you end it basically by saying that you aren't trying to sound pushy and antagonizing.

Yeah, and you’re a reptilian shapeshifter. “What say ye? Does it have an excuse too?” I bet you will say you’re not, like all shapeshifters do.

@normen said: Yeah, and you're a reptilian shapeshifter. "What say ye? Does it have an excuse too?" I bet you will say you're not, like all shapeshifters do.

I’ll come back when your head is out of your ass.

Sometimes in life we can choose to do one thing or we can choose to do another totally different thing.

For example, some people start out writing games but then spend years writing frameworks instead because they forgot to write a game in the mean time.

In this case, someone wants to write a GUI editor for nifty. Writing a GUI Editor for “all kinds of GUIs ever” is a multiyear project and is counter productive to writing a Nifty editor.

…this is why we don’t really see any of these editors already. Even writing a Swing editor is hard enough on its own. I don’t see any editors that let you do swing and SWT at the same time.

Every GUI library is going to have its own quirks and idioms and if you ignore those to generalize then you ruin half of the reason to have an editor in the first place: to help those unfamiliar work around the quirks until they learn them.

As a writer of a GUI library, personally I wouldn’t even want Lemur to be saddled with the same approaches as some other GUI library… nor would I want those libraries saddled with any of my approaches.

It’s the same reason we don’t have a universal 3D editor that can simultaneously and fluidly work with all formats: Max, Maya, Lightwave, Blender, etc… Every app has a unique way of looking at things and it’s own special set of features.

Hey,

“I WANT TO MAKE AN UNIVERSAL EDITOR FOR ALL THE GUI FORMAT IN JAVA WORLD”
is not i intend to do.

I did said
I will use code generation to have a portion or migrate from one GUI to another. An interface to connect with Actions and interactivities. And it’s also what GUI PROTYPING is about.

Don’t morph my words into the captilized line above which I also consider nonsense my self.

For the timebeing I also write games!!! But I also want to have others to write them with tools… The generic classes you are talking about and imply is big and wasteful is less then 10k lines of codes. Because I just care about the similarity but not the differences.

I also consider this a advice to focus to the main features, so @recluri , you should clean up and abstract out enough in the mean time to focus in working feature for the SDK instead. I will still go my way :))

Yep, just to remove all the worries , the Nifty-Editor is not in danger. The Soc goals will be reached anyway and I won’t spend all the time taking in mind what is in common for the other Gui frameworks. What I’ll do is to follow a bit the atomix’s advice and try to make the desing of my model a little better , that’s also make the implementation of interact and effects easier. After that we could again discuss what it’s worth to do with other framework since I see that the Tonegod and Lemur users are increasing time by time.

I hope I have clarified a bit , thanks for all the inputs! It’s what I like the most about SOC experience :slight_smile: