use of org.opennms.features.topology.app.internal.gwt.client.svg.ClientRect in project opennms by OpenNMS.
the class MarqueeSelectHandler method inSelection.
private boolean inSelection(SVGElement elem) {
SVGElement marquee = m_topologyView.getMarqueeElement().cast();
SVGRect mBBox = marquee.getBBox();
ClientRect elemClientRect = elem.getBoundingClientRect();
Interval marqueeX = new Interval(mBBox.getX(), mBBox.getX() + mBBox.getWidth());
Interval marqueeY = new Interval(mBBox.getY(), mBBox.getY() + mBBox.getHeight());
int left = elemClientRect.getLeft() - m_offsetX;
int top = elemClientRect.getTop() - m_offsetY;
Interval vertexX = new Interval(left, left + elemClientRect.getWidth());
Interval vertexY = new Interval(top, top + elemClientRect.getHeight());
return marqueeX.contains(vertexX.getLo()) && marqueeX.contains(vertexX.getHi()) && marqueeY.contains(vertexY.getLo()) && marqueeY.contains(vertexY.getHi());
}
Aggregations