use of com.google.security.zynamics.binnavi.Gui.GraphWindows.CGraphWindow in project binnavi by google.
the class CWindowManager method bringViewToFront.
/**
* Brings the given {@link INaviView view} to front
*
* @param view The {@link INaviView view} to bring to front.
*/
public void bringViewToFront(final INaviView view) {
for (final CGraphWindow graphContainer : getOpenWindows()) {
for (final IGraphPanel window : graphContainer) {
if (window.getModel().getGraph().getRawView() == view) {
graphContainer.activate(window);
graphContainer.toFront();
return;
}
}
}
}
use of com.google.security.zynamics.binnavi.Gui.GraphWindows.CGraphWindow in project binnavi by google.
the class CViewLoader method load.
/**
* Loads a view.
*
* @throws LoadCancelledException Thrown if the user canceled the load operation.
* @throws CPartialLoadException Thrown if not all required modules are loaded.
* @throws CouldntLoadDataException Thrown if the view data could not be loaded from the database.
*/
public void load() throws CouldntLoadDataException, CPartialLoadException, LoadCancelledException {
if (!view.isLoaded()) {
view.load();
}
// Convert the data from the raw view into a graph that can be displayed.
final ZyGraph graph = container instanceof CModuleContainer ? CGraphBuilder.buildDnDGraph(view, container.getModules().get(0).getTypeManager()) : CGraphBuilder.buildGraph(view);
CRegisterHotKeys.register(graph);
if (window == null) {
// If the parent window of the graph is null, a new graph window is created.
final CGraphWindow navi = new CGraphWindow();
final CGraphModel model = new CGraphModel(navi, container.getDatabase(), container, graph);
CNodeUpdaterInitializer.addUpdaters(model);
final CGraphPanel panel = new CGraphPanel(model);
navi.addGraph(panel);
CWindowManager.instance().register(navi);
// Part of the workaround you can find in WorkaroundListener in CGraphWindow
navi.setSize(Toolkit.getDefaultToolkit().getScreenSize());
navi.setVisible(true);
GuiHelper.applyWindowFix(navi);
navi.setExtendedState(Frame.MAXIMIZED_BOTH);
workArounds(panel);
graphModel = model;
} else {
final CGraphModel model = new CGraphModel(window, container.getDatabase(), container, graph);
CNodeUpdaterInitializer.addUpdaters(model);
final CGraphPanel panel = new CGraphPanel(model);
// If a parent window is given, the graph is added to this window.
window.addGraph(panel);
workArounds(panel);
window.toFront();
graphModel = model;
}
}
Aggregations