Package diva.canvas.interactor
Class QuadrantConstraint
- java.lang.Object
-
- diva.canvas.interactor.QuadrantConstraint
-
- All Implemented Interfaces:
PointConstraint
public class QuadrantConstraint extends java.lang.Object implements PointConstraint
Keep a point within one of the four quadrants relative to some reference point.- Version:
- $Id$
- Author:
- John Reekie
-
-
Constructor Summary
Constructors Constructor Description QuadrantConstraint(java.awt.geom.Point2D origin, int quadrant)Create a new QuadrantConstraint with the given origin and quadrant.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconstrain(java.awt.geom.Point2D point)Ask the bounds constraint to constrain this point.java.awt.geom.Point2DgetOrigin()Get the originintgetQuadrant()Get the quadrantvoidsetOrigin(java.awt.geom.Point2D origin)Set the originvoidsetQuadrant(int quadrant)Set the quadrantbooleansnapped()Return false.
-
-
-
Method Detail
-
constrain
public void constrain(java.awt.geom.Point2D point)
Ask the bounds constraint to constrain this point.- Specified by:
constrainin interfacePointConstraint
-
getOrigin
public java.awt.geom.Point2D getOrigin()
Get the origin
-
getQuadrant
public int getQuadrant()
Get the quadrant
-
setOrigin
public void setOrigin(java.awt.geom.Point2D origin)
Set the origin
-
setQuadrant
public void setQuadrant(int quadrant)
Set the quadrant
-
snapped
public boolean snapped()
Return false. This constraint never snaps.- Specified by:
snappedin interfacePointConstraint
-
-