Package org.onebusaway.webapp.gwt.where_library.view

Examples of org.onebusaway.webapp.gwt.where_library.view.StopFinderPresenter


    HistoryContextManager manager = new HistoryContextManager();

    StopFinderWidget widget = new StopFinderWidget();
    widget.setTitleWidget(new TitleWidget());

    StopFinderPresenter stopFinder = new StopFinderPresenter(manager);

    widget.setStopFinder(stopFinder);
    stopFinder.setWidget(widget);

    StandardApplicationContainer.add(widget);

    StyleInjector.inject(WhereStopFinderStandardResources.INSTANCE.getCSS().getText());

    stopFinder.initialize();
  }
View Full Code Here


    _dialog = new ModalLayoutPanel();

    StopFinderWidgetExtension widget = new StopFinderWidgetExtension();

    final StopFinderPresenter stopFinder = new StopFinderPresenter();
    stopFinder.setDefaultOperationHandler(new DefaultOperationHandler());

    stopFinder.setWidget(widget);
    widget.setStopFinder(stopFinder);

    widget.addStyleName(style.StopFinderDialog());

    _dialog.add(widget);
    _dialog.setWidgetLeftRight(widget, 5, Unit.PCT, 5, Unit.PCT);
    _dialog.setWidgetTopBottom(widget, 10, Unit.PCT, 10, Unit.PCT);

    _dialog.addCloseHandler(new CloseHandler<ModalLayoutPanel>() {
      @Override
      public void onClose(CloseEvent<ModalLayoutPanel> arg0) {
        if (_stop != null)
          addStop(_stop);
      }
    });

    _dialog.show();

    Context context = new ContextImpl();

    if (!_stopsById.isEmpty()) {
      CoordinateBounds b = new CoordinateBounds();
      for (StopBean stop : _stopsById.values())
        b.addPoint(stop.getLat(), stop.getLon());
      b = SphericalGeometryLibrary.bounds(b, 100);
      context = stopFinder.getCoordinateBoundsAsContext(b);
      System.out.println("context=" + context);
    }

    final Context c = context;

    DeferredCommand.addCommand(new Command() {
      @Override
      public void execute() {
        stopFinder.onContextChanged(c);
      }
    });
  }
View Full Code Here

TOP

Related Classes of org.onebusaway.webapp.gwt.where_library.view.StopFinderPresenter

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.