|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectptolemy.vergil.toolbox.SnapConstraint
This constraint ensures that a point is a multiple of a constant that defaults to 5.0.
| Red (johnr) |
| Red (eal) |
| Constructor Summary | |
SnapConstraint()
Construct a new instance of a snap constraint. |
|
| Method Summary | |
double[] |
constrain(double[] point)
Modify the specified point to snap to grid using the local resolution. |
double[] |
constrain(double x,
double y)
Modify the specified point to snap to grid using the local resolution. |
void |
constrain(java.awt.geom.Point2D point)
Modify the specified point to snap to grid using the local resolution. |
static double[] |
constrainPoint(double[] point)
Modify the specified point to snap to grid using the global default resolution. |
static double[] |
constrainPoint(double x,
double y)
Modify the specified point to snap to grid using the global default resolution. |
static java.awt.geom.Point2D |
constrainPoint(java.awt.geom.Point2D point)
Modify the specified point to snap to grid using the global default resolution. |
void |
setResolution(double resolution)
Set the resolution for this instance. |
boolean |
snapped()
Return true to indicate that this does snap to grid. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public SnapConstraint()
| Method Detail |
public void constrain(java.awt.geom.Point2D point)
constrain in interface PointConstraintpoint - The point to modify.public double[] constrain(double[] point)
point - The point to modify (a dimension 2 array).
public double[] constrain(double x,
double y)
x - The x dimension of the point to modify.y - The y dimension of the point to modify.public static java.awt.geom.Point2D constrainPoint(java.awt.geom.Point2D point)
point - The point to modify.public static double[] constrainPoint(double[] point)
point - The point to modify (a dimension 2 array).
public static double[] constrainPoint(double x,
double y)
x - The x dimension of the point to modify.y - The y dimension of the point to modify.public boolean snapped()
snapped in interface PointConstraintpublic void setResolution(double resolution)
resolution - The new resolution.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||