Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (757)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (843)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  using beans for my game editor, good idea? comments wanted :)  (Read 2334 times)
0 Members and 1 Guest are viewing this topic.
Offline zulo

Junior Devvie

Java games rock!

« Posted 2006-01-12 00:04:42 »


I am about to start a new editor for my new game engine. This would be the third time i try to
create an editor. Iterative development process  Grin

This time I will implement besides sprites, actions,dialog etc. I will also use beanshell as the script.

The problem is how to design the editor. How should I build it. I want the user to be able to
add new sprites, define the animations, actions, events and more. I.e set properties. So i was thinking I could
make all the sprites etc. as beans to use in the editor. Is this a good idea or just as much work as programming all the frames,windows
and property dialogs in a normal way? Even if i make the editor able to use my beans i still have to code the actual functions and panels of property setting?Or
is this a function available in java already?

Without using beans I could select an object/sprite from a list, click a button "edit" and pass the object to a dialog which in turn knows
how to edit a sprite object etc.. Im just unsure if its easier to use beans or not.  Undecided

Thank you for any replies Smiley
Offline cylab

JGO Kernel

Medals: 180

« Reply #1 - Posted 2006-01-12 11:30:43 »

Creating all objects of your engine as full blown beans with bean descriptors and such is a bit overkill, but you should follow the bean pattern, i.e. have default constructors and setter/getter methods. There are several libraries (like out there to analyse the class-objects to detect this properties, so you could generate the forms you need automatically.

I assume you want to build a hierarchical scene model for your engine. To save or load a model, you could use XStream (, which provides a very easy way to serialize a complete object tree to and from XML without implementing Serializable and such. Keep in mind that XML might be the right format for an editor, but you may want to create some form of "compiled" binary-format when delivering a game for performance and intellectual property reasons.

Another way would be to create the editor on top of an plattform like eclipse ( or netbeans (, the 5.0 beta IDE has some wizards and tutorials how to create an application based on it). Using the tools provided by the Netbeans plattform (I don't know much about eclipse RCP), you will get a lot out of the box (including xml-treeviews, automatically generated editor sheets for object-properties, etc.). There is an active and helpful community around this plattform. Maybe you should ask your question in the openide mailinglist at

Having said that, writing an editor either way - standalone or on top of netbeans or eclipse - is a daunting task. Using a plattform you have a steep learning curve, but the advantage of having tested frameworks, design patterns and extension mechanisms in place. Creating a standalone editor, you will get going faster, but run the risk of reinventing several wheels, so in the end you spend more time writing an application platform instead of an application Wink

I have already walked on both paths  Undecided  and like the plattform approach better...

Mathias - I Know What [you] Did Last Summer!
Offline zulo

Junior Devvie

Java games rock!

« Reply #2 - Posted 2006-01-12 13:07:40 »

thank you

I used some hours yesterday to learn beans, and how to use them in eclipse visual editor. I had never tried to program beans
before but it seems like a nice way to get easy property settings when you use the eclipse visual editor. I would customize my eclipse with
could be a mess though (? )

I was thinking of creating a beans-version of all my library objects for an editor and have a clean version for the actual game engine.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline DaveLloyd

Junior Devvie

Making things happen fast with Java!

« Reply #3 - Posted 2006-01-12 13:44:13 »

I'll second the recommendation on XStream. I'm using to load/save my game state which is really quite complex but well handled by XStream and easy to extend. I used to use the Java beans XMLEncoder but continually hit problems with it (usually cos it is just too smart - dangerously so).

Pages: [1]
  ignore  |  Print  

EgonOlsen (42 views)
2018-06-10 19:43:48

EgonOlsen (22 views)
2018-06-10 19:43:44

EgonOlsen (43 views)
2018-06-10 19:43:20

DesertCoockie (197 views)
2018-05-13 18:23:11

nelsongames (124 views)
2018-04-24 18:15:36

nelsongames (123 views)
2018-04-24 18:14:32

ivj94 (863 views)
2018-03-24 14:47:39

ivj94 (124 views)
2018-03-24 14:46:31

ivj94 (768 views)
2018-03-24 14:43:53

Solater (140 views)
2018-03-17 05:04:08
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!