Search in sources :

Example 1 with CDefaultLabelEventHandler

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

the class CEditNodeHelper method select.

public static void select(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.handleMouseDraggedEvent(nodeX, nodeY, mouseX, mouseY, zoom);
    }
}
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 2 with CDefaultLabelEventHandler

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

the class CEditNodeHelper method setCaretStart.

public static void setCaretStart(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();
    graph.getEditMode().getLabelEventHandler().activateLabelContent(labelContent, new ZyRegenerateableNodeRealizer(realizer));
    if (labelContent.isSelectable()) {
        final double zoom = graph.getView().getZoom();
        final double nodeX = realizer.getRealizer().getX();
        final double nodeY = realizer.getRealizer().getY();
        labelEventHandler.handleMousePressedEvent(nodeX, nodeY, mouseX, mouseY, zoom);
    }
}
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) ZyRegenerateableNodeRealizer(com.google.security.zynamics.zylib.gui.zygraph.realizers.ZyRegenerateableNodeRealizer)

Example 3 with CDefaultLabelEventHandler

use of com.google.security.zynamics.zylib.gui.zygraph.CDefaultLabelEventHandler 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)

Aggregations

CDefaultLabelEventHandler (com.google.security.zynamics.zylib.gui.zygraph.CDefaultLabelEventHandler)3 ZyLabelContent (com.google.security.zynamics.zylib.gui.zygraph.realizers.ZyLabelContent)3 IZyNodeRealizer (com.google.security.zynamics.zylib.yfileswrap.gui.zygraph.realizers.IZyNodeRealizer)3 ZyRegenerateableNodeRealizer (com.google.security.zynamics.zylib.gui.zygraph.realizers.ZyRegenerateableNodeRealizer)1