ReportMill 7.0 API

com.reportmill.foundation
Class RMSize

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

public class RMSize
extends com.reportmill.foundation.RMObject

This class represents a simple geometric size (width, height).


Field Summary
 float height
           
 float width
           
 
Constructor Summary
RMSize()
          Creates a size initialized to 0,0.
RMSize(float w, float h)
          Creates a size initialized to the given width and height.
RMSize(RMSize s)
          Creates a size initialized to the given size.
 
Method Summary
 RMSize abs()
          Normalizes the receiver to positive values.
 boolean equals(float w, float h)
          Returns whether size is equal to given width and height.
 boolean equals(java.lang.Object anObj)
          Standard equals implementation.
 float magnitude()
          Returns the square root of the sum of the squares of the width and height.
 void negate()
          Simply sets the width and height to their negatives.
 RMSize normalize()
          Normalizes the receiver by scaling its width and height such that its magnitude will be 1.
 
Methods inherited from class com.reportmill.foundation.RMObject
archiverClassName, clone, copy, didChange, didUndo, getAnimAttribute, getClassNameShort, initWithArchiver, undoClone, undoCopy, undoEquals
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

width

public float width

height

public float height
Constructor Detail

RMSize

public RMSize()
Creates a size initialized to 0,0.


RMSize

public RMSize(float w,
              float h)
Creates a size initialized to the given width and height.


RMSize

public RMSize(RMSize s)
Creates a size initialized to the given size.

Method Detail

abs

public RMSize abs()
Normalizes the receiver to positive values.


magnitude

public float magnitude()
Returns the square root of the sum of the squares of the width and height.


normalize

public RMSize normalize()
Normalizes the receiver by scaling its width and height such that its magnitude will be 1.


negate

public void negate()
Simply sets the width and height to their negatives.


equals

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


equals

public boolean equals(float w,
                      float h)
Returns whether size is equal to given width and height.


ReportMill 7.0 API