misc cleanups to visualization utilities

git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@2464 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
This commit is contained in:
sjfink 2008-01-24 23:12:52 +00:00
parent 444d3a92b0
commit 8512589f49
5 changed files with 6 additions and 113 deletions

View File

@ -139,3 +139,4 @@ analyses
monitorenter
monitorexit
dominators
yahave

View File

@ -17,65 +17,33 @@ import org.eclipse.jface.window.ApplicationWindow;
*
* TODO: unify with other launchers?
*/
public abstract class EJfaceApplicationRunner {
public abstract class AbstractJFaceRunner {
/**
* The cached value of the '{@link #getApplicationWindow() <em>Application Window</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getApplicationWindow()
* @generated
* @ordered
*/
protected ApplicationWindow applicationWindow = null;
protected boolean blockInput = false;
protected EJfaceApplicationRunner() {
protected AbstractJFaceRunner() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ApplicationWindow getApplicationWindow() {
return applicationWindow;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setApplicationWindow(ApplicationWindow newApplicationWindow) {
applicationWindow = newApplicationWindow;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean isBlockInput() {
return blockInput;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setBlockInput(boolean newBlockInput) {
blockInput = newBlockInput;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String toString() {
StringBuffer result = new StringBuffer(super.toString());
@ -86,5 +54,4 @@ public abstract class EJfaceApplicationRunner {
result.append(')');
return result.toString();
}
} //EJfaceApplicationRunner
}

View File

@ -1,31 +0,0 @@
/*******************************************************************************
* Copyright (c) 2002 - 2006 IBM Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.ibm.wala.viz;
import com.ibm.wala.ipa.callgraph.CGNode;
import com.ibm.wala.util.graph.NodeDecorator;
public abstract class BasicBlockDecorator implements NodeDecorator {
private CGNode currentNode;
public BasicBlockDecorator() {
super();
}
public CGNode getCurrentNode() {
return currentNode;
}
public void setCurrentNode(CGNode currentNode) {
this.currentNode = currentNode;
}
}

View File

@ -35,7 +35,7 @@ import com.ibm.wala.util.warnings.WalaException;
/**
*/
public class SWTTreeViewer extends EJfaceApplicationRunner {
public class SWTTreeViewer extends AbstractJFaceRunner {
protected Graph graphInput;

View File

@ -1,44 +0,0 @@
/*******************************************************************************
* Copyright (c) 2002 - 2006 IBM Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.ibm.wala.viz;
import com.ibm.wala.ipa.callgraph.CallGraph;
import com.ibm.wala.ssa.IR;
import com.ibm.wala.util.warnings.WalaException;
/**
* @author sfink
*
*/
public class ViewAnnotatedIRAction extends ViewIRAction {
private final BasicBlockDecorator dec;
public ViewAnnotatedIRAction(SWTTreeViewer viewer, CallGraph cg, String psFile, String dotFile, String dotExe, String gvExe,
BasicBlockDecorator dec) {
super(viewer, cg, psFile, dotFile, dotExe, gvExe);
this.dec = dec;
}
@Override
public void run() {
IR ir = getIRForSelection();
// spawn the viewer
System.err.println("Spawn IR Viewer for " + ir.getMethod());
try {
dec.setCurrentNode(getNodeForSelection());
GhostviewUtil.ghostviewIR(getCg().getClassHierarchy(), ir, getPsFile(), getDotFile(), getDotExe(), getGvExe(), dec);
} catch (WalaException e) {
e.printStackTrace();
}
}
}