Search in sources :

Example 1 with CViewSelectionDialog

use of com.google.security.zynamics.binnavi.Gui.InsertViewDialog.CViewSelectionDialog in project binnavi by google.

the class CViewInserter method insertView.

/**
   * Asks the user for a view and inserts that view into a graph.
   *
   * @param parent Parent window used to display dialogs.
   * @param graph The graph where the view is inserted.
   * @param viewContainer The container that provides the views that can be inserted.
   */
public static void insertView(final JFrame parent, final ZyGraph graph, final IViewContainer viewContainer) {
    Preconditions.checkNotNull(parent, "IE00008: Parent argument can not be null");
    Preconditions.checkNotNull(graph, "IE00009: Graph argument can not be null");
    Preconditions.checkNotNull(viewContainer, "IE00010: View container argument can not be null");
    final CViewSelectionDialog dlg = new CViewSelectionDialog(parent, viewContainer);
    GuiHelper.centerChildToParent(parent, dlg, true);
    dlg.setVisible(true);
    final INaviView view = dlg.getView();
    if (view != null) {
        if (!view.isLoaded() && !loadView(parent, viewContainer, view)) {
            // View can not be loaded for some reason
            return;
        }
        com.google.security.zynamics.binnavi.disassembly.algorithms.CViewInserter.insertView(view, graph.getRawView());
        graph.updateViews();
        view.close();
    }
}
Also used : INaviView(com.google.security.zynamics.binnavi.disassembly.views.INaviView) CViewSelectionDialog(com.google.security.zynamics.binnavi.Gui.InsertViewDialog.CViewSelectionDialog)

Aggregations

CViewSelectionDialog (com.google.security.zynamics.binnavi.Gui.InsertViewDialog.CViewSelectionDialog)1 INaviView (com.google.security.zynamics.binnavi.disassembly.views.INaviView)1