Search in sources :

Example 11 with DumpData

use of com.android.preload.DumpData in project android_frameworks_base by crdroidandroid.

the class ShowDataAction method actionPerformed.

@Override
public void actionPerformed(ActionEvent e) {
    // TODO(agampe): Auto-generated method stub
    int selRow = Main.getUI().getSelectedDataTableRow();
    if (selRow != -1) {
        DumpData data = dataTableModel.getData().get(selRow);
        Map<String, Set<String>> inv = data.invertData();
        StringBuilder builder = new StringBuilder();
        // First bootclasspath.
        add(builder, "Boot classpath:", inv.get(null));
        // Now everything else.
        for (String k : inv.keySet()) {
            if (k != null) {
                builder.append("==================\n\n");
                add(builder, k, inv.get(k));
            }
        }
        JFrame newFrame = new JFrame(data.getPackageName() + " " + data.getDate());
        newFrame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
        newFrame.getContentPane().add(new JScrollPane(new JTextArea(builder.toString())), BorderLayout.CENTER);
        newFrame.setSize(800, 600);
        newFrame.setLocationRelativeTo(null);
        newFrame.setVisible(true);
    }
}
Also used : JScrollPane(javax.swing.JScrollPane) Set(java.util.Set) JTextArea(javax.swing.JTextArea) JFrame(javax.swing.JFrame) DumpData(com.android.preload.DumpData)

Example 12 with DumpData

use of com.android.preload.DumpData in project platform_frameworks_base by android.

the class ComputeThresholdAction method run.

@Override
public void run() {
    Main.getUI().showWaitDialog();
    Map<String, Set<String>> uses = new HashMap<String, Set<String>>();
    for (DumpData d : dataTableModel.getData()) {
        Main.getUI().updateWaitDialog("Merging " + d.getPackageName());
        updateClassUse(d.getPackageName(), uses, getBootClassPathClasses(d.getDumpData()));
    }
    Main.getUI().updateWaitDialog("Computing thresholded set");
    Set<String> result = fromThreshold(uses, blacklist, threshold);
    Main.getUI().hideWaitDialog();
    boolean ret = Main.getUI().showConfirmDialog("Computed a set with " + result.size() + " classes, would you like to save to disk?", "Save?");
    if (ret) {
        File f = Main.getUI().showSaveDialog();
        if (f != null) {
            saveSet(result, f);
        }
    }
}
Also used : Set(java.util.Set) TreeSet(java.util.TreeSet) HashSet(java.util.HashSet) HashMap(java.util.HashMap) DumpData(com.android.preload.DumpData) File(java.io.File)

Example 13 with DumpData

use of com.android.preload.DumpData in project platform_frameworks_base by android.

the class ScanPackageAction method work.

private void work(Client c) {
    String pkg = c.getClientData().getClientDescription();
    Main.getUI().showWaitDialog();
    Main.getUI().updateWaitDialog("Retrieving heap data for " + pkg);
    try {
        Map<String, String> data = Main.findAndGetClassData(device, pkg);
        DumpData dumpData = new DumpData(pkg, data, new Date());
        dataTableModel.addData(dumpData);
    } catch (Exception e) {
        e.printStackTrace();
    }
}
Also used : DumpData(com.android.preload.DumpData) Date(java.util.Date)

Example 14 with DumpData

use of com.android.preload.DumpData in project platform_frameworks_base by android.

the class ShowDataAction method actionPerformed.

@Override
public void actionPerformed(ActionEvent e) {
    // TODO(agampe): Auto-generated method stub
    int selRow = Main.getUI().getSelectedDataTableRow();
    if (selRow != -1) {
        DumpData data = dataTableModel.getData().get(selRow);
        Map<String, Set<String>> inv = data.invertData();
        StringBuilder builder = new StringBuilder();
        // First bootclasspath.
        add(builder, "Boot classpath:", inv.get(null));
        // Now everything else.
        for (String k : inv.keySet()) {
            if (k != null) {
                builder.append("==================\n\n");
                add(builder, k, inv.get(k));
            }
        }
        JFrame newFrame = new JFrame(data.getPackageName() + " " + data.getDate());
        newFrame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
        newFrame.getContentPane().add(new JScrollPane(new JTextArea(builder.toString())), BorderLayout.CENTER);
        newFrame.setSize(800, 600);
        newFrame.setLocationRelativeTo(null);
        newFrame.setVisible(true);
    }
}
Also used : JScrollPane(javax.swing.JScrollPane) Set(java.util.Set) JTextArea(javax.swing.JTextArea) JFrame(javax.swing.JFrame) DumpData(com.android.preload.DumpData)

Example 15 with DumpData

use of com.android.preload.DumpData in project android_frameworks_base by AOSPA.

the class ShowDataAction method actionPerformed.

@Override
public void actionPerformed(ActionEvent e) {
    // TODO(agampe): Auto-generated method stub
    int selRow = Main.getUI().getSelectedDataTableRow();
    if (selRow != -1) {
        DumpData data = dataTableModel.getData().get(selRow);
        Map<String, Set<String>> inv = data.invertData();
        StringBuilder builder = new StringBuilder();
        // First bootclasspath.
        add(builder, "Boot classpath:", inv.get(null));
        // Now everything else.
        for (String k : inv.keySet()) {
            if (k != null) {
                builder.append("==================\n\n");
                add(builder, k, inv.get(k));
            }
        }
        JFrame newFrame = new JFrame(data.getPackageName() + " " + data.getDate());
        newFrame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
        newFrame.getContentPane().add(new JScrollPane(new JTextArea(builder.toString())), BorderLayout.CENTER);
        newFrame.setSize(800, 600);
        newFrame.setLocationRelativeTo(null);
        newFrame.setVisible(true);
    }
}
Also used : JScrollPane(javax.swing.JScrollPane) Set(java.util.Set) JTextArea(javax.swing.JTextArea) JFrame(javax.swing.JFrame) DumpData(com.android.preload.DumpData)

Aggregations

DumpData (com.android.preload.DumpData)20 Date (java.util.Date)10 Set (java.util.Set)10 Client (com.android.ddmlib.Client)5 File (java.io.File)5 HashMap (java.util.HashMap)5 HashSet (java.util.HashSet)5 TreeSet (java.util.TreeSet)5 JFrame (javax.swing.JFrame)5 JScrollPane (javax.swing.JScrollPane)5 JTextArea (javax.swing.JTextArea)5 JFileChooser (javax.swing.JFileChooser)4