Search in sources :

Example 6 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 7 with BoundsBuilder

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

the class BoundsBuilderTest method testExtendEastThenWest.

@Test
public void testExtendEastThenWest() {
    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, -90.0);
    assertEquals(new GWTBounds(0, -90, 0, 170), 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 8 with BoundsBuilder

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

the class BoundsBuilderTest method testAddOnePoint.

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

Example 9 with BoundsBuilder

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

the class BoundsBuilderTest method testAddTwoCornerPoints.

@Test
public void testAddTwoCornerPoints() {
    BoundsBuilder bldr = new BoundsBuilder();
    bldr.extend(0.0, 0.0);
    bldr.extend(1.0, 1.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 10 with BoundsBuilder

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

the class LocationAddedToMapTest method createLocations.

private GWTBounds createLocations(int num, Set<LocationInfo> locations) {
    BoundsBuilder boundsBldr = new BoundsBuilder();
    for (int i = 1; i <= num; i++) {
        double lat = m_random.nextDouble() * 22 + 27;
        double lng = m_random.nextDouble() * -57 - 67;
        boundsBldr.extend(lat, lng);
        LocationInfo location1 = new LocationInfo("location" + i, "area" + i, i + " Opennms Way", lat + "," + lng, 100L, null, new StatusDetails(Status.UP, "reason is that its up"), null);
        locations.add(location1);
    }
    return boundsBldr.getBounds();
}
Also used : BoundsBuilder(org.opennms.features.poller.remote.gwt.client.utils.BoundsBuilder) LocationInfo(org.opennms.features.poller.remote.gwt.client.location.LocationInfo)

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