Examples of EdgeHitInfo


Examples of com.puzzlebazar.client.util.EdgeHitInfo

    if (vertexHitInfo != null) {
      fireEvent(new VertexMouseDownEvent(vertexHitInfo.getVertex()));
      return;
    }

    EdgeHitInfo edgeHitInfo = edgeHit(x, y, edgeClickDistance);
    if (edgeHitInfo != null) {
      fireEvent(new EdgeMouseDownEvent(edgeHitInfo.isVertical(), edgeHitInfo.getEdge()));
      return;
    }

    Vec2i cell = cellHit(x, y);
    if (cell != null) {
View Full Code Here

Examples of com.puzzlebazar.client.util.EdgeHitInfo

    if (vertexHitInfo != null) {
      fireEvent(new VertexMouseUpEvent(vertexHitInfo.getVertex()));
      return;
    }

    EdgeHitInfo edgeHitInfo = edgeHit(x, y, edgeClickDistance);
    if (edgeHitInfo != null) {
      fireEvent(new EdgeMouseUpEvent(edgeHitInfo.isVertical(), edgeHitInfo.getEdge()));
      return;
    }

    Vec2i cell = cellHit(x, y);
    if (cell != null) {
View Full Code Here

Examples of com.puzzlebazar.client.util.EdgeHitInfo

      }
      fireEvent(new VertexMouseMoveEvent(vertexHitInfo.getVertex()));
      return;
    }

    EdgeHitInfo edgeHitInfo = edgeHit(x, y, edgeMoveDistance);
    if (edgeHitInfo != null) {
      if (current != OVER_EDGE ||
          currentVertical != edgeHitInfo.isVertical() ||
          !currentLoc.equals(edgeHitInfo.getEdge())) {
        fireOutEvent();
        current = OVER_EDGE;
        currentVertical = edgeHitInfo.isVertical();
        currentLoc = edgeHitInfo.getEdge();
        fireEvent(new EdgeMouseOverEvent(edgeHitInfo.isVertical(), edgeHitInfo.getEdge()));
      }
      fireEvent(new EdgeMouseMoveEvent(edgeHitInfo.isVertical(), edgeHitInfo.getEdge()));
      return;
    }

    Vec2i cell = cellHit(x, y);
    if (cell != null) {
View Full Code Here

Examples of com.puzzlebazar.client.util.EdgeHitInfo

   */
  private EdgeHitInfo edgeHit(int x, int y, int distance) {
    if (distance < 0 || squareGridConverter == null || squareGridValidator == null) {
      return null;
    }
    EdgeHitInfo edgeHitInfo = squareGridConverter.pixelToEdge(x, y);
    if (edgeHitInfo != null &&
        edgeHitInfo.isVertical() &&
        squareGridValidator.isValidVerticalEdge(edgeHitInfo.getEdge()) &&
        edgeHitInfo.getDist() <= distance) {
      return edgeHitInfo;
    }
    if (edgeHitInfo != null &&
        !edgeHitInfo.isVertical() &&
        squareGridValidator.isValidHorizontalEdge(edgeHitInfo.getEdge()) &&
        edgeHitInfo.getDist() <= 4) {
      return edgeHitInfo;
    }
    return null;
  }
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.