diff --git a/src/org/ntlab/actions/AbstractFrameAction.java b/src/org/ntlab/actions/AbstractFrameAction.java deleted file mode 100644 index 0fed0cd..0000000 --- a/src/org/ntlab/actions/AbstractFrameAction.java +++ /dev/null @@ -1,26 +0,0 @@ -package org.ntlab.actions; - -import java.awt.event.ActionEvent; - -import javax.swing.AbstractAction; - -import org.ntlab.deltaViewer.MagnetRONFrame; - -public class AbstractFrameAction extends AbstractAction { - - protected MagnetRONFrame magnetRONFrame = null; - - public AbstractFrameAction() { - } - - public AbstractFrameAction(String string, MagnetRONFrame magnetRONFrame) { - super(string); - this.magnetRONFrame = magnetRONFrame; - } - - @Override - public void actionPerformed(ActionEvent e) { - - } - -} diff --git a/src/org/ntlab/actions/AbstractMagnetRONAction.java b/src/org/ntlab/actions/AbstractMagnetRONAction.java new file mode 100644 index 0000000..2033193 --- /dev/null +++ b/src/org/ntlab/actions/AbstractMagnetRONAction.java @@ -0,0 +1,26 @@ +package org.ntlab.actions; + +import java.awt.event.ActionEvent; + +import javax.swing.AbstractAction; + +import org.ntlab.deltaViewer.IMagnetRON; + +public class AbstractMagnetRONAction extends AbstractAction { + + protected IMagnetRON magnetRON = null; + + public AbstractMagnetRONAction() { + } + + public AbstractMagnetRONAction(String string, IMagnetRON magnetRON) { + super(string); + this.magnetRON = magnetRON; + } + + @Override + public void actionPerformed(ActionEvent e) { + + } + +} diff --git a/src/org/ntlab/actions/ExtractAction.java b/src/org/ntlab/actions/ExtractAction.java new file mode 100644 index 0000000..ee66c62 --- /dev/null +++ b/src/org/ntlab/actions/ExtractAction.java @@ -0,0 +1,21 @@ +package org.ntlab.actions; + +import java.awt.event.ActionEvent; + +import org.ntlab.deltaViewer.IMagnetRON; +import org.ntlab.featureExtractor.Feature; + +public class ExtractAction extends AbstractMagnetRONAction { + + private Feature feature = null; + + public ExtractAction(Feature feature, IMagnetRON magnetRON) { + super(feature.getName(), magnetRON); + this.feature = feature; + } + + @Override + public void actionPerformed(ActionEvent e) { + magnetRON.doExtract(feature); + } +} diff --git a/src/org/ntlab/actions/OpenAction.java b/src/org/ntlab/actions/OpenAction.java index c0620a1..fc7d271 100644 --- a/src/org/ntlab/actions/OpenAction.java +++ b/src/org/ntlab/actions/OpenAction.java @@ -6,14 +6,14 @@ import javax.swing.JFileChooser; import javax.swing.filechooser.FileFilter; -import org.ntlab.deltaViewer.MagnetRONFrame; +import org.ntlab.deltaViewer.IMagnetRON; -public class OpenAction extends AbstractFrameAction { +public class OpenAction extends AbstractMagnetRONAction { private String lastDir = null; - public OpenAction(MagnetRONFrame magnetRONFrame) { - super("�J��...", magnetRONFrame); + public OpenAction(IMagnetRON magnetRON) { + super("�J��...", magnetRON); } @Override @@ -35,6 +35,7 @@ int rc = fc.showDialog(null, "�J��"); if (rc == JFileChooser.APPROVE_OPTION) { lastDir = fc.getSelectedFile().getParent(); + magnetRON.open(fc.getSelectedFile()); } } diff --git a/src/org/ntlab/actions/StartAnimationAction.java b/src/org/ntlab/actions/StartAnimationAction.java index 4fa8a34..852f6db 100644 --- a/src/org/ntlab/actions/StartAnimationAction.java +++ b/src/org/ntlab/actions/StartAnimationAction.java @@ -2,19 +2,19 @@ import java.awt.event.ActionEvent; -import org.ntlab.deltaViewer.MagnetRONFrame; +import org.ntlab.deltaViewer.IMagnetRON; -public class StartAnimationAction extends AbstractFrameAction { +public class StartAnimationAction extends AbstractMagnetRONAction { - public StartAnimationAction(MagnetRONFrame magnetRONFrame) { - super("�Đ�", magnetRONFrame); + public StartAnimationAction(IMagnetRON magnetRON) { + super("�Đ�", magnetRON); } @Override public void actionPerformed(ActionEvent e) { new Thread() { public void run() { - magnetRONFrame.startCollaborationViewer(); + magnetRON.startAnimation(); } }.start(); } diff --git a/src/org/ntlab/deltaViewer/DeltaViewerSample.java b/src/org/ntlab/deltaViewer/DeltaViewerSample.java index 3c5d7ff..efe0dea 100644 --- a/src/org/ntlab/deltaViewer/DeltaViewerSample.java +++ b/src/org/ntlab/deltaViewer/DeltaViewerSample.java @@ -10,7 +10,7 @@ // Build a frame, create a graph, and add the graph to the frame so you can actually see the graph. MagnetRONFrame frame = new MagnetRONFrame(); frame.setVisible(true); - frame.startAnimation(); + frame.startAll(); } } diff --git a/src/org/ntlab/deltaViewer/MagnetRONFrame.java b/src/org/ntlab/deltaViewer/MagnetRONFrame.java index 9c96d80..c518e35 100644 --- a/src/org/ntlab/deltaViewer/MagnetRONFrame.java +++ b/src/org/ntlab/deltaViewer/MagnetRONFrame.java @@ -3,11 +3,13 @@ import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.HeadlessException; +import java.io.File; import java.util.AbstractMap; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Map.Entry; import javax.swing.JFrame; @@ -16,6 +18,8 @@ import org.ntlab.deltaExtractor.ExtractedStructure; import org.ntlab.deltaExtractor.IAliasCollector; import org.ntlab.deltaExtractor.IAliasTracker; +import org.ntlab.featureExtractor.Extract; +import org.ntlab.featureExtractor.Feature; import org.ntlab.trace.MethodExecution; import org.ntlab.trace.ObjectReference; import org.ntlab.trace.Reference; @@ -23,17 +27,13 @@ import org.ntlab.trace.TraceJSON; import org.ntlab.trace.TracePoint; -public class MagnetRONFrame extends JFrame { - // Delta Extract Type - protected static final String CONTAINER_COMPONENT = "Container-Component"; - protected static final String CONTAINER_COMPONENT_COLLECTION = "Container-Component(Collection)"; - protected static final String THIS_ANOTHER = "This-Another"; - +public class MagnetRONFrame extends JFrame implements IMagnetRON { private static Dimension DEFAULT_SIZE = new Dimension(1300, 700); private static String WINDOW_TITLE = "Delta Viewer"; private TraceJSON trace = null; private DeltaExtractorJSON s = null; + private List features = new ArrayList<>(); private CollaborationViewer viewer = null; private MagnetRONMenuBar menuBar; @@ -41,8 +41,8 @@ private Map argsMap = new HashMap<>(); private IObjectCallGraph objectCallGraph; private IAliasCollector aliasCollector; - - public MagnetRONFrame() throws HeadlessException { + +public MagnetRONFrame() throws HeadlessException { super(WINDOW_TITLE); setSize(DEFAULT_SIZE); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); @@ -56,15 +56,11 @@ pack(); } - public void setTrace(TraceJSON trace) { - this.trace = trace; - } - public TraceJSON getTrace() { return trace; } - public void startAnimation() { + public void startAll() { // Change Here! setArgmentsForDeltaExtract(argsMap); //���o�������f���^�̈������i�[����Map��key @@ -103,6 +99,38 @@ // }.start(); } + @Override + public void open(File file) { + + } + + @Override + public void doExtract(Feature feature) { + Map.Entry extracted = extractMulti(feature); + objectCallGraph = extracted.getKey(); + aliasCollector = extracted.getValue(); + } + + private Entry extractMulti(Feature feature) { + CollaborationObjectCallGraph cocg = null; + CollaborationAliasCollector cac = null; + + for(Extract extract: feature.getExtracts()) { + Map.Entry extracted = extract(extract); + if (cocg == null) { + cocg = new CollaborationObjectCallGraph(extracted.getKey()); + } else { + cocg.merge(extracted.getKey()); + } + if (cac == null) { + cac = new CollaborationAliasCollector(extracted.getValue()); + } else { + cac.merge(extracted.getValue()); + } + } + return new AbstractMap.SimpleEntry(cocg, cac); + } + public Map.Entry extractMulti(List keys) { CollaborationObjectCallGraph cocg = null; CollaborationAliasCollector cac = null; @@ -140,6 +168,67 @@ return new AbstractMap.SimpleEntry(cocg, cac); } + private Entry extract(Extract extract) { + if (extract.getType() == Extract.CONTAINER_COMPONENT || extract.getType() == Extract.CONTAINER_COMPONENT_COLLECTION) { + + HashMap threads = trace.getAllThreads(); + List eList = new ArrayList<>(); + List dacList = new ArrayList<>(); + if (threads.values().size() == 1) { + ThreadInstance thread = threads.values().iterator().next(); // �Ō�̃X���b�h�����Ă��邾���c + TracePoint tp = thread.getRoot().get(thread.getRoot().size() - 1).getExitPoint(); + Reference reference = new Reference(extract.getSrcId(), extract.getDstId(), extract.getSrcClass(), extract.getDstClass()); + IAliasTracker dac = new DeltaAliasCollector(); + ExtractedStructure e = s.extract(reference, tp, dac); + eList.add(e); + dacList.add(dac); + } else { + for (ThreadInstance thread: threads.values()) { + TracePoint tp = thread.getRoot().get(thread.getRoot().size() - 1).getExitPoint(); + Reference reference = new Reference(extract.getSrcId(), extract.getDstId(), extract.getSrcClass(), extract.getDstClass()); + if (extract.getType() == Extract.CONTAINER_COMPONENT_COLLECTION) { + reference.setCollection(true); + } +// reference.setArray(true); +// reference.setFinalLocal(true); +// reference.setCreation(true); + ExtractedStructure e = null; + do { + if (e == null) { + IAliasTracker dac = new DeltaAliasCollector(); + e = s.extract(reference, tp, dac); + System.out.println(e); + if (e != null) { + eList.add(e); + dacList.add(dac); + } + } else { + tp = e.getRelatedTracePoint().duplicate(); + tp.stepBackOver(); + IAliasTracker dac = new DeltaAliasCollector(); + e = s.extract(reference, tp, dac); + System.out.println(e); + if (e != null) { + eList.add(e); + dacList.add(dac); + System.out.println("add" + eList.size() + ", " + dacList.size()); + } + } + } while (e != null); + System.out.println("---------------------------"); + } + } + return new AbstractMap.SimpleEntry(eList.get(extract.getOrder()), dacList.get(extract.getOrder())); + } else { + IAliasTracker dac = new DeltaAliasCollector(); + MethodExecution me = trace.getLastMethodExecution(extract.getSrcClass()); + Map refs = me.getObjectReferences(extract.getDstClass()); + ObjectReference ref = refs.keySet().iterator().next(); + ExtractedStructure e = s.extract(refs.get(ref), ref, dac); + return new AbstractMap.SimpleEntry(e, dac); + } + } + public Map.Entry extract(String argsKey, int index) { // DeltaExtractorJSON dex = new DeltaExtractorJSON(trace); // HashMap threads = trace.getAllThreads(); @@ -221,7 +310,7 @@ // } long time = System.nanoTime(); - if (argsMap.get(argsKey)[5] == CONTAINER_COMPONENT || argsMap.get(argsKey)[5] == CONTAINER_COMPONENT_COLLECTION) { + if (argsMap.get(argsKey)[5] == Extract.CONTAINER_COMPONENT || argsMap.get(argsKey)[5] == Extract.CONTAINER_COMPONENT_COLLECTION) { HashMap threads = trace.getAllThreads(); List eList = new ArrayList<>(); @@ -238,7 +327,7 @@ for (ThreadInstance thread: threads.values()) { TracePoint tp = thread.getRoot().get(thread.getRoot().size() - 1).getExitPoint(); Reference reference = new Reference(argsMap.get(argsKey)[0], argsMap.get(argsKey)[1], argsMap.get(argsKey)[2], argsMap.get(argsKey)[3]); - if (argsMap.get(argsKey)[5] == CONTAINER_COMPONENT_COLLECTION) { + if (argsMap.get(argsKey)[5] == Extract.CONTAINER_COMPONENT_COLLECTION) { reference.setCollection(true); } // reference.setArray(true); @@ -339,7 +428,8 @@ } } - public void startCollaborationViewer() { + @Override + public void startAnimation() { // Build a frame, create a graph, and add the graph to the frame so you can actually see the graph. if (objectCallGraph != null && aliasCollector != null) { List relatedPoints = objectCallGraph.getRelatedPoints(); @@ -389,66 +479,66 @@ private void setArgmentsForDeltaExtract(Map map){ // one delta extract - String[] traceSample1 = {null, null, "","", "traces/traceSample1.txt", CONTAINER_COMPONENT_COLLECTION}; map.put("traceSample1", traceSample1); - String[] traceSample2 = {null, null, "","", "traces/traceSample2.txt", CONTAINER_COMPONENT_COLLECTION}; map.put("traceSample2", traceSample2); - String[] presenSample = {null, null, "","", "traces/presenSample.txt", CONTAINER_COMPONENT_COLLECTION}; map.put("presenSample", presenSample); - String[] worstCase = {null, null, "worstCase.P", "worstCase.M", "traces/_worstCase.txt", CONTAINER_COMPONENT_COLLECTION}; map.put("worstCase", worstCase); - String[] sample1 = {null, null, "sample1.D", "sample1.C", "traces\\sample1.trace", CONTAINER_COMPONENT_COLLECTION}; map.put("sample1", sample1); - String[] sampleArray = {null, null, "sampleArray.D", "sampleArray.C", "traces\\sampleArray.trace", CONTAINER_COMPONENT_COLLECTION}; map.put("sampleArray", sampleArray); - String[] sampleCollection = {null, null, "sampleCollection.D", "sampleCollection.C", "traces\\sampleCollection.trace", CONTAINER_COMPONENT_COLLECTION}; map.put("sampleCollection", sampleCollection); - String[] sampleCreate = {null, null, "sampleCreate.D", "sampleCreate.C", "traces\\sampleCreate.trace", CONTAINER_COMPONENT_COLLECTION}; map.put("sampleCreate", sampleCreate); - String[] sampleStatic = {null, null, "sampleStatic.D", "sampleStatic.C", "traces\\sampleStatic.trace", CONTAINER_COMPONENT_COLLECTION}; map.put("sampleStatic", sampleStatic); - String[] delta_eg1 = {null, null, "E","C", "traces/testTrace.txt", CONTAINER_COMPONENT_COLLECTION}; map.put("delta_eg1", delta_eg1); - String[] delta_eg5 = {null, null, "E","C", "traces/testTrace5.txt", CONTAINER_COMPONENT_COLLECTION}; map.put("delta_eg5", delta_eg5); - String[] testTrace2 = {null, null, "","", "traces/testTrace2.txt", CONTAINER_COMPONENT_COLLECTION}; map.put("testTrace2", testTrace2); - String[] testTrace3 = {null, null, "","", "traces/testTrace3.txt", CONTAINER_COMPONENT_COLLECTION}; map.put("testTrace3", testTrace3); - String[] objTrace5 = {null, null, "A","B", "traces/objTraceSample5.txt", CONTAINER_COMPONENT_COLLECTION}; map.put("objTrace5", objTrace5); + String[] traceSample1 = {null, null, "","", "traces/traceSample1.txt", Extract.CONTAINER_COMPONENT_COLLECTION}; map.put("traceSample1", traceSample1); + String[] traceSample2 = {null, null, "","", "traces/traceSample2.txt", Extract.CONTAINER_COMPONENT_COLLECTION}; map.put("traceSample2", traceSample2); + String[] presenSample = {null, null, "","", "traces/presenSample.txt", Extract.CONTAINER_COMPONENT_COLLECTION}; map.put("presenSample", presenSample); + String[] worstCase = {null, null, "worstCase.P", "worstCase.M", "traces/_worstCase.txt", Extract.CONTAINER_COMPONENT_COLLECTION}; map.put("worstCase", worstCase); + String[] sample1 = {null, null, "sample1.D", "sample1.C", "traces\\sample1.trace", Extract.CONTAINER_COMPONENT_COLLECTION}; map.put("sample1", sample1); + String[] sampleArray = {null, null, "sampleArray.D", "sampleArray.C", "traces\\sampleArray.trace", Extract.CONTAINER_COMPONENT_COLLECTION}; map.put("sampleArray", sampleArray); + String[] sampleCollection = {null, null, "sampleCollection.D", "sampleCollection.C", "traces\\sampleCollection.trace", Extract.CONTAINER_COMPONENT_COLLECTION}; map.put("sampleCollection", sampleCollection); + String[] sampleCreate = {null, null, "sampleCreate.D", "sampleCreate.C", "traces\\sampleCreate.trace", Extract.CONTAINER_COMPONENT_COLLECTION}; map.put("sampleCreate", sampleCreate); + String[] sampleStatic = {null, null, "sampleStatic.D", "sampleStatic.C", "traces\\sampleStatic.trace", Extract.CONTAINER_COMPONENT_COLLECTION}; map.put("sampleStatic", sampleStatic); + String[] delta_eg1 = {null, null, "E","C", "traces/testTrace.txt", Extract.CONTAINER_COMPONENT_COLLECTION}; map.put("delta_eg1", delta_eg1); + String[] delta_eg5 = {null, null, "E","C", "traces/testTrace5.txt", Extract.CONTAINER_COMPONENT_COLLECTION}; map.put("delta_eg5", delta_eg5); + String[] testTrace2 = {null, null, "","", "traces/testTrace2.txt", Extract.CONTAINER_COMPONENT_COLLECTION}; map.put("testTrace2", testTrace2); + String[] testTrace3 = {null, null, "","", "traces/testTrace3.txt", Extract.CONTAINER_COMPONENT_COLLECTION}; map.put("testTrace3", testTrace3); + String[] objTrace5 = {null, null, "A","B", "traces/objTraceSample5.txt", Extract.CONTAINER_COMPONENT_COLLECTION}; map.put("objTrace5", objTrace5); // �\�������̂Ƃ��ɗp����Toy program - String[] pre_Exp1 = {null, null, "E","C", "traces/pre_Exp1.txt", CONTAINER_COMPONENT_COLLECTION}; map.put("pre_Exp1", pre_Exp1); - String[] pre_Exp2 = {null, null, "E","C", "traces/pre_Exp2.txt", CONTAINER_COMPONENT_COLLECTION}; map.put("pre_Exp2", pre_Exp2); - String[] pre_Exp3 = {null, null, "E","C", "traces/pre_Exp3.txt", CONTAINER_COMPONENT_COLLECTION}; map.put("pre_Exp3", pre_Exp3); - String[] pre_Exp4 = {null, null, "E","C", "traces/pre_Exp4.txt", CONTAINER_COMPONENT_COLLECTION}; map.put("pre_Exp4", pre_Exp4); - String[] pre_Exp5 = {null, null, "E","C", "traces/pre_Exp5.txt", CONTAINER_COMPONENT_COLLECTION}; map.put("pre_Exp5", pre_Exp5); - String[] pre_Exp6 = {null, null, "E","C", "traces/pre_Exp6.txt", CONTAINER_COMPONENT_COLLECTION}; map.put("pre_Exp6", pre_Exp6); - String[] pre_Exp7 = {null, null, "E","C", "traces/pre_Exp7.txt", CONTAINER_COMPONENT_COLLECTION}; map.put("pre_Exp7", pre_Exp7); + String[] pre_Exp1 = {null, null, "E","C", "traces/pre_Exp1.txt", Extract.CONTAINER_COMPONENT_COLLECTION}; map.put("pre_Exp1", pre_Exp1); + String[] pre_Exp2 = {null, null, "E","C", "traces/pre_Exp2.txt", Extract.CONTAINER_COMPONENT_COLLECTION}; map.put("pre_Exp2", pre_Exp2); + String[] pre_Exp3 = {null, null, "E","C", "traces/pre_Exp3.txt", Extract.CONTAINER_COMPONENT_COLLECTION}; map.put("pre_Exp3", pre_Exp3); + String[] pre_Exp4 = {null, null, "E","C", "traces/pre_Exp4.txt", Extract.CONTAINER_COMPONENT_COLLECTION}; map.put("pre_Exp4", pre_Exp4); + String[] pre_Exp5 = {null, null, "E","C", "traces/pre_Exp5.txt", Extract.CONTAINER_COMPONENT_COLLECTION}; map.put("pre_Exp5", pre_Exp5); + String[] pre_Exp6 = {null, null, "E","C", "traces/pre_Exp6.txt", Extract.CONTAINER_COMPONENT_COLLECTION}; map.put("pre_Exp6", pre_Exp6); + String[] pre_Exp7 = {null, null, "E","C", "traces/pre_Exp7.txt", Extract.CONTAINER_COMPONENT_COLLECTION}; map.put("pre_Exp7", pre_Exp7); // Samples of Multiple Deltas - String[] getterOverlap1 = {null, null, "getterOverlap.F","getterOverlap.D", "traces/getterOverlap.txt", CONTAINER_COMPONENT_COLLECTION}; map.put("getterOverlap1", getterOverlap1); - String[] getterOverlap2 = {null, null, "getterOverlap.G","getterOverlap.D", "traces/getterOverlap.txt", CONTAINER_COMPONENT_COLLECTION}; map.put("getterOverlap2", getterOverlap2); - String[] setterOverlap1 = {null, null, "setterOverlap.F","setterOverlap.C", "traces/setterOverlap.txt", CONTAINER_COMPONENT_COLLECTION}; map.put("setterOverlap1", setterOverlap1); - String[] setterOverlap2 = {null, null, "setterOverlap.G","setterOverlap.C", "traces/setterOverlap.txt", CONTAINER_COMPONENT_COLLECTION}; map.put("setterOverlap2", setterOverlap2); + String[] getterOverlap1 = {null, null, "getterOverlap.F","getterOverlap.D", "traces/getterOverlap.txt", Extract.CONTAINER_COMPONENT_COLLECTION}; map.put("getterOverlap1", getterOverlap1); + String[] getterOverlap2 = {null, null, "getterOverlap.G","getterOverlap.D", "traces/getterOverlap.txt", Extract.CONTAINER_COMPONENT_COLLECTION}; map.put("getterOverlap2", getterOverlap2); + String[] setterOverlap1 = {null, null, "setterOverlap.F","setterOverlap.C", "traces/setterOverlap.txt", Extract.CONTAINER_COMPONENT_COLLECTION}; map.put("setterOverlap1", setterOverlap1); + String[] setterOverlap2 = {null, null, "setterOverlap.G","setterOverlap.C", "traces/setterOverlap.txt", Extract.CONTAINER_COMPONENT_COLLECTION}; map.put("setterOverlap2", setterOverlap2); - String[] test = {null, null, "org.argouml.uml.diagram.static_structure.ui.FigClass","org.tigris.gef.base.LayerPerspectiveMutable", "traces\\ArgoUMLBenchmarkWithMoreStandardClasses.trace", CONTAINER_COMPONENT}; map.put("test", test); - String[] testVectorAddElement = {null, null, "java.util.Vector", "org.tigris.gef.base.LayerPerspective", "traces\\ArgoUMLBenchmarkWithMoreStandardClasses.trace", CONTAINER_COMPONENT}; map.put("testVectorAddElement", testVectorAddElement);//trace.java��"addElement("�ɑΉ�����悤�ɒlj� - String[] ArgoUMLBenchmark = {"", "", "", "", "traces/ArgoUMLBenchmark.trace", CONTAINER_COMPONENT}; map.put("ArgoUMLBenchmark", ArgoUMLBenchmark); - String[] ArgoUMLBenchmarkWithMoreStandardClasses = {"", "", "", "", "traces/ArgoUMLBenchmarkWithMoreStandardClasses.trace", CONTAINER_COMPONENT}; map.put("ArgoUMLBenchmarkWithMoreStandardClasses", ArgoUMLBenchmarkWithMoreStandardClasses); -// String[] ArgoUMLSelect0_1 = {"1994249754", "1141430801", "java.util.ArrayList", "org.argouml.uml.diagram.static_structure.ui.SelectionClass","traces\\ArgoUMLBenchmarkWithMoreStandardClasses.trace", CONTAINER_COMPONENT}; map.put("ArgoUMLSelect0_1", ArgoUMLSelect0_1); - String[] ArgoUMLSelect0_1 = {"1994249754", "1141430801", null, null,"traces\\ArgoUMLBenchmarkWithMoreStandardClasses.trace", CONTAINER_COMPONENT}; map.put("ArgoUMLSelect0_1", ArgoUMLSelect0_1); - /*Vector.addElemnt()�ɑΉ��ς�*/String[] ArgoUMLDelete0_2 = {"1784213708", "1337038091", "java.util.Vector", "org.argouml.uml.diagram.static_structure.ui.FigClass", "traces\\ArgoUMLBenchmarkWithMoreStandardClasses.trace", CONTAINER_COMPONENT}; map.put("ArgoUMLDelete0_2", ArgoUMLDelete0_2); - /*�X�ɉߋ�mouse.Pressed(), mouseReleased()*/String[] ArgoUMLPlace1_1 = {null, null, "java.util.ArrayList", "org.argouml.uml.diagram.static_structure.ui.FigClass", "traces\\ArgoUMLBenchmarkWithMoreStandardClasses.trace", CONTAINER_COMPONENT}; map.put("ArgoUMLPlace1_1", ArgoUMLPlace1_1); -// String[] ArgoUMLSelect1_2 = {"1994249754", "1141430801", "java.util.ArrayList", "org.argouml.uml.diagram.static_structure.ui.SelectionClass", "traces\\ArgoUMLBenchmarkWithMoreStandardClasses.trace", CONTAINER_COMPONENT}; map.put("ArgoUMLSelect1_2", ArgoUMLSelect1_2); -// String[] ArgoUMLSelect1_2 = {"125345735", "1672744985", "java.util.ArrayList", "org.argouml.uml.diagram.static_structure.ui.SelectionClass", "traces\\ArgoUMLBenchmarkWithMoreStandardClasses.trace", CONTAINER_COMPONENT}; map.put("ArgoUMLSelect1_2", ArgoUMLSelect1_2); - String[] jEditBenchmark = {"", "", "", "", "traces/jEditBenchmark.trace", CONTAINER_COMPONENT}; map.put("jEditBenchmark", jEditBenchmark); - String[] jEditSelect2_1 = {"932187140", "1572482885", "java.util.ArrayList", "org.gjt.sp.jedit.textarea.Selection$Range", "traces\\jEditBenchmarkWithMoreStandardClasses.trace", CONTAINER_COMPONENT}; map.put("jEditSelect2_1", jEditSelect2_1); - String[] jHotDrawBenchmark = {"", "", "", "", "traces/jHotDrawBenchmark.trace", CONTAINER_COMPONENT}; map.put("jHotDrawBenchmark", jHotDrawBenchmark); - String[] jHotDrawBenchmarkWithMoreStandardClasses = {"", "", "", "", "traces/jHotDrawBenchmarkWithMoreStandardClasses.trace", CONTAINER_COMPONENT}; map.put("jHotDrawBenchmarkWithMoreStandardClasses", jHotDrawBenchmarkWithMoreStandardClasses); - /*List.toArray()�ɑΉ�������K�v������H*/String[] jEditDelete2_2 = {null, null, "org.gjt.sp.jedit.buffer.ContentManager", "java.util.ArrayList", "traces\\jEditBenchmarkWithMoreStandardClasses.trace", CONTAINER_COMPONENT}; map.put("jEditDelete2_2", jEditDelete2_2); - String[] jHotDrawSelect3_1 = {"361298449", "212532447", "java.util.LinkedHashSet", "org.jhotdraw.draw.RectangleFigure", "traces\\jHotDrawBenchmarkWithMoreStandardClasses.trace", CONTAINER_COMPONENT}; map.put("jHotDrawSelect3_1", jHotDrawSelect3_1); - String[] jHotDrawMove3_2 = {"778703711", "212532447", "org.jhotdraw.draw.tool.DefaultDragTracker", "org.jhotdraw.draw.RectangleFigure", "traces\\jHotDrawBenchmarkWithMoreStandardClasses.trace", CONTAINER_COMPONENT}; map.put("jHotDrawMove3_2", jHotDrawMove3_2); - /*�s��*/String[] jHotDrawMove3_2_1 = {null, null, "java.util.ArrayList", "org.jhotdraw.draw.RectangleFigure", "traces\\jHotDrawBenchmarkWithMoreStandardClasses.trace", CONTAINER_COMPONENT}; map.put("jHotDrawMove3_2_1", jHotDrawMove3_2_1); - String[] jHotDrawPlace4_1 = {"1284329882", "212532447", "java.util.HashMap", "org.jhotdraw.draw.RectangleFigure", "traces\\jHotDrawBenchmarkWithMoreStandardClasses.trace", CONTAINER_COMPONENT}; map.put("jHotDrawPlace4_1", jHotDrawPlace4_1); -// String[] jHotDrawSelect4_2 = {"361298449", "212532447", "java.util.LinkedHashSet", "org.jhotdraw.draw.RectangleFigure", "traces\\jHotDrawBenchmarkWithMoreStandardClasses.trace", CONTAINER_COMPONENT}; map.put("jHotDrawSelect4_2", jHotDrawSelect4_2); - String[] jHotDrawSelect4_2 = {null, null, "java.util.LinkedHashSet", "org.jhotdraw.draw.RectangleFigure", "traces\\jHotDrawBenchmarkWithMoreStandardClasses.trace", CONTAINER_COMPONENT}; map.put("jHotDrawSelect4_2", jHotDrawSelect4_2); + String[] test = {null, null, "org.argouml.uml.diagram.static_structure.ui.FigClass","org.tigris.gef.base.LayerPerspectiveMutable", "traces\\ArgoUMLBenchmarkWithMoreStandardClasses.trace", Extract.CONTAINER_COMPONENT}; map.put("test", test); + String[] testVectorAddElement = {null, null, "java.util.Vector", "org.tigris.gef.base.LayerPerspective", "traces\\ArgoUMLBenchmarkWithMoreStandardClasses.trace", Extract.CONTAINER_COMPONENT}; map.put("testVectorAddElement", testVectorAddElement);//trace.java��"addElement("�ɑΉ�����悤�ɒlj� + String[] ArgoUMLBenchmark = {"", "", "", "", "traces/ArgoUMLBenchmark.trace", Extract.CONTAINER_COMPONENT}; map.put("ArgoUMLBenchmark", ArgoUMLBenchmark); + String[] ArgoUMLBenchmarkWithMoreStandardClasses = {"", "", "", "", "traces/ArgoUMLBenchmarkWithMoreStandardClasses.trace", Extract.CONTAINER_COMPONENT}; map.put("ArgoUMLBenchmarkWithMoreStandardClasses", ArgoUMLBenchmarkWithMoreStandardClasses); +// String[] ArgoUMLSelect0_1 = {"1994249754", "1141430801", "java.util.ArrayList", "org.argouml.uml.diagram.static_structure.ui.SelectionClass","traces\\ArgoUMLBenchmarkWithMoreStandardClasses.trace", Extract.CONTAINER_COMPONENT}; map.put("ArgoUMLSelect0_1", ArgoUMLSelect0_1); + String[] ArgoUMLSelect0_1 = {"1994249754", "1141430801", null, null,"traces\\ArgoUMLBenchmarkWithMoreStandardClasses.trace", Extract.CONTAINER_COMPONENT}; map.put("ArgoUMLSelect0_1", ArgoUMLSelect0_1); + /*Vector.addElemnt()�ɑΉ��ς�*/String[] ArgoUMLDelete0_2 = {"1784213708", "1337038091", "java.util.Vector", "org.argouml.uml.diagram.static_structure.ui.FigClass", "traces\\ArgoUMLBenchmarkWithMoreStandardClasses.trace", Extract.CONTAINER_COMPONENT}; map.put("ArgoUMLDelete0_2", ArgoUMLDelete0_2); + /*�X�ɉߋ�mouse.Pressed(), mouseReleased()*/String[] ArgoUMLPlace1_1 = {null, null, "java.util.ArrayList", "org.argouml.uml.diagram.static_structure.ui.FigClass", "traces\\ArgoUMLBenchmarkWithMoreStandardClasses.trace", Extract.CONTAINER_COMPONENT}; map.put("ArgoUMLPlace1_1", ArgoUMLPlace1_1); +// String[] ArgoUMLSelect1_2 = {"1994249754", "1141430801", "java.util.ArrayList", "org.argouml.uml.diagram.static_structure.ui.SelectionClass", "traces\\ArgoUMLBenchmarkWithMoreStandardClasses.trace", Extract.CONTAINER_COMPONENT}; map.put("ArgoUMLSelect1_2", ArgoUMLSelect1_2); +// String[] ArgoUMLSelect1_2 = {"125345735", "1672744985", "java.util.ArrayList", "org.argouml.uml.diagram.static_structure.ui.SelectionClass", "traces\\ArgoUMLBenchmarkWithMoreStandardClasses.trace", Extract.CONTAINER_COMPONENT}; map.put("ArgoUMLSelect1_2", ArgoUMLSelect1_2); + String[] jEditBenchmark = {"", "", "", "", "traces/jEditBenchmark.trace", Extract.CONTAINER_COMPONENT}; map.put("jEditBenchmark", jEditBenchmark); + String[] jEditSelect2_1 = {"932187140", "1572482885", "java.util.ArrayList", "org.gjt.sp.jedit.textarea.Selection$Range", "traces\\jEditBenchmarkWithMoreStandardClasses.trace", Extract.CONTAINER_COMPONENT}; map.put("jEditSelect2_1", jEditSelect2_1); + String[] jHotDrawBenchmark = {"", "", "", "", "traces/jHotDrawBenchmark.trace", Extract.CONTAINER_COMPONENT}; map.put("jHotDrawBenchmark", jHotDrawBenchmark); + String[] jHotDrawBenchmarkWithMoreStandardClasses = {"", "", "", "", "traces/jHotDrawBenchmarkWithMoreStandardClasses.trace", Extract.CONTAINER_COMPONENT}; map.put("jHotDrawBenchmarkWithMoreStandardClasses", jHotDrawBenchmarkWithMoreStandardClasses); + /*List.toArray()�ɑΉ�������K�v������H*/String[] jEditDelete2_2 = {null, null, "org.gjt.sp.jedit.buffer.ContentManager", "java.util.ArrayList", "traces\\jEditBenchmarkWithMoreStandardClasses.trace", Extract.CONTAINER_COMPONENT}; map.put("jEditDelete2_2", jEditDelete2_2); + String[] jHotDrawSelect3_1 = {"361298449", "212532447", "java.util.LinkedHashSet", "org.jhotdraw.draw.RectangleFigure", "traces\\jHotDrawBenchmarkWithMoreStandardClasses.trace", Extract.CONTAINER_COMPONENT}; map.put("jHotDrawSelect3_1", jHotDrawSelect3_1); + String[] jHotDrawMove3_2 = {"778703711", "212532447", "org.jhotdraw.draw.tool.DefaultDragTracker", "org.jhotdraw.draw.RectangleFigure", "traces\\jHotDrawBenchmarkWithMoreStandardClasses.trace", Extract.CONTAINER_COMPONENT}; map.put("jHotDrawMove3_2", jHotDrawMove3_2); + /*�s��*/String[] jHotDrawMove3_2_1 = {null, null, "java.util.ArrayList", "org.jhotdraw.draw.RectangleFigure", "traces\\jHotDrawBenchmarkWithMoreStandardClasses.trace", Extract.CONTAINER_COMPONENT}; map.put("jHotDrawMove3_2_1", jHotDrawMove3_2_1); + String[] jHotDrawPlace4_1 = {"1284329882", "212532447", "java.util.HashMap", "org.jhotdraw.draw.RectangleFigure", "traces\\jHotDrawBenchmarkWithMoreStandardClasses.trace", Extract.CONTAINER_COMPONENT}; map.put("jHotDrawPlace4_1", jHotDrawPlace4_1); +// String[] jHotDrawSelect4_2 = {"361298449", "212532447", "java.util.LinkedHashSet", "org.jhotdraw.draw.RectangleFigure", "traces\\jHotDrawBenchmarkWithMoreStandardClasses.trace", Extract.CONTAINER_COMPONENT}; map.put("jHotDrawSelect4_2", jHotDrawSelect4_2); + String[] jHotDrawSelect4_2 = {null, null, "java.util.LinkedHashSet", "org.jhotdraw.draw.RectangleFigure", "traces\\jHotDrawBenchmarkWithMoreStandardClasses.trace", Extract.CONTAINER_COMPONENT}; map.put("jHotDrawSelect4_2", jHotDrawSelect4_2); // MagnetRON Experiment - String[] ArgoUMLSelect = {"125345735", "1672744985", "java.util.ArrayList", "org.argouml.uml.diagram.static_structure.ui.SelectionClass", "traces\\ArgoUMLBenchmarkWithMoreStandardClasses.trace", CONTAINER_COMPONENT_COLLECTION}; map.put("ArgoUMLSelect", ArgoUMLSelect); // ArgoUML �I���@�\ (collection) - String[] ArgoUMLDelete1 = {null, null, "public void org.argouml.uml.diagram.ui.ActionRemoveFromDiagram.actionPerformed(", "org.argouml.uml.diagram.static_structure.ui.FigClass", "traces\\ArgoUMLBenchmarkWithMoreStandardClasses.trace", THIS_ANOTHER}; map.put("ArgoUMLDelete1", ArgoUMLDelete1);// ArgoUML �폜�@�\1 (this to another) - String[] ArgoUMLDelete2 = {"450474599", "1675174935", "java.util.Vector", "org.argouml.uml.diagram.static_structure.ui.FigClass", "traces\\ArgoUMLBenchmarkWithMoreStandardClasses.trace", CONTAINER_COMPONENT_COLLECTION}; map.put("ArgoUMLDelete2", ArgoUMLDelete2); // ArgoUML �폜�@�\2 (collection) - String[] JHotDrawTransform = {"176893671", "1952912699", "java.util.HashSet", "org.jhotdraw.draw.RectangleFigure", "traces\\jHotDrawBenchmarkWithMoreStandardClasses.trace", CONTAINER_COMPONENT_COLLECTION}; map.put("JHotDrawTransform", JHotDrawTransform); // JHotDraw �ړ��@�\ (collection) - String[] JHotDrawSelect1 = {"758826749", "1952912699", "org.jhotdraw.draw.tool.DefaultDragTracker", "org.jhotdraw.draw.RectangleFigure", "traces\\jHotDrawBenchmarkWithMoreStandardClasses.trace", CONTAINER_COMPONENT}; map.put("JHotDrawSelect1", JHotDrawSelect1); // JHotDraw �I���@�\1 - String[] JHotDrawSelect2 = {"1378082106", "1952912699", "java.util.HashSet", "org.jhotdraw.draw.RectangleFigure", "traces\\jHotDrawBenchmarkWithMoreStandardClasses.trace", CONTAINER_COMPONENT_COLLECTION}; map.put("JHotDrawSelect2", JHotDrawSelect2); // JHotDraw �I���@�\2 (collection) - String[] JHotDrawSelect3 = {"1787265837", "1952912699", "java.util.LinkedHashSet", "org.jhotdraw.draw.RectangleFigure", "traces\\jHotDrawBenchmarkWithMoreStandardClasses.trace", CONTAINER_COMPONENT_COLLECTION}; map.put("JHotDrawSelect3", JHotDrawSelect3); // JHotDraw �I���@�\3 (collection) - String[] JHotDrawSelect4 = {"599587451", "758826749", "org.jhotdraw.draw.tool.DelegationSelectionTool", "org.jhotdraw.draw.tool.DefaultDragTracker", "traces\\jHotDrawBenchmarkWithMoreStandardClasses.trace", CONTAINER_COMPONENT}; map.put("JHotDrawSelect4", JHotDrawSelect4); // JHotDraw �I���@�\3 (collection) + String[] ArgoUMLSelect = {"125345735", "1672744985", "java.util.ArrayList", "org.argouml.uml.diagram.static_structure.ui.SelectionClass", "traces\\ArgoUMLBenchmarkWithMoreStandardClasses.trace", Extract.CONTAINER_COMPONENT_COLLECTION}; map.put("ArgoUMLSelect", ArgoUMLSelect); // ArgoUML �I���@�\ (collection) + String[] ArgoUMLDelete1 = {null, null, "public void org.argouml.uml.diagram.ui.ActionRemoveFromDiagram.actionPerformed(", "org.argouml.uml.diagram.static_structure.ui.FigClass", "traces\\ArgoUMLBenchmarkWithMoreStandardClasses.trace", Extract.THIS_ANOTHER}; map.put("ArgoUMLDelete1", ArgoUMLDelete1);// ArgoUML �폜�@�\1 (this to another) + String[] ArgoUMLDelete2 = {"450474599", "1675174935", "java.util.Vector", "org.argouml.uml.diagram.static_structure.ui.FigClass", "traces\\ArgoUMLBenchmarkWithMoreStandardClasses.trace", Extract.CONTAINER_COMPONENT_COLLECTION}; map.put("ArgoUMLDelete2", ArgoUMLDelete2); // ArgoUML �폜�@�\2 (collection) + String[] JHotDrawTransform = {"176893671", "1952912699", "java.util.HashSet", "org.jhotdraw.draw.RectangleFigure", "traces\\jHotDrawBenchmarkWithMoreStandardClasses.trace", Extract.CONTAINER_COMPONENT_COLLECTION}; map.put("JHotDrawTransform", JHotDrawTransform); // JHotDraw �ړ��@�\ (collection) + String[] JHotDrawSelect1 = {"758826749", "1952912699", "org.jhotdraw.draw.tool.DefaultDragTracker", "org.jhotdraw.draw.RectangleFigure", "traces\\jHotDrawBenchmarkWithMoreStandardClasses.trace", Extract.CONTAINER_COMPONENT}; map.put("JHotDrawSelect1", JHotDrawSelect1); // JHotDraw �I���@�\1 + String[] JHotDrawSelect2 = {"1378082106", "1952912699", "java.util.HashSet", "org.jhotdraw.draw.RectangleFigure", "traces\\jHotDrawBenchmarkWithMoreStandardClasses.trace", Extract.CONTAINER_COMPONENT_COLLECTION}; map.put("JHotDrawSelect2", JHotDrawSelect2); // JHotDraw �I���@�\2 (collection) + String[] JHotDrawSelect3 = {"1787265837", "1952912699", "java.util.LinkedHashSet", "org.jhotdraw.draw.RectangleFigure", "traces\\jHotDrawBenchmarkWithMoreStandardClasses.trace", Extract.CONTAINER_COMPONENT_COLLECTION}; map.put("JHotDrawSelect3", JHotDrawSelect3); // JHotDraw �I���@�\3 (collection) + String[] JHotDrawSelect4 = {"599587451", "758826749", "org.jhotdraw.draw.tool.DelegationSelectionTool", "org.jhotdraw.draw.tool.DefaultDragTracker", "traces\\jHotDrawBenchmarkWithMoreStandardClasses.trace", Extract.CONTAINER_COMPONENT}; map.put("JHotDrawSelect4", JHotDrawSelect4); // JHotDraw �I���@�\3 (collection) } } diff --git a/src/org/ntlab/deltaViewer/MagnetRONMenuBar.java b/src/org/ntlab/deltaViewer/MagnetRONMenuBar.java index 1235651..d3cd5c4 100644 --- a/src/org/ntlab/deltaViewer/MagnetRONMenuBar.java +++ b/src/org/ntlab/deltaViewer/MagnetRONMenuBar.java @@ -8,19 +8,19 @@ public class MagnetRONMenuBar extends JMenuBar { - public MagnetRONMenuBar(MagnetRONFrame magnetRONFrame) { + public MagnetRONMenuBar(IMagnetRON magnetRON) { super(); JMenu fileMenu = add(new JMenu("�t�@�C��")); - fileMenu.add(new OpenAction(magnetRONFrame)); + fileMenu.add(new OpenAction(magnetRON)); - JMenu extractsMenu = add(new JMenu("���o")); + JMenu extractsMenu = add(new JMenu("�@�\���o")); JMenu animationSettingMenu = add(new JMenu("�A�j���[�V�����ݒ�")); JMenu viewMenu = add(new JMenu("�\��")); JMenu animationMenu = add(new JMenu("�A�j���[�V����")); - animationMenu.add(new StartAnimationAction(magnetRONFrame)); + animationMenu.add(new StartAnimationAction(magnetRON)); } diff --git a/src/org/ntlab/featureExtractor/Extract.java b/src/org/ntlab/featureExtractor/Extract.java new file mode 100644 index 0000000..b74bff0 --- /dev/null +++ b/src/org/ntlab/featureExtractor/Extract.java @@ -0,0 +1,52 @@ +package org.ntlab.featureExtractor; + +public class Extract { + // Delta Extract Type + public static final String CONTAINER_COMPONENT = "Container-Component"; + public static final String CONTAINER_COMPONENT_COLLECTION = "Container-Component(Collection)"; + public static final String THIS_ANOTHER = "This-Another"; + + private String srcId = null; + private String srcClass = null; + + private String dstId = null; + private String dstClass = null; + + private String type = null; + + private int order = 0; + + public Extract(String srcId, String srcClass, String dstId, String dstClass, String type, int order) { + this.srcId = srcId; + this.srcClass = srcClass; + this.dstId = dstId; + this.dstClass = dstClass; + this.type = type; + this.order = order; + } + + public String getSrcId() { + return srcId; + } + + public String getSrcClass() { + return srcClass; + } + + public String getDstId() { + return dstId; + } + + public String getDstClass() { + return dstClass; + } + + public String getType() { + return type; + } + + public int getOrder() { + return order; + } + +} diff --git a/src/org/ntlab/featureExtractor/Feature.java b/src/org/ntlab/featureExtractor/Feature.java new file mode 100644 index 0000000..5143eb0 --- /dev/null +++ b/src/org/ntlab/featureExtractor/Feature.java @@ -0,0 +1,30 @@ +package org.ntlab.featureExtractor; + +import java.util.ArrayList; +import java.util.List; + +public class Feature { + + private String name = null; + private List extracts = new ArrayList<>(); + + public Feature() { + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public List getExtracts() { + return extracts; + } + + public void setExtracts(List extracts) { + this.extracts = extracts; + } + +}