Package diva.canvas.interactor
Class BoundsConstraint
- java.lang.Object
-
- diva.canvas.interactor.BoundsConstraint
-
- All Implemented Interfaces:
PointConstraint
public class BoundsConstraint extends java.lang.Object implements PointConstraint
Keep a point within a given rectangular bounds.- Version:
- $Id$
- Author:
- John Reekie
-
-
Constructor Summary
Constructors Constructor Description BoundsConstraint(java.awt.geom.Rectangle2D bounds)
Create a new BoundsConstraint with the given bounds.
-
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.Rectangle2D
getBounds()
Get the boundsvoid
setBounds(java.awt.geom.Rectangle2D bounds)
Set the boundsboolean
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
-
getBounds
public java.awt.geom.Rectangle2D getBounds()
Get the bounds
-
snapped
public boolean snapped()
Return false. This constraint never snaps.- Specified by:
snapped
in interfacePointConstraint
-
setBounds
public void setBounds(java.awt.geom.Rectangle2D bounds)
Set the bounds
-
-