lib/browser/GraphBrowser/GraphBrowser.java
changeset 11812 8d191eaf7fc4
parent 11798 fbab70de9b0d
child 11876 6ac0627167ed
equal deleted inserted replaced
11811:38721b2c6f57 11812:8d191eaf7fc4
   192 				InputStream is=new FileInputStream(args[0]);
   192 				InputStream is=new FileInputStream(args[0]);
   193 				gb.initBrowser(is);
   193 				gb.initBrowser(is);
   194 				is.close();
   194 				is.close();
   195 			}
   195 			}
   196 			if (args.length > 1) {
   196 			if (args.length > 1) {
   197 			    gb.gv.getGraph().layout(null);
       
   198                             try {
   197                             try {
   199 			      if (args[1].endsWith(".ps")) {
   198 			      if (args[1].endsWith(".ps")) {
   200                                 gb.gv.PS(args[1], true);
   199                                 gb.gv.PS(args[1], true);
   201                               } else if (args[1].endsWith(".eps")) {
   200                               } else if (args[1].endsWith(".eps")) {
   202                                 gb.gv.PS(args[1], false);
   201                                 gb.gv.PS(args[1], false);
   204                                 System.err.println("Unknown file type: " + args[1]);
   203                                 System.err.println("Unknown file type: " + args[1]);
   205                               }
   204                               }
   206                             } catch (IOException exn) {
   205                             } catch (IOException exn) {
   207                               System.err.println("Unable to write file " + args[1]);
   206                               System.err.println("Unable to write file " + args[1]);
   208                             }
   207                             }
       
   208 			    System.exit(0);
   209                         } else {
   209                         } else {
   210 			    f=new GraphBrowserFrame(gb);
   210 			    f=new GraphBrowserFrame(gb);
   211 			    f.setSize(700,500);
   211 			    f.setSize(700,500);
   212 			    f.show();
   212 			    f.show();
   213                         }
   213                         }
   214 		} catch (IOException exn) {
   214 		} catch (IOException exn) {
   215 			System.err.println("Can't open graph file "+args[0]);
   215 			System.err.println("Can't open graph file "+args[0]);
   216 		}
   216 		}
   217 		System.exit(0);
       
   218 	}
   217 	}
   219 }
   218 }
   220 
   219