Re: Dynamically Processing Nodes
"Kirk Daries" <[email protected]>
| Newsgroups | gmane.comp.java.enhydra.barracuda.general |
|---|---|
| Message-ID | <[email protected]> |
Cool... Thanx for the tip. This makes sense. Will spend some time with this over the next couple of days. Thanx Diez, --KD >>> [email protected] 2003/12/03 22:01:15 >>> Hi, > Nah, > I've got parent/child loops nailed. Good to know :) > It has more to do with using the Iterative Model and dynamically > "growing it"...?? I still think that its basically the way I said before - what you have with you rows is a tree. To create a flat list of rows (or RowCollections) you'll have to traverse this tree with an vistor like this: class RowVisitor { List _rowList = new LinkedList(); public void visit(List rows) { for(Iterator it = rows.iterator(); it.hasNext();) { visit((Row)it.next()); } } public void visit(Row row) { _rowList.add(row); for(Iterator it = row.getRowCollection().iterator(); it.hasNext();) { visit((Row)it.next()); } } } This should end up with a list of rows in the correct order. Now for the rendering - the rowspan is (1 + row.getRowCollection().size()). Maybe you have to make the visitor tag the rows with additional information like depth to make the rendering of the colspan easier. The colspan is (3 - depth). Does this give you an idea? Diez _______________________________________________ Barracuda mailing list [email protected] http://barracudamvc.org/lists/listinfo/barracuda --------------------------------------------------------------- All views or opinions expressed in this electronic message and its attachments are the view of the sender and do not necessarily reflect the views and opinions of the Provincial Government Western Cape (the PGWC). No employee of the WCPG is entitled to conclude a binding contract on behalf of the PGWC unless he/she is an Accounting Officer of the PGWC, or his or her authorised representative. The information contained in this message and its attachments may be confidential or privileged and is for the use of the named recipient only, except where the sender specifically states otherwise. If you are not the intended recipient you may not copy or deliver this message to anyone.