use of com.google.security.zynamics.binnavi.disassembly.CGroupNode in project binnavi by google.
the class CNodeHoverer method nodeHovered.
/**
* Updates the node hoverer.
*
* @param node Node over which the mouse hovered.
* @param y Current y-coordinate of the mouse.
*/
public void nodeHovered(final NaviNode node, final double y) {
// group nodes do not have any mouse to line matchings.
if (node.getRawNode() instanceof CGroupNode) {
return;
}
final double yPos = y - node.getY();
final IZyNodeRealizer realizer = node.getRealizer();
final int row = node.positionToRow(yPos);
if (row == -1) {
if (m_lastHoveredLine != null) {
m_lastHoveredLine.clearHighlighting(1);
m_lastHoveredLine = null;
}
return;
}
final ZyLabelContent content = realizer.getNodeContent();
final ZyLineContent hoveredLine = content.getLineContent(row);
if (hoveredLine.equals(m_lastHoveredLine)) {
return;
}
setHoveredLine(content, hoveredLine, realizer.isSelected() ? realizer.getFillColor().darker().darker() : realizer.getFillColor().darker());
if (m_lastHoveredLine != null) {
m_lastHoveredLine.clearHighlighting(1);
}
m_lastHoveredLine = hoveredLine;
}
use of com.google.security.zynamics.binnavi.disassembly.CGroupNode in project binnavi by google.
the class CGraphGrouper method groupNodes.
/**
* Creates a new group node from a list of nodes.
*
* @param graph The graph where the group node is created.
* @param nodes The nodes to be grouped.
*/
private static void groupNodes(final ZyGraph graph, final List<NaviNode> nodes) {
final StringBuilder stringBuilder = new StringBuilder();
final List<INaviViewNode> rawNodes = new ArrayList<INaviViewNode>();
// ATTENTION: DO NOT MOVE THIS LINE BELOW THE REMOVEELEMENT LINE
final INaviGroupNode commonParent = getCommonParent(nodes);
for (final NaviNode node : nodes) {
if (node.getRawNode().getParentGroup() != null) {
node.getRawNode().getParentGroup().removeElement(node.getRawNode());
}
rawNodes.add(node.getRawNode());
stringBuilder.append(determineNodeText(node));
stringBuilder.append('\n');
}
final CGroupNode groupNode = graph.getRawView().getContent().createGroupNode(rawNodes);
if (commonParent != null) {
commonParent.addElement(groupNode);
}
try {
groupNode.appendComment(stringBuilder.toString());
} catch (CouldntSaveDataException | CouldntLoadDataException exception) {
CUtilityFunctions.logException(exception);
}
}
Aggregations