ReportMill 8.0 API

com.reportmill.base
Class RMPoint

java.lang.Object
  extended bycom.reportmill.base.RMObject
      extended bycom.reportmill.base.RMPoint
All Implemented Interfaces:
java.lang.Cloneable, com.reportmill.base.RMArchiver.Archiving

public class RMPoint
extends com.reportmill.base.RMObject

This class represents a simple geometric point (x, y).


Field Summary
 float x
           
 float y
           
static RMPoint zeroPoint
           
 
Constructor Summary
RMPoint()
          Creates a point initialized to 0,0.
RMPoint(double x1, double y1)
          Creates a point initialized to the given x and y (double).
RMPoint(float x1, float y1)
          Creates a point initialized to the given x and y (float).
RMPoint(int x1, int y1)
          Creates a point initialized to the given x and y (int).
RMPoint(java.awt.geom.Point2D p)
          Creates a point initialized to the given AWT Point.
RMPoint(RMPoint p)
          Creates a point initialized from the given point.
 
Method Summary
 RMPoint average(RMPoint aPoint, float t)
          Returns the weighted average of this point with another point.
 float distanceSquaredTo(RMPoint aPoint)
          Returns the distance from receiver to given point.
 float distanceTo(RMPoint aPoint)
          Returns the distance from receiver to given point.
 boolean equals(java.lang.Object anObj)
          Standard equals implementation.
 boolean inRect(RMRect r)
          Returns whether the receiver is in the given rect.
 RMPoint multipliedPoint(float f)
          Creates a point multiplied by the given amount.
 RMPoint multipliedPoint(float fx, float fy)
          Creates a point multiplied by the given x and y.
 RMPoint multiply(float f)
          Multiplies the receiver by the given amount.
 RMPoint multiply(float fx, float fy)
          Multiplies the receiver by the given x and y.
 RMPoint offset(float d)
          Offsets the receiver by the given amount.
 RMPoint offset(float dx, float dy)
          Offsets the receiver by the given x and y.
 RMPoint offsetPoint(float d)
          Creates a point offset by the given amounnt.
 RMPoint offsetPoint(float dx, float dy)
          Creates a point offset by the given x and y.
 RMPoint pointByAdding(RMPoint p)
          Creates a point by adding the given point to the receiver.
 RMPoint pointBySubtracting(RMPoint p)
          Creates a point by subtracting the given point from the receiver.
 RMPoint round()
          Rounds the receiver to an integral x and y.
 void scale(float sx, float sy)
          Scales the receiver by the given sx and sy.
 java.lang.String toString()
          Returns a string representation of the receiver in the form "[x y]".
 RMPoint transform(com.reportmill.graphics.RMTransform aTransform)
          Transforms the point by the given transform.
static RMPoint zeroPoint()
           
 
Methods inherited from class com.reportmill.base.RMObject
clone, copy, didChange, didUndo, getAnimAttribute, getClassNameShort, initWithArchiver, undoClone, undoCopy, undoEquals
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

x

public float x

y

public float y

zeroPoint

public static final RMPoint zeroPoint
Constructor Detail

RMPoint

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


RMPoint

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


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(RMPoint p)
Creates a point initialized from the given point.


RMPoint

public RMPoint(java.awt.geom.Point2D p)
Creates a point initialized to the given AWT Point.

Method Detail

zeroPoint

public static final RMPoint zeroPoint()

distanceTo

public float distanceTo(RMPoint aPoint)
Returns the distance from receiver to given point.


distanceSquaredTo

public float distanceSquaredTo(RMPoint aPoint)
Returns the distance from receiver to given point.


offset

public RMPoint offset(float d)
Offsets the receiver by the given amount.


offset

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


offsetPoint

public RMPoint offsetPoint(float d)
Creates a point offset by the given amounnt.


offsetPoint

public RMPoint offsetPoint(float dx,
                           float dy)
Creates a point offset by the given x and y.


multiply

public RMPoint multiply(float f)
Multiplies the receiver by the given amount.


multiply

public RMPoint multiply(float fx,
                        float fy)
Multiplies the receiver by the given x and y.


multipliedPoint

public RMPoint multipliedPoint(float f)
Creates a point multiplied by the given amount.


multipliedPoint

public RMPoint multipliedPoint(float fx,
                               float fy)
Creates a point multiplied by the given x and y.


round

public RMPoint round()
Rounds the receiver to an integral x and y.


average

public RMPoint average(RMPoint aPoint,
                       float t)
Returns the weighted average of this point with another point.


inRect

public boolean inRect(RMRect r)
Returns whether the receiver is in the given rect.


scale

public void scale(float sx,
                  float sy)
Scales the receiver by the given sx and sy.


pointByAdding

public RMPoint pointByAdding(RMPoint p)
Creates a point by adding the given point to the receiver.


pointBySubtracting

public RMPoint pointBySubtracting(RMPoint p)
Creates a point by subtracting the given point from the receiver.


transform

public RMPoint transform(com.reportmill.graphics.RMTransform aTransform)
Transforms the point by the given transform.


equals

public boolean equals(java.lang.Object anObj)
Standard equals implementation.


toString

public java.lang.String toString()
Returns a string representation of the receiver in the form "[x y]".


ReportMill 8.0 API