diva.canvas.interactor
Class QuadrantConstraint

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

public class QuadrantConstraint
extends Object
implements PointConstraint

Keep a point within one of the four quadrants relative to some reference point.

Version:
$Revision: 1.4 $
Author:
John Reekie

Constructor Summary
QuadrantConstraint(Point2D origin, int quadrant)
          Create a new QuadrantConstraint with the given origin and quadrant.
 
Method Summary
 void constrain(Point2D point)
          Ask the bounds constraint to constrain this point.
 Point2D getOrigin()
          Get the origin
 int getQuadrant()
          Get the quadrant
 void setOrigin(Point2D origin)
          Set the origin
 void setQuadrant(int quadrant)
          Set the quadrant
 boolean snapped()
          Return false.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QuadrantConstraint

public QuadrantConstraint(Point2D origin,
                          int quadrant)
Create a new QuadrantConstraint with the given origin and quadrant.

Method Detail

constrain

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

Specified by:
constrain in interface PointConstraint

getOrigin

public Point2D getOrigin()
Get the origin


getQuadrant

public int getQuadrant()
Get the quadrant


setOrigin

public void setOrigin(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 interface PointConstraint


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