Made working "Rpg System List" read from regular text file.
Original posting 2007-12-04: Long and painful (3 days) gack! But working at last.
It's painful getting my thinking back into Java syntax. Don't get me wrong, I love the language, I've just forgotten so much, it sucks feeling like a n00b all over again.
Anyhow, I struggled with making the system read from a (plain) text file to populate a JComboBox.
That line above just doesn't cover how much effort and time went into making this work. And it's still one more significant step away from where I want to be in the long run, which is using all XML files, rather than plain text files. Which require different classes and calls. But At least I'm in the right direction.
So for now, I'm able to call my class "JComboBoxPopulator" and receive back a list which is retrieved from my class "ReadListFromFile" which has methods for either ArrayList<String> or String[], and a method to readFileListLength (for the number of entries).
One thing I had to do though, was get rid of the bloody entry for the jComboBox DefaultComboBoxModel that the IDE put in there.
I was not figuring out how to make this work with that still there.
Next I need to try to make this work reading from XML file, rather than plain text.
I'll add that as a method in the ReadListFromFile class.
This is such slow progress right now, but it builds on a solid foundation.
I totally separated each of these insto separate classes so that they can easily be used by other classes and are not coupled together, so no repetition of code. This is proper OOA&D (one of the parts of).
The new classes created are:
- ReadListFromFile
- JComboBoxPopulator
To get to just those two working classes, I had created around a dozen others experimenting to get it working and abstracted out enough. I'm sure there's still TONS of room for improvement, and look forward to when I have enough of a code base to put up there to hopefully get other programmers on board to help.
Anyhow, onward to making it work with XML.
First make it read FROM an XML file.
After that, making it properly Internationalized.
Then create data entry forms that write TO an XML file, with options to append or overwrite existing entries.
These are the core tools that will make Suite GM so extensible for any user to add (most) any RPG System eventually (I hope).
After that, I think I can get back on track with just cranking out functionality, instead of this current foundation building.
Ciao for now.
-Hawke

