public void refresh(CellView view, boolean create) { if (view != null) { view.refresh(this, this, create); CellView[] children = view.getChildViews(); for (int i = 0; i < children.length; i++) refresh(children[i], create); } }
/** * Updates the cached array of ports. */ protected void updatePorts() { Object[] roots = DefaultGraphModel.getRoots(graphModel); List list = DefaultGraphModel.getDescendants(graphModel, roots); if (list != null) { ArrayList result = new ArrayList(); Iterator it = list.iterator(); while (it.hasNext()) { Object cell = it.next(); if (graphModel.isPort(cell)) { CellView portView = getMapping(cell, false); if (portView != null) { result.add(portView); portView.refresh(this, this, false); } } } ports = new PortView[result.size()]; result.toArray(ports); } }
/** * Completely reloads all roots from the model in the order returned by * DefaultGraphModel.getAll. This uses the current visibleSet and mapping to * fetch the cell views for the cells. */ protected void reloadRoots() { // Reorder roots Object[] orderedCells = DefaultGraphModel.getAll(graphModel); List newRoots = new ArrayList(); for (int i = 0; i < orderedCells.length; i++) { CellView view = getMapping(orderedCells[i], false); if (view != null) { view.refresh(this, this, true); if (view.getParentView() == null) { newRoots.add(view); } } } roots = newRoots; }
cv.refresh(this, this, false);
/** * 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 translate(int dx, int dy) { // System.err.println(view.getCell() + ": Translate by " + dx + ", " + dy); if (view.isLeaf()) { model.getAttributes(node).translate(dx, dy); } else { CellView[] cells = view.getChildViews(); for (int index = 0; index < cells.length; index++) { CellView child = cells[index]; model.getAttributes(child.getCell()).translate(dx, dy); child.refresh(model, mapper, false); } } view.refresh(model, mapper, false); } };
view.refresh(this, this, false);
preview.refresh(graph.getGraphLayoutCache(), this, false);
public CellView createMapping(Object cell) { CellView view = graphLayoutCache.getFactory().createView( graph.getModel(), cell); putMapping(cell, view); view.refresh(graph.getGraphLayoutCache(), this, true); // Create Dependent Views // Fetch Attributes From Original View CellView src = graphLayoutCache.getMapping(cell, false); if (src != null) { view.changeAttributes(graphLayoutCache, (AttributeMap) src.getAttributes().clone()); // Inserts portviews into points list view.refresh(graph.getGraphLayoutCache(), this, false); } return view; }
if (view != null) view.refresh(model, mapper, false);
public static boolean isContainer(DefaultGraphCell object, JGraph jg){ boolean found=false; CellView[] views = jg.getGraphLayoutCache().getAllViews(); Hashtable<String, CollectionPanel> vc = new Hashtable<String, CollectionPanel>(); for (CellView cv : views) { if (cv.getCell() == object) { if (cv instanceof VertexView) { if (((VertexView) cv).getRenderer() instanceof CompositeRenderer) { cv.refresh(jg.getGraphLayoutCache(), new GraphContext(jg, new Object[] { ((VertexView) cv).getCell() }), false); Component element = ((VertexView) cv) .getRendererComponent(jg, false, false, false); // to // set // the // entity CompositeRenderer jc = (CompositeRenderer) ((VertexView) cv) .getRenderer(); vc = evaluate(jc, (ingenias.editor.entities.Entity) object .getUserObject(),jg.getModel().getAttributes(object)); } } } } return vc.size()>0; } public boolean isContainer(
graph.getGraphLayoutCache(), (AttributeMap) attr.clone()); all[i].refresh(graph.getGraphLayoutCache(), context, false);
public Hashtable<String, CollectionPanel> parentHasVisibleContainers( DefaultGraphCell object) { CellView[] views = glc.getAllViews(); Hashtable<String, CollectionPanel> vc = new Hashtable<String, CollectionPanel>(); for (CellView cv : views) { if (cv.getCell() == object) { if (cv instanceof VertexView) { if (((VertexView) cv).getRenderer() instanceof CompositeRenderer) { cv.refresh(glc, new GraphContext(jg, new Object[] { ((VertexView) cv).getCell() }), false); Component element = ((VertexView) cv) .getRendererComponent(jg, false, false, false); // to // set // the // entity CompositeRenderer jc = (CompositeRenderer) ((VertexView) cv) .getRenderer(); vc = evaluate(jc, (ingenias.editor.entities.Entity) object .getUserObject(),jg.getModel().getAttributes(object)); } } } } return vc; }
.getAllAttributes().clone(); all[i].changeAttributes(graph.getGraphLayoutCache(), origAttr); all[i].refresh(graph.getGraphLayoutCache(), context, false);
attrs.remove(GraphConstants.RESIZE); view.refresh(getGraphLayoutCache(), getGraphLayoutCache(), false);
CellView view = getMapping(changed[i], false); if (view != null) { view.refresh(this, this, true);