Search in sources :

Example 1 with MouseEventDetails

use of com.vaadin.shared.MouseEventDetails in project opennms by OpenNMS.

the class VTopologyComponent method vertexClickHandler.

private Handler<GWTVertex> vertexClickHandler() {
    return new D3Events.Handler<GWTVertex>() {

        @Override
        public void call(GWTVertex vertex, int index) {
            if (D3.eventDefaultPrevented()) {
                return;
            }
            NativeEvent event = D3.getEvent();
            SVGGElement vertexElement = event.getCurrentEventTarget().cast();
            vertexElement.getParentElement().appendChild(vertexElement);
            event.preventDefault();
            event.stopPropagation();
            final MouseEventDetails mouseDetails = MouseEventDetailsBuilder.buildMouseEventDetails(event, getElement());
            m_serverRpc.vertexClicked(vertex.getId(), mouseDetails, Navigator.getPlatform());
        }
    };
}
Also used : SVGGElement(org.opennms.features.topology.app.internal.gwt.client.svg.SVGGElement) MouseEventDetails(com.vaadin.shared.MouseEventDetails) MarqueeSelectHandler(org.opennms.features.topology.app.internal.gwt.client.handler.MarqueeSelectHandler) PanHandler(org.opennms.features.topology.app.internal.gwt.client.handler.PanHandler) Handler(org.opennms.features.topology.app.internal.gwt.client.d3.D3Events.Handler) NativeEvent(com.google.gwt.dom.client.NativeEvent)

Example 2 with MouseEventDetails

use of com.vaadin.shared.MouseEventDetails in project opennms by OpenNMS.

the class VTopologyComponent method setVertexSelection.

@Override
public void setVertexSelection(List<String> vertIds) {
    final MouseEventDetails mouseDetails = MouseEventDetailsBuilder.buildMouseEventDetails(D3.getEvent(), getElement());
    m_serverRpc.marqueeSelection(vertIds.toArray(new String[] {}), mouseDetails);
}
Also used : MouseEventDetails(com.vaadin.shared.MouseEventDetails)

Aggregations

MouseEventDetails (com.vaadin.shared.MouseEventDetails)2 NativeEvent (com.google.gwt.dom.client.NativeEvent)1 Handler (org.opennms.features.topology.app.internal.gwt.client.d3.D3Events.Handler)1 MarqueeSelectHandler (org.opennms.features.topology.app.internal.gwt.client.handler.MarqueeSelectHandler)1 PanHandler (org.opennms.features.topology.app.internal.gwt.client.handler.PanHandler)1 SVGGElement (org.opennms.features.topology.app.internal.gwt.client.svg.SVGGElement)1