Package com.google.gwt.resources.client

Examples of com.google.gwt.resources.client.DataResource


   }

   @Test
   public void dataResource() {
      // Arrange
      DataResource testDataResource = MyClientBundle.INSTANCE.dataResource();

      // Act
      String name = testDataResource.getName();
      String url = testDataResource.getSafeUri().asString();
      String toString = testDataResource.toString();

      // Assert
      assertEquals("dataResource", name);
      assertEquals("http://127.0.0.1:8888/gwt_test_utils_module/textResourceXml.xml", url);
      assertEquals(
View Full Code Here


public class MyOverridedClientBundleTest extends GwtTestTest {

   @Test
   public void testDataResource_NoOverride() {
      // Arrange
      DataResource testDataResource = MyOverridedClientBundle.INSTANCE.dataResource();

      // Act
      String name = testDataResource.getName();
      String url = testDataResource.getSafeUri().asString();
      String toString = testDataResource.toString();

      // Assert
      assertEquals("dataResource", name);
      assertEquals("http://127.0.0.1:8888/gwt_test_utils_module/textResourceXml.xml", url);
      assertEquals(
View Full Code Here

    TripPlannerResources resources = TripPlannerResources.INSTANCE;

    for (LegBean segment : trip.getLegs()) {
      if( segment.getMode().equals("walk") ) {
        if (segment.getDistance() > 400) {
          DataResource walkIcon = resources.getWalkTripTypeIcon();
          Image image = new Image(walkIcon.getUrl());
          panel.add(image);
        }
      }
      else if( segment.getMode().equals("transit")) {
        DataResource busIcon = resources.getBusTripTypeIcon();
        Image image = new Image(busIcon.getUrl());
        panel.add(image);
      }
    }

    return panel;
View Full Code Here

        System.err.println("PROBLEM!");
        return;
      }

      MapResources resources = MapResources.INSTANCE;
      DataResource resource = resources.getImageRouteStart();
      Icon icon = Icon.newInstance();
      icon.setImageURL(resource.getUrl());
      icon.setIconSize(Size.newInstance(20, 34));
      icon.setIconAnchor(Point.newInstance(10, 34));
      MarkerOptions opts = MarkerOptions.newInstance(icon);

      _marker = new Marker(location, opts);
View Full Code Here

        panel.addStyleName(_css.tripPanelVehiclePanel());

        DivPanel row1 = new DivPanel(_css.tripPanelVehiclePanelRow1());
        panel.add(row1);

        DataResource busIcon = resources.getBusTripTypeIcon();
        Image image = new Image(busIcon.getUrl());
        image.addStyleName(_css.tripPanelVehiclePanelModeImage());
        row1.add(image);

        int minutes = Math.round((leg.getEndTime() - leg.getStartTime())
            / (1000 * 60));
       
        String routeShortName = getBestName(transitLeg.getRouteShortName(),tripBean.getRouteShortName(), routeBean.getShortName(),"");
        String tripHeadsign = getBestName(transitLeg.getTripHeadsign(),tripBean.getTripHeadsign(),routeBean.getLongName(),"");
       
        row1.add(new DivWidget("Bus - " + routeShortName + " - "
            + tripHeadsign, _css.tripPanelVehiclePanelTitle()));

        String departureTime = _timeFormat.format(new Date(leg.getStartTime()));
        String arrivalTime = _timeFormat.format(new Date(leg.getEndTime()));

        DivPanel row2 = new DivPanel(_css.tripPanelVehiclePanelRow2());
        panel.add(row2);

        DivPanel row3 = new DivPanel(_css.tripPanelVehiclePanelRow3());
        panel.add(row3);

        DivPanel row4 = new DivPanel(_css.tripPanelVehiclePanelRow4());
        panel.add(row4);
       
        String fromStopName = "";
        StopBean fromStop = transitLeg.getFromStop();
        if( fromStop != null)
          fromStopName = fromStop.getName();
       
        String toStopName = "";
        StopBean toStop = transitLeg.getToStop();
        if( toStop != null)
          toStopName = toStop.getName();

        row2.add(new DivWidget(departureTime,
            _css.tripPlanVehiclePanelDepartureTime(),
            _css.tripPlanVehiclePanelA()));
        row2.add(new DivWidget("Depart " + fromStopName,
            _css.tripPlanVehiclePanelDepartureLabel(),
            _css.tripPlanVehiclePanelB()));
        row3.add(new DivWidget("...",
            _css.tripPlanVehiclePanelInTransitLabel(),
            _css.tripPlanVehiclePanelA()));
        row3.add(new DivWidget(minutes + " mins",
            _css.tripPlanVehiclePanelInTransitTime(),
            _css.tripPlanVehiclePanelB()));
        row4.add(new DivWidget(arrivalTime,
            _css.tripPlanVehiclePanelArrivalLabel(),
            _css.tripPlanVehiclePanelA()));
        row4.add(new DivWidget("Arrive " + toStopName,
            _css.tripPlanVehiclePanelArrivalTime(),
            _css.tripPlanVehiclePanelB()));
        _panel.add(panel);

      } else if (mode.equals("walk")) {
       
        DivPanel panel = new DivPanel();
        panel.addStyleName(_css.tripPanelWalkPanel());

        DivPanel row1 = new DivPanel(_css.tripPanelWalkPanelRow1());
        panel.add(row1);

        DataResource walkIcon = resources.getWalkTripTypeIcon();
        Image image = new Image(walkIcon.getUrl());
        image.addStyleName(_css.tripPanelWalkPanelModeImage());
        row1.add(image);

        String target = getWalkToTarget(legs, i, destination);
        row1.add(new DivWidget("Walk to " + target,
View Full Code Here

TOP

Related Classes of com.google.gwt.resources.client.DataResource

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.