Tuesday, November 6, 2007

Java: DII Character Simulator Update #2

The third and final piece of the GUI for the character simulator is completed. This won't be the last page to be made, but for the initial application attempt this will suffice. Thanks to the lessons learned making the Equipment tab the format was much easier to setup with the GroupLayout manager.

I took the LCS of the Diablo II program as a template and then added any information I felt was necessary for display purposes. The first few subpanels were fairly basic, the Misc mods, Mods of note and Resistance panels were for pure display purposes. It was the other panels that required extra components.

Originally I was going to create the Stat panel with JTextFields and have the user enter in the amount of points to add to each characteristic, then a "Calculate" button would need to be pressed to add the needed info. This unfortunately didn't take into account removing points as a user played with the virtual character's setup. So instead I followed the setup of the LCS and used buttons, one plus and one minus, for adding/subtracting stat points. GroupLayout was of course utilized to arrange the JLabels and JButtons into an appropriate order.

This was however only part of the subpanel. There was also the display of the sum of remaining stat points that needed to be added. The subpanel was actually governed not by GroupLayout but by BorderLayout with the GroupLayout section in the center and a FlowLayout in the southern portion containing the JLabel/JTextField combination that displays remaining stat points. The same layout setup was used for the Damage subpanel, with its JComboBox for skill selection component taking up the southern portion of the subpanel.

The last subpanel to be added was the Skill Info section. It occurred to me that there is not a place in the Skill Planner tab to view the properties of each of the skills once points have been allocated. I could have placed a JTextArea at the bottom of the page with this information, but I thought that would ruin the layout of each page. So this feature is added to the Stat panel instead, so that damage and effects of each skill may be viewed, taking into account bonuses from the equipment the virtual character is wearing.


This completes the first phase of the application's development. With the GUI completed I can now begin work implementing listeners and functionality to all of the JComboBoxes, JButtons, JCheckBoxes, JTextFields and JTextAreas. There is a limited amount of pieces that can be tied together before data is required, but as much as possible will be implemented.

No comments: