for (int i = level - 1; i >= 0; i--) { this.localGraphStruct.setLocationContainersAtLevel(i); }
	public void collapse()	{		Object[] nodeList = this.getContainedElements().toArray();		ConnectionSet cs = this.localGraphStruct.getConnectionSet();			this.localGraphStruct.getJGraph().getGraphLayoutCache().setVisible(new Object[]{this}, true);				Iterator splitEdgeIter = localGraphStruct.getGraphModel().edges(this.getSplitter().getPort());		Iterator joinEdgeIter = localGraphStruct.getGraphModel().edges(this.getJoiner().getPort());				ArrayList edgesToRemove =  new ArrayList();						while (splitEdgeIter.hasNext())		{			DefaultEdge edge = (DefaultEdge) splitEdgeIter.next();			Iterator sourceIter = this.getJoiner().getSourceEdges().iterator();					//	Iterator sourceIter = this.getSplitter().getSourceEdges().iterator();			while(sourceIter.hasNext())			{				DefaultEdge target = (DefaultEdge) sourceIter.next();				if(target.equals(edge))				{					cs.disconnect(edge, true);					cs.connect(edge, this.getPort(), true);					this.addSourceEdge(edge);					edgesToRemove.add(edge);				}			}						Iterator targetIter = this.getSplitter().getTargetEdges().iterator();				while(targetIter.hasNext())			{				DefaultEdge source = (DefaultEdge) targetIter.next();				if (source.equals(edge))				{					cs.disconnect(edge,false);					cs.connect(edge, this.getPort(),false);					this.addTargetEdge(edge);					edgesToRemove.add(edge);				}			}					}		while (joinEdgeIter.hasNext())		{			DefaultEdge edge = (DefaultEdge) joinEdgeIter.next();								Iterator sourceIter = this.getJoiner().getSourceEdges().iterator();			while(sourceIter.hasNext())			{				DefaultEdge source = (DefaultEdge) sourceIter.next();				if(source.equals(edge))				{					cs.disconnect(edge, true);					cs.connect(edge, this.getPort(), true);					this.addSourceEdge(edge);					edgesToRemove.add(edge);				}			}									Iterator targetIter = this.getSplitter().getTargetEdges().iterator();				while(targetIter.hasNext())			{				DefaultEdge target = (DefaultEdge) targetIter.next();				if (target.equals(edge))				{					cs.disconnect(edge,false);					cs.connect(edge, this.getPort(),false);					this.addTargetEdge(edge);					edgesToRemove.add(edge);				}			}								}						Object[] removeArray = edgesToRemove.toArray();		for(int i = 0; i<removeArray.length;i++)		{			this.splitter.removeSourceEdge((DefaultEdge)removeArray[i]);			this.splitter.removeTargetEdge((DefaultEdge)removeArray[i]);			this.joiner.removeSourceEdge((DefaultEdge)removeArray[i]);			this.joiner.removeTargetEdge((DefaultEdge)removeArray[i]);		}			GraphConstants.setAutoSize(this.attributes, true);					this.localGraphStruct.getGraphModel().edit(localGraphStruct.getAttributes(), cs, null, null);		this.localGraphStruct.getJGraph().getGraphLayoutCache().setVisible(nodeList, false);				for (int i = level - 1; i >= 0; i--)		{			this.localGraphStruct.containerNodes.hideContainersAtLevel(i);		}					//JGraphLayoutManager manager = new JGraphLayoutManager(this.localGraphStruct.getJGraph());		JGraphLayoutManager manager = new JGraphLayoutManager(this.localGraphStruct);		manager.arrange();				for (int i = level - 1; i >= 0; i--)		{			this.localGraphStruct.setLocationContainersAtLevel(i);		}							}