use of com.google.security.zynamics.binnavi.yfileswrap.zygraph.NaviNode in project binnavi by google.
the class CSelectionHistoryChooser method insertSnapshot.
/**
* Adds a new selection state to the history chooser.
*
* @param snapshot Provides information about the selection state to add.
*/
private void insertSnapshot(final CSelectionSnapshot snapshot) {
// New Group node
final CSelectionHistoryTreeNode selection = new CSelectionHistoryTreeNode(snapshot, m_stateIndex);
// Add the selected node addresses to the group node
for (final NaviNode node : snapshot.getSelection()) {
selection.add(new CNodeNode(node));
}
m_stateIndex++;
// Add the new group node to the
m_model.insertNodeInto(selection, (CSelectionHistoryTreeNode) m_model.getRoot(), 0);
}
use of com.google.security.zynamics.binnavi.yfileswrap.zygraph.NaviNode in project binnavi by google.
the class CSelectionHistoryNodeWrapper method toString.
@Override
public String toString() {
int visible = 0;
int invisible = 0;
int selected = 0;
int all = 0;
final List<NaviNode> selection = m_operation.getSelection();
for (final NaviNode graphnode : selection) {
all++;
if (graphnode.getRawNode().isVisible()) {
if (graphnode.getRawNode().isSelected()) {
selected++;
}
visible++;
} else {
invisible++;
}
}
return String.format("%d-%s (%d/%d/%d/%d)", m_stateIndex, m_operation.getDescription(), selected, visible, invisible, all);
}
use of com.google.security.zynamics.binnavi.yfileswrap.zygraph.NaviNode in project binnavi by google.
the class CTaggedGraphNodeNodeTest method test2getGraphNode.
@Test
public void test2getGraphNode() throws FileReadException, CouldntLoadDataException, LoadCancelledException, CouldntSaveDataException {
final ZyGraph graph = ZyGraphFactory.generateTestGraph();
final CCodeNode node = graph.getRawView().getBasicBlocks().get(0);
final NaviNode naviNode = graph.getNode(node);
final CTaggedGraphNodeNode taggedNode = new CTaggedGraphNodeNode(graph, naviNode);
assertEquals(naviNode, taggedNode.getGraphNode());
}
use of com.google.security.zynamics.binnavi.yfileswrap.zygraph.NaviNode 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.yfileswrap.zygraph.NaviNode in project binnavi by google.
the class CVisibilityEvaluatorTest method testComplete.
@Test
public void testComplete() {
final NaviNode node = CNaviNodeFactory.get();
assertTrue(CVisibilityEvaluator.evaluate(node, VisibilityState.VISIBLE));
assertFalse(CVisibilityEvaluator.evaluate(node, VisibilityState.UNVISIBLE));
}
Aggregations