private void graphToPS(File psOutputFile, Rectangle boundingBox, PositionTransformation pt){
		
		EPSOutputPrintStream pw = null;
		try {
			pw = new EPSOutputPrintStream(psOutputFile);
		} catch (FileNotFoundException e) {
			Main.minorError("Could not open the file to write the ps to.");
		}
		
		pw.setBoundingBox((int)boundingBox.getX()-2, (int)boundingBox.getY()-2, boundingBox.width+2, boundingBox.height+2);
		
		pw.writeHeader();
		
		//add the default macros.
		pw.println("%default Macros");
		pw.addMacro("line", "newpath moveto lineto stroke");
		pw.addMacro("filledCircle", "newpath 0 360 arc fill stroke");
		pw.addMacro("filled4Polygon", "newpath moveto lineto lineto lineto closepath fill stroke");
		pw.addMacro("filledArrowHead", "newpath moveto lineto lineto closepath fill stroke");
		pw.println();
		
		// print the map prior to the background (such that the border is on top of the map
		if(Configuration.useMap) {
			Runtime.map.drawToPostScript(pw,pt);
		}
		
		//draw the background
		if(Configuration.epsDrawDeploymentAreaBoundingBox) {
			pt.drawBackgroundToPostScript(pw);
		}
		

		//draw the edges
		if(Configuration.drawEdges) {
			Enumeration<Node> nodeEnumer = Runtime.nodes.getSortedNodeEnumeration(true);
			while(nodeEnumer.hasMoreElements()){
				Node n = nodeEnumer.nextElement();
				for(Edge e: n.outgoingConnections){
					e.drawToPostScript(pw, pt);
				}
			}
		}
		
		if(Configuration.drawNodes) {
			// draw the nodes
			for(Node n: Runtime.nodes){
				n.drawToPostScript(pw, pt);
			}
		}
		
		pw.writeEOF();
		pw.close();
	}