public void update(CellView view) { if (view != null) { view.update(this); CellView[] children = view.getChildViews(); for (int i = 0; i < children.length; i++) update(children[i]); } }
/** * Returns the view for the specified cell. If create is true and no view is * found then a view is created using createView(Object). */ public CellView getMapping(Object cell, boolean create) { if (cell == null) return null; CellView view = (CellView) mapping.get(cell); if (view == null && create && isVisible(cell)) { view = (CellView) hiddenMapping.get(cell); if (view != null) { putMapping(cell, view); hiddenMapping.remove(cell); } else { view = factory.createView(graphModel, cell); putMapping(cell, view); view.refresh(this, this, true); // Create Dependent // Views view.update(this); } } return view; }
public void updateAutoSize(CellView view) { if (!view.isLeaf()) { CellView[] children = view.getChildViews(); Rectangle2D rect = GraphConstants.getBounds(children[0] .getAllAttributes()); double x = rect.getMaxX() + 10; double y = rect.getY(); for (int index = 1; index < children.length; index++) { Rectangle2D childRect = GraphConstants .getBounds(children[index].getAllAttributes()); childRect.setFrame(x, y, childRect.getWidth(), childRect .getHeight()); x += childRect.getWidth() + 10; children[index].update(); } } else { super.updateAutoSize(view); } }