package jdraw.framework;

import java.awt.Point;

/**
 * A PointConstrainer is used to restrict the coordinates used when the mouse
 * is clicked. The methods defined in this interface are used by the draw view.
 *
 * @author  Dominik Gruntz
 * @version 2.0, 26.04.01
 */
public interface PointConstrainer {
	
	/**
	 * Returns constrained coordinates for p, e.g. rounded to a grid.
	 * @param p mouse coordinates
	 * @return constrained coordinates
	 */
	Point constrainPoint(Point p);
	
	/**
	 * Returns the horizontal step size when the selection is moved with the arrow keys.
	 * @return step size in horizontal direction
	 */
	int getStepX();

	/**
	 * Returns the vertical step size when the selection is moved with the arrow keys.
	 * @return step size in vertical direction
	 */
	int getStepY();
}
