http://www.eteks.com

com.eteks.jeks
Class ReferringCellsListener

java.lang.Object
  |
  +--com.eteks.jeks.ReferringCellsListener
All Implemented Interfaces:
java.util.EventListener, javax.swing.event.TableModelListener

public class ReferringCellsListener
extends java.lang.Object
implements javax.swing.event.TableModelListener

This class records the set of the links between the computed cells of a table. The geAlltReferringCells () method allows to list all the cells which use a cell x in their formula, in the goal to optimize table updates, when x is modified. Linked to a TableModel instance, it listens to the changes of a table to update automatically all the computed cells referring to a cell.

Since:
Jeks 1.0
Version:
1.0
Author:
Emmanuel Puybaret

Constructor Summary
ReferringCellsListener()
           
 
Method Summary
 void addParametersReferringToCell(JeksCell cell, JeksExpression expression)
          Adds a referring link between cells cell and all the cells of the parameters of expression in the formula of cell.
 java.util.Vector getAllReferringCells(JeksCell cell)
          Returns the full list of all the cells referring cell as a parameter in their formula directly or indirectly.
 java.util.Vector getReferringCells(JeksCell cell)
          Returns the list of all the cells referring cell as a parameter in their formula directly.
 void removeParametersReferringToCell(JeksCell cell, JeksExpression expression)
          Removes all referring link between cells cell and all the cells of the parameters of expression in the formula of cell.
 void removeReferringCells(JeksCell cell)
          Removes all referring link to cell.
 void tableChanged(javax.swing.event.TableModelEvent event)
          TableModelListener implementation
 void tableUpdated(javax.swing.table.TableModel model, java.util.Vector updatedSet)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReferringCellsListener

public ReferringCellsListener()
Method Detail

addParametersReferringToCell

public void addParametersReferringToCell(JeksCell cell,
                                         JeksExpression expression)
Adds a referring link between cells cell and all the cells of the parameters of expression in the formula of cell.
Parameters:
cell - a cell.
expression - an expression using a set of cells as parameters in its formula.

removeReferringCells

public void removeReferringCells(JeksCell cell)
Removes all referring link to cell.
Parameters:
cell - a cell.

removeParametersReferringToCell

public void removeParametersReferringToCell(JeksCell cell,
                                            JeksExpression expression)
Removes all referring link between cells cell and all the cells of the parameters of expression in the formula of cell.
Parameters:
cell - a cell.
expression - an expression using a set of cells as parameters in its formula.

getReferringCells

public java.util.Vector getReferringCells(JeksCell cell)
Returns the list of all the cells referring cell as a parameter in their formula directly.
Parameters:
cell - a cell.

getAllReferringCells

public java.util.Vector getAllReferringCells(JeksCell cell)
Returns the full list of all the cells referring cell as a parameter in their formula directly or indirectly. This method is mostly used to get all the cells to update after a change of cell.
Parameters:
cell - a cell.

tableChanged

public void tableChanged(javax.swing.event.TableModelEvent event)
TableModelListener implementation
Specified by:
tableChanged in interface javax.swing.event.TableModelListener

tableUpdated

public void tableUpdated(javax.swing.table.TableModel model,
                         java.util.Vector updatedSet)

&cp; 1998-2003 eTeks - All rights reserved