jdraw.framework
Interface PointConstrainer


public interface PointConstrainer

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.


Method Summary
 java.awt.Point constrainPoint(java.awt.Point p)
          Returns constrained coordinates for p, e.g. rounded to a grid.
 int getStepX()
          Returns the horizontal step size when the selection is moved with the arrow keys.
 int getStepY()
          Returns the vertical step size when the selection is moved with the arrow keys.
 

Method Detail

constrainPoint

public java.awt.Point constrainPoint(java.awt.Point p)
Returns constrained coordinates for p, e.g. rounded to a grid.

Parameters:
p - mouse coordinates
Returns:
constrained coordinates

getStepX

public int getStepX()
Returns the horizontal step size when the selection is moved with the arrow keys.

Returns:
step size in horizontal direction

getStepY

public int getStepY()
Returns the vertical step size when the selection is moved with the arrow keys.

Returns:
step size in vertical direction