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);
}
}
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);
}
}
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());
}
}
Aggregations