Examples of manhattanDistanceTo()


Examples of com.cburch.logisim.data.Location.manhattanDistanceTo()

            } else {
              Location to = Location.create(x, y);
              Location a = LineUtil.snapTo8Cardinals(prev, x, y);
              Location b = LineUtil.snapTo8Cardinals(next, x, y);
              int ad = a.manhattanDistanceTo(to);
              int bd = b.manhattanDistanceTo(to);
              r = ad < bd ? a : b;
            }
          } else {
            r = Location.create(x, y);
          }
View Full Code Here

Examples of com.cburch.logisim.data.Location.manhattanDistanceTo()

  public void mouseReleased(MouseEvent e) { }

  public void mouseDragged(MouseEvent e) {
    Location start = dragStart;
    if (start != null && start.manhattanDistanceTo(e.getX(), e.getY()) > 4) {
      hideCurrentPopup();
    }
  }

  public void mouseMoved(MouseEvent arg0) { }
View Full Code Here

Examples of com.cburch.logisim.data.Location.manhattanDistanceTo()

  @Override
  public boolean contains(Location loc, AttributeSet attrs) {
    if (super.contains(loc, attrs)) {
      Direction facing = attrs.getValue(StdAttr.FACING);
      Location center = Location.create(0, 0).translate(facing, -20);
      return center.manhattanDistanceTo(loc) < 24;
    } else {
      return false;
    }
  }
View Full Code Here

Examples of com.cburch.logisim.data.Location.manhattanDistanceTo()

  @Override
  public boolean contains(Location loc, AttributeSet attrs) {
    if (super.contains(loc, attrs)) {
      Direction facing = attrs.getValue(StdAttr.FACING);
      Location center = Location.create(0, 0).translate(facing, -20);
      return center.manhattanDistanceTo(loc) < 24;
    } else {
      return false;
    }
  }
View Full Code Here

Examples of com.cburch.logisim.data.Location.manhattanDistanceTo()

                        } else {
                            Location to = Location.create(x, y);
                            Location a = LineUtil.snapTo8Cardinals(prev, x, y);
                            Location b = LineUtil.snapTo8Cardinals(next, x, y);
                            int ad = a.manhattanDistanceTo(to);
                            int bd = b.manhattanDistanceTo(to);
                            r = ad < bd ? a : b;
                        }
                    } else {
                        r = Location.create(x, y);
                    }
View Full Code Here

Examples of com.cburch.logisim.data.Location.manhattanDistanceTo()

    @Override
    public boolean contains(Location loc, AttributeSet attrs) {
        if (super.contains(loc, attrs)) {
            Direction facing = attrs.getValue(StdAttr.FACING);
            Location center = Location.create(0, 0).translate(facing, -20);
            return center.manhattanDistanceTo(loc) < 24;
        } else {
            return false;
        }
    }
View Full Code Here

Examples of com.cburch.logisim.data.Location.manhattanDistanceTo()

    @Override
    public boolean contains(Location loc, AttributeSet attrs) {
        if (super.contains(loc, attrs)) {
            Direction facing = attrs.getValue(StdAttr.FACING);
            Location center = Location.create(0, 0).translate(facing, -20);
            return center.manhattanDistanceTo(loc) < 24;
        } else {
            return false;
        }
    }
View Full Code Here

Examples of com.cburch.logisim.data.Location.manhattanDistanceTo()

    public void mouseReleased(MouseEvent e) { }

    @Override
    public void mouseDragged(MouseEvent e) {
        Location start = dragStart;
        if (start != null && start.manhattanDistanceTo(e.getX(), e.getY()) > 4) {
            hideCurrentPopup();
        }
    }

    @Override
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.