use of org.opennms.features.topology.app.internal.gwt.client.handler.DragObject in project opennms by OpenNMS.
the class VTopologyComponent method vertexDragStartHandler.
private Handler<GWTVertex> vertexDragStartHandler() {
return new Handler<GWTVertex>() {
@Override
public void call(GWTVertex vertex, int index) {
NativeEvent event = D3.getEvent();
Element draggableElement = Element.as(event.getEventTarget()).getParentElement();
D3 selection = null;
boolean isSelected = draggableElement.getAttribute("class").equals("vertex selected");
if (isSelected) {
selection = D3.d3().selectAll(GWTVertex.SELECTED_VERTEX_CLASS_NAME);
} else {
selection = D3.d3().select(Element.as(event.getEventTarget()).getParentElement());
}
m_dragObject = new DragObject(VTopologyComponent.this.m_topologyView, draggableElement, m_topologyView.getSVGViewPort(), selection);
D3.getEvent().preventDefault();
D3.getEvent().stopPropagation();
}
};
}
Aggregations