GraphStructure graphStruct = graphpad.getCurrentDocument().getGraphStructure(); int currentLevelView = graphStruct.getCurrentLevelView(); graphStruct.collapseContainersAtLevel(currentLevelView);  graphStruct.setCurrentLevelView(--currentLevelView);
if (cells.length == 0) { graphStruct.containerNodes.collapseContainersAtLevel(currentLevelView); graphStruct.containerNodes.setCurrentLevelView(--currentLevelView);  }  else if (cells.length == 1) { GEContainer container = null; int firstCell = 0;   if (!(cells[firstCell] instanceof GEStreamNode)) { System.out.println("WARNING: CAN ONLY COLLAPSE GESTREAMNODES"); return; }   if (cells[firstCell] instanceof GEContainer) { container =  (GEContainer) cells[firstCell]; currentLevelView = ((GEStreamNode)container).getDepthLevel();   System.out.println("Current Level View is " + graphStruct.containerNodes.getCurrentLevelView()); System.out.println("Node to collapse is in level "+ currentLevelView); for (int j = graphStruct.containerNodes.getCurrentLevelView(); j > currentLevelView; j--) { graphStruct.containerNodes.collapseContainersAtLevel(j); } container.collapse(); graphStruct.containerNodes.setCurrentLevelView(currentLevelView);  }  else { GEStreamNode node = (GEStreamNode) cells[firstCell]; container = ((GEContainer) node.getEncapsulatingNode()); currentLevelView = ((GEStreamNode)container).getDepthLevel();   for (int j = graphStruct.containerNodes.getCurrentLevelView(); j > currentLevelView ; j--) { graphStruct.containerNodes.collapseContainersAtLevel(j); } container.collapse(); graphStruct.containerNodes.setCurrentLevelView(currentLevelView); } }  else { System.out.println("WARNING: CAN ONLY SELECT ONE CELL TO COLLAPSE AT A TIME"); return; }   for (int i = currentLevelView; i >= 0; i--) { graphStruct.setLocationContainersAtLevel(i); }
	public void actionPerformed(ActionEvent e) 	{				graphpad.getCurrentDocument().setResizeAction(null);		if (graphpad.getCurrentGraph().getScale() < 8) 		{			GraphStructure graphStruct = graphpad.getCurrentDocument().getGraphStructure();			int currentLevelView = graphStruct.getCurrentLevelView();			graphStruct.collapseContainersAtLevel(currentLevelView);						graphStruct.setCurrentLevelView(--currentLevelView);						if (currentLevelView < 0 )			{				graphStruct.setCurrentLevelView(0);			}						graphpad.getCurrentDocument().setScale(graphpad.getCurrentGraph().getScale() * 1.2);			if (graphpad.getCurrentGraph().getSelectionCell() != null)			{				graphpad.getCurrentGraph().scrollCellToVisible(graphpad.getCurrentGraph().getSelectionCell());							}			}	}