Examples of pick()


Examples of co.cask.cdap.common.discovery.RandomEndpointStrategy.pick()

    ServiceDiscovered serviceDiscovered = discoveryServiceClient.discover(String.format("service.%s.%s.%s",
                                                                                        getAccountId(),
                                                                                        applicationId,
                                                                                        serviceId));
    EndpointStrategy endpointStrategy = new RandomEndpointStrategy(serviceDiscovered);
    Discoverable discoverable = endpointStrategy.pick();
    if (discoverable != null) {
      return createURL(discoverable, applicationId, serviceId);
    }

    final SynchronousQueue<URL> discoverableQueue = new SynchronousQueue<URL>();
View Full Code Here

Examples of co.cask.cdap.common.discovery.TimeLimitEndpointStrategy.pick()

      @Override
      public URI get() {
        Iterable<Discoverable> serviceDiscovered = discoveryServiceClient.discover(Constants.Service.ACL);
        TimeLimitEndpointStrategy strategy = new TimeLimitEndpointStrategy(
          new RandomEndpointStrategy(serviceDiscovered), 5, TimeUnit.SECONDS);
        Preconditions.checkNotNull(strategy.pick(), "No discoverable endpoint found for ACLService");

        InetSocketAddress socketAddress = strategy.pick().getSocketAddress();
        try {
          // TODO: support https by checking router ssl enabled from Configuration
          String url = String.format("http://%s:%d", socketAddress.getAddress().getHostName(), socketAddress.getPort());
View Full Code Here

Examples of co.cask.cdap.common.discovery.TimeLimitEndpointStrategy.pick()

        Iterable<Discoverable> serviceDiscovered = discoveryServiceClient.discover(Constants.Service.ACL);
        TimeLimitEndpointStrategy strategy = new TimeLimitEndpointStrategy(
          new RandomEndpointStrategy(serviceDiscovered), 5, TimeUnit.SECONDS);
        Preconditions.checkNotNull(strategy.pick(), "No discoverable endpoint found for ACLService");

        InetSocketAddress socketAddress = strategy.pick().getSocketAddress();
        try {
          // TODO: support https by checking router ssl enabled from Configuration
          String url = String.format("http://%s:%d", socketAddress.getAddress().getHostName(), socketAddress.getPort());
          return new URI(url);
        } catch (URISyntaxException e) {
View Full Code Here

Examples of co.cask.cdap.common.discovery.TimeLimitEndpointStrategy.pick()

  public boolean isServiceAvailable() {
    try {
      Iterable<Discoverable> discoverables = this.discoveryServiceClient.discover(serviceName);
      EndpointStrategy endpointStrategy = new TimeLimitEndpointStrategy(
        new RandomEndpointStrategy(discoverables), discoveryTimeout, TimeUnit.SECONDS);
      Discoverable discoverable = endpointStrategy.pick();
      if (discoverable == null) {
        return false;
      }

      return txClient.status().equals(Constants.Monitor.STATUS_OK);
View Full Code Here

Examples of com.kitfox.svg.SVGDiagram.pick()

    {//GEN-HEADEREND:event_panel_svgAreaMouseReleased
        SVGDiagram diagram = svgDisplayPanel.getDiagram();
        List pickedElements;
        try
        {
            pickedElements = diagram.pick(new Point(evt.getX(), evt.getY()), null);
        }
        catch (SVGException ex)
        {
            ex.printStackTrace();
            return;
View Full Code Here

Examples of com.kitfox.svg.SVGDiagram.pick()

                if (diagram == null) return;
               
                System.out.println("Picking at cursor (" + evt.getX() + ", " + evt.getY() + ")");
                try
                {
                    List paths = diagram.pick(new Point2D.Float(evt.getX(), evt.getY()), null);
                    for (int i = 0; i < paths.size(); i++)
                    {
                        ArrayList path = (ArrayList)paths.get(i);
                        System.out.println(pathToString(path));
                    }
View Full Code Here

Examples of diva.canvas.FigureLayer.pick()

            // so we have to use a lower level mechanism.
            double halo = layer.getPickHalo();
            double width = halo * 2;
            Rectangle2D region = new Rectangle2D.Double(transformedPoint.getX()
                    - halo, transformedPoint.getY() - halo, width, width);
            CanvasComponent figureUnderMouse = layer.pick(region);

            // Find a user object belonging to the figure under the mouse
            // or to any figure containing it (it may be a composite figure).
            Object objectUnderMouse = null;

View Full Code Here

Examples of edu.uci.ics.jung.visualization.PickedState.pick()

               
                vertex = pickSupport.getVertex(ip.getX(), ip.getY());
                if(vertex != null) {
                    if(pickedState.isPicked(vertex) == false) {
                        pickedState.clearPickedVertices();
                        pickedState.pick(vertex, true);
                        vv.fireStateChanged();
                    }
                    // layout.getLocation applies the layout transformer so
                    // q is transformed by the layout transformer only
                    Point2D q = layout.getLocation(vertex);
View Full Code Here

Examples of edu.uci.ics.jung.visualization.PickedState.pick()

                    offsetx = (float) (gp.getX()-q.getX());
                    offsety = (float) (gp.getY()-q.getY());
                } else if(isPickingEdges() &&
                        (edge = pickSupport.getEdge(ip.getX(), ip.getY())) != null) {
                    pickedState.clearPickedEdges();
                    pickedState.pick(edge, true);
                } else {
                    pickedState.clearPickedEdges();
                    pickedState.clearPickedVertices();
                    vv.fireStateChanged();
                }
View Full Code Here

Examples of edu.uci.ics.jung.visualization.PickedState.pick()

                Point2D p = e.getPoint();
                // remove view transform
                Point2D ip = vv.inverseViewTransform(p);
                vertex = pickSupport.getVertex(ip.getX(), ip.getY());
                if(vertex != null) {
                    boolean wasThere = pickedState.pick(vertex, !pickedState.isPicked(vertex));
                    if(wasThere) {
                        vertex = null;
                    } else {
                        // layout.getLocation applies the layout transformer so
                        // q is transformed by the layout transformer only
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.