use of com.google.security.zynamics.binnavi.ZyGraph.ZyGraphViewSettings in project binnavi by google.
the class CBreakpointTableTest method testAddedDebugger.
/**
* This test is making sure that listeners are correctly attached to new debuggers.
*
* @throws CouldntSaveDataException
* @throws FileReadException
*/
@Test
public void testAddedDebugger() throws CouldntSaveDataException, FileReadException {
ConfigManager.instance().read();
final INaviModule mockModule = new MockModule();
final DebugTargetSettings target = new ModuleTargetSettings(mockModule);
final DebuggerProvider debuggerProvider = new DebuggerProvider(target);
final ZyGraphViewSettings settings = new ZyGraphViewSettings(new FlowGraphSettingsConfigItem());
settings.getLayoutSettings().setDefaultGraphLayout(LayoutStyle.CIRCULAR);
final ZyGraph graph = new ZyGraph(new MockView(), new LinkedHashMap<Node, NaviNode>(), new LinkedHashMap<Edge, NaviEdge>(), settings, new ZyGraph2DView());
final IViewContainer viewContainer = new MockViewContainer();
final CBreakpointTable table = new CBreakpointTable(debuggerProvider, graph, viewContainer);
final MockDebugger debugger = new MockDebugger(new ModuleTargetSettings(mockModule));
final MockModule module = new MockModule();
debugger.getBreakpointManager().addBreakpoints(BreakpointType.REGULAR, Sets.newHashSet(new BreakpointAddress(module, new UnrelocatedAddress(new CAddress(0)))));
debuggerProvider.addDebugger(debugger);
table.dispose();
}
use of com.google.security.zynamics.binnavi.ZyGraph.ZyGraphViewSettings in project binnavi by google.
the class CSettingsDialogFunctions method showCallgraphSettingsDialog.
/**
* Shows the initial call graph settings dialog.
*
* @param parent Parent window used for dialogs.
*/
public static void showCallgraphSettingsDialog(final JFrame parent) {
final ZyGraphViewSettings settings = ConfigManager.instance().getDefaultCallGraphSettings();
final CGraphSettingsDialog dlg = new CGraphSettingsDialog(parent, "Initial Call graph Settings", settings, true, true);
dlg.setVisible(true);
ConfigManager.instance().updateCallgraphSettings(settings);
ConfigManager.instance().saveSettings(parent);
}
use of com.google.security.zynamics.binnavi.ZyGraph.ZyGraphViewSettings in project binnavi by google.
the class CGraphBuilder method loadNativeSettings.
/**
* Generates the default graph settings for a native view.
*
* @param view The view whose graph settings are generated.
*
* @return The generated graph settings.
*/
private static Pair<Map<String, String>, ZyGraphViewSettings> loadNativeSettings(final INaviView view) {
final ConfigManager configFile = ConfigManager.instance();
// Native views receive the default settings when they are loaded.
final ZyGraphViewSettings graphSettings = view.getGraphType() == GraphType.CALLGRAPH ? configFile.getDefaultCallGraphSettings() : configFile.getDefaultFlowGraphSettings();
graphSettings.getProximitySettings().setProximityBrowsing(view.getGraph().nodeCount() >= graphSettings.getProximitySettings().getProximityBrowsingActivationThreshold());
return new Pair<Map<String, String>, ZyGraphViewSettings>(new HashMap<String, String>(), graphSettings);
}
Aggregations