Path: csiph.com!optima2.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Martin Gregorie Newsgroups: comp.lang.java.programmer Subject: Re: Vertical Text - part 3 Date: Thu, 2 Jul 2015 21:55:53 +0000 (UTC) Organization: A noiseless patient Spider Lines: 38 Message-ID: References: <1980b894-6ca3-48f5-b70a-1628c56185e1@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Thu, 2 Jul 2015 21:55:53 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="e5160e2be48f1ea550cf61512446f525"; logging-data="14275"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18bIedu/aRBt392nAa2k37BuSLCVSwdibk=" User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508 git://git.gnome.org/pan2) Cancel-Lock: sha1:vJMSkUExXmzQuKiu6ab90qkGfoA= Xref: csiph.com comp.lang.java.programmer:31931 On Thu, 02 Jul 2015 12:54:41 -0700, e.d.programmer wrote: > That screenshot is confusing. Are you attempting to render everything > on that window in a single JTable? It looks like several linked tables. > No JTables are used at all. Its quite a different structure, based on se.datadosen.component.ControlPanel instances which are laid out using the se.dosen.component.RiverLayout layout manager and switched with the Roles menu, which is dynamically built when the program starts up and reads its configuration. For starters, there are one or more rosters, each on a different ControlPanel instance, managed and switched with the CardLayout layout manager and an ArrayList of ControlPanel instances. Each ControlPanel instance is laid out with rows of display classes which have a 1:N relationship with the data classes in the Model - 1:N because some data classes (e.g. the ones above the row of names, display different aspects of the same underlying class. And its normal for each named person to take part in more than one roster, so their N associated display classes appear on more than one 'card' as well. User actions (allocate/deallocate/swap duties) are applied directly to the the class instances in Model as you'd expect. Each 'card' has a list of all the display classes on the card, so refreshing the display merely involves walking the list and calling the refresh() method of each display class instance in the list, which causes it to retrieve its displayed value from the Model. If you think that makes the Model sound like an in-memory database plus database procedures you'd be right and, yes, I did draw an Entity Relationship Diagram (ERD) as the first step in designing this tool. The data structure and its internal relationships are surprisingly complex and would have been quite difficult to get right without drawing a ERD in 3rd normal form. -- martin@ | Martin Gregorie gregorie. | Essex, UK org |