JGraph 5.2

JGraph.setSelectNewCells

This method was replaced by setSelectClonedCells, which uses the following pattern when cloning cells. The actual functionality of selecting newly inserted cells was removed from the core. Use the following pattern instead:

graph.getGraphLayoutCache().insert(cells, ...); 
graph.setSelectionCells(cells);

DefaultCellViewFactory

JGraph is no longer a cell view factory. Instead, the cell view factory is a standalone object that is referenced from the layout cache. Also, the cell view factory is no longer in charge of updating the auto size, this is done in the basic graph ui. Use the following code to create custom cell views:

graph.getGraphLayoutCache().setFactory(new DefaultCellViewFactory() { 
   public CellView createView(GraphModel model, Object cell) { 
      ... 
   } 
}

Extended Observer Pattern

The layout cache does now provide a getChanged method to indicate the changed cell views to its observers. The changed cell views are collected using addChanged before the call to notifyObservers. You must still call setChanged to notify the observers. The changed cell views are cleared when clearChanged is called.

Standalone GraphLayoutCache and Cell Views

For the cell views, the constructor now only takes the cell. The refresh method is used to refresh on a model-level change, and adds the graph model as a parameter. The layout cache is no longer in charge of auto-sizing and selection of new cells. Constructors have been changed to take a model and a factory. This change allows to use GraphLayoutCache and contained cell views in more than one JGraph instance.