diva.canvas.interactor
Class BoundsConstraint

java.lang.Object
  extended by 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: BoundsConstraint.java 38798 2005-07-08 20:00:01Z cxh $
Author:
John Reekie

Field Summary
private  java.awt.geom.Rectangle2D _bounds
          The bounds
private  double _boundsX0
           
private  double _boundsX1
           
private  double _boundsY0
           
private  double _boundsY1
           
 
Constructor Summary
BoundsConstraint(java.awt.geom.Rectangle2D bounds)
          Create a new BoundsConstraint with the given bounds.
 
Method Summary
 void constrain(java.awt.geom.Point2D point)
          Ask the bounds constraint to constrain this point.
 java.awt.geom.Rectangle2D getBounds()
          Get the bounds
 void setBounds(java.awt.geom.Rectangle2D bounds)
          Set the bounds
 boolean snapped()
          Return false.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_bounds

private java.awt.geom.Rectangle2D _bounds
The bounds


_boundsX0

private double _boundsX0

_boundsY0

private double _boundsY0

_boundsX1

private double _boundsX1

_boundsY1

private double _boundsY1
Constructor Detail

BoundsConstraint

public BoundsConstraint(java.awt.geom.Rectangle2D bounds)
Create a new BoundsConstraint with the given bounds.

Method Detail

constrain

public void constrain(java.awt.geom.Point2D point)
Ask the bounds constraint to constrain this point.

Specified by:
constrain in interface PointConstraint

getBounds

public java.awt.geom.Rectangle2D getBounds()
Get the bounds


snapped

public boolean snapped()
Return false. This constraint never snaps.

Specified by:
snapped in interface PointConstraint

setBounds

public void setBounds(java.awt.geom.Rectangle2D bounds)
Set the bounds