diva.canvas.interactor
Class BoundsConstraint

java.lang.Object
  extended by diva.canvas.interactor.BoundsConstraint
All Implemented Interfaces:
PointConstraint

public class BoundsConstraint
extends Object
implements PointConstraint

Keep a point within a given rectangular bounds.

Version:
$Revision: 1.3 $
Author:
John Reekie

Constructor Summary
BoundsConstraint(Rectangle2D bounds)
          Create a new BoundsConstraint with the given bounds.
 
Method Summary
 void constrain(Point2D point)
          Ask the bounds constraint to constrain this point.
 Rectangle2D getBounds()
          Get the bounds
 void setBounds(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
 

Constructor Detail

BoundsConstraint

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

Method Detail

constrain

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

Specified by:
constrain in interface PointConstraint

getBounds

public 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(Rectangle2D bounds)
Set the bounds



Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.