|
It seems odd that there are getState() and setState() functions on mxCell, but once the cell is created, the state for the cell is never used again. \nIt appears (and maybe I am wrong) that once the mxCell is created, then the mxGraphView creates a state for the cell, which stores the style as an object. From this point on, the mxCell style does not seem to be used. This seems to be a 'disconnect' or inconsistency. I tried setting the style of an mxCell using cell.setStyle().. but, that had no effect. After some digging into the code, I found that the state.style is used in most cases. \nCould I get an explanation of the intent of these two different style values, and how the are intended to be used? If I change the style of a cell, what is the proper way to do so to insure that the change gets propagated. |
|
After further digging, I have answered my own question. \nIt seems that the proper way to update a cell style is to call mxGraphModel.setStyle(cell,style); This call will send an mxStyleChanged event. The mxStyleChanged event is handled in mxGraph.processChange (among other places). mxGraph.processChange will remove the state for the cell, forcing the mxCellState to be re-created the next time it is needed. |