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();
}
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());
}
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());
}
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());
}
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();
}
Aggregations