01: /*
02: * This file is not part of the ItsNat framework.
03: *
04: * Original source code use and closed source derivatives are authorized
05: * to third parties with no restriction or fee.
06: * The original source code is owned by the author.
07: *
08: * This program is distributed AS IS in the hope that it will be useful,
09: * but WITHOUT ANY WARRANTY; without even the implied warranty of
10: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11: *
12: * Author: Jose Maria Arranz Santamaria
13: * (C) Innowhere Software Services S.L., Spanish company, year 2007
14: */
15:
16: package org.itsnat.feashow.features.components.lists;
17:
18: import org.itsnat.comp.ItsNatList;
19: import org.itsnat.comp.ItsNatListCellRenderer;
20: import org.itsnat.feashow.features.components.shared.Circle;
21: import org.w3c.dom.Element;
22:
23: public class CircleListCellRenderer implements ItsNatListCellRenderer {
24:
25: public CircleListCellRenderer() {
26: }
27:
28: public void renderListCell(ItsNatList list, int index,
29: Object value, boolean isSelected, boolean cellHasFocus,
30: Element cellElem, boolean isNew) {
31: Circle circle = (Circle) value;
32:
33: int radio = circle.getRadio();
34: int cx = index * radio + radio;
35: cellElem.setAttribute("cx", Integer.toString(cx));
36: cellElem.setAttribute("r", Integer.toString(radio));
37: }
38:
39: public void unrenderListCell(ItsNatList list, int index,
40: Element cellContentElem) {
41: }
42: }
|