Class RMPoint

All Implemented Interfaces:
Serializable, Cloneable

public class RMPoint extends Point2D.Float
This class extends Point2D.Float to add a few convenience methods.
See Also:
  • Field Details

    • zeroPoint

      public static final RMPoint zeroPoint
  • Constructor Details

    • RMPoint

      public RMPoint()
      Creates a point initialized to 0,0.
    • RMPoint

      public RMPoint(float x1, float y1)
      Creates a point initialized to the given x and y (float).
    • RMPoint

      public RMPoint(double x1, double y1)
      Creates a point initialized to the given x and y (double).
    • RMPoint

      public RMPoint(Point2D aPoint)
      Creates a point initialized to the given AWT Point.
  • Method Details

    • offset

      public RMPoint offset(float dx, float dy)
      Offsets the receiver by the given x and y.
    • add

      public RMPoint add(RMPoint aPoint)
      Adds the given point to this point.
    • subtract

      public RMPoint subtract(RMPoint aPoint)
      Subtracts the given point from this point.
    • multiply

      public void multiply(double sx, double sy)
      Multiplies this point by the given sx and sy.
    • inRect

      public boolean inRect(RMRect aRect)
      Returns whether the receiver is in the given rect.
    • transform

      public RMPoint transform(RMTransform aTransform)
      Transforms the point by the given transform.
    • toString

      public String toString()
      Returns a string representation of the receiver in the form "[x y]".
      Overrides:
      toString in class Point2D.Float
    • getPoint

      public static RMPoint getPoint(Point2D aPoint)
      Returns an RMPoint version of the given Point2D (just the Point2D if it's already an RMPoint).