@@ -27,11 +27,18 @@ public class Main {
2727 * "problem.JarWatcher", "problem.TextPrinterWatcher",
2828 * "problem.TxtWatcher", "problem.IWatcher"
2929 */
30+ // "java.lang.Runtime",
31+ // "java.io.FilterInputStream",
32+ // "java.awt.Desktop",
33+ "java.util.Calendar"
34+
3035 };
3136
3237 public static final String [] PACKAGES = {
33- //"edu.rosehulman.cjjb"//, "edu.rosehulman.asm"
34- // "headfirst.factory.pizzaaf", "headfirst.factory.pizzafm"
38+ // "edu.rosehulman.cjjb", "edu.rosehulman.asm", "edu.rosehulman.cjjb.javaModel",
39+ // "edu.rosehulman.cjjb.javaModel.checks", "edu.rosehulman.cjjb.javaModel.modifier",
40+ // "edu.rosehulman.cjjb.javaModel.visitor"
41+ // "headfirst.factory.pizzaaf", "headfirst.factory.pizzafm"
3542 };
3643
3744 public static final String boilerPlate = "digraph G { fontname = \" Bitstream Vera Sans\" fontsize = 8 node [ fontname = \" Bitstream Vera Sans\" fontsize = 8 shape = \" record\" ] edge [ fontname = \" Bitstream Vera Sans\" fontsize = 8 ]" ;
@@ -50,7 +57,7 @@ public static void main(String[] args) throws IOException, ClassNotFoundExceptio
5057 QualifiedMethod qm = new QualifiedMethod (getMethodFromArgs (args ), getDescFromArgs (args ));
5158 // QualifiedMethod qm = new QualifiedMethod("shuffle", "(Ljava/util/List;)V");
5259 String clazz = getClassFromArgs (args );
53- JavaModelClassVisitor visitor = new JavaModelClassVisitor (out , clazz , qm , 2 );
60+ JavaModelClassVisitor visitor = new JavaModelClassVisitor (clazz , qm , 2 );
5461
5562 visitor .buildSeqModel ();
5663 ISequenceVisitor seqVisitor = new SDSequenceVisitor (clazz , qm , 2 , out );
@@ -66,11 +73,11 @@ public static void main(String[] args) throws IOException, ClassNotFoundExceptio
6673
6774 visitor = new JavaModelClassVisitor (classesToVisit , out );
6875 visitor .buildUMLModel ();
69- IUMLVisitor umlVisitor = new UMLDotVisitor (out );
76+ IUMLVisitor umlVisitor = new UMLDotVisitor (out , visitor . getModel () );
7077 visitor .getModel ().accept (umlVisitor );
7178 break ;
7279 case "EXAMPLE" :
73- exampleCall (new FileOutputStream ("output .txt" ));
80+ exampleCall (new FileOutputStream ("umlOutput.txt" ), new FileOutputStream ( "seqOutput .txt" ));
7481 break ;
7582 default :
7683 System .out .println ("Not a valid diagram type. Valid Types: SEQ|UML|EXAMPLE" );
@@ -133,7 +140,7 @@ private static List<String> getClassesFromArgs(String[] args) {
133140 return toReturn ;
134141 }
135142
136- private static void exampleCall (OutputStream out ) throws IOException , ClassNotFoundException {
143+ private static void exampleCall (OutputStream umlOut , OutputStream seqOut ) throws IOException , ClassNotFoundException {
137144 Set <String > classesToVisit = new HashSet <String >();
138145 classesToVisit .addAll (Arrays .asList (CLASSES ));
139146
@@ -142,14 +149,14 @@ private static void exampleCall(OutputStream out ) throws IOException, ClassNotF
142149 }
143150
144151 QualifiedMethod qm = new QualifiedMethod ("shuffle" , "(Ljava/util/List;)V" );
145- JavaModelClassVisitor visitor = new JavaModelClassVisitor (classesToVisit , out , "java.util.Collections" , qm , 2 );
152+ JavaModelClassVisitor visitor = new JavaModelClassVisitor (classesToVisit , "java.util.Collections" , qm , 2 );
146153
147154 visitor .buildUMLModel ();
148- IUMLVisitor umlVisitor = new UMLDotVisitor (out );
155+ IUMLVisitor umlVisitor = new UMLDotVisitor (umlOut , visitor . getModel () );
149156 visitor .getModel ().accept (umlVisitor );
150157
151158 visitor .buildSeqModel ();
152- ISequenceVisitor seqVisitor = new SDSequenceVisitor ("java.util.Collections" , qm , 2 , out );
159+ ISequenceVisitor seqVisitor = new SDSequenceVisitor ("java.util.Collections" , qm , 2 , seqOut );
153160 visitor .getModel ().accept (seqVisitor );
154161 }
155162
0 commit comments