use of org.opennms.features.topology.app.internal.gwt.client.GWTVertex 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 org.opennms.features.topology.app.internal.gwt.client.GWTVertex in project opennms by OpenNMS.
the class MarqueeSelectHandler method selectVertices.
private void selectVertices() {
// We use the svgIconOverlay to determine the selection and ignore the status border, the label
// and possible invisible elements, such as status badge, navigate to target etc, as the vertex is
// slightly greater than the svgIconOverlay and the user probably uses the icon itself to make the selection.
D3 iconOverlay = m_svgTopologyMap.selectAllVertexElements().select(".svgIconOverlay");
JsArray<JsArray<SVGElement>> selection = iconOverlay.cast();
final JsArray<SVGElement> elemArray = selection.get(0);
iconOverlay.each(new Handler<GWTVertex>() {
@Override
public void call(GWTVertex vertex, int index) {
SVGElement elem = elemArray.get(index).cast();
boolean selected = inSelection(elem);
vertex.setSelected(selected);
}
});
}
Aggregations