Search in sources :

Example 1 with ClientRect

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());
}
Also used : SVGElement(org.opennms.features.topology.app.internal.gwt.client.svg.SVGElement) ClientRect(org.opennms.features.topology.app.internal.gwt.client.svg.ClientRect) SVGRect(org.opennms.features.topology.app.internal.gwt.client.svg.SVGRect)

Aggregations

ClientRect (org.opennms.features.topology.app.internal.gwt.client.svg.ClientRect)1 SVGElement (org.opennms.features.topology.app.internal.gwt.client.svg.SVGElement)1 SVGRect (org.opennms.features.topology.app.internal.gwt.client.svg.SVGRect)1