Wednesday, September 10, 2008

Java: Character Simulator Update #8

I had a decision to make as to whether to create a Runeword Wizard or finish the character simulator part of CharSi. I know that were I to start the character part I wouldn't be finished for quite a while. Since I already have a decent idea how to make the runeword wizard I decided that was the application I would work on. It is still going to be part of the overall CharSi program, but more of an add-on than an integral part since it won't interact with any other tabs.


I have a general idea as to what type of information was needed to perform the runeword query properly. After I had my list created I reviewed an online runeword calculator to ensure I didn't miss anything important. From that version I added the Paladin only aura runeword option, but that was all. The online version has some modifiers I can't see myself using, and since this is primarily for my personal use I'm not adding them in.

So then it was off to create the look-and-feel portion of the program. I created a separate JPanel for each section to be combined at the end into a single JPanel. I borrowed code from a few earlier programs to speed up the process, no need to recreate the wheel all over again. Specifically I am using a JList and JTextArea panel from the equipment tabs of CharSi. Virtually a cut-and-paste operation with only a few variable names changed. Also utilizing the Rune JPanel from the AMAS program, with a few modifications. The columns were changed from three to two and I needed to use a different constructor for the JCheckBoxes.

JCheckBoxMenuItem (String text, Icon icon, boolean b)

Actually it's a different component all together to be honest. Also needed to set their value upon initialization as I wanted all of the rune options to be initially checked. As a result had to borrow all of the rune images as well to include with the JPanel.

As it turned out the only pieces that had to be created from scratch were the query modifiers. Once that was all done the separate JPanels were grouped together using GroupLayout to display correctly. Now I need to look into how I want to handle the queries, and how to store the runeword information so that the information displayed is accurate. I'm considering an array of arrays so that For and While loops can be used rather than a separate instance for each runeword.

No comments: