use of com.google.security.zynamics.binnavi.disassembly.views.INaviView in project binnavi by google.
the class CGraphPanel method dispose.
/**
* Frees allocated resources.
*/
@Override
public void dispose() {
m_graphSynchronizer.dispose();
m_bottomPanel.dispose();
m_centerPanel.dispose();
m_model.dispose();
final INaviView view = m_model.getGraph().getRawView();
view.close();
m_menuBar.dipose();
m_toolBar.dispose();
// Note: The following line is necessary for garbage collection
// because the menus keep references to the graph panel and
// this leads to circular object references.
m_menuBar.removeAll();
m_toolBar.removeAll();
m_menuBar = null;
m_toolBar = null;
m_rightPanel.dispose();
m_leftPanel.dispose();
m_dialogs.dispose();
removeAll();
}
use of com.google.security.zynamics.binnavi.disassembly.views.INaviView in project binnavi by google.
the class CGraphWindow method updateCurrentWindowTitle.
/**
* Updates the window title of the current window if the view whose name changed equals the view
* displayed in the current window.
*
* @param view The view whose name changed.
*/
private void updateCurrentWindowTitle(final INaviView view) {
final IGraphPanel window = getActiveGraphWindow();
if (window == null) {
return;
}
final INaviView currentView = window.getModel().getGraph().getRawView();
if (view == currentView) {
setTitle(CWindowTitle.generate(window));
}
}
use of com.google.security.zynamics.binnavi.disassembly.views.INaviView in project binnavi by google.
the class CProject method load.
@Override
public void load() throws CouldntLoadDataException, LoadCancelledException {
synchronized (m_loadReporter) {
if (isLoaded()) {
return;
}
m_isLoading = true;
try {
if (!m_loadReporter.report(ProjectLoadEvents.Starting)) {
throw new LoadCancelledException();
}
if (!m_loadReporter.report(ProjectLoadEvents.LoadingAddressSpaces)) {
throw new LoadCancelledException();
}
final List<CAddressSpace> addressSpaces = m_provider.loadAddressSpaces(this);
for (final CAddressSpace space : addressSpaces) {
space.load();
}
if (!m_loadReporter.report(ProjectLoadEvents.LoadingCallgraphViews)) {
throw new LoadCancelledException();
}
final List<ICallgraphView> userCallgraphs = m_provider.loadCallgraphViews(this);
if (!m_loadReporter.report(ProjectLoadEvents.LoadingFlowgraphViews)) {
throw new LoadCancelledException();
}
final List<IFlowgraphView> userFlowgraphs = m_provider.loadFlowgraphs(this);
if (!m_loadReporter.report(ProjectLoadEvents.LoadingMixedgraphViews)) {
throw new LoadCancelledException();
}
final List<INaviView> userMixedgraphs = m_provider.loadMixedgraphs(this);
if (!m_loadReporter.report(ProjectLoadEvents.LoadingTraces)) {
throw new LoadCancelledException();
}
final List<TraceList> traces = m_provider.loadTraces(this);
final ArrayList<INaviView> views = new ArrayList<INaviView>(userCallgraphs);
views.addAll(userFlowgraphs);
views.addAll(userMixedgraphs);
m_content = new CProjectContent(this, m_listeners, m_provider, addressSpaces, views, new FilledList<TraceList>(traces));
} catch (CouldntLoadDataException | LoadCancelledException e) {
m_isLoading = false;
throw e;
} finally {
m_loadReporter.report(ProjectLoadEvents.Finished);
}
for (final IProjectListener listener : m_listeners) {
try {
listener.loadedProject(this);
} catch (final Exception exception) {
CUtilityFunctions.logException(exception);
}
}
m_isLoading = false;
}
}
use of com.google.security.zynamics.binnavi.disassembly.views.INaviView in project binnavi by google.
the class PostgreSQLProviderTestSetup method testCreateViewProject5.
@Test
public void testCreateViewProject5() throws CouldntLoadDataException, CouldntSaveDataException, CPartialLoadException, LoadCancelledException {
final INaviModule module = getKernel32Module();
module.load();
final INaviView view = module.getContent().getViewContainer().getViews().get(200);
view.load();
final CView newView = getProvider().createView(loadProject(), view, "View Name", "View Description");
assertEquals("View Name", newView.getName());
assertEquals("View Description", newView.getConfiguration().getDescription());
}
use of com.google.security.zynamics.binnavi.disassembly.views.INaviView in project binnavi by google.
the class PostgreSQLTypeInstanceFunctionsTests method loadSingleTypeInstanceReference6.
@Test
public void loadSingleTypeInstanceReference6() throws CouldntLoadDataException, LoadCancelledException, CPartialLoadException {
module.load();
for (final INaviView view : module.getContent().getViewContainer().getViews().subList(10, 20)) {
view.load();
final TypeInstanceContainer container = module.getContent().getTypeInstanceContainer();
for (final TypeInstance typeInstance : container.getTypeInstances()) {
for (final TypeInstanceReference reference : container.getReferences(typeInstance)) {
if (reference.getTreeNode().isPresent()) {
final RawTypeInstanceReference rawReference = provider.loadTypeInstanceReference(module, typeInstance.getId(), reference.getAddress().toBigInteger(), reference.getPosition(), reference.getTreeNode().get().getId());
Assert.assertEquals(reference.getAddress(), rawReference.getAddress());
}
}
}
view.close();
}
}
Aggregations