Search in sources :

Example 1 with Point

use of com.google.gwt.touch.client.Point in project opennms by OpenNMS.

the class DragObject method move.

public void move() {
    final int deltaX = getCurrentX() - getStartX();
    final int deltaY = getCurrentY() - getStartY();
    m_selection.each(new Handler<GWTVertex>() {

        @Override
        public void call(GWTVertex vertex, int index) {
            if (m_startPosition.containsKey(vertex.getId())) {
                Point p = m_startPosition.get(vertex.getId());
                vertex.setX((int) (p.getX() + deltaX));
                vertex.setY((int) (p.getY() + deltaY));
            }
        }
    });
}
Also used : GWTVertex(org.opennms.features.topology.app.internal.gwt.client.GWTVertex) Point(com.google.gwt.touch.client.Point) SVGPoint(org.opennms.features.topology.app.internal.gwt.client.svg.SVGPoint) Point(com.google.gwt.touch.client.Point) SVGPoint(org.opennms.features.topology.app.internal.gwt.client.svg.SVGPoint)

Example 2 with Point

use of com.google.gwt.touch.client.Point in project opennms by OpenNMS.

the class VTopologyComponent method createBoundingRect.

private BoundingRect createBoundingRect(JsArray<GWTVertex> vertices, boolean fitToView) {
    final BoundingRect rect = new BoundingRect();
    for (int i = 0; i < vertices.length(); i++) {
        GWTVertex vertex = vertices.get(i);
        if (fitToView || vertex.isSelected()) {
            double vertexX = vertex.getX();
            double vertexY = vertex.getY();
            rect.addPoint(new Point(vertexX, vertexY));
        }
    }
    return rect;
}
Also used : BoundingRect(org.opennms.features.topology.app.internal.gwt.client.svg.BoundingRect) SVGPoint(org.opennms.features.topology.app.internal.gwt.client.svg.SVGPoint) Point(com.google.gwt.touch.client.Point) SVGPoint(org.opennms.features.topology.app.internal.gwt.client.svg.SVGPoint) Point(com.google.gwt.touch.client.Point)

Aggregations

Point (com.google.gwt.touch.client.Point)2 SVGPoint (org.opennms.features.topology.app.internal.gwt.client.svg.SVGPoint)2 GWTVertex (org.opennms.features.topology.app.internal.gwt.client.GWTVertex)1 BoundingRect (org.opennms.features.topology.app.internal.gwt.client.svg.BoundingRect)1