Example spag work in progress

here is a simple interface for a basic chat client. it’s no where near done and there is not a backend client-server engine. it’s a bit buggy, but if you want to know how to get started with spag, it is decent.



http://mypage.iu.edu/~natjohns/examples/najchat-0.1.zip



stuff that is working:

  • you can drag the windows all over
  • click the buttons
  • type in the textfields
  • it does look like it is working because the buttons do cause side effects to the other widgets in the system
  • etc.



    you will need ant if you want to run it out of the box… then just unzip, go to the command where you unzipped and type ‘ant’ (no quotes) to run it



    the only source that you need to look at to figure out how to use spag is in the src/naj/ChatClient.java file… its not as pretty as i would like, but it is pretty simple :slight_smile:



    let me know if you have any problems or questions (this is a windows build only, as far as the lwjgl dll files provided)



    note: it is not jme-i-fied yet, but i will do that and post updates at some point :slight_smile:

Very nice layout :slight_smile:



My next task on my JMEtestapp is to get the scrollbars working - so you’ve geven me a bit of a start. From what I can tell, very roughly, I need to put the scrollbars on a panel with a textarea & then put the panel on the window - bit like awt I suppose.



I’ll send you my code when I do.







Have you worked out how to change the look/feel?

Cool, :stuck_out_tongue: worked first time. Would be great if it can be integrated into jme.

tomcat

"tomcat" wrote:
Cool, :P worked first time. Would be great if it can be integrated into jme.
tomcat

i am just not that familiar with jme yet... i plan to enlighten myself, and then start playing with a jme/spag combination-rewrite... it really needs to be rewritten, unless 2.0 comes along real fast and is awesome, to fit into the jme scenegraph to really work well in jme... sure it is doable as is, if you only want lwjgl support, but it will be very cool after the rewrite :)

so if there are any suggestions on making it easier to write interfaces, shoot em out
"Big_Bluey" wrote:
My next task on my JMEtestapp is to get the scrollbars working - so you've geven me a bit of a start. From what I can tell, very roughly, I need to put the scrollbars on a panel with a textarea & then put the panel on the window - bit like awt I suppose.

yeah, my scrollpane works that way... add textarea to scrollpane to chatwindow... the problem is if you keep on posting messages, they run out of the scrollable area... you can grab the scrollbars and drag though, just need to figure how to make it scroll up when there are too many messages to show at one time... but i have to say the hotspot of the mouse cursor needs fixed too... you have to click around the knobs until you see it light up to get ahold of it right :D

"Big_Bluey" wrote:
Have you worked out how to change the look/feel?
if you mean change the scrolly background, then yes (just override the renderXXX() methods of the Window you want to change), but other than that, no :). also, fonts and buttons and stuff would be done with resources. what kind of stuff would you want?

At the moment I was just thinking of a completely different look to alien flux & perhaps having a default/set look for JME which had all the images, fonts, etc already done for anyone wanting to use the engine GUI.



After I’ve experimented with the widgets I want to see how much I can change the look with resources without changing the source. Creation of the pngs princec left in sourceforge/cvs is the place I think I would start at. I’ve just had a look at the images in Photoshop while I was typing this - they are all transparent images, the checkboxes seems to be with the radiobuttons - I assume the imageconverter must read them all from this layout/format (with no scaling) for the widgets.



I suppose I’ve partly answered my own question now.



Anyway hope it gives an idea of what I’m thinking about. Ultimately it would be good to test how far we can push the look/feel as far as possible away from alien flux, as this is the only benchmark we have.

new version (it works too):



http://mypage.iu.edu/~natjohns/examples/najchat-0.3.zip



i have a server running: type ‘ant’ and use ip address 156.56.52.210



i havent tested it really, so give it a try and let’s see what happens :slight_smile:

I tested this one but the app seem to hang. I guess it could be a problem with my firewall more tahn anything else.



so if there are any suggestions on making it easier to write interfaces, shoot em out


I like to have 2.5D look instead of the flat 2D look. This needs adding say depth to some widgets but I am not sure if this is possible in spag. I also like to have tabbed dialog boxes, and status monitoring like how much life you have left etc.

tomcat

If you look at Alien Flux - especially the main menu it has a 2.5D look.

The buttons have 3D text & move’in’ when they are brought into focus giving a ‘sort of’ 2.5D look.



I’m not sure how this was done but I imagine the the OpenGL fonts where adjusted in resources.data for a start. Needs to be looked at but I think it may be case of playing with the spag tools & the XML file possibly.



With regards to other widget & how easy it is to write new ones its a case for waiting for spag 2.0 I think.

that guest reply was me :smiley:


do not use it as an example of good client server chat code, because its not



But it does work! + the layout is pretty cool!


Thanks again. :D

Tried again, no luck. It does not seem that our firewall allows RMI connections to be made or accepted. :?

tomcat

"tomcat" wrote:
Tried again, no luck. It does not seem that our firewall allows RMI connections to be made or accepted. :?
tomcat

thats because it is not running -- i probably will not turn it back on -- you can run the server yourself and talk to your friends :)

thanks, I like the suggestion. I tested it running on my machine and managed to talk to myself :smiley: . Now time to find some friends XD

"tomcat" wrote:
thanks, I like the suggestion. I tested it running on my machine and managed to talk to myself :D . Now time to find some friends XD

cool :) one thing to beware... the scrollpane does not work yet, so the text will just keep on going down the screen :) need to work on those spag widgets some more...

I’m going to set up a new thread regarding those damn ScrollPanes, because I think to get the functionality we all require we need to do more than just bind them to a TextArea :frowning:

Hey guys,



pretty cool work you are doing there with Spag. Just chime in with a couple thoughts.



Implementing it with a scenegraph: GUI components lend themselves to this quite well. GUI’s tend to be heirarchical in nature anyways (window contains a panel that contains a text field that contains text, etc). So, I think jME will require a class Component (thinking AWT terms here) that extends Spatial. The renderer can then render and Component object (the subclasses of component will have need info on how the rendering takes place). The user than creates a GUI much as they would AWT (possibly Spag) and then adds the main GUI component to the scenegraph.



Second, look and feel: Take a look at ogre sometime and how they handle creation of the GUI’s look and feel. It’s an idea. You create the GUI via resource files, point to the images, etc. That may be a way to go.

yep, that is basically what i was thinking in the scenegraph arena :slight_smile: