Package org.geomajas.gwt.client.gfx

Examples of org.geomajas.gwt.client.gfx.PainterVisitor


    this.applicationId = applicationId;
    mapModel = new MapModel(getID() + "Graphics");
    mapModel.addMapModelHandler(this);
    mapModel.getMapView().addMapViewChangedHandler(this);
    graphics = new GraphicsWidget(getID() + "Graphics");
    painterVisitor = new PainterVisitor(graphics);
    mapModel.addFeatureSelectionHandler(new MapWidgetFeatureSelectionHandler(this));
    graphics.setFallbackController(new PanController(this));

    // Painter registration:
    painterVisitor.registerPainter(new CirclePainter());
View Full Code Here


    Composite c = new Composite();
    MockPaintable r = new MockPaintable();
    c.addChild(r);

    PainterVisitor pv = new PainterVisitor(new MapContext(){

      public MenuContext getMenuContext() {
        return null;
      }

      public ImageContext getRasterContext() {
        return null;
      }

      public GraphicsContext getVectorContext() {
        return null;
      }

      public boolean isReady() {
        return true;
      }

      public HandlerRegistration addGraphicsReadyHandler(GraphicsReadyHandler handler) {
        return null;
      }

      public void fireEvent(GwtEvent<?> event) {
      }});
    pv.registerPainter(new MockPainter());
    c.accept(pv, null, null, false);
    Assert.assertTrue("should have accepted visitor", r.visitorAccepted);
  }
View Full Code Here

TOP

Related Classes of org.geomajas.gwt.client.gfx.PainterVisitor

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.