Re: Editor / Renderer: data flow
- From: zero <zero@xxxxxxx>
- Date: Sat, 25 Feb 2006 22:08:03 GMT
"Denis" <denis.mazzucato@xxxxxxxxx> wrote in news:1140769944.254545.278210
@u72g2000cwu.googlegroups.com:
Thanks!
My error was on the model.
I didn't implement method setValueAt(Object value, Object node, int
column) and so the model didn't change!
Ok. Now: I need to implement formula into the table referring to other
cells, and the table change dinamically.
I thought to add a custom-made listener to cells containing formula and
when a cell change I send to the listener an event like "dataChenged".
Is the correct approach?
DM
This is a possibility, however I think you can get the same effect a lot
easier by using a TableModelListener, or a subclass of it. You don't need
to define your own event & listener, and you don't need to add a listener
to each cell - if a lot of cells contain formulas, or if the user can add a
formula to any and all cells, this will be a lot more efficient.
Register a TableModelListener on the TableModel, and if a tableChanged
event is raised, check if any formulas depend on the changed cell(s), and
update as needed. Checking which, if any, formulas depend on the changed
cell(s) can probably be optimised by subclassing TableModelListener, or
maybe a separate class can keep track of this info, depending on what best
fits your design.
Zero
.
- Follow-Ups:
- Re: Editor / Renderer: data flow
- From: Denis
- Re: Editor / Renderer: data flow
- References:
- Editor / Renderer: data flow
- From: Denis
- Re: Editor / Renderer: data flow
- From: zero
- Re: Editor / Renderer: data flow
- From: Denis
- Editor / Renderer: data flow
- Prev by Date: Re: does java has any api for compressing files or folders by tar and gzip?
- Next by Date: Re: Pls Help: Making modal dialogs semi-modal
- Previous by thread: Re: Editor / Renderer: data flow
- Next by thread: Re: Editor / Renderer: data flow
- Index(es):