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