From: Joe E. <jo...@em...> - 2005-03-04 10:17:42
|
Okay guys... I changed the JList to a JTree in DeviceAddDialog. Do a CVS update and try adding a synth. The stuff you see on the screen doesn't look like much... but I really cleaned up the underlying code. --------------------------------- Explaination of the layout --------------------------------- The tree supports grouping by manufacturer, type (ie, synth, controller, drum machine, etc.), manufacturer-then-type, type-then-manufacturer, or no grouping at all (in which case it looks just like the old JList, pretty much). It is *currently* configured to group by Type, then by Manufacturer. The problem is, devices don't have types yet. In the meantime, so that we have something to test, the type is the first letter of the manufacturer name. So, a "Kawai K4" will have type "K". This is why the tree initially starts out with just a bunch of folders with single-letter names. So, the Kawai K4 is in "/K/Kawai/Kawai K4". If you want to experiment with different groupings, look in DeviceSelectionTree and change the groupStyle field to GROUP_NONE, GROUP_MANUF, GROUP_TYPE, GROUP_MANUF_TYPE, or GROUP_TYPE_MANUF (which is what it is now). Should we just hard-code this a certain way, or let the user change it with a setting? -------------------------------- Things to watch out for -------------------------------- Keep an eye out for any time the tree isn't in alphabetical order. I tried to remember to keep it sorted in all of the different groupings, but I might have missed something. Also, you shouldn't be able to select or double-click on any tree items *except* the actual devices. Double-clicking on a type or manufacturer shouldn't do anything. Double-clicking on an acutal device, however, is treated as though you selected it and clicked OK. -------------------------- Future possibilities -------------------------- Sorry I'm obsessing over this, but this is one of the first things a new user sees, so I'd like to make it as snazzy as I can.... JTree's support custom icons and images in places of the little folder/document icons used for nodes and leafs. When we do, someday, support types, I'd like to consider having some little icons which look like the various types (drum machine, rackmount synth, keyboard, etc). Also, if I'm inspired later, I could go in and add support for selecting multiple synths at a time. - Joe |