this.localGraphStruct.getGraphModel().edit(null, cs, null, null);
GraphConstants.setAutoSize(this.attributes, true); this.localGraphStruct.getGraphModel().edit(localGraphStruct.getAttributes(), cs, null, null);
	public void collapse(JGraph jgraph)	{		Object[] nodeList = this.getContainedElements().toArray();		ConnectionSet cs = this.localGraphStruct.getConnectionSet();			jgraph.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();			while(sourceIter.hasNext())			{				DefaultEdge target = (DefaultEdge) sourceIter.next();				if(target.equals(edge))				{					System.out.println("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 source = (DefaultEdge) targetIter.next();				if (source.equals(edge))				{					System.out.println("target equals target");					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))				{					System.out.println("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))				{					System.out.println("target equals target");					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]);		}														/*		if (splitEdgeIter.hasNext())		{			DefaultEdge sEdge = (DefaultEdge) splitEdgeIter.next();			cs.disconnect(sEdge, false);			cs.connect(sEdge, this, false);		}		ArrayList joinEdgeArray = new ArrayList();		while (joinEdgeIter.hasNext())		{			joinEdgeArray.add(joinEdgeIter.next());		}					DefaultEdge jEdge = (DefaultEdge) joinEdgeArray.get(joinEdgeArray.size()-1);		cs.disconnect(jEdge,true);		cs.connect(jEdge, this,true);		*/												this.localGraphStruct.getGraphModel().edit(null, cs, null, null);		jgraph.getGraphLayoutCache().setVisible(nodeList, false);				//JGraphLayoutManager manager = new JGraphLayoutManager(this.localGraphStruct.getJGraph());		JGraphLayoutManager manager = new JGraphLayoutManager(jgraph);		manager.arrange();		}