Examples of Location


Examples of org.hibernate.test.annotations.id.sequences.entities.Location

    Session s = openSession();
    Transaction tx = s.beginTransaction();
    s.persist( tower );
    s.flush();
    s.clear();
    Location loc = new Location();
    loc.latitude = tower.latitude;
    loc.longitude = tower.longitude;
    assertNotNull( s.get( Tower.class, loc ) );
    tx.rollback();
    s.close();
View Full Code Here

Examples of org.itcr.myguru.model.Location

            return;
        }
       
        // Business logic
        //  :: Find Location by code
        Location loc = dao.findLocationByCode(code);
        if(loc == null) {
            return;
        }
       
        // Add location to user expertise
        boolean hasExpertise = user.hasExpertise(loc);
        if(action.equals("add")) { // Add
            // Do nothing if user is already expert
            if(hasExpertise) {
                return;
            }
            user.addExpertise(loc);
           
        } else { // Remove
            // Do nothing if user is already expert
            if(!hasExpertise) {
                return;
            }
            user.removeExpertise(loc);
        }
       
        try {
            dao.persistChanges(user);
        } catch(Exception e) {
            e.printStackTrace();
            return;
        }
        String contextPath = request.getContextPath();
        PrintWriter out = response.getWriter();
        if(action.equals("add")) {
            out.println("<li id=\"expertise_" + loc.getCode() + "\">");
            out.println("    <span class=\"expertise_name\">" + loc.toString() + "</span> |");
            out.println("    <a class=\"expertise_remove\" href=\"" + contextPath + "/expertise/remove\">Eliminar</a>");
            out.println("</li>");
        } else { // Remove
            out.println("<option value=\"" + loc.getCode() + "\">" + loc.toString() + "</option>");
        }
        out.flush();
        out.close();
        return;
    }
View Full Code Here

Examples of org.jakstab.cfa.Location

  /**
   * Set the program entry point to the given address.
   * @param entryAddress the new entry address
   */
  public void setEntryAddress(AbsoluteAddress entryAddress) {
    setStart(new Location(entryAddress));
  }
View Full Code Here

Examples of org.jboss.arquillian.graphene.page.Location

        handleLocationOf(pageObject, browser);
        return result;
    }

    private void handleLocationOf(Class<?> pageObjectClass, WebDriver browser) {
        Location location = pageObjectClass.getAnnotation(Location.class);
        if (location == null) {
            throw new IllegalArgumentException(String.format("The page object '%s' that you are navigating to "
                + "using either Graphene.goTo(<page_object>) or @InitialPage is not annotated with @Location",
                pageObjectClass.getSimpleName()));
        }

        if (location.scheme() == null) {
            throw new IllegalArgumentException("Scheme for provided @Location can not be a null object.");
        }

        Class<?> schemeClass = null;

        String defaultSchemeString = configuration.get().getScheme();

        try {
            if (defaultSchemeString != null) {
                schemeClass = SecurityActions.newInstance(defaultSchemeString);
            }
        } catch (IllegalArgumentException ex) {
        }

        if (schemeClass == null) {
            schemeClass = location.scheme();
        }

        injector.get().inject(locationStore.get());

        LocationDecider decider = resolveDecider(serviceLoader.get().all(LocationDecider.class), schemeClass);

        if (decider == null) {
            throw new UnsupportedOperationException(String.format("There is not any registered location decider "
                + "which can decide '%s' scheme.", location.scheme().toString()));
        }

        browser.get(decider.decide(location.value()));
    }
View Full Code Here

Examples of org.jboss.dna.graph.Location

            Thread.interrupted();
            return this;
        }
        // Index all of the workspaces ...
        Path rootPath = context.getValueFactories().getPathFactory().createRootPath();
        Location rootLocation = Location.create(rootPath);
        for (String workspaceName : getWorkspaces.getAvailableWorkspaceNames()) {
            index(workspaceName, rootLocation);
        }
        return this;
    }
View Full Code Here

Examples of org.jboss.msc.service.Location

     *
     * @param msg the detail message
     */
    public DeploymentUnitProcessingException(final String msg) {
        super(msg);
        this.location = new Location(this.getStackTrace()[0].getFileName(), this.getStackTrace()[0].getLineNumber(), -1, null);
    }
View Full Code Here

Examples of org.jboss.seam.rest.example.client.geo.SearchResult.Location

        return 5;
    }

    @Override
    public Object getValueAt(int rowIndex, int columnIndex) {
        Location location = search.getLocations().getLocations().get(rowIndex);

        switch (columnIndex) {
            case 0:
                return location.getPostalCode();
            case 1:
                return location.getName();
            case 2:
                return location.getCountryCode();
            case 3:
                return location.getLatitude();
            case 4:
                return location.getLongitude();
            default:
                throw new IllegalArgumentException("columnIndex");
        }
    }
View Full Code Here

Examples of org.jclouds.domain.Location

   @Override
   public Location apply(Network from) {
      Matcher matcher = netPattern.matcher(from.getHref().toASCIIString());
      if (matcher.find()) {
         Location provider = new LocationBuilder().scope(LocationScope.PROVIDER).id(providerName).description(
                  endpoint.get().toASCIIString()).iso3166Codes(isoCodes).build();

         Org org = api.getBrowsingApi().getOrg(matcher.group(1));

         Location orgLocation = new LocationBuilder().scope(LocationScope.REGION).id(org.getId()).description(
                  org.getDescription()).parent(provider).build();

         VDC vdc = api.getBrowsingApi().getVDCInOrg(org.getId(), matcher.group(2));

         Location vdcLocation = new LocationBuilder().scope(LocationScope.ZONE).id(vdc.getId()).description(
                  vdc.getDescription()).parent(orgLocation).build();

         return new LocationBuilder().scope(LocationScope.NETWORK).id(from.getId()).description(from.getName()).parent(
                  vdcLocation).build();
      } else {
View Full Code Here

Examples of org.jclouds.ibm.smartcloud.domain.Location

public class LocationHandlerTest extends BaseHandlerTest {

   public void testApplyInputStream() {
      InputStream is = getClass().getResourceAsStream("/location.xml");

      Location result = factory.create(injector.getInstance(LocationHandler.class)).parse(is);

      Location expects = Location.builder().id("41").name("RTP").description("RTP usrdtsa0a1ccxra").location("RTP")
               .state(Location.State.ONLINE).capability(Capabilities.CAPABILITY_FORMAT,
                        ImmutableMap.<String, String> of("EXT3", "ext3", "RAW", "raw")).capability(
                        Capabilities.CAPABILITY_I386).capability(Capabilities.CAPABILITY_x86_64)
               .capability(Capabilities.CAPABILITY_AVAILABILITYAREA).build();

      assertEquals(result.toString(), expects.toString());
   }
View Full Code Here

Examples of org.jpokemon.overworld.Location

  @Override
  public void execute(Player player) throws ServiceException {
    OverworldService overworldService = (OverworldService) PlayerManager.getService("overworld");
    Map nextMap = overworldService.getMap(nextMapId);
    Entity nextDoor = nextMap.getEntity(mapId);
    Location nextLocation = nextDoor.getLocation().clone();
    nextLocation.setWidth(1);
    nextLocation.setHeight(1);
    nextLocation.setDirection("down");

    overworldService.teleportPlayer(player, nextLocation);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.