CH.ifa.draw.standard
Class GridConstrainer
- java.lang.Object
-
- CH.ifa.draw.standard.GridConstrainer
-
- All Implemented Interfaces:
- PointConstrainer, java.io.Serializable
public class GridConstrainer extends java.lang.Object implements PointConstrainer, java.io.Serializable
Constrains a point such that it falls on a grid.- See Also:
DrawingView, Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description GridConstrainer(int x, int y)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.awt.PointconstrainPoint(java.awt.Point p)Constrains the given point.intgetStepX()Gets the x offset to move an object.intgetStepY()Gets the y offset to move an object.
-
-
-
Method Detail
-
constrainPoint
public java.awt.Point constrainPoint(java.awt.Point p)
Constrains the given point.- Specified by:
constrainPointin interfacePointConstrainer- Returns:
- constrained point.
-
getStepX
public int getStepX()
Gets the x offset to move an object.- Specified by:
getStepXin interfacePointConstrainer
-
getStepY
public int getStepY()
Gets the y offset to move an object.- Specified by:
getStepYin interfacePointConstrainer
-
-
DataMelt 3.0 © DataMelt by jWork.ORG