use of com.google.security.zynamics.binnavi.yfileswrap.zygraph.NaviNode in project binnavi by google.
the class CSelectionTreeCellRenderer method renderLeafNode.
/**
* Renders a leaf node.
*
* @param treeNode The leaf node to render.
*/
private void renderLeafNode(final CNodeNode treeNode) {
final NaviNode graphNode = treeNode.getNode();
if (graphNode.isSelected() && graphNode.isVisible()) {
setForeground(SELECTED_FONT_COLOR);
} else if (!graphNode.isVisible()) {
setForeground(INVISIBLE_FONT_COLOR);
}
setToolTipText(buildToolTip(graphNode));
}
use of com.google.security.zynamics.binnavi.yfileswrap.zygraph.NaviNode in project binnavi by google.
the class CSelectionTreeCellRenderer method buildToolTip.
/**
* Builds the tooltip for used for nodes that represent multiple graph nodes.
*
* @param nodes The graph nodes that provide the tooltip content.
*
* @return The generated tooltip.
*/
private String buildToolTip(final List<NaviNode> nodes) {
final StringBuilder tooltip = new StringBuilder("<html>");
boolean first = true;
for (final NaviNode graphNode : nodes) {
if (!first) {
tooltip.append("<br>");
}
tooltip.append(CNodesDisplayString.getDisplayString(graphNode));
first = false;
}
return tooltip + "</html>";
}
use of com.google.security.zynamics.binnavi.yfileswrap.zygraph.NaviNode in project binnavi by google.
the class OpenInLastWindowAndZoomToAddressAction method actionPerformed.
@Override
public void actionPerformed(final ActionEvent event) {
final FutureCallback<Boolean> callBack = new FutureCallback<Boolean>() {
@Override
public void onFailure(final Throwable t) {
CUtilityFunctions.logException(t);
}
@Override
public void onSuccess(final Boolean result) {
ZyGraph graph = null;
final List<CGraphWindow> windows = CWindowManager.instance().getOpenWindows();
for (final CGraphWindow graphContainer : windows) {
for (final IGraphPanel window : graphContainer) {
if (reference.getView().equals(window.getModel().getGraph().getRawView())) {
graph = window.getModel().getGraph();
}
}
}
for (final NaviNode node : graph.getNodes()) {
if (node.getRawNode() instanceof INaviCodeNode) {
final INaviCodeNode codeNode = (INaviCodeNode) node.getRawNode();
for (final INaviInstruction instruction : codeNode.getInstructions()) {
if (instruction.getAddress().equals(reference.getAddress())) {
ZyZoomHelpers.zoomToAddress(graph, reference.getAddress());
CrossReferencePainter.paintCrossReference(node, codeNode, reference, instruction);
}
}
}
}
}
};
CShowViewFunctions.showViewsAndPerformCallBack(m_parent, m_container, m_views, CWindowManager.instance().getLastWindow(), callBack);
}
use of com.google.security.zynamics.binnavi.yfileswrap.zygraph.NaviNode in project binnavi by google.
the class COutDegreeEvaluatorTest method testInvalidOperator.
@Test
public void testInvalidOperator() {
final NaviNode node = CNaviNodeFactory.get();
try {
COutdegreeEvaluator.matches(node, "!=", 1);
fail();
} catch (final IllegalStateException e) {
}
try {
COutdegreeEvaluator.matches(node, "==", 1);
fail();
} catch (final IllegalStateException e) {
}
}
use of com.google.security.zynamics.binnavi.yfileswrap.zygraph.NaviNode in project binnavi by google.
the class COutDegreeEvaluatorTest method testComplete.
@Test
public void testComplete() {
final NaviNode node = CNaviNodeFactory.get();
assertTrue(COutdegreeEvaluator.matches(node, "=", 0));
assertFalse(COutdegreeEvaluator.matches(node, "<", 0));
assertFalse(COutdegreeEvaluator.matches(node, ">", 0));
assertFalse(COutdegreeEvaluator.matches(node, "=", 1));
}
Aggregations