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 void
constrain(java.awt.geom.Point2D point)
Ask the bounds constraint to constrain this point.java.awt.geom.Point2D
getOrigin()
Get the originint
getQuadrant()
Get the quadrantvoid
setOrigin(java.awt.geom.Point2D origin)
Set the originvoid
setQuadrant(int quadrant)
Set the quadrantboolean
snapped()
Return false.
-
-
-
Method Detail
-
constrain
public void constrain(java.awt.geom.Point2D point)
Ask the bounds constraint to constrain this point.- Specified by:
constrain
in 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:
snapped
in interfacePointConstraint
-
-