Search in sources :

Example 1 with BoundsBuilder

use of org.opennms.features.poller.remote.gwt.client.utils.BoundsBuilder in project opennms by OpenNMS.

the class MapQuestMapPanel method toGWTBounds.

private static GWTBounds toGWTBounds(final MQARectLL bounds) {
    final BoundsBuilder bldr = new BoundsBuilder();
    bldr.extend(bounds.getUpperLeft().getLatitude(), bounds.getUpperLeft().getLongitude());
    bldr.extend(bounds.getLowerRight().getLatitude(), bounds.getLowerRight().getLongitude());
    return bldr.getBounds();
}
Also used : BoundsBuilder(org.opennms.features.poller.remote.gwt.client.utils.BoundsBuilder)

Example 2 with BoundsBuilder

use of org.opennms.features.poller.remote.gwt.client.utils.BoundsBuilder in project opennms by OpenNMS.

the class BoundsBuilderTest method testAddOppositeCornerPoints.

@Test
public void testAddOppositeCornerPoints() {
    BoundsBuilder bldr = new BoundsBuilder();
    bldr.extend(0.0, 1.0);
    bldr.extend(1.0, 0.0);
    assertEquals(new GWTBounds(0.0, 0.0, 1.0, 1.0), bldr.getBounds());
}
Also used : GWTBounds(org.opennms.features.poller.remote.gwt.client.GWTBounds) BoundsBuilder(org.opennms.features.poller.remote.gwt.client.utils.BoundsBuilder) Test(org.junit.Test)

Example 3 with BoundsBuilder

use of org.opennms.features.poller.remote.gwt.client.utils.BoundsBuilder in project opennms by OpenNMS.

the class BoundsBuilderTest method testExtendEastAndWrap.

@Test
public void testExtendEastAndWrap() {
    BoundsBuilder bldr = new BoundsBuilder();
    bldr.extend(0.0, 0.0);
    bldr.extend(0.0, 170.0);
    assertEquals(new GWTBounds(0.0, 0.0, 0, 170), bldr.getBounds());
    bldr.extend(0.0, -100.0);
    assertEquals(new GWTBounds(0, 0, 0, -100), bldr.getBounds());
}
Also used : GWTBounds(org.opennms.features.poller.remote.gwt.client.GWTBounds) BoundsBuilder(org.opennms.features.poller.remote.gwt.client.utils.BoundsBuilder) Test(org.junit.Test)

Example 4 with BoundsBuilder

use of org.opennms.features.poller.remote.gwt.client.utils.BoundsBuilder in project opennms by OpenNMS.

the class BoundsBuilderTest method testDistanceFromEasternHemi.

@Test
public void testDistanceFromEasternHemi() {
    BoundsBuilder bldr = new BoundsBuilder();
    bldr.extend(10, 170);
    bldr.extend(0, 160);
    assertEquals(5.0, bldr.distanceEast(175), 0.0);
    assertEquals(5.0, bldr.distanceWest(155), 0.0);
    assertEquals(20.0, bldr.distanceEast(-170), 0.0);
    assertEquals(330.0, bldr.distanceWest(-170), 0.0);
}
Also used : BoundsBuilder(org.opennms.features.poller.remote.gwt.client.utils.BoundsBuilder) Test(org.junit.Test)

Example 5 with BoundsBuilder

use of org.opennms.features.poller.remote.gwt.client.utils.BoundsBuilder in project opennms by OpenNMS.

the class BoundsBuilderTest method testAddNoPoints.

@Test
public void testAddNoPoints() {
    BoundsBuilder bldr = new BoundsBuilder();
    assertEquals(new GWTBounds(-90, -180, 90, 180), bldr.getBounds());
}
Also used : GWTBounds(org.opennms.features.poller.remote.gwt.client.GWTBounds) BoundsBuilder(org.opennms.features.poller.remote.gwt.client.utils.BoundsBuilder) Test(org.junit.Test)

Aggregations

BoundsBuilder (org.opennms.features.poller.remote.gwt.client.utils.BoundsBuilder)16 Test (org.junit.Test)13 GWTBounds (org.opennms.features.poller.remote.gwt.client.GWTBounds)11 Bounds (org.gwtopenmaps.openlayers.client.Bounds)1 GWTLatLng (org.opennms.features.poller.remote.gwt.client.GWTLatLng)1 LocationInfo (org.opennms.features.poller.remote.gwt.client.location.LocationInfo)1