Search in sources :

Example 6 with SVGPoint

use of org.opennms.features.topology.app.internal.gwt.client.svg.SVGPoint in project opennms by OpenNMS.

the class PanObject method move.

@Override
public void move() {
    Event event = D3.getEvent().cast();
    SVGPoint eventPoint = getEventPoint(event);
    SVGPoint p = eventPoint.matrixTransform(m_stateTf);
    SVGMatrix m = m_stateTf.inverse().translate(p.getX() - m_stateOrigin.getX(), p.getY() - m_stateOrigin.getY());
    String matrixTransform = "matrix(" + m.getA() + ", " + m.getB() + ", " + m.getC() + ", " + m.getD() + ", " + m.getE() + ", " + m.getF() + ")";
    getDraggableElement().setAttribute("transform", matrixTransform);
}
Also used : SVGPoint(org.opennms.features.topology.app.internal.gwt.client.svg.SVGPoint) SVGMatrix(org.opennms.features.topology.app.internal.gwt.client.svg.SVGMatrix) Event(com.google.gwt.user.client.Event)

Aggregations

SVGPoint (org.opennms.features.topology.app.internal.gwt.client.svg.SVGPoint)6 SVGMatrix (org.opennms.features.topology.app.internal.gwt.client.svg.SVGMatrix)3 SVGGElement (org.opennms.features.topology.app.internal.gwt.client.svg.SVGGElement)2 JavaScriptObject (com.google.gwt.core.client.JavaScriptObject)1 EventTarget (com.google.gwt.dom.client.EventTarget)1 NativeEvent (com.google.gwt.dom.client.NativeEvent)1 Point (com.google.gwt.touch.client.Point)1 Event (com.google.gwt.user.client.Event)1 HashMap (java.util.HashMap)1 D3 (org.opennms.features.topology.app.internal.gwt.client.d3.D3)1 D3Behavior (org.opennms.features.topology.app.internal.gwt.client.d3.D3Behavior)1 D3Drag (org.opennms.features.topology.app.internal.gwt.client.d3.D3Drag)1 DragHandlerManager (org.opennms.features.topology.app.internal.gwt.client.handler.DragHandlerManager)1 DragObject (org.opennms.features.topology.app.internal.gwt.client.handler.DragObject)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 ServiceRegistry (org.opennms.features.topology.app.internal.gwt.client.service.ServiceRegistry)1 DefaultServiceRegistry (org.opennms.features.topology.app.internal.gwt.client.service.support.DefaultServiceRegistry)1 SVGElement (org.opennms.features.topology.app.internal.gwt.client.svg.SVGElement)1