diff --git a/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/actions/InteractiveFeatureLocatorAction.java b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/actions/InteractiveFeatureLocatorAction.java index 35ca8c9..e5f632d 100644 --- a/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/actions/InteractiveFeatureLocatorAction.java +++ b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/actions/InteractiveFeatureLocatorAction.java @@ -272,6 +272,8 @@ // ��̓{�^���������̏��� analysisButton.addSelectionListener(new SelectionAdapter() { + private InteractiveDerivationView interactiveDerivationView; + public void widgetSelected(SelectionEvent arg0) { featureXMLPath = featureFolderPath + "\\feature" + featureNo + ".xml"; File featureFile = new File(featureXMLPath); @@ -289,14 +291,17 @@ page.findView(TraceView.ID); } } - InteractiveDerivationView.theInstance.reset(); + interactiveDerivationView = InteractiveDerivationView.theInstance; + interactiveDerivationView.reset(); shell.dispose(); try { Feature feature = new Feature(featureFolderPath); - doAnalyze(feature); + derivationManager = doAnalyze(feature); traceListView.setDerivationManager(derivationManager); traceListView.updateViewer(); + interactiveDerivationView.setDerivationManager(derivationManager); + interactiveDerivationView.updateViewer(); } catch (ParserConfigurationException | SAXException | IOException e2) { e2.printStackTrace(); } @@ -340,10 +345,11 @@ } // scenario.xml�����Ƃɉ�� - public void doAnalyze(Feature feature) { + public DerivationManager doAnalyze(Feature feature) { // System.out.println("��͊J�n"); - derivationManager = new DerivationManager(feature); + DerivationManager derivationManager = new DerivationManager(feature); derivationManager.firstDerivation(); + return derivationManager; } public ArrayList getFolder(File[] files) { diff --git a/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/views/CallTreeGraph.java b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/views/CallTreeGraph.java index 3d91f81..f7c9c47 100644 --- a/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/views/CallTreeGraph.java +++ b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/views/CallTreeGraph.java @@ -1,10 +1,12 @@ package interactivefeaturelocator.views; +import interactivefeaturelocator.model.DerivationManager; import interactivefeaturelocator.model.DerivationSession; import interactivefeaturelocator.model.CallTreeGraphConnection; import interactivefeaturelocator.model.CallTreeGraphLayoutAlgorithm; import interactivefeaturelocator.model.CallTreeGraphLayoutAlgorithm; import interactivefeaturelocator.model.CallTreeGraphNode; +import interactivefeaturelocator.model.DerivationUnit; import org.eclipse.core.resources.IFile; import org.eclipse.swt.SWT; @@ -23,9 +25,11 @@ public class CallTreeGraph extends Graph { private CallTreeGraphNode currentNode; + private InteractiveDerivationSessionTab sessionTab; - public CallTreeGraph(Composite parent, int style) { + public CallTreeGraph(Composite parent, InteractiveDerivationSessionTab sessionTab, int style) { super(parent, style); + this.sessionTab = sessionTab; // TODO Auto-generated constructor stub } @@ -57,6 +61,14 @@ return callerNode; } + public DerivationManager getDerivationManager() { + return sessionTab.getDerivationManager(); + } + + public DerivationUnit getDerivationUnit() { + return sessionTab.getDerivationUnit(); + } + public CallTreeGraphNode getCurrentNode() { return currentNode; } diff --git a/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/views/InteractionComposite.java b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/views/InteractionComposite.java index 878dc89..4a06be9 100644 --- a/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/views/InteractionComposite.java +++ b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/views/InteractionComposite.java @@ -1,6 +1,8 @@ package interactivefeaturelocator.views; +import interactivefeaturelocator.model.DerivationManager; import interactivefeaturelocator.model.DerivationSession; +import interactivefeaturelocator.model.DerivationUnit; import interactivefeaturelocator.model.MethodInfo; import interactivefeaturelocator.model.MethodProperty; import interactivefeaturelocator.model.CallTreeGraphNode; @@ -27,10 +29,12 @@ private Combo combo; private Label discription; private Button decideButton; - - public InteractionComposite(Composite parent, int style, MethodExecution me, boolean dataflow) { + private InteractiveDerivationSessionTab sessionTab; + + public InteractionComposite(Composite parent, InteractiveDerivationSessionTab sessionTab, int style, MethodExecution me, boolean dataflow) { super(parent, style); // TODO Auto-generated constructor stub + this.sessionTab = sessionTab; this.me = me; this.dataflow = dataflow; @@ -56,6 +60,9 @@ // session.decideMethodProperty(((ArrayList)combo.getData()).get(index)); MessageDialog.openInformation(parent.getShell(), "����", me.getSignature() + "��" + combo.getText() + "�Ɍ���B"); + DerivationManager manager = getDerivationManager(); + int index = combo.getSelectionIndex(); + manager.nextDerivation(getDerivationUnit(), ((ArrayList)combo.getData()).get(index)); } }); decideButton.setText("����"); @@ -120,5 +127,11 @@ discription.setText(text); } - + public DerivationManager getDerivationManager() { + return sessionTab.getDerivationManager(); + } + + public DerivationUnit getDerivationUnit() { + return sessionTab.getDerivationUnit(); + } } diff --git a/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/views/InteractiveDerivationSessionTab.java b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/views/InteractiveDerivationSessionTab.java index b139673..94542b6 100644 --- a/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/views/InteractiveDerivationSessionTab.java +++ b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/views/InteractiveDerivationSessionTab.java @@ -4,7 +4,9 @@ import java.util.HashMap; import java.util.Set; +import interactivefeaturelocator.model.DerivationManager; import interactivefeaturelocator.model.DerivationSession; +import interactivefeaturelocator.model.DerivationUnit; import interactivefeaturelocator.model.MethodInfo; import interactivefeaturelocator.model.MethodProperty; import interactivefeaturelocator.model.CallTreeGraphNode; @@ -29,9 +31,9 @@ private Composite bodyComposite; private CallTreeGraph graph; private InteractionComposite interactionComposite; - private CTabFolder parent; + private InteractiveDerivationTabFolder parent; - public InteractiveDerivationSessionTab(CTabFolder parent, int style, MethodExecution seed) { + public InteractiveDerivationSessionTab(InteractiveDerivationTabFolder parent, int style, MethodExecution seed) { super(parent, style); // TODO Auto-generated constructor stub this.parent = parent; @@ -49,7 +51,7 @@ public void createCallTreeGraph() { // �㕔�̌Ăяo���؂�`�悷��Composite - graph = new CallTreeGraph(bodyComposite, SWT.BORDER); + graph = new CallTreeGraph(bodyComposite, this, SWT.BORDER); FormData graphForm = new FormData(); graphForm.top = new FormAttachment(0, 0); graphForm.left = new FormAttachment(0, 0); @@ -66,7 +68,7 @@ public void createInteractionComposite(boolean dataflow) { // �����̃J�����g���\�b�h�̐����ƑI���{�^����\������Composite - interactionComposite = new InteractionComposite(bodyComposite, SWT.NONE, session.getCurrentMethodExecution(), false); + interactionComposite = new InteractionComposite(bodyComposite, this, SWT.NONE, session.getCurrentMethodExecution(), false); interactionComposite.setLayout(new FormLayout()); FormData interactionData = new FormData(); interactionData.top = new FormAttachment(graph, 0); @@ -75,6 +77,14 @@ interactionData.bottom = new FormAttachment(100, 0); interactionComposite.setLayoutData(interactionData); } + + public DerivationManager getDerivationManager() { + return parent.getDerivationManager(); + } + + public DerivationUnit getDerivationUnit() { + return parent.getDerivationUnit(); + } public CallTreeGraph getCallTreeGraph() { return this.graph; diff --git a/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/views/InteractiveDerivationTabFolder.java b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/views/InteractiveDerivationTabFolder.java index 3b908c0..a5002d5 100644 --- a/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/views/InteractiveDerivationTabFolder.java +++ b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/views/InteractiveDerivationTabFolder.java @@ -21,11 +21,15 @@ public class InteractiveDerivationTabFolder extends CTabFolder { final public DerivationUnit iu = null; public HashSet methodExecs; // ���o����(�ߒ�) + private InteractiveDerivationView interactiveDerivationView; + private DerivationUnit unit; - public InteractiveDerivationTabFolder(Composite parent, int style, HashSet methodExecs) { + public InteractiveDerivationTabFolder(Composite parent, InteractiveDerivationView interactiveDerivationView, int style, DerivationUnit unit) { super(parent, style); // iu = new InferenceUnit(trace); - this.methodExecs = methodExecs; + this.interactiveDerivationView = interactiveDerivationView; + this.unit = unit; + this.methodExecs = unit.getMethodExecutions(); createTab(methodExecs); // TODO Auto-generated constructor stub } @@ -60,6 +64,14 @@ // } } + public DerivationManager getDerivationManager() { + return interactiveDerivationView.getDerivationManager(); + } + + public DerivationUnit getDerivationUnit() { + return unit; + } + public void showFolder() { } diff --git a/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/views/InteractiveDerivationView.java b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/views/InteractiveDerivationView.java index 0737b7a..50221a3 100644 --- a/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/views/InteractiveDerivationView.java +++ b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/views/InteractiveDerivationView.java @@ -36,6 +36,7 @@ // private HashMap traceToThreads = new HashMap<>(); private HashMap> traceToMethods = new HashMap<>(); // private SelectMethodTabFolder tabFolder; + private DerivationManager derivationManager; public InteractiveDerivationView() { // TODO Auto-generated constructor stub @@ -48,8 +49,8 @@ setParent(parent); } - public void createTabFolder(HashSet methodExecs) { - InteractiveDerivationTabFolder tabFolder = new InteractiveDerivationTabFolder(this.getParent(), SWT.NONE | SWT.BOTTOM, methodExecs); + public void createTabFolder(DerivationUnit unit) { + InteractiveDerivationTabFolder tabFolder = new InteractiveDerivationTabFolder(this.getParent(), this, SWT.NONE | SWT.BOTTOM, unit); tabFolder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); tabFolder.setSimple(false); if (focusFolder == null) { @@ -123,4 +124,17 @@ this.tabFolders.clear(); this.traceToMethods.clear(); } + + public void setDerivationManager(DerivationManager derivationManager) { + this.derivationManager = derivationManager; + } + + public DerivationManager getDerivationManager() { + return derivationManager; + } + + public void updateViewer() { + // TODO Auto-generated method stub + + } } diff --git a/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/views/TraceView.java b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/views/TraceView.java index 3997b91..f59bbc2 100644 --- a/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/views/TraceView.java +++ b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/views/TraceView.java @@ -93,7 +93,7 @@ DerivationUnit unit = derivationManager.getDerivationUnit(i); Trace plusTrace = unit.getPlusTrace(); traces.add(plusTrace); - interactiveDerivationView.createTabFolder(unit.getMethodExecutions()); + interactiveDerivationView.createTabFolder(unit); System.out.println(plusTrace.getFileName()); } viewer.setInput(makeData(traces));