public void actionPerformed(ActionEvent e) {

    // sum of coordinates
    double sx = 0;
    double sy = 0;

    // coordinates of center of graph
    double cx = 0;
    double cy = 0;

    // coordinates with graph centered at (0,0)
    double nx;
    double ny;

    CyNetworkView parent = Cytoscape.getCurrentNetworkView();
    // loop through each node to add up all x and all y coordinates
    for (Iterator i = parent.getNodeViewsIterator(); i.hasNext(); ) {
      NodeView nodeView = (NodeView) i.next();
      // get coordinates of node
      double ax = nodeView.getXPosition();
      double ay = nodeView.getYPosition();
      // sum up coordinates of all the nodes
      sx += ax;
      sy += ay;
    }

    // set new coordinates of each node at center (0,0), shrink, then return to
    // original center at (cx, cy)
    for (Iterator i = parent.getNodeViewsIterator(); i.hasNext(); ) {
      NodeView nodeView = (NodeView) i.next();
      nodeView.setXPosition(m * ((nodeView.getXPosition()) - cx) + cx);
      nodeView.setYPosition(m * ((nodeView.getYPosition()) - cy) + cy);
    }

    // remove bends
    for (Iterator i = parent.getEdgeViewsIterator(); i.hasNext(); ) {
      EdgeView edgeView = (EdgeView) i.next();
      edgeView.getBend().removeAllHandles();
    }
  } // Action Performed