Class 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 origin
      int getQuadrant()
      Get the quadrant
      void setOrigin​(java.awt.geom.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​(java.awt.geom.Point2D origin,
                                  int quadrant)
        Create a new QuadrantConstraint with the given origin and quadrant.
    • 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
      • 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 interface PointConstraint