Search in sources :

Example 26 with ZyLabelContent

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

the class CEditNodeHelper method setCaretEnd.

public static void setCaretEnd(final AbstractZyGraph<?, ?> graph, final Node node, final MouseEvent event) {
    final double mouseX = graph.getEditMode().translateX(event.getX());
    final double mouseY = graph.getEditMode().translateY(event.getY());
    final IZyNodeRealizer realizer = (IZyNodeRealizer) graph.getGraph().getRealizer(node);
    final ZyLabelContent labelContent = realizer.getNodeContent();
    final CDefaultLabelEventHandler labelEventHandler = graph.getEditMode().getLabelEventHandler();
    if (labelContent.isSelectable()) {
        final double zoom = graph.getView().getZoom();
        final double nodeX = realizer.getRealizer().getX();
        final double nodeY = realizer.getRealizer().getY();
        labelEventHandler.handleMouseReleasedEvent(nodeX, nodeY, mouseX, mouseY, zoom, event.getClickCount());
    }
}
Also used : ZyLabelContent(com.google.security.zynamics.zylib.gui.zygraph.realizers.ZyLabelContent) CDefaultLabelEventHandler(com.google.security.zynamics.zylib.gui.zygraph.CDefaultLabelEventHandler) IZyNodeRealizer(com.google.security.zynamics.zylib.yfileswrap.gui.zygraph.realizers.IZyNodeRealizer)

Example 27 with ZyLabelContent

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

the class ZyFunctionNodeBuilder method buildContent.

/**
   * Creates the node content of a function node.
   *
   * @param node The node which provides the raw data.
   * @param graphSettings Graph settings used to build the graph.
   * @param modifier Calculates the address strings. This argument can be null.
   *
   * @return The generated node content of the function node.
   */
public static ZyLabelContent buildContent(final INaviFunctionNode node, final ZyGraphViewSettings graphSettings, final INodeModifier modifier) {
    Preconditions.checkNotNull(node, "IE01556: Argument node can't be null");
    final ZyLabelContent content = new ZyLabelContent(null);
    buildContent(content, node, graphSettings, modifier);
    return content;
}
Also used : ZyLabelContent(com.google.security.zynamics.zylib.gui.zygraph.realizers.ZyLabelContent)

Example 28 with ZyLabelContent

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

the class ZyGroupNodeBuilder method buildContent.

/**
   * Builds the content of a single group node.
   *
   * @param node The group node that provides the underlying data.
   *
   * @return The created content.
   */
public static ZyLabelContent buildContent(final INaviGroupNode node) {
    Preconditions.checkNotNull(node, "IE01558: Node argument can not be null");
    final ZyLabelContent content = new ZyLabelContent(null);
    buildContent(content, node);
    return content;
}
Also used : ZyLabelContent(com.google.security.zynamics.zylib.gui.zygraph.realizers.ZyLabelContent)

Example 29 with ZyLabelContent

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

the class GraphSearcher method clearResults.

/**
   * Clears the results list.
   */
public void clearResults() {
    for (final SearchResult result : m_results) {
        if (result.getObject() instanceof NaviNode) {
            ((NaviNode) result.getObject()).setBackgroundColor(result.getLine(), result.getPosition(), result.getLength(), null);
        } else if (result.getObject() instanceof NaviEdge) {
            final NaviEdge edge = (NaviEdge) result.getObject();
            final ZyLabelContent content = edge.getLabelContent();
            content.getLineContent(result.getLine()).setBackgroundColor(result.getPosition(), result.getLength(), null);
        }
    }
    m_results.clear();
    m_cursor.clear();
    m_changed = false;
}
Also used : ZyLabelContent(com.google.security.zynamics.zylib.gui.zygraph.realizers.ZyLabelContent) NaviNode(com.google.security.zynamics.binnavi.yfileswrap.zygraph.NaviNode) SearchResult(com.google.security.zynamics.binnavi.Gui.GraphWindows.Searchers.Text.Model.SearchResult) NaviEdge(com.google.security.zynamics.binnavi.yfileswrap.zygraph.NaviEdge)

Example 30 with ZyLabelContent

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

the class ZyEdgeBuilder method buildContent.

/**
   * Builds the content of a graph edge label.
   *
   * @param edge The edge whose label content is built.
   *
   * @return The created edge label content.
   */
public static ZyLabelContent buildContent(final INaviEdge edge) {
    final ZyLabelContent content = new ZyLabelContent(null);
    ZyNodeBuilder.addCommentLines(content, edge, edge.getLocalComment(), edge.getGlobalComment());
    return content;
}
Also used : ZyLabelContent(com.google.security.zynamics.zylib.gui.zygraph.realizers.ZyLabelContent)

Aggregations

ZyLabelContent (com.google.security.zynamics.zylib.gui.zygraph.realizers.ZyLabelContent)33 IZyNodeRealizer (com.google.security.zynamics.zylib.yfileswrap.gui.zygraph.realizers.IZyNodeRealizer)10 NaviNode (com.google.security.zynamics.binnavi.yfileswrap.zygraph.NaviNode)6 NaviEdge (com.google.security.zynamics.binnavi.yfileswrap.zygraph.NaviEdge)5 ZyLineContent (com.google.security.zynamics.zylib.gui.zygraph.realizers.ZyLineContent)5 ZyEdgeRealizer (com.google.security.zynamics.zylib.yfileswrap.gui.zygraph.realizers.ZyEdgeRealizer)5 Edge (y.base.Edge)4 Node (y.base.Node)4 MockSqlProvider (com.google.security.zynamics.binnavi.Database.MockClasses.MockSqlProvider)3 CTextNode (com.google.security.zynamics.binnavi.disassembly.CTextNode)3 INaviEdge (com.google.security.zynamics.binnavi.disassembly.INaviEdge)3 CModule (com.google.security.zynamics.binnavi.disassembly.Modules.CModule)3 CDefaultLabelEventHandler (com.google.security.zynamics.zylib.gui.zygraph.CDefaultLabelEventHandler)3 ZyNormalNodeRealizer (com.google.security.zynamics.zylib.yfileswrap.gui.zygraph.realizers.ZyNormalNodeRealizer)3 MockDatabase (com.google.security.zynamics.binnavi.Database.MockClasses.MockDatabase)2 SearchResult (com.google.security.zynamics.binnavi.Gui.GraphWindows.Searchers.Text.Model.SearchResult)2 CallGraphSettingsConfigItem (com.google.security.zynamics.binnavi.config.CallGraphSettingsConfigItem)2 INaviCodeNode (com.google.security.zynamics.binnavi.disassembly.INaviCodeNode)2 CView (com.google.security.zynamics.binnavi.disassembly.views.CView)2 ZyGraph (com.google.security.zynamics.binnavi.yfileswrap.zygraph.ZyGraph)2