Examples of Handle


Examples of CH.ifa.draw.framework.Handle

   * @param y Document coordinates
   * @return The hit handle or null if no handle is found
   */
  public Handle findHandle(final int x, final int y)
  {
    Handle handle;

    Enumeration k = selectionHandles();

    while (k.hasMoreElements())
    {
      handle = (Handle) k.nextElement();

      if (handle.containsPoint(x, y))
        return handle;
    }

    return null;
  }
View Full Code Here

Examples of co.cask.cdap.api.annotation.Handle

        break;
      }

      // Gather all handler method
      for (Method method : type.getRawType().getDeclaredMethods()) {
        Handle handleAnnotation = method.getAnnotation(Handle.class);
        if (!method.getName().startsWith(HANDLER_METHOD_PREFIX) && handleAnnotation == null) {
          continue;
        }

        Set<String> methodNames;
        if (handleAnnotation == null || handleAnnotation.value().length == 0) {
          methodNames = ImmutableSet.of(ANY_METHOD);
        } else {
          methodNames = ImmutableSet.copyOf(handleAnnotation.value());
        }

        for (String methodName : methodNames) {
          result.put(methodName, new ReflectionHandlerMethod(procedure, method, dataFabricFacade));
        }
View Full Code Here

Examples of com.android.tools.lint.detector.api.Location.Handle

        // Check to make sure that the argument counts and types are consistent
        int prevCount = -1;
        for (Pair<Handle, String> pair : list) {
            Set<Integer> indices = new HashSet<Integer>();
            int count = getFormatArgumentCount(pair.getSecond(), indices);
            Handle handle = pair.getFirst();
            if (prevCount != -1 && prevCount != count) {
                Object clientData = handle.getClientData();
                if (clientData instanceof Node) {
                    if (context.getDriver().isSuppressed(null, ARG_COUNT, (Node) clientData)) {
                        return;
                    }
                }
                Location location = handle.resolve();
                Location secondary = list.get(0).getFirst().resolve();
                secondary.setMessage("Conflicting number of arguments here");
                location.setSecondary(secondary);
                String message = String.format(
                        "Inconsistent number of arguments in formatting string %1$s; " +
                        "found both %2$d and %3$d", name, prevCount, count);
                context.report(ARG_COUNT, location, message, null);
                break;
            }

            for (int i = 1; i <= count; i++) {
                if (!indices.contains(i)) {
                    Object clientData = handle.getClientData();
                    if (clientData instanceof Node) {
                        if (context.getDriver().isSuppressed(null, ARG_COUNT,
                                (Node) clientData)) {
                            return;
                        }
                    }

                    Set<Integer> all = new HashSet<Integer>();
                    for (int j = 1; j < count; j++) {
                        all.add(j);
                    }
                    all.removeAll(indices);
                    List<Integer> sorted = new ArrayList<Integer>(all);
                    Collections.sort(sorted);
                    Location location = handle.resolve();
                    String message = String.format(
                            "Formatting string '%1$s' is not referencing numbered arguments %2$s",
                            name, sorted);
                    context.report(ARG_COUNT, location, message, null);
                    break;
View Full Code Here

Examples of com.bulletphysics.collision.broadphase.AxisSweep3Internal.Handle

  protected void sortMinDown(int axis, int edge, Dispatcher dispatcher, boolean updateOverlaps) {
    EdgeArray edgeArray = pEdges[axis];
    int pEdge_idx = edge;
    int pPrev_idx = pEdge_idx - 1;

    Handle pHandleEdge = getHandle(edgeArray.getHandle(pEdge_idx));

    while (edgeArray.getPos(pEdge_idx) < edgeArray.getPos(pPrev_idx)) {
      Handle pHandlePrev = getHandle(edgeArray.getHandle(pPrev_idx));

      if (edgeArray.isMax(pPrev_idx) != 0) {
        // if previous edge is a maximum check the bounds and add an overlap if necessary
        if (updateOverlaps && testOverlap(axis, pHandleEdge, pHandlePrev)) {
          pairCache.addOverlappingPair(pHandleEdge, pHandlePrev);
          if (userPairCallback != null) {
            userPairCallback.addOverlappingPair(pHandleEdge, pHandlePrev);
            //AddOverlap(pEdge->m_handle, pPrev->m_handle);
          }
        }

        // update edge reference in other handle
        pHandlePrev.incMaxEdges(axis);
      }
      else {
        pHandlePrev.incMinEdges(axis);
      }
      pHandleEdge.decMinEdges(axis);

      // swap the edges
      edgeArray.swap(pEdge_idx, pPrev_idx);
View Full Code Here

Examples of com.cburch.draw.model.Handle

 
  @Override
  public List<Handle> getHandles(HandleGesture gesture) {
    Location c = getLocation();
    Location end = c.translate(facing, RADIUS + INDICATOR_LENGTH);
    return UnmodifiableList.create(new Handle[] { new Handle(this, c),
        new Handle(this, end) });
  }
View Full Code Here

Examples of com.cburch.draw.model.Handle

  public List<Handle> getHandles(HandleGesture gesture) {
    Location loc = getLocation();
   
    int r = isInput() ? INPUT_RADIUS : OUTPUT_RADIUS;
    return UnmodifiableList.create(new Handle[] {
        new Handle(this, loc.translate(-r, -r)),
        new Handle(this, loc.translate(r, -r)),
        new Handle(this, loc.translate(r, r)),
        new Handle(this, loc.translate(-r, r)) });
  }
View Full Code Here

Examples of com.cburch.draw.model.Handle

    return UnmodifiableList.create(getHandleArray(gesture));
  }
 
  private Handle[] getHandleArray(HandleGesture gesture) {
    if (gesture == null) {
      return new Handle[] { new Handle(this, p0), new Handle(this, p1),
          new Handle(this, p2) };
    } else {
      Handle g = gesture.getHandle();
      int gx = g.getX() + gesture.getDeltaX();
      int gy = g.getY() + gesture.getDeltaY();
      Handle[] ret = { new Handle(this, p0), new Handle(this, p1),
          new Handle(this, p2) };
      if (g.isAt(p0)) {
        if (gesture.isShiftDown()) {
          Location p = LineUtil.snapTo8Cardinals(p2, gx, gy);
          ret[0] = new Handle(this, p);
        } else {
          ret[0] = new Handle(this, gx, gy);
        }
      } else if (g.isAt(p2)) {
        if (gesture.isShiftDown()) {
          Location p = LineUtil.snapTo8Cardinals(p0, gx, gy);
          ret[2] = new Handle(this, p);
        } else {
          ret[2] = new Handle(this, gx, gy);
        }
      } else if (g.isAt(p1)) {
        if (gesture.isShiftDown()) {
          double x0 = p0.getX();
          double y0 = p0.getY();
          double x1 = p2.getX();
          double y1 = p2.getY();
          double midx = (x0 + x1) / 2;
          double midy = (y0 + y1) / 2;
          double dx = x1 - x0;
          double dy = y1 - y0;
          double[] p = LineUtil.nearestPointInfinite(gx, gy,
              midx, midy, midx - dy, midy + dx);
          gx = (int) Math.round(p[0]);
          gy = (int) Math.round(p[1]);
        }
        if (gesture.isAltDown()) {
          double[] e0 = { p0.getX(), p0.getY() };
          double[] e1 = { p2.getX(), p2.getY() };
          double[] mid = { gx, gy };
          double[] ct = CurveUtil.interpolate(e0, e1, mid);
          gx = (int) Math.round(ct[0]);
          gy = (int) Math.round(ct[1]);
        }
        ret[1] = new Handle(this, gx, gy);
      }
      return ret;
    }
  }
View Full Code Here

Examples of com.cburch.draw.model.Handle

  }
 
  @Override
  public Handle moveHandle(HandleGesture gesture) {
    Handle[] hs = getHandleArray(gesture);
    Handle ret = null;
    if (!hs[0].equals(p0)) {
      p0 = hs[0].getLocation();
      ret = hs[0];
    }
    if (!hs[1].equals(p1)) {
View Full Code Here

Examples of com.cburch.draw.model.Handle

    int x = bds.getX();
    int y = bds.getY();
    int w = bds.getWidth();
    int h = bds.getHeight();
    return UnmodifiableList.create(new Handle[] {
        new Handle(this, x, y), new Handle(this, x + w, y),
        new Handle(this, x + w, y + h), new Handle(this, x, y + h) });
  }
View Full Code Here

Examples of com.cburch.draw.model.Handle

 
  @Override
  public List<Handle> getHandles(HandleGesture gesture) {
    if (gesture == null) {
      return UnmodifiableList.create(new Handle[] {
          new Handle(this, x0, y0), new Handle(this, x1, y1) });
    } else {
      Handle h = gesture.getHandle();
      int dx = gesture.getDeltaX();
      int dy = gesture.getDeltaY();
      Handle[] ret = new Handle[2];
      ret[0] = new Handle(this, h.isAt(x0, y0)
          ? Location.create(x0 + dx, y0 + dy) : Location.create(x0, y0));
      ret[1] = new Handle(this, h.isAt(x1, y1)
          ? Location.create(x1 + dx, y1 + dy) : Location.create(x1, y1));
      return UnmodifiableList.create(ret);
    }
  }
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.