Search in sources :

Example 1 with ZyLineContent

use of com.google.security.zynamics.zylib.gui.zygraph.realizers.ZyLineContent in project binnavi by google.

the class GraphSearcherTest method testSimpleNoResult.

@Test
public void testSimpleNoResult() {
    final ZyNodeRealizer<NaviNode> r = new ZyNormalNodeRealizer<NaviNode>(m_content);
    final NaviNode m_node1 = new NaviNode(m_ynode, r, m_codeNode1);
    final GraphSearcher searcher = new GraphSearcher();
    m_content.addLineContent(new ZyLineContent("Hello my Test", null));
    searcher.search(Lists.newArrayList(m_node1), new ArrayList<NaviEdge>(), "mx");
    searcher.getCursor().next();
    assertNull(searcher.getCursor().current());
}
Also used : ZyNormalNodeRealizer(com.google.security.zynamics.zylib.yfileswrap.gui.zygraph.realizers.ZyNormalNodeRealizer) NaviNode(com.google.security.zynamics.binnavi.yfileswrap.zygraph.NaviNode) GraphSearcher(com.google.security.zynamics.binnavi.yfileswrap.Gui.GraphWindows.Searchers.Text.Model.GraphSearcher) ZyLineContent(com.google.security.zynamics.zylib.gui.zygraph.realizers.ZyLineContent) NaviEdge(com.google.security.zynamics.binnavi.yfileswrap.zygraph.NaviEdge) Test(org.junit.Test)

Example 2 with ZyLineContent

use of com.google.security.zynamics.zylib.gui.zygraph.realizers.ZyLineContent in project binnavi by google.

the class GraphSearcherTest method testAfterLast.

@Test
public void testAfterLast() {
    final ZyNodeRealizer<NaviNode> r = new ZyNormalNodeRealizer<NaviNode>(m_content);
    final NaviNode m_node1 = new NaviNode(m_ynode, r, m_codeNode1);
    final GraphSearcher searcher = new GraphSearcher();
    searcher.search(Lists.newArrayList(m_node1), new ArrayList<NaviEdge>(), "");
    assertNull(searcher.getCursor().current());
    m_content.addLineContent(new ZyLineContent("Hello my Test", null));
    searcher.search(Lists.newArrayList(m_node1), new ArrayList<NaviEdge>(), "my");
    assertFalse(searcher.getCursor().isAfterLast());
    searcher.getCursor().next();
    assertTrue(searcher.getCursor().isAfterLast());
    searcher.getCursor().next();
    assertTrue(searcher.getCursor().isAfterLast());
}
Also used : ZyNormalNodeRealizer(com.google.security.zynamics.zylib.yfileswrap.gui.zygraph.realizers.ZyNormalNodeRealizer) NaviNode(com.google.security.zynamics.binnavi.yfileswrap.zygraph.NaviNode) GraphSearcher(com.google.security.zynamics.binnavi.yfileswrap.Gui.GraphWindows.Searchers.Text.Model.GraphSearcher) ZyLineContent(com.google.security.zynamics.zylib.gui.zygraph.realizers.ZyLineContent) NaviEdge(com.google.security.zynamics.binnavi.yfileswrap.zygraph.NaviEdge) Test(org.junit.Test)

Example 3 with ZyLineContent

use of com.google.security.zynamics.zylib.gui.zygraph.realizers.ZyLineContent in project binnavi by google.

the class ZyGraphNode method setHighlighting.

public void setHighlighting(final int level, final int line, final int start, final int length, final Color color) {
    final ZyLineContent lineContent = m_realizer.getNodeContent().getLineContent(line);
    lineContent.setHighlighting(start, length, level, color);
    updateViews();
}
Also used : ZyLineContent(com.google.security.zynamics.zylib.gui.zygraph.realizers.ZyLineContent)

Example 4 with ZyLineContent

use of com.google.security.zynamics.zylib.gui.zygraph.realizers.ZyLineContent in project binnavi by google.

the class ZyGraphNode method setBackgroundColor.

/**
   * Colorizes a complete line of the node in a given color.
   *
   * @param line The index of the line.
   * @param color The color of the line.
   */
public void setBackgroundColor(final int line, final Color color) {
    final ZyLineContent lineContent = m_realizer.getNodeContent().getLineContent(line);
    lineContent.setBackgroundColor(color);
    updateViews();
}
Also used : ZyLineContent(com.google.security.zynamics.zylib.gui.zygraph.realizers.ZyLineContent)

Example 5 with ZyLineContent

use of com.google.security.zynamics.zylib.gui.zygraph.realizers.ZyLineContent in project binnavi by google.

the class ProximityNodeCreator method createProximityNode.

/**
   * Creates a proximity browsing node.
   * 
   * @param graph The graph where the proximity node is added to.
   * @param attachedNode The graph node the proximity node is attached to.
   * @param degree The edge degree of the attached node (this is the number shown in the proximity
   *        node).
   * @param isIncoming True, to signal that the proximity node is incoming. False, if it is
   *        outcoming.
   * 
   * @param <NodeType> Raw node type of the real (e.g. not proximity nodes) nodes in the graph.
   * 
   * @return The created proximity node.
   */
public static <NodeType extends IViewNode<?>> ZyProximityNode<?> createProximityNode(final Graph2D graph, final ZyGraphNode<?> attachedNode, final int degree, final boolean isIncoming) {
    Preconditions.checkNotNull(graph, "Graph argument can not be null");
    Preconditions.checkNotNull(attachedNode, "Target node argument can not be null");
    final ZyLabelContent labelcontent = new ZyLabelContent(null);
    labelcontent.addLineContent(new ZyLineContent(String.valueOf(degree), new Font("New Courier", Font.PLAIN, 12), null));
    final ZyProximityNodeRealizer<NodeType> r = new ZyProximityNodeRealizer<NodeType>(labelcontent);
    final Node node = graph.createNode(r);
    @SuppressWarnings("unchecked") final ZyProximityNode<NodeType> infoNode = new ZyProximityNode<NodeType>(node, r, (ZyGraphNode<NodeType>) attachedNode, isIncoming);
    final ZyNodeData<ZyProximityNode<NodeType>> data = new ZyNodeData<ZyProximityNode<NodeType>>(infoNode);
    r.setUserData(data);
    return infoNode;
}
Also used : ZyLabelContent(com.google.security.zynamics.zylib.gui.zygraph.realizers.ZyLabelContent) ZyNodeData(com.google.security.zynamics.zylib.gui.zygraph.nodes.ZyNodeData) ZyGraphNode(com.google.security.zynamics.zylib.yfileswrap.gui.zygraph.nodes.ZyGraphNode) IViewNode(com.google.security.zynamics.zylib.gui.zygraph.nodes.IViewNode) Node(y.base.Node) ZyLineContent(com.google.security.zynamics.zylib.gui.zygraph.realizers.ZyLineContent) ZyProximityNodeRealizer(com.google.security.zynamics.zylib.yfileswrap.gui.zygraph.realizers.ZyProximityNodeRealizer) Font(java.awt.Font)

Aggregations

ZyLineContent (com.google.security.zynamics.zylib.gui.zygraph.realizers.ZyLineContent)56 IZyEditableObject (com.google.security.zynamics.zylib.gui.zygraph.realizers.IZyEditableObject)24 Point (java.awt.Point)15 GraphSearcher (com.google.security.zynamics.binnavi.yfileswrap.Gui.GraphWindows.Searchers.Text.Model.GraphSearcher)8 NaviEdge (com.google.security.zynamics.binnavi.yfileswrap.zygraph.NaviEdge)8 NaviNode (com.google.security.zynamics.binnavi.yfileswrap.zygraph.NaviNode)8 ZyNormalNodeRealizer (com.google.security.zynamics.zylib.yfileswrap.gui.zygraph.realizers.ZyNormalNodeRealizer)8 Test (org.junit.Test)8 ZyLabelContent (com.google.security.zynamics.zylib.gui.zygraph.realizers.ZyLabelContent)5 CStyleRunData (com.google.security.zynamics.zylib.gui.zygraph.realizers.CStyleRunData)3 IZyNodeRealizer (com.google.security.zynamics.zylib.yfileswrap.gui.zygraph.realizers.IZyNodeRealizer)3 INaviFunction (com.google.security.zynamics.binnavi.disassembly.INaviFunction)2 UnrelocatedAddress (com.google.security.zynamics.binnavi.disassembly.UnrelocatedAddress)2 ArrayList (java.util.ArrayList)2 MockSqlProvider (com.google.security.zynamics.binnavi.Database.MockClasses.MockSqlProvider)1 MaybeNullException (com.google.security.zynamics.binnavi.Exceptions.MaybeNullException)1 IComment (com.google.security.zynamics.binnavi.Gui.GraphWindows.CommentDialogs.Interfaces.IComment)1 CTag (com.google.security.zynamics.binnavi.Tagging.CTag)1 DefaultAddressConverter (com.google.security.zynamics.binnavi.debug.debugger.DefaultAddressConverter)1 IDebugger (com.google.security.zynamics.binnavi.debug.debugger.interfaces.IDebugger)1