Package org.geomajas.puregwt.client.spatial

Examples of org.geomajas.puregwt.client.spatial.GeometryFactory


  private ZoomStrategy zoomStrategy;

  @PostConstruct
  public void initialize() {
    GeometryFactory factory = new GeometryFactoryImpl();
    Bbox maxBounds = factory.createBbox(mapInfo.getMaxBounds());
    zoomStrategy = new FreeForAllZoomStrategy(mapInfo, maxBounds);
    zoomStrategy.setMapSize(100, 100);
  }
View Full Code Here


  private ZoomStrategy zoomStrategy;

  @PostConstruct
  public void initialize() {
    GeometryFactory factory = new GeometryFactoryImpl();
    Bbox maxBounds = factory.createBbox(mapInfo.getMaxBounds());
    zoomStrategy = new FixedStepZoomStrategy(mapInfo, maxBounds);
    zoomStrategy.setMapSize(100, 100);
  }
View Full Code Here

    Assert.assertEquals(SCALES[0], zoomStrategy.checkScale(SCALES[0] + 0.001, ZoomOption.LEVEL_FIT));
  }

  @Test
  public void testFaultyConfiguration() {
    GeometryFactory factory = new GeometryFactoryImpl();
    Bbox maxBounds = factory.createBbox(mapInfo.getMaxBounds());

    // Null value for scale levels:
    mapInfo.getScaleConfiguration().setZoomLevels(null);
    try {
      zoomStrategy = new FixedStepZoomStrategy(mapInfo, maxBounds);
View Full Code Here

  @Test
  public void testApplyBounds() {
    Assert.assertEquals(4.0, viewPort.getScale());
    Assert.assertNull(event);
    GeometryFactory factory = new GeometryFactoryImpl();

    HandlerRegistration reg = eventBus.addHandler(ViewPortChangedHandler.TYPE, new AllowChangedHandler());

    // Now a changed event should occur:
    viewPort.applyBounds(factory.createBbox(0, 0, 100, 100));
    Assert.assertEquals(8.0, viewPort.getScale());
    Assert.assertNotNull(event);
    Assert.assertTrue(event instanceof ViewPortChangedEvent);

    reg.removeHandler();
    reg = eventBus.addHandler(ViewPortChangedHandler.TYPE, new AllowTranslationHandler());

    // Expect to end up at the same scale, so no changed event, but translation only:
    viewPort.applyBounds(factory.createBbox(-50, -50, 100, 100));
    Assert.assertEquals(8.0, viewPort.getScale());
    Assert.assertNotNull(event);
    Assert.assertTrue(event instanceof ViewPortTranslatedEvent);

    reg.removeHandler();
View Full Code Here

TOP

Related Classes of org.geomajas.puregwt.client.spatial.GeometryFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.