I've also decided to start writing reports on what I have learned about coding on my own, Friendship Report style. See it after the break.
I have used buttons, radio buttons, checkboxes and a status bar from Peter Lager's GUI library in the latest version of my skin previewer for the MineLP mod for Minecraft. There was no menu bar, so I made my own much like how I did in the previous versions of the program. One array of button objects and strings were used for the menu bar. Three two dimensional arrays were used for the menu items, one for buttons, another for checkboxes, and another for the radio buttons. To simplify all three kind of components into one array, I used a two dimensional String array, than initialized each component. The first character of each string indicates its type, while the following characters were used for the name. Several loops are used to initialize each component of the menus, creating them, disabling them, and hiding them until a menu is opened. Other functions were used to change the components for human and pony models whenever the race was changed.
Each type of component generates events when ever the user interacts with them. They all have a tag number that I set to to correspond with the menu item and used modulo and integer division to extract the location of the menu item in the for of indicies. So for example, if the there were 10 menus in total (so it would be easy to calculate), the 5th item of the 3rd menu would be assigned a tag of 42; 42/10 (which is 4) being the index of the 5th menu and 42%10 (which is 2) the index of the 3rd menu item for the two dimensional arrays for the GUI components. The menus was tagged separately with negative numbers to avoid interfering with the menu items. This can be modified to work for any number of menus.
I also made a class was made for each model, which stored the data necessary for this adaptive GUI and the necessary functions and variables to draw the model. These variables included boolean values to indicate whether or not a body part was hidden, and PVector objects to stor the translations necessary for changing the centering of the model. Separating code into classes is invaluable for modularity.
You Faithful Student: