/** Sets the flagstate as a source node.
*/
public void setAsSourceNode(){
- issourcenode=true;
- this.tasks=new Vector();
+ if(!issourcenode){
+ issourcenode=true;
+ this.tasks=new Vector();
+ }
}
public void addAllocatingTask(TaskDescriptor task){
- tasks.addElement(task);
+ tasks.add(task);
}
public Vector getAllocatingTasks(){
Hashtable<TaskNode,TaskNode> alltasknodes;
//Colors
- String colors[]={"red","blue","green","brown","orange","pink","black","brown","grey","olivedrab"};
+ String colors[]={"red","blue","green","brown","orange","pink","black","grey","olivedrab","yellow"};
public TaskGraph(State state, TaskAnalysis taskanalysis) {
this.state=state;
Set fsnodes;
if (cd.hasFlags()&&((fsnodes=taskanalysis.getFlagStates(cd))!=null)){
- System.out.println(cd.getSymbol());
+ //
+ System.out.println("\nWorking on fses of Class: "+cd.getSymbol());
+ //
for(Iterator it=fsnodes.iterator();it.hasNext();) {
FlagState fs=(FlagState)it.next();
+ //
+ System.out.println("Evaluating fs: "+fs.getTextLabel());
+ //
Iterator it_inedges=fs.inedges();
TaskNode tn,sn;
if (fs.isSourceNode()){
+ //
+ System.out.println("A sourcenode");
+ //
if(fs.edges().hasNext()){
Vector allocatingtasks=fs.getAllocatingTasks();
+ //
+ if (allocatingtasks.iterator().hasNext())
+ System.out.println("has been allocated by "+allocatingtasks.size()+" tasks");
+ //
for(Iterator it_at=allocatingtasks.iterator();it_at.hasNext();){
- tn=new TaskNode(((TaskDescriptor)it_at.next()).getSymbol());
+ TaskDescriptor allocatingtd=(TaskDescriptor)it_at.next();
+ //
+ System.out.println(allocatingtd.getSymbol());
+ //
+ tn=new TaskNode(allocatingtd.getSymbol());
+
addEdges(fs,tn,alltasknodes,ColorID);
}
}
public class WebInterface {
TaskAnalysis taskanalysis;
TaskGraph taskgraph;
+ TagAnalysis taganalysis;
State state;
Hashtable flagstatemap;
Hashtable taskgraphmap;
Hashtable taskmap; // to hold the filenames for each of the pages linked to tasks in the program.
GarbageAnalysis garbageanalysis;
- public WebInterface(State state, TaskAnalysis taskanalysis, TaskGraph taskgraph, GarbageAnalysis garbageanalysis) {
+ public WebInterface(State state, TaskAnalysis taskanalysis, TaskGraph taskgraph, GarbageAnalysis garbageanalysis, TagAnalysis taganalysis) {
this.state=state;
this.taskanalysis=taskanalysis;
this.taskgraph=taskgraph;
this.garbageanalysis=garbageanalysis;
+ this.taganalysis=taganalysis;
flagstatemap=new Hashtable();
taskgraphmap=new Hashtable();
PrintWriter pw=new PrintWriter(out);
pw.println("<br><br><h3>Task: "+td.toString()+"</h3><br>");
printTask(td,pw);
+
+ //printing out the classes that are instantiated by this task
+ pw.println("<br><h3>Instantiated Classes:</h3>");
+ Set newstates=taganalysis.getFlagStates(td);
+ for(Iterator fsit=newstates.iterator();fsit.hasNext();) {
+ FlagState fsnew=(FlagState) fsit.next();
+ ClassDescriptor cd=fsnew.getClassDescriptor();
+ pw.println(" <a href=\"/"+cd.getSymbol()+".html\">"+cd.getSymbol()+"</a><br>");
+ pw.println(" "+fsnew.getTextLabel()+"<br>");
+ }
+
pw.flush();
} catch (Exception e) {e.printStackTrace();System.exit(-1);}
return null;
tg.createDOTfiles();
if (state.WEBINTERFACE) {
GarbageAnalysis ga=new GarbageAnalysis(state, ta);
- WebInterface wi=new WebInterface(state, ta, tg, ga);
+ WebInterface wi=new WebInterface(state, ta, tg, ga, taganalysis);
JhttpServer serve=new JhttpServer(8000,wi);
serve.run();
}